paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Byzantine-Robust Learning on Heterogeneous Datasets via Resampling
1 INTRODUCTION . Distributed or federated machine learning , where the data is distributed across multiple workers , has become an increasingly important learning paradigm both due to growing sizes of datasets , as well as privacy and security concerns . In such a setting , the workers collaborate to train a single model without transmitting their data directly over the networks ( McMahan et al. , 2016 ; Bonawitz et al. , 2019 ; Kairouz et al. , 2019 ) . Due to the presence of either actively malicious agents in the network , or simply due to system and network failures , some workers may disobey the protocols and send arbitrary messages ; such workers are also known as Byzantine workers ( Lamport et al. , 2019 ) . Byzantine robust optimization algorithms combine the gradients received by all workers using robust aggregation rules , to ensure that the training is not impacted by the malicious workers . While this problem has received significant recent attention , ( Alistarh et al. , 2018 ; Blanchard et al. , 2017 ; Yin et al. , 2018a ) , most of the current approaches assume that the data present on each different worker has identical distribution . In this work , we show that existing Byzantine-robust methods catastrophically fail in the realistic setting when the data is distributed heterogeneously across the workers . We then propose a simple resampling scheme which can be readily combined with existing aggregation rules to allow robust training on heterogeneous data . Contribution . Concretely , our contributions in this work are • We show that when the data across workers is heterogeneous , existing robust rules might not converge , even without any Byzantine adversaries . • We propose two new attacks , normalized gradient and mimic , which take advantage of data heterogeneity and circumvent median and sign-based defenses ( Blanchard et al. , 2017 ; Pillutla et al. , 2019 ; Li et al. , 2019 ) . • We propose a simple new resampling step which can be used before any existing robust aggregation rule . We instantiate our scheme with KRUM and theoretically prove that the resampling generalizes it to the setting of heterogeneous data . • Our experiments evaluate the proposed resampling scheme against known and new attacks and show that it drastically improves the performance of 3 existing schemes on realistic heterogeneously distributed datasets . Setup and notations . We study the general distributed optimization problem L ? = minx∈Rd { L ( x ) : = 1n ∑n i=1 Li ( x ) } ( 1 ) where Li : Rd → R are the individual loss functions distributed among n workers , each having its own ( heterogeneous ) data distribution { Di } ni=1 . The case of empirical risk minimization with mi datapoints ξi ∼ Di on worker i is obtained when using Li ( x ) : = 1mi ∑mi j=1 Li ( x , ξ j i ) . The ( stochastic ) gradient computed by a good node i with sample j is given as gi ( x ) : = ∇Li ( x , ξji ) with mean µi and variance σ2i . We also assume that the heterogeneity ( variance across good workers ) is bounded i.e . Ei‖∇Li ( x ) −∇L ( x ) ‖2 ≤ σ̄2 , ∀x . We write gi instead of gi ( xt ) when there is no ambiguity . A distributed training step using an aggregation rule is given as xt+1 : = xt − γtAggr ( { gi ( xt ) : i ∈ [ n ] } ) ( 2 ) If the aggregation rule is the arithmetic mean , then ( 2 ) recovers standard minibatch SGD . Byzantine attack model . In each iteration , there is a set Byz of at most f Byzantine workers . The remaining workers are good , thus follow the described protocol . A Byzantine worker j ∈Byz can deviate from protocol and send an arbitrary vecter to the server . Besides , we also allow that Byzantine workers can collude with each other and know every state of the system . Unlike martingale-based approaches like ( Alistarh et al. , 2018 ) , we allow the set Byz to change over time ( Blanchard et al. , 2017 ; Chen et al. , 2017 ; Mhamdi et al. , 2018 ) . 2 RELATED WORK . There has been significant recent work of the case when the workers have identical data distributions ( Blanchard et al. , 2017 ; Chen et al. , 2017 ; Mhamdi et al. , 2018 ; Alistarh et al. , 2018 ; Mhamdi et al. , 2018 ; Yin et al. , 2018a ; b ; Su & Xu , 2018 ; Damaskinos et al. , 2019 ) . We discuss the most pertinent of these methods next . Blanchard et al . ( 2017 ) formalize the Byzantine robust setup and propose a distance-based approach KRUM which selects a worker whose gradient is very close to at least half the other workers . A different approach involves using the median and its variants ( Blanchard et al. , 2017 ; Pillutla et al. , 2019 ; Yin et al. , 2018a ) . Yin et al . ( 2018a ) propose to use and analyze the coordinate-wise median method ( CM ) . Pillutla et al . ( 2019 ) use a smoothed version of Weiszfeld ’ s algorithm to iteratively compute an approximate geometric median of the input gradients . In a third approach , ( Bernstein et al. , 2018 ) propose to use the signs of the gradients and then aggregate them by majority vote , however , ( Karimireddy et al. , 2019 ) show that it may not always converge . Finally , Alistarh et al . ( 2018 ) use a martingale-based aggregation rule which gives a sample complexity optimal algorithm for iid data . The distance-based approach of KRUM was later extended in Mhamdi et al . ( 2018 ) who propose BULYAN to overcome the dimensional leeway attack . This is the so called strong Byzantine resilience and is orthogonal to the question of non-iid-ness we study here . Recently , ( Peng & Ling , 2020 ; Yang & Bajwa , 2019a ; b ) studied Byzantine-resilient algorithms in the decentralized setting where there is no central server available . Extending our techniques to the decentralized setting is an important direction for future work . In a different line of work , ( Lai et al. , 2016 ; Diakonikolas et al. , 2019 ) develop sophisticated spectral techniques to robust estimate the mean of a high dimensional multi-variate standard Gaussian distribution where samples are evenly distributed in all directions and the attackers are concentrated in one direction . Very recent work ( Data & Diggavi , 2020 ) extend the theoretical analysis to non-convex , strongly-convex and non-i.i.d setup under a gradient dissimilarity assumption and propose a gradient compression scheme on top of it . Our resampling trick can be combined with it to further reduce gradient dissimilarity . Many attacks have been devised for distributed training . For the iid setting , the state-of-the-art attacks are ( Baruch et al. , 2019 ; Xie et al. , 2019b ) . The latter attack is very strong when the fraction of adversaries is large ( nearly half ) , but in this work we focus on settings when this fraction is quite small ( e.g . ≤ 0.2 ) . Further our normalized mean attack Section 3.2 is inspired by ( Xie et al. , 2019b ) . The former work focuses on attacks which are coordinated across time steps . Developing strong practical defenses even in the iid case against such time-coordinated attacks remains an open problem . In this work , we sidestep this issue by restricting ourselves to new attacks made possible by non-iid data and studying how to overcome them . We focus on schemes which work in the iid setting , but fail with non-iid data . Once a new method which can defend against ( Baruch et al. , 2019 ) is developed , our proposed scheme shows how to adapt such a method to the important non-iid case . For the non-iid setting , backdoor attacks are designed to take advantage of heavy-tailed data and manipulate model inference on specific subtask , rather than lower the overall accuracies of training ( Bagdasaryan et al. , 2018 ; Bhagoji et al. , 2018 ) . In contrast , this paper is not intended to address aforementioned challenges but rather to defend the attacks that lower the training accuracies in the non-iid setting . As far as we are aware , only ( Li et al. , 2019 ; Ghosh et al. , 2019 ; Sattler et al. , 2020 ) explicitly investigate Byzantine robustness with non-iid workers . Li et al . ( 2019 ) proposes an SGD variant ( RSA ) which modifies the original objective by adding an ` 1 penalty . Ghosh et al . ( 2019 ) ; Sattler et al . ( 2020 ) assume that all workers belong to an apriori fixed number of clusters and use an outlier-robust clustering method to recover these clusters . If we assume that the server has the entire training dataset and can control the distribution of samples to good workers , Xie et al . ( 2019a ) ; Chen et al . ( 2018 ) ; Rajput et al . ( 2019 ) show that non-iid-ness can be overcome . Typical examples of this is distributed training of neural networks on public cloud , or volunteer computing Meeds et al . ( 2015 ) ; Miura & Harada ( 2015 ) . However , none of these methods are applicable in the standard federated learning setup we consider here . We aim to minimize the original loss function over workers while respecting the non-iid data locality , i.e . the partition of the given heterogeneous dataset over the workers , without data transfer . 3 ATTACKS AGAINST EXISTING AGGREGATION SCHEMES . In this section we show that when the data across the workers is heterogeneous ( non-iid ) , then we can design new attacks which take advantage of the heterogeneity , leading to the failure of existing aggregation schemes . We study three classes of robust aggregation schemes : i ) schemes which select a representative worker in each round ( e.g . KRUM ( Blanchard et al. , 2017 ) ) , ii ) schemes which use normalized means ( e.g . RSA ( Li et al. , 2019 ) ) , and iii ) those which use the median ( e.g . RFA ( Pillutla et al. , 2019 ) ) . We show realistic settings under which each of these classes would fail when faced with heterogeneous data . 3.1 FAILURE OF REPRESENTATIVE WORKER SCHEMES ON NON-IID DATA . Algorithms like KRUM select workers who are representative of a majority of the workers , by relying on statistics such as pairwise differences between the various worker updates . Let ( g1 , . . . , gn ) be the gradients by the workers , f of which are Byzantine ( e.g . n ≥ 2f + 3 for KRUM ) . For i 6= j , let i→ j denote that gj belongs to the n− f − 2 closest vectors to gi . Then KRUM is defined as follows KRUM ( g1 , . . . , gn ) : = arg mini ∑ i→j ‖gi − gj‖2 ( 3 ) However , when the data across the workers is heterogeneous , there is no ‘ representative ’ worker . This is because each worker computes their local gradient over vastly different local data . Hence , for convergence it is important to not only select a good ( non-Byzantine ) worker , but also ensure that each of the good workers is selected with roughly equal frequency . Hence KRUM suffers a significant loss in performance with heterogeneous data , even when there are no Byzantine workers . For example , when KRUM is used for iid datasets without adversary ( f =0 , see left of Figure 1a ) , the test accuracy is close to simple average and the gap can be filled by MULTI-KRUM ( Blanchard et al. , 2017 ) . The right plot of Figure 1a also shows that KRUM ’ s selection of gradients is biased towards certain nodes . When KRUM is applied to non-iid datasets ( the middle of Figure 1a ) , KRUM performs poorly even without any attack . This is because KRUM mostly selects gradients from a few nodes whose distribution is closer to others ( the right of Figure 1a ) . This is an example of how robust aggregation rules may fail on realistic non-iid datasets .
Many existing researches on distributed deep learning works in byzantine robustness in a centralized PS setting under the assumption of i.i.d. data distribution on workers, e.g. KRUM. This paper presents a simple resampling scheme that adapts the existing robust algorithms to heterogeneous datasets (referred as KRUM-RS later in this review). It firstly proposes two new attacks under non-iid data distribution that fooled byzantine fault tolerant algorithms like KRUM, Coordinate Median (CM), and RFA (Normalized Median-NM or Geometric Median-GM). Then it proposes the RS algorithm and proved its theoretical convergence guarantee the of KRUM algorithm over non-iid data, and when the parameter server (PS) does not control the dataset distribution. Experiments showed the convergence guarantee over KRUM and even CM, NM/GM algorithm.
SP:72f25cb455c7d0e0a2ce818d3baab4a916376dd3
Fusion 360 Gallery: A Dataset and Environment for Programmatic CAD Reconstruction
1 INTRODUCTION . The manufactured objects that surround us in everyday life are created in computer-aided design ( CAD ) software using common modeling operations such as sketch and extrude . With just these two modeling operations , a highly expressive range of 3D designs can be created ( Figure 1 ) . Parametric CAD files contain construction sequence information that is critical for documenting design intent , maintaining editablity , and downstream simulation and manufacturing . Despite the value of this information , it is often lost due to data translation or error and must be reverse engineered from geometry or even raw 3D scan data . The task of reconstructing CAD operations from geometry has been pursued for over 40 years ( Shah et al. , 2001 ) and is available in commercial CAD software using heuristic approaches ( Autodesk , 2012 ; Dassault , 2019 ) . Recent advances in neural networks for 3D shape generation has spurred new interest in CAD reconstruction , due to the potential to generalize better and further automate this challenging problem . However , learning-based approaches to CAD reconstruction have not yet had access to a human-designed dataset of 3D CAD construction sequences , instead relying on synthetic data for both training and testing purposes , e.g . Li et al . ( 2020 ) . The absence of real world data has limited work on CAD reconstruction using common sketch and extrude modeling operations . Instead a focus has been on reconstruction from simple geometric primitives ( Sharma et al. , 2017 ; Tian et al. , 2019 ; Ellis et al. , 2019 ) that lack the rich parametric sketches commonly used in mechanical CAD ( e.g . Figure 2 ) . As there is no existing learning-based approach to reconstruct sketch and extrude sequences , we take a first step towards this goal by introducing data , a supporting software environment , and a novel action representation for reconstructing sketch and extrude designs . In this paper we present the Fusion 360 Gallery reconstruction dataset and environment for learning CAD reconstruction . The dataset contains 8,625 designs created by users of Autodesk Fusion 360 using a simple subset of CAD modeling operations : sketch and extrude . To the best of our knowledge this dataset is the first to provide human designed 3D CAD construction sequence data for use with machine learning . To support research with the dataset we provide an environment called the Fusion 360 Gym for working with CAD reconstruction . A key motivation of this work is to provide insights into the process of how people design objects . Furthermore , our goal is to provide a universal benchmark for research and evaluation of learning-based CAD reconstruction algorithms , bridging the gap between the computer graphics and machine learning community . To this end we describe a standard CAD reconstruction task and associated evaluation metrics with respect to the ground truth construction sequence . We also introduce a novel action representation for CAD reconstruction of sketch and extrude designs using neurally guided search . This search employs a policy , trained using imitation learning , consisting of a graph neural network encoding of CAD geometry . This paper makes the following contributions : • We present the Fusion 360 Gallery reconstruction dataset containing construction sequence information for 8,625 human-designed sketch and extrude CAD models . • We introduce an environment called the Fusion 360 Gym , standardizing the CAD reconstruction task in a Markov Decision Process formulation . • We introduce a novel action representation to enable neurally guided CAD reconstruction trained on real world construction sequences for the first time . 2 RELATED WORK . CAD Datasets Existing 3D CAD datasets have largely focused on providing mesh geometry ( Chang et al. , 2015 ; Wu et al. , 2015 ; Zhou & Jacobson , 2016 ; Mo et al. , 2019b ; Kim et al. , 2020 ) . However , the de facto standard for parametric CAD is the boundary representation ( B-Rep ) format , containing valuable analytic representations of surfaces and curves suitable for high level control of 3D shapes . B-Reps are collections of trimmed parametric surfaces along with topological information which describes adjacency relationships and the ordering of elements such as faces , loops , edges , and vertices ( Weiler , 1986 ) . B-Rep datasets have recently been made available with both human-designed ( Koch et al. , 2019 ) and synthetic data ( Zhang et al. , 2018 ; Jayaraman et al. , 2020 ; Starly , 2020 ) . Missing from these datasets is construction sequence information . We believe it is critical to understand not only what is designed , but how that design came about . Parametric CAD files contain valuable information on the construction history of a design . Schulz et al . ( 2014 ) provide a standard collection of human designs with full parametric history , albeit a limited set of 67 designs in a proprietary format . SketchGraphs ( Seff et al. , 2020 ) constrains the broad area of parametric CAD by focusing on the underlying 2D engineering sketches , including sketch construction sequences . In the absence of 3D human design data , learning-based approaches have instead leveraged synthetic CAD construction sequences ( Sharma et al. , 2017 ; Li et al. , 2020 ) . The dataset presented in this paper is , to the best of our knowledge , the first to provide humandesigned 3D CAD construction sequence information suitable for use with machine learning . CAD Reconstruction The task of CAD reconstruction involves recovering the sequence of modeling operations used to construct a CAD model from geometry input , such as B-reps , triangle meshes , or point clouds . Despite extensive prior work ( Shah et al. , 2001 ) , CAD reconstruction remains a challenging problem as it requires deductions on both continuous parameters ( e.g. , ex- tracting the dimensions of primitives ) and discrete operations ( e.g. , choosing a proper operation for the next step ) , leading to a mixed combinatorial search space . To recover the sequence of operations , traditional methods typically run global search methods ( e.g. , evolutionary algorithms as in Hamza & Saitou ( 2004 ) , Weiss ( 2009 ) , Friedrich et al . ( 2019 ) , and Fayolle & Pasko ( 2016 ) ) with heuristic rules to prune the search space ( Shapiro & Vossler , 1993 ; Buchele , 2000 ; Buchele & Roles , 2001 ; Buchele & Crawford , 2003 ) . Heuristic approaches are also available in a number of commercial software tools , often as a user-guided semi-automatic system ( Autodesk , 2012 ; Dassault , 2019 ) to aid with file conversion between CAD systems . These traditional algorithms operate by removing faces from the B-rep body and reapplying them as parametric modeling operations . This strategy can recover the later modeling operations , but fail to completely rebuild the construction sequence from the first step . We instead tackle the task of recovering the entire construction sequence from the first extrusion . Another approach is using program synthesis ( Du et al. , 2018 ; Nandi et al. , 2017 ; 2018 ; 2020 ) to infer CAD programs written in domain specific languages from given shapes . CAD reconstruction is also related to the inverse procedural modeling problem ( Talton et al. , 2011 ; Stava et al. , 2014 ; Vanegas et al. , 2012 ) , which attempts to reverse-engineer procedures that can faithfully match a given target . Inverse procedural modeling methods typically work with synthetic data , while our paper tackles tasks on real CAD models and modeling operations . Compared to the rule-based or grammar-based methods above , learning-based approaches can potentially learn the types of rules that are typically hard-coded , automate scenarios that require userinput , and generalize when confronted with unfamiliar geometry . One of the earliest such works is CSGNet ( Sharma et al. , 2017 ) , which trains a neural network to infer the sequence of Constructive Solid Geometry ( CSG ) operations based on visual inputs . More recent works along this line of research include Ellis et al . ( 2019 ) , Tian et al . ( 2019 ) , and Kania et al . ( 2020 ) . Typically associated with these methods are a customized , domain specific language ( e.g. , CSG ) that parameterizes the space of geometry , some heuristic rules that limit the search space , and a neural network generative model ( Zou et al. , 2017 ; Mo et al. , 2019a ; Chen et al. , 2020 ; Jones et al. , 2020 ) . Lin et al . ( 2020 ) reconstruct input shapes with a dual action representation that first positions cuboids and then edits edge-loops for refinement . Although editing edge-loops of cuboids may be a suitable modeling operation in artistic design , it is not as expressive or precise as the sketch and extrude operations used in real mechanical components . Additionally , Lin et al . ( 2020 ) chooses to train and evaluate their network on synthetic data due to the lack of a benchmark dataset of CAD construction sequences , a space that our work aims to fill . Our approach is , to the best of our knowledge , the first to apply a learning-based method to reconstruction using common sketch and extrude CAD modeling operations from real human designs . 3 FUSION 360 GALLERY RECONSTRUCTION DATASET . The Fusion 360 Gallery reconstruction dataset1 is produced from designs submitted by users of the CAD software Autodesk Fusion 360 . The dataset contains CAD construction sequence information from a subset of sketch and extrude designs . We intentionally limit the data to the sketch and extrude modeling operations to reduce the complexity of the CAD reconstruction task . Figure 1 shows a random sampling of the designs in the dataset . Each design is provided in three different representations : B-Rep , mesh , and construction sequence JSON text format . An official 80:20 train- 1https : //github.com/xxx/xxx test split is provided with 6,900 and 1,725 designs respectively . We now briefly outline the sketch and extrude modeling operations and provide additional details in Section A.1 of the appendix . Sketch Unlike free-form sketches , sketches in CAD are composed of 2D geometric primitives ( lines , circles , splines etc . ) , associated dimensions ( distance , diameter , angle etc . ) and constraints ( symmetry , tangent , parallel etc. ) . Sketch geometry is represented by points , that create curves , that in turn form loops within profiles . The intersection of curves , as the user draws , automatically creates closed loops and profiles that are serialized as both raw curves and trimmed profiles . Sketch profiles form the basis for 3D extrusion as shown in ( Figure 2 ) . Extrude An extrude operation takes one or more sketch profiles and extrudes them from 2D into a 3D B-Rep body . A distance parameter defines how far the profile is extruded . A notable feature of extrude operations in Fusion 360 is the ability to perform Boolean operations in the same step . As a user extrudes a sketch profile , they choose to create a new body , join , cut , or intersect with other bodies in the design ( Figure 2 ) . Additional extrude options are available such as two-sided extrude , symmetrical extrude , and tapered extrude . The combination of expressive sketches and extrude operations with built in Boolean capability enables a wide variety of designs to be constructed . 4 FUSION 360 GYM . Together with the dataset we provide an open source environment , called the Fusion 360 Gym , for standardizing the CAD reconstruction task . The Fusion 360 Gym wraps the underlying Fusion 360 Python API ( Autodesk , 2014 ) and serves as the environment that interacts with an intelligent agent for the task of CAD reconstruction ( Figure 3 ) . Specifically , the Fusion 360 Gym formalizes the following Markov Decision Process : • state : Contains the current geometry , and optionally , the target geometry to be reconstructed . We use a B-Rep face-adjacency graph as our state representation . • action : A modeling operation that allows the agent to modify the current geometry . We consider two action representations : sketch extrusion and face extrusion . • transition : Fusion 360 Gym implements the transition function that applies the modeling operation to the current geometry . • reward : The user can define custom reward functions depending on the task . We provide intersection over union ( IoU ) as one measure to compare the current and target geometry .
The paper presents the first large scale CAD construction sequence dataset together with environment that allows us to synthesize 3D CAD from these sequences. The dataset and environment are essential building blocks for applying machine learning algorithms to CAD design process. Furthermore, the paper proposes comprehensive evaluation metrics and a baseline method for predicting the sequence of 3D CAD design from a CAD model.
SP:96e936fc1cf2e77c2bf154a66da19aa9a1f68400
Fusion 360 Gallery: A Dataset and Environment for Programmatic CAD Reconstruction
1 INTRODUCTION . The manufactured objects that surround us in everyday life are created in computer-aided design ( CAD ) software using common modeling operations such as sketch and extrude . With just these two modeling operations , a highly expressive range of 3D designs can be created ( Figure 1 ) . Parametric CAD files contain construction sequence information that is critical for documenting design intent , maintaining editablity , and downstream simulation and manufacturing . Despite the value of this information , it is often lost due to data translation or error and must be reverse engineered from geometry or even raw 3D scan data . The task of reconstructing CAD operations from geometry has been pursued for over 40 years ( Shah et al. , 2001 ) and is available in commercial CAD software using heuristic approaches ( Autodesk , 2012 ; Dassault , 2019 ) . Recent advances in neural networks for 3D shape generation has spurred new interest in CAD reconstruction , due to the potential to generalize better and further automate this challenging problem . However , learning-based approaches to CAD reconstruction have not yet had access to a human-designed dataset of 3D CAD construction sequences , instead relying on synthetic data for both training and testing purposes , e.g . Li et al . ( 2020 ) . The absence of real world data has limited work on CAD reconstruction using common sketch and extrude modeling operations . Instead a focus has been on reconstruction from simple geometric primitives ( Sharma et al. , 2017 ; Tian et al. , 2019 ; Ellis et al. , 2019 ) that lack the rich parametric sketches commonly used in mechanical CAD ( e.g . Figure 2 ) . As there is no existing learning-based approach to reconstruct sketch and extrude sequences , we take a first step towards this goal by introducing data , a supporting software environment , and a novel action representation for reconstructing sketch and extrude designs . In this paper we present the Fusion 360 Gallery reconstruction dataset and environment for learning CAD reconstruction . The dataset contains 8,625 designs created by users of Autodesk Fusion 360 using a simple subset of CAD modeling operations : sketch and extrude . To the best of our knowledge this dataset is the first to provide human designed 3D CAD construction sequence data for use with machine learning . To support research with the dataset we provide an environment called the Fusion 360 Gym for working with CAD reconstruction . A key motivation of this work is to provide insights into the process of how people design objects . Furthermore , our goal is to provide a universal benchmark for research and evaluation of learning-based CAD reconstruction algorithms , bridging the gap between the computer graphics and machine learning community . To this end we describe a standard CAD reconstruction task and associated evaluation metrics with respect to the ground truth construction sequence . We also introduce a novel action representation for CAD reconstruction of sketch and extrude designs using neurally guided search . This search employs a policy , trained using imitation learning , consisting of a graph neural network encoding of CAD geometry . This paper makes the following contributions : • We present the Fusion 360 Gallery reconstruction dataset containing construction sequence information for 8,625 human-designed sketch and extrude CAD models . • We introduce an environment called the Fusion 360 Gym , standardizing the CAD reconstruction task in a Markov Decision Process formulation . • We introduce a novel action representation to enable neurally guided CAD reconstruction trained on real world construction sequences for the first time . 2 RELATED WORK . CAD Datasets Existing 3D CAD datasets have largely focused on providing mesh geometry ( Chang et al. , 2015 ; Wu et al. , 2015 ; Zhou & Jacobson , 2016 ; Mo et al. , 2019b ; Kim et al. , 2020 ) . However , the de facto standard for parametric CAD is the boundary representation ( B-Rep ) format , containing valuable analytic representations of surfaces and curves suitable for high level control of 3D shapes . B-Reps are collections of trimmed parametric surfaces along with topological information which describes adjacency relationships and the ordering of elements such as faces , loops , edges , and vertices ( Weiler , 1986 ) . B-Rep datasets have recently been made available with both human-designed ( Koch et al. , 2019 ) and synthetic data ( Zhang et al. , 2018 ; Jayaraman et al. , 2020 ; Starly , 2020 ) . Missing from these datasets is construction sequence information . We believe it is critical to understand not only what is designed , but how that design came about . Parametric CAD files contain valuable information on the construction history of a design . Schulz et al . ( 2014 ) provide a standard collection of human designs with full parametric history , albeit a limited set of 67 designs in a proprietary format . SketchGraphs ( Seff et al. , 2020 ) constrains the broad area of parametric CAD by focusing on the underlying 2D engineering sketches , including sketch construction sequences . In the absence of 3D human design data , learning-based approaches have instead leveraged synthetic CAD construction sequences ( Sharma et al. , 2017 ; Li et al. , 2020 ) . The dataset presented in this paper is , to the best of our knowledge , the first to provide humandesigned 3D CAD construction sequence information suitable for use with machine learning . CAD Reconstruction The task of CAD reconstruction involves recovering the sequence of modeling operations used to construct a CAD model from geometry input , such as B-reps , triangle meshes , or point clouds . Despite extensive prior work ( Shah et al. , 2001 ) , CAD reconstruction remains a challenging problem as it requires deductions on both continuous parameters ( e.g. , ex- tracting the dimensions of primitives ) and discrete operations ( e.g. , choosing a proper operation for the next step ) , leading to a mixed combinatorial search space . To recover the sequence of operations , traditional methods typically run global search methods ( e.g. , evolutionary algorithms as in Hamza & Saitou ( 2004 ) , Weiss ( 2009 ) , Friedrich et al . ( 2019 ) , and Fayolle & Pasko ( 2016 ) ) with heuristic rules to prune the search space ( Shapiro & Vossler , 1993 ; Buchele , 2000 ; Buchele & Roles , 2001 ; Buchele & Crawford , 2003 ) . Heuristic approaches are also available in a number of commercial software tools , often as a user-guided semi-automatic system ( Autodesk , 2012 ; Dassault , 2019 ) to aid with file conversion between CAD systems . These traditional algorithms operate by removing faces from the B-rep body and reapplying them as parametric modeling operations . This strategy can recover the later modeling operations , but fail to completely rebuild the construction sequence from the first step . We instead tackle the task of recovering the entire construction sequence from the first extrusion . Another approach is using program synthesis ( Du et al. , 2018 ; Nandi et al. , 2017 ; 2018 ; 2020 ) to infer CAD programs written in domain specific languages from given shapes . CAD reconstruction is also related to the inverse procedural modeling problem ( Talton et al. , 2011 ; Stava et al. , 2014 ; Vanegas et al. , 2012 ) , which attempts to reverse-engineer procedures that can faithfully match a given target . Inverse procedural modeling methods typically work with synthetic data , while our paper tackles tasks on real CAD models and modeling operations . Compared to the rule-based or grammar-based methods above , learning-based approaches can potentially learn the types of rules that are typically hard-coded , automate scenarios that require userinput , and generalize when confronted with unfamiliar geometry . One of the earliest such works is CSGNet ( Sharma et al. , 2017 ) , which trains a neural network to infer the sequence of Constructive Solid Geometry ( CSG ) operations based on visual inputs . More recent works along this line of research include Ellis et al . ( 2019 ) , Tian et al . ( 2019 ) , and Kania et al . ( 2020 ) . Typically associated with these methods are a customized , domain specific language ( e.g. , CSG ) that parameterizes the space of geometry , some heuristic rules that limit the search space , and a neural network generative model ( Zou et al. , 2017 ; Mo et al. , 2019a ; Chen et al. , 2020 ; Jones et al. , 2020 ) . Lin et al . ( 2020 ) reconstruct input shapes with a dual action representation that first positions cuboids and then edits edge-loops for refinement . Although editing edge-loops of cuboids may be a suitable modeling operation in artistic design , it is not as expressive or precise as the sketch and extrude operations used in real mechanical components . Additionally , Lin et al . ( 2020 ) chooses to train and evaluate their network on synthetic data due to the lack of a benchmark dataset of CAD construction sequences , a space that our work aims to fill . Our approach is , to the best of our knowledge , the first to apply a learning-based method to reconstruction using common sketch and extrude CAD modeling operations from real human designs . 3 FUSION 360 GALLERY RECONSTRUCTION DATASET . The Fusion 360 Gallery reconstruction dataset1 is produced from designs submitted by users of the CAD software Autodesk Fusion 360 . The dataset contains CAD construction sequence information from a subset of sketch and extrude designs . We intentionally limit the data to the sketch and extrude modeling operations to reduce the complexity of the CAD reconstruction task . Figure 1 shows a random sampling of the designs in the dataset . Each design is provided in three different representations : B-Rep , mesh , and construction sequence JSON text format . An official 80:20 train- 1https : //github.com/xxx/xxx test split is provided with 6,900 and 1,725 designs respectively . We now briefly outline the sketch and extrude modeling operations and provide additional details in Section A.1 of the appendix . Sketch Unlike free-form sketches , sketches in CAD are composed of 2D geometric primitives ( lines , circles , splines etc . ) , associated dimensions ( distance , diameter , angle etc . ) and constraints ( symmetry , tangent , parallel etc. ) . Sketch geometry is represented by points , that create curves , that in turn form loops within profiles . The intersection of curves , as the user draws , automatically creates closed loops and profiles that are serialized as both raw curves and trimmed profiles . Sketch profiles form the basis for 3D extrusion as shown in ( Figure 2 ) . Extrude An extrude operation takes one or more sketch profiles and extrudes them from 2D into a 3D B-Rep body . A distance parameter defines how far the profile is extruded . A notable feature of extrude operations in Fusion 360 is the ability to perform Boolean operations in the same step . As a user extrudes a sketch profile , they choose to create a new body , join , cut , or intersect with other bodies in the design ( Figure 2 ) . Additional extrude options are available such as two-sided extrude , symmetrical extrude , and tapered extrude . The combination of expressive sketches and extrude operations with built in Boolean capability enables a wide variety of designs to be constructed . 4 FUSION 360 GYM . Together with the dataset we provide an open source environment , called the Fusion 360 Gym , for standardizing the CAD reconstruction task . The Fusion 360 Gym wraps the underlying Fusion 360 Python API ( Autodesk , 2014 ) and serves as the environment that interacts with an intelligent agent for the task of CAD reconstruction ( Figure 3 ) . Specifically , the Fusion 360 Gym formalizes the following Markov Decision Process : • state : Contains the current geometry , and optionally , the target geometry to be reconstructed . We use a B-Rep face-adjacency graph as our state representation . • action : A modeling operation that allows the agent to modify the current geometry . We consider two action representations : sketch extrusion and face extrusion . • transition : Fusion 360 Gym implements the transition function that applies the modeling operation to the current geometry . • reward : The user can define custom reward functions depending on the task . We provide intersection over union ( IoU ) as one measure to compare the current and target geometry .
The paper describes a new dataset of 3D geometry construction sequences based on sequential sketching (i.e. sets of two-dimensional curves) and extruding (i.e. axes, angles and distances for extrusion profiles from sketches) combined with Boolean solid geometry operations. The dataset comprises the resulting objects as well as the human designed sketch-extrude sequence that lead to the object geometry. The 8625 objects are available in three different geometry representations (boundary representation, mesh, and construction sequence in structured format). Furthermore the submission describes a new infrastructure ("gym") to train and evaluate algorithms that estimate such construction sequences, as well as evaluation metrics to gauge the efficiency and effectiveness of such estimation algorithms. The paper also provides a reference method for sequence estimation based on imitation learning as well as several baselines and their empirical evaluation with respect to the posed benchmarks.
SP:96e936fc1cf2e77c2bf154a66da19aa9a1f68400
Learning to Solve Nonlinear Partial Differential Equation Systems To Accelerate MOSFET Simulation
1 INTRODUCTION . Nonlinear partial differential equations ( PDEs ) appear frequently in many science and engineering problems including transport equations for certain quantities like heat , mass , momentum , and energy ( Fischetti & Vandenberghe , 2016 ) . The Maxwell equations for the electromagnetic fields ( Jackson , 1999 ) , which govern one of the fundamental forces in the physical world , is one of the examples . By calculating the solution of those equations , the status of system-under-consideration can be characterized . In the machine learning society , solving a set of coupled partial differential equations has become an important emerging application field . ( de Avila Belbute-Peres et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) Among many nonlinear partial differential equations , we consider the semiconductor device simulation ( Grasser et al. , 2003 ) . The simulation is a pivotal application to foster next-generation semiconductor device technology at scale . Since the technology development heavily relies on the device simulation results , if the simulation time reduces , the turnaround time also significantly reduce . In order to reduce the simulation time , acceleration techniques based upon the multi-core computing have been successfully applied ( Rupp et al. , 2011 ; Sho & Odanaka , 2017 ) . However , the number of cores can not be exponentially increased and the cost also increases drastically as the number of cores involved increases . Moreover , as engineers submit many simulation jobs for a group of semiconductor devices , computing resources available to each simulation job is limited . As an alternative , we propose to improve the efficiency of the simulation per se . In the semiconductor device simulation , a solution of a system of partial differential equations is numerically calculated with a certain boundary condition . Those differential equations are coupled together and the overall system is highly nonlinear . The Newton-Raphson method ( Stoer & Bulirsch , 2002 ) is known to be one of the most robust methods to solve a set of coupled nonlinear equations . When the method converges to the solution , the error decreases rapidly as the Newton iterations proceed . To achieve a rapid convergence , it is crucial that initial guess for the solution needs to be close enough to the real solution ; otherwise , the method converges very slowly or may even diverge . Although we are interested in obtaining a solution at a specific boundary condition which is determined by an applied voltage , even obtaining an approximated solution to initiate the NewtonRaphson method successfully is challenging . In literature , in order to prepare an initial guess for the target boundary condition , several intermediate boundary conditions are introduced and solutions with those boundary conditions are computed sequentially ( Synopsys , 2014 ) . It , however , increases the overall computation time significantly . If the initial solution that is sufficiently close to the final one is provided by any means , we can save huge computational cost of calculating several unnecessary solutions . Instead , we propose to learn an approximate initial solution of a set of coupled PDE for a target boundary condition by an artificial neural network . Specifically , when a set of labeled images is available , a neural network can be trained to generate a similar image for a given label . The trained model generates a numerical solution for a target boundary condition . We show that the proposed initial solution by our method can speed up the device simulation significantly by providing a better initial guess . We summarize our contributions as follows : • We derive a compact solution for PDE systems based on the electrostatic potential . As a result , the network size is reduced by a factor of three . Since the electrostatic potential is well bounded , the normalization issue can be avoided . • For addressing various semiconductor devices , we propose a device template that can address various device structures with a set of hyper-parameters . Since the electrical characteristics of semiconductor devices are largely determined by the physical sizes of internal components , handling grids with varying size and spacing is particularly important . • We propose a convolutional neural network ( CNN ) which generates the electrostatic potential from the device parameters . It can be used to accelerate the device simulation . • Compared with the conventional method , the simulation time is significantly reduced ( at least 12 times ) with the proposed method while the numerical stability is not hampered . • Results from the convolutional neural network are compared with other methods such as an alternative architecture ( the fully-connected network ) and the local linear regression . • Our approach can be extended to the complex two-dimensional domains . Preliminary results are shown . 2 RELATED WORK . 2.1 NEURAL NETWORKS FOR SOLVING DIFFERENTIAL EQUATIONS . Recently , there have been many attempts to build a neural network to solve a differential equation ( Han et al. , 2018 ; Long et al. , 2018 ; Piscopo et al. , 2019 ; Raissi et al. , 2019 ; Winovich et al. , 2019 ; Zhu et al. , 2019 ; Obiols-Sales et al. , 2020 ; Lu et al. , 2020 ; Xiao et al. , 2020 ) . Among them , the Poisson equation is particularly of importance in the semiconductor device simulation . The Poisson equation plays a fundamental role in the semiconductor device simulation , by connecting the electrostatic potential and other physical quantities . In Magill et al . ( 2018 ) , the Laplace equation ( the Poisson equation with a vanishing source term ) is considered for a nanofluidic device . A fully-connected neural network is trained to minimize the loss function , which combines the residue vector and the boundary condition . The authors assume a specific two-dimensional structure and the mixed boundary condition is applied . Another attempt to solve the Poisson equation is suggested in Özbay et al . ( 2019 ) . The Poisson equation with the Dirichlet boundary condition is considered . It is decomposed into two equations . One is the Poisson equation with the homogeneous Neumann boundary condition . The other one is the Laplace equation with the Dirichlet boundary condition . A convolutional neural network architecture is adopted and the entire source term and the grid spacing are used as the input parameters . The network is trained with randomly generated source terms and a predicted solution shows a good agreement with the numerical solution . In order to consider a complex two-dimensional geometry , a rectangular domain covering the original geometry is introduced in Winovich et al . ( 2019 ) and a convolutional network is used . A neural network is used to solve the Poisson equation in a L-shape domain in Lu et al . ( 2020 ) . Quite recently , it has been independently proposed to accelerate the computational fluid dynamics simulations by predicting an appropriate initial guess from a convolutional neural network ( ObiolsSales et al. , 2020 ) . The basic idea is quite similar with this work and such a coincidence strongly demonstrates that the proposed approach is not restricted to a relatively narrow application domain . 2.2 NEURAL NETWORKS IN SEMICONDUCTOR DEVICE SIMULATION . Researchers are much interested with application of machine learning technique to the semiconductor device simulation ( Carrillo-Nuñez et al. , 2019 ; Bankapalli & Wong , 2019 ; Han & Hong , 2019 ; Souma & Ogawa , 2020 ) . However , the actual research activities are quite diverse . In many cases , the neural networks are merely used as an efficient descriptor of the input-output relation without considering the internal physical quantities ( Carrillo-Nuñez et al. , 2019 ; Bankapalli & Wong , 2019 ) . On the other hand , in their quantum transport simulation , Souma & Ogawa ( 2020 ) try to predict the electron density profile from the electrostatic potential . Although application of neural networks on the semiconductor device simulation is in its infancy , it has a huge potential . 3 PRELIMINARY : SEMICONDUCTOR DEVICE SIMULATION . We briefly introduce the semiconductor device simulation as a preliminary . As shown in Figure 1a , a multi-dimensional device structure has multiple terminals ( yellow bars in the figure ) whose voltages are controllable . Since the planar MOSFET has the translational symmetry along the direction perpendicular to the plane in Figure 1a , the three-dimensional device structure can be treated as a two-dimensional one . The terminal currents ( in Ampere ) under the determined terminal voltages ( in Volt ) are the output of the simulator , as shown in Figure 1b . As the motion of electrons yields the current , the terminal current itself can be only calculated from the internal physical quantities . ( See Figure 1c . ) Since the electrons are charged particles , the electric field due to the net charge density is also affected by the electronic motion . Therefore , we need to consider both effects of electronic motion and electric field by solving two equations , to calculate the terminal currents . The first one is the continuity equation for electrons : ∇ · Jn = 0 , ( 1 ) where the electron current density vector , Jn , is given by Jn = qµnnE+ qDn∇n , ( 2 ) where the elementary charge ( q ) , the electron mobility ( µn ) , and the electron diffusion constant ( Dn ) are scalar parameters and the electron density ( n ) is a position-dependent unknown variable . Note that the current density ( Jn ) also depends on the electric field vector ( E ) . Similar relations hold for holes with minor modification . The second equation is the Gauss law , also called as the Poisson equation : ∇ · ( E ) = q ( p− n+N+dop ) , ( 3 ) where p is the hole density , is the permittivity ( Jackson , 1999 ) and N+dop is the positively charged impurity density . Under the electrostatic approximation , the electric field vector can be expressed in terms of the electrostatic potential ( φ ) as E = −∇φ . ( 4 ) With the electrostatic potential , the above set of equations has two unknown variables ; n and φ . Note that nonlinearity is originated from ( 2 ) . The first term in the right-hand-side of ( 2 ) is proportional to nE , which is nonlinear with respect to unknown variables of n and φ . Therefore , when φ is fixed , the continuity equation becomes linear . For numerical analysis , we need to discretize the equations . In general , the i-th component of the residual vector can be written as ri = fi ( φ1 , ... φN , n1 , ... , nN , p1 , ... , pN ) − si = 0 , ( 5 ) where N is the number of grid points , fi ( · ) is a nonlinear function , and si is a constant . si becomes nonzero only at the boundary nodes and depends on the voltages applied to the device terminals . Since the system is nonlinar , the solution at each boundary condition must be computed . Detailed discussion can be found in Appendix A . The set of discretized equations in ( 5 ) is highly nonlinear and the iterative Newton-Raphson method is used to solve the system . Typically , a user wants to know the drain current at VG = VD = VDD , where VDD is the maximum allowed voltage . However , an appropriate initial guess to start the Newton-Raphson method at that condition is not directly available . Only the solution at VG = VD = 0 V can be easily calculated . Starting from the solution with all zero terminal voltages , many intermediate steps toward the target terminal voltages are introduced . Based upon the converged solution at the previous condition as an initial guess , the next step is solved sequentially . Detailed discussion can be found in Appendix B . Therefore , computing several intermediate boundary values is the main source of increase of computation . Let us denote the number of boundary values simulated during the solution procedure as Nstep . To evaluate the acceleration quantitatively , we define the reduction factor of the simulation time , α , and it is well approximated as α ≡ τconv τnn = Nstep ×Nnewton Ndirectnewton ≈ Nstep , ( 6 ) where τconv is the simulation time with the conventional method while τnn is the one with the proposed method . Moreover , Nnewton is the average number of the Newton iterations per a bias condition and Ndirectnewton is the number of the Newton iterations at the target bias condition . Since Nstep is typically larger than 10 , we expect that the reduction factor can be larger than 10 .
The paper proposes to use a CNN to compute an initial guess for the iterative Newton-Rhapson solution of a coupled PDE system used for semiconductor device simulation. To do so, the authors construct a "device template" which parametrizes the design space. The CNN then maps a device configuration in this 6-dim space to the predicted electrostatic potential in the form of a 64x64 grid. The authors provide an analysis showing why predicting the electrostatic potential alone is sufficient. Overall, this approach can provide a simulation speedup of 12x or more. The authors are also planning to publish the dataset generated for the paper.
SP:a5f75e1ad5a0650b7d39d4a0c74e1f20884f3680
Learning to Solve Nonlinear Partial Differential Equation Systems To Accelerate MOSFET Simulation
1 INTRODUCTION . Nonlinear partial differential equations ( PDEs ) appear frequently in many science and engineering problems including transport equations for certain quantities like heat , mass , momentum , and energy ( Fischetti & Vandenberghe , 2016 ) . The Maxwell equations for the electromagnetic fields ( Jackson , 1999 ) , which govern one of the fundamental forces in the physical world , is one of the examples . By calculating the solution of those equations , the status of system-under-consideration can be characterized . In the machine learning society , solving a set of coupled partial differential equations has become an important emerging application field . ( de Avila Belbute-Peres et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) Among many nonlinear partial differential equations , we consider the semiconductor device simulation ( Grasser et al. , 2003 ) . The simulation is a pivotal application to foster next-generation semiconductor device technology at scale . Since the technology development heavily relies on the device simulation results , if the simulation time reduces , the turnaround time also significantly reduce . In order to reduce the simulation time , acceleration techniques based upon the multi-core computing have been successfully applied ( Rupp et al. , 2011 ; Sho & Odanaka , 2017 ) . However , the number of cores can not be exponentially increased and the cost also increases drastically as the number of cores involved increases . Moreover , as engineers submit many simulation jobs for a group of semiconductor devices , computing resources available to each simulation job is limited . As an alternative , we propose to improve the efficiency of the simulation per se . In the semiconductor device simulation , a solution of a system of partial differential equations is numerically calculated with a certain boundary condition . Those differential equations are coupled together and the overall system is highly nonlinear . The Newton-Raphson method ( Stoer & Bulirsch , 2002 ) is known to be one of the most robust methods to solve a set of coupled nonlinear equations . When the method converges to the solution , the error decreases rapidly as the Newton iterations proceed . To achieve a rapid convergence , it is crucial that initial guess for the solution needs to be close enough to the real solution ; otherwise , the method converges very slowly or may even diverge . Although we are interested in obtaining a solution at a specific boundary condition which is determined by an applied voltage , even obtaining an approximated solution to initiate the NewtonRaphson method successfully is challenging . In literature , in order to prepare an initial guess for the target boundary condition , several intermediate boundary conditions are introduced and solutions with those boundary conditions are computed sequentially ( Synopsys , 2014 ) . It , however , increases the overall computation time significantly . If the initial solution that is sufficiently close to the final one is provided by any means , we can save huge computational cost of calculating several unnecessary solutions . Instead , we propose to learn an approximate initial solution of a set of coupled PDE for a target boundary condition by an artificial neural network . Specifically , when a set of labeled images is available , a neural network can be trained to generate a similar image for a given label . The trained model generates a numerical solution for a target boundary condition . We show that the proposed initial solution by our method can speed up the device simulation significantly by providing a better initial guess . We summarize our contributions as follows : • We derive a compact solution for PDE systems based on the electrostatic potential . As a result , the network size is reduced by a factor of three . Since the electrostatic potential is well bounded , the normalization issue can be avoided . • For addressing various semiconductor devices , we propose a device template that can address various device structures with a set of hyper-parameters . Since the electrical characteristics of semiconductor devices are largely determined by the physical sizes of internal components , handling grids with varying size and spacing is particularly important . • We propose a convolutional neural network ( CNN ) which generates the electrostatic potential from the device parameters . It can be used to accelerate the device simulation . • Compared with the conventional method , the simulation time is significantly reduced ( at least 12 times ) with the proposed method while the numerical stability is not hampered . • Results from the convolutional neural network are compared with other methods such as an alternative architecture ( the fully-connected network ) and the local linear regression . • Our approach can be extended to the complex two-dimensional domains . Preliminary results are shown . 2 RELATED WORK . 2.1 NEURAL NETWORKS FOR SOLVING DIFFERENTIAL EQUATIONS . Recently , there have been many attempts to build a neural network to solve a differential equation ( Han et al. , 2018 ; Long et al. , 2018 ; Piscopo et al. , 2019 ; Raissi et al. , 2019 ; Winovich et al. , 2019 ; Zhu et al. , 2019 ; Obiols-Sales et al. , 2020 ; Lu et al. , 2020 ; Xiao et al. , 2020 ) . Among them , the Poisson equation is particularly of importance in the semiconductor device simulation . The Poisson equation plays a fundamental role in the semiconductor device simulation , by connecting the electrostatic potential and other physical quantities . In Magill et al . ( 2018 ) , the Laplace equation ( the Poisson equation with a vanishing source term ) is considered for a nanofluidic device . A fully-connected neural network is trained to minimize the loss function , which combines the residue vector and the boundary condition . The authors assume a specific two-dimensional structure and the mixed boundary condition is applied . Another attempt to solve the Poisson equation is suggested in Özbay et al . ( 2019 ) . The Poisson equation with the Dirichlet boundary condition is considered . It is decomposed into two equations . One is the Poisson equation with the homogeneous Neumann boundary condition . The other one is the Laplace equation with the Dirichlet boundary condition . A convolutional neural network architecture is adopted and the entire source term and the grid spacing are used as the input parameters . The network is trained with randomly generated source terms and a predicted solution shows a good agreement with the numerical solution . In order to consider a complex two-dimensional geometry , a rectangular domain covering the original geometry is introduced in Winovich et al . ( 2019 ) and a convolutional network is used . A neural network is used to solve the Poisson equation in a L-shape domain in Lu et al . ( 2020 ) . Quite recently , it has been independently proposed to accelerate the computational fluid dynamics simulations by predicting an appropriate initial guess from a convolutional neural network ( ObiolsSales et al. , 2020 ) . The basic idea is quite similar with this work and such a coincidence strongly demonstrates that the proposed approach is not restricted to a relatively narrow application domain . 2.2 NEURAL NETWORKS IN SEMICONDUCTOR DEVICE SIMULATION . Researchers are much interested with application of machine learning technique to the semiconductor device simulation ( Carrillo-Nuñez et al. , 2019 ; Bankapalli & Wong , 2019 ; Han & Hong , 2019 ; Souma & Ogawa , 2020 ) . However , the actual research activities are quite diverse . In many cases , the neural networks are merely used as an efficient descriptor of the input-output relation without considering the internal physical quantities ( Carrillo-Nuñez et al. , 2019 ; Bankapalli & Wong , 2019 ) . On the other hand , in their quantum transport simulation , Souma & Ogawa ( 2020 ) try to predict the electron density profile from the electrostatic potential . Although application of neural networks on the semiconductor device simulation is in its infancy , it has a huge potential . 3 PRELIMINARY : SEMICONDUCTOR DEVICE SIMULATION . We briefly introduce the semiconductor device simulation as a preliminary . As shown in Figure 1a , a multi-dimensional device structure has multiple terminals ( yellow bars in the figure ) whose voltages are controllable . Since the planar MOSFET has the translational symmetry along the direction perpendicular to the plane in Figure 1a , the three-dimensional device structure can be treated as a two-dimensional one . The terminal currents ( in Ampere ) under the determined terminal voltages ( in Volt ) are the output of the simulator , as shown in Figure 1b . As the motion of electrons yields the current , the terminal current itself can be only calculated from the internal physical quantities . ( See Figure 1c . ) Since the electrons are charged particles , the electric field due to the net charge density is also affected by the electronic motion . Therefore , we need to consider both effects of electronic motion and electric field by solving two equations , to calculate the terminal currents . The first one is the continuity equation for electrons : ∇ · Jn = 0 , ( 1 ) where the electron current density vector , Jn , is given by Jn = qµnnE+ qDn∇n , ( 2 ) where the elementary charge ( q ) , the electron mobility ( µn ) , and the electron diffusion constant ( Dn ) are scalar parameters and the electron density ( n ) is a position-dependent unknown variable . Note that the current density ( Jn ) also depends on the electric field vector ( E ) . Similar relations hold for holes with minor modification . The second equation is the Gauss law , also called as the Poisson equation : ∇ · ( E ) = q ( p− n+N+dop ) , ( 3 ) where p is the hole density , is the permittivity ( Jackson , 1999 ) and N+dop is the positively charged impurity density . Under the electrostatic approximation , the electric field vector can be expressed in terms of the electrostatic potential ( φ ) as E = −∇φ . ( 4 ) With the electrostatic potential , the above set of equations has two unknown variables ; n and φ . Note that nonlinearity is originated from ( 2 ) . The first term in the right-hand-side of ( 2 ) is proportional to nE , which is nonlinear with respect to unknown variables of n and φ . Therefore , when φ is fixed , the continuity equation becomes linear . For numerical analysis , we need to discretize the equations . In general , the i-th component of the residual vector can be written as ri = fi ( φ1 , ... φN , n1 , ... , nN , p1 , ... , pN ) − si = 0 , ( 5 ) where N is the number of grid points , fi ( · ) is a nonlinear function , and si is a constant . si becomes nonzero only at the boundary nodes and depends on the voltages applied to the device terminals . Since the system is nonlinar , the solution at each boundary condition must be computed . Detailed discussion can be found in Appendix A . The set of discretized equations in ( 5 ) is highly nonlinear and the iterative Newton-Raphson method is used to solve the system . Typically , a user wants to know the drain current at VG = VD = VDD , where VDD is the maximum allowed voltage . However , an appropriate initial guess to start the Newton-Raphson method at that condition is not directly available . Only the solution at VG = VD = 0 V can be easily calculated . Starting from the solution with all zero terminal voltages , many intermediate steps toward the target terminal voltages are introduced . Based upon the converged solution at the previous condition as an initial guess , the next step is solved sequentially . Detailed discussion can be found in Appendix B . Therefore , computing several intermediate boundary values is the main source of increase of computation . Let us denote the number of boundary values simulated during the solution procedure as Nstep . To evaluate the acceleration quantitatively , we define the reduction factor of the simulation time , α , and it is well approximated as α ≡ τconv τnn = Nstep ×Nnewton Ndirectnewton ≈ Nstep , ( 6 ) where τconv is the simulation time with the conventional method while τnn is the one with the proposed method . Moreover , Nnewton is the average number of the Newton iterations per a bias condition and Ndirectnewton is the number of the Newton iterations at the target bias condition . Since Nstep is typically larger than 10 , we expect that the reduction factor can be larger than 10 .
Contribution: Authors propose using a neural network to learn an approximate solution for desired boundary conditions in order to accelerate the semiconductor device simulation. They significately reduce the computational cost to calculate several unnecessary solutions when considering an initial solution sufficiently close to the final one by a convolutional neural network (CNN). To compute this initial solution, authors authors train a MOSFET based convolutional neural network. They empirically show that their proposed method accelerates the simulation by more than 12 times.
SP:a5f75e1ad5a0650b7d39d4a0c74e1f20884f3680
Open Question Answering over Tables and Text
1 INTRODUCTION . Open question answering considers the problem of retrieving documents from a fixed corpus with a retriever , and then analyzes retrieved evidence to provide answers to a given question with a reader . Prior open question answering systems focused only on retrieving and reading free-form passages or documents . However , a significant amount of real-world information is stored in other forms , such as semi-structured web tables due to its compact representation to aggregate related information . For example , tables are often used to hold large quantities of related facts , especially numeric facts , such as ‘ Career Statistics for Lebron James ’ . This type of detailed information is found much less frequently in unstructured text . Tables are also commonly used for collections of homogeneous entities or recurring events , like ‘ List of Periodic Comets ’ or ‘ List of Champions League Winners since 1966 ’ . Hence tabular information serves as an excellent complement to textual data , especially in the open setting . Despite these advantages , no previous studies have exploited the millions of web tables to augment their open QA system . In this paper , we describe the first study to jointly exploit tables and text for open-domain question answering . For this purpose , we construct a new dataset , Open Table-and-Text Question Answering ( OTT-QA ) . OTT-QA is built on the HybridQA dataset ( Chen et al. , 2020 ) , and like HybridQA , OTTQA questions are multi-hop questions which require aggregating information from both tables and text to answer . However , unlike HybridQA , OTT-QA requires the system to retrieve relevant tables and text — in contrast , in HybridQA , the ground truth tables and textual passages required for each question are given . To produce OTT-QA ’ s questions , we begin by re-annotating the questions from HybridQA to ‘ decontextualize ’ them—i.e. , we make questions suitable for the open-domain setting ∗Part of this work was done during an internship at Google . 1Data was released in https : //github.com/wenhuchen/OTT-QA by UCSB NLP Group so that unique answers can be determined from the question alone , without needing context from the provided text and tables . We then add new questions to remove potential biases . After these steps , OTT-QA contains 45K human-annotated questions that require retrieving and aggregating information over tables and text from the whole Wikipedia . Examples from OTT-QA are depicted in Figure 1 . Note the table and passages contain non-overlapping information , and both of them must be understood to answer the question . For example , the question has a low lexical overlap with the passage about the ‘ Lakers ’ , and it needs the table as the bridge to retrieve this passage . Such cross-modality multi-hop retrieval features OTT-QA . More examples are displayed in Appendix . OTT-QA is distinguished from the existing QA datasets in two aspects . Existing table-based QA datasets ( Pasupat & Liang , 2015 ; Yu et al. , 2018 ; Chen et al. , 2020 ) operates in the closed setting without requiring any retrieval , whereas most existing open QA datasets ( Joshi et al. , 2017 ; Yang et al. , 2018 ) require only text retrieval , not table retrieval . One dataset , Natural Questions ( NQ ) ( Kwiatkowski et al. , 2019 ) includes some tabular information in its corpus , but the tables are nearly always of a restricted type ( infobox tables with only a single row ) . In contrast , OTT-QA models require retrieving both tabular data and text , and unlike the NQ dataset , requires information fusion from text and tables in non-trivial ways . OTT-QA poses novel and realistic challenges to both the retriever and reader in open QA though the questions are less natural than the real queries from NQ ( Kwiatkowski et al. , 2019 ) . Retrievers for OTT-QA need to consider two information formats , making the search space larger . Even worse , as questions in OTT-QA often require multi-hop inference , one round of retrieval is often not enough . Readers for OTT-QA also need to aggregate a significant amount of knowledge-intensive information , compared to other reader models : a single table in OTT-QA has an average length of over 300 words . Moreover , readers are often expected to process multiple retrieved units due to the uncertainty in retrieval , which makes it difficult to design strong reader models ( Devlin et al. , 2019 ; Liu et al. , 2019 ) with a length limit of 512 tokens . The baseline system that we propose to address these challenges uses an iterative retriever ( Sun et al. , 2019 ; Qi et al. , 2019 ; Min et al. , 2019 ; Ding et al. , 2019 ; Asai et al. , 2019 ) and a BERT reader ( Devlin et al. , 2019 ) . The iterative retriever explores multiple evidence documents iteratively , interacting with the candidate pool to gradually reformulate the query . Beam search is used to find multiple subsets of documents that may contain all the required evidence , and each subset is then fed to the BERT reader to predict the answer span . The highest-scored prediction is chosen as the answer . The iterative retriever needs to re-encode the query with a big transformer and re-search over the candidate pool , such a procedure ( especially dense ) can be computationally expensive . Furthermore , the BERT reader fails to capture a global overview of the retrieved documents , which leads to bad local optimum in the model prediction . We propose a more sophisticated system that addresses these challenges with two novel strategies : namely fusion retrieval and cross-block reading . The fusion retriever first pre-aligns the table segments to their highly related passages , using entity linking . Then , the aligned table segments and passages are grouped as a fused block , which contains aggregated information from two modalities ; hence , compared to the previous documents , it contains richer context to benefit the following retrieval . We view the fused block as the basic unit to be retrieved , and instead of performing multiple runs of retrieval iteratively , the fusion retriever is used once to retrieve the top K fused blocks ; however , due to errors in fusion and retrieval , the retrieved top-1 fused block might not contain the necessary information . We thus also propose a cross-block reader based on a sparse-attention based transformer architecture ( Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) , which can process extremely long sequences efficiently . We use the cross-block reader to read all the top-K retrieved fused blocks jointly . Both strategies have proven effective compared to the baseline system : the best model combining the two strategies improves the accuracy of the baseline system by a huge margin . 2 BACKGROUND . The aim of an open QA system is to extract an answer to a question q from a given large corpus . Most open QA models are retriever-reader models , which extract answers in two steps : retrieval and reading . In the retrieval step , a retrieval model f is used to retrieve a set of passages from the text corpus . In the reading step , the reader is then used to extract the answer from them . Retrieval Function There are two commonly-used types of retrieval function f : sparse retrievers and dense retrievers . Our sparse retriever uses a unigram-based BM-25 score to retrieve an evidence unit b from the candidate pool B . Our dense retrieval function is a dual-encoder model ( Bromley et al. , 1994 ) , and we follow ( Lee et al. , 2019 ; Guu et al. , 2020 ) for the dual encoder design . The query and the passage are encoded with separate Transformers . As in ( Devlin et al. , 2019 ) , the vector corresponding to the first token , [ CLS ] , is used as a “ pooled ” representation of the sequence . The dense retrieval function is the dot product between hq = BERTQ ( q ) [ CLS ] and hb = BERTB ( b ) [ CLS ] for each evidence block b in the candidate corpus—i.e. , the scoring function is f ( q , b ) = hTq hb , which can viewed as finding the nearest neighbor in vector space . In the multi-hop open QA setting ( Yang et al. , 2018 ) , an iterative retrieval function ( Sun et al. , 2019 ; Min et al. , 2019 ; Ding et al. , 2019 ) is proposed , which defines the retrieval process as an auto-regressive formula . Our iterative retriever function is denoted as f ( [ q , b1 , · · · , bj−1 ] , bj ) , which appends the previous j− 1 rounds of retrieval to the original q in in the j-th round of retrieval . Beam search is used in test time . Single-Block Reader Due to the uncertainty in retrieval , the top-1 document might not always contain the answer . Existing models normally retrieve the top-k documents and feed them to the reader for span selection . The standard reader ( Chen et al. , 2017 ; Joshi et al. , 2017 ) aims to extract a span from each of the retrieved blocks bi and assign a confidence f ( q , bi ) fread ( a|q , bi ) to it , with f ( q , bi ) indicating the retrieval probability and fread ( a|q , bi ) denoting the span selection probability by reader . Multiple answers { a1 , · · · , ak } are ranked with this confidence score and the highest scored answer span â is the final answer . Note that the reader needs to run k times , once for each of the top-k retrievals . We refer to this model as the single-block reader and use it as our baseline . HybridQA HybridQA ( Chen et al. , 2020 ) , a closed-domain QA dataset , is the most related to ours . During the annotation of HybridQA , a table T and its relevant passages { P1 , · · · , PN } ( surrounding text and hyperlinked passage ) are given to a crowd worker to write questions which necessarily require both the passage and table information to answer . The original dataset contains 72K multi-hop questions paired with 13K tables with their paired passages . During training/testing time , the ground-truth tables and passages are given to a model , HYBRIDER , to find the final answer . HYBRIDER also serves as an important baseline in our paper . 3 TASK AND DATASET . In OTT-QA , the retrieval corpus consists of a set of table candidates BT and a set of passage candidates BP . The task is to answer question q by extracting answer strings from blocks b ∈ BT ∪ BP , where b can be either textual and tabular data . We adopt the standard exact match ( EM ) and F1 scores ( Yang et al. , 2018 ) for evaluation . Different from HybridQA , OTT-QA ’ s table candidates are web tables without hyperlinks provided . This decision was made to make the problem setting more general , as otherwise systems that solve OTT-QA could only be applied to high-quality data in Wikipedia . However , in OTT-QA , we provide hyperlinks in the training subset , but not dev/test set . Removing hyperlinks in tables makes the overall task much more challenging , but makes the final systems applicable to more general domains . Thus , an OTT-QA model needs to jointly retrieve both tables and text , without abusing gold hyperlinks , and then aggregate them to find the answer . Candidate Pool For our table collection BT , we extracted all Wikipedia regular tables with their metadata including page title , page section title , and section text . The metadata , denoted TM , is essential for de-contextualization . We obtain a table corpus containing over 400k high-quality tables with an average length of 320 words including metadata . For the text passage collection BP , we crawl English Wikipedia dump pages and filter out noisy pages . We follow HybridQA ( Chen et al. , 2020 ) and only keep a maximum of 12 sentences in the introduction section as the passage . We obtain a corpus containing over 5 million passages , with an average of 94 words . Notation We define each table as a matrix T , which consists of cells Ti , j with i specifying the row , and j specifying the column . Each cell Ti , j could be a number , date , phrase or even sentence due to its semi-structured nature . However , a single complete table with structured representation ( Herzig et al. , 2020 ) can easily exceed the 512-token limit , which poses great challenges to the downstream reader to process top-K retrieval . Hence we propose to decompose each table T into multiple rows Ri , which are combined with the headers , metadata , and global max/min information from the original table as a table segment . The table segment is used as the basic retrieval block in our paper . This decomposition procedure increases candidate BT from 400k to 5 million , making the retrieval problems even more fine-grained and more challenging . Our table segment representation is described in Appendix subsection B.1 . In summary , we build a candidate pool of 5 million table segments BT and a pool of 5 million passages BP . We denote as B as our full candidate pool , which our model needs to find the block b ( a table segment or a passage ) containing the answer span .
In this paper, the authors introduce the task of open domain QA using table and text. Unlike recent tasks on table and text retrieval, where the table associated with the text is known, in this task both tables and text need to be retrieved from a large collection. Similar to the recent HybridQA task, questions may require fusing information both tables and text to answer questions. The dataset has been constructed by reusing the Hybrid QA dataset as well as crawling additional tables and passages from Wikipedia. Since the questions in the dataset may be non-contextual (for instance, not explicitly mentioning the name of a country when the data is only for that country), the authors used crowd-sourced workers to insert words or phrases from the section title, caption etc and make the question self-contained. However, this can cause the questions to become unnatural and excessively long - the authors manually select the 25% worst questions and get them refined by a second set of annotation tasks. Additionally, to include new samples beyond Hybrid QA, they collect 2200 new QA pairs using the additional tables crawled and include them as part of the dev and test set. The exact answer in the table is annotated using distant supervision and has an extraction accuracy of 85%. The overall dataset contains 41.5K questions in train and approximately 2K questions each in the dev and test set.
SP:f4a2e63fc2cd7787434a51f3a9511ed64b6a7e0d
Open Question Answering over Tables and Text
1 INTRODUCTION . Open question answering considers the problem of retrieving documents from a fixed corpus with a retriever , and then analyzes retrieved evidence to provide answers to a given question with a reader . Prior open question answering systems focused only on retrieving and reading free-form passages or documents . However , a significant amount of real-world information is stored in other forms , such as semi-structured web tables due to its compact representation to aggregate related information . For example , tables are often used to hold large quantities of related facts , especially numeric facts , such as ‘ Career Statistics for Lebron James ’ . This type of detailed information is found much less frequently in unstructured text . Tables are also commonly used for collections of homogeneous entities or recurring events , like ‘ List of Periodic Comets ’ or ‘ List of Champions League Winners since 1966 ’ . Hence tabular information serves as an excellent complement to textual data , especially in the open setting . Despite these advantages , no previous studies have exploited the millions of web tables to augment their open QA system . In this paper , we describe the first study to jointly exploit tables and text for open-domain question answering . For this purpose , we construct a new dataset , Open Table-and-Text Question Answering ( OTT-QA ) . OTT-QA is built on the HybridQA dataset ( Chen et al. , 2020 ) , and like HybridQA , OTTQA questions are multi-hop questions which require aggregating information from both tables and text to answer . However , unlike HybridQA , OTT-QA requires the system to retrieve relevant tables and text — in contrast , in HybridQA , the ground truth tables and textual passages required for each question are given . To produce OTT-QA ’ s questions , we begin by re-annotating the questions from HybridQA to ‘ decontextualize ’ them—i.e. , we make questions suitable for the open-domain setting ∗Part of this work was done during an internship at Google . 1Data was released in https : //github.com/wenhuchen/OTT-QA by UCSB NLP Group so that unique answers can be determined from the question alone , without needing context from the provided text and tables . We then add new questions to remove potential biases . After these steps , OTT-QA contains 45K human-annotated questions that require retrieving and aggregating information over tables and text from the whole Wikipedia . Examples from OTT-QA are depicted in Figure 1 . Note the table and passages contain non-overlapping information , and both of them must be understood to answer the question . For example , the question has a low lexical overlap with the passage about the ‘ Lakers ’ , and it needs the table as the bridge to retrieve this passage . Such cross-modality multi-hop retrieval features OTT-QA . More examples are displayed in Appendix . OTT-QA is distinguished from the existing QA datasets in two aspects . Existing table-based QA datasets ( Pasupat & Liang , 2015 ; Yu et al. , 2018 ; Chen et al. , 2020 ) operates in the closed setting without requiring any retrieval , whereas most existing open QA datasets ( Joshi et al. , 2017 ; Yang et al. , 2018 ) require only text retrieval , not table retrieval . One dataset , Natural Questions ( NQ ) ( Kwiatkowski et al. , 2019 ) includes some tabular information in its corpus , but the tables are nearly always of a restricted type ( infobox tables with only a single row ) . In contrast , OTT-QA models require retrieving both tabular data and text , and unlike the NQ dataset , requires information fusion from text and tables in non-trivial ways . OTT-QA poses novel and realistic challenges to both the retriever and reader in open QA though the questions are less natural than the real queries from NQ ( Kwiatkowski et al. , 2019 ) . Retrievers for OTT-QA need to consider two information formats , making the search space larger . Even worse , as questions in OTT-QA often require multi-hop inference , one round of retrieval is often not enough . Readers for OTT-QA also need to aggregate a significant amount of knowledge-intensive information , compared to other reader models : a single table in OTT-QA has an average length of over 300 words . Moreover , readers are often expected to process multiple retrieved units due to the uncertainty in retrieval , which makes it difficult to design strong reader models ( Devlin et al. , 2019 ; Liu et al. , 2019 ) with a length limit of 512 tokens . The baseline system that we propose to address these challenges uses an iterative retriever ( Sun et al. , 2019 ; Qi et al. , 2019 ; Min et al. , 2019 ; Ding et al. , 2019 ; Asai et al. , 2019 ) and a BERT reader ( Devlin et al. , 2019 ) . The iterative retriever explores multiple evidence documents iteratively , interacting with the candidate pool to gradually reformulate the query . Beam search is used to find multiple subsets of documents that may contain all the required evidence , and each subset is then fed to the BERT reader to predict the answer span . The highest-scored prediction is chosen as the answer . The iterative retriever needs to re-encode the query with a big transformer and re-search over the candidate pool , such a procedure ( especially dense ) can be computationally expensive . Furthermore , the BERT reader fails to capture a global overview of the retrieved documents , which leads to bad local optimum in the model prediction . We propose a more sophisticated system that addresses these challenges with two novel strategies : namely fusion retrieval and cross-block reading . The fusion retriever first pre-aligns the table segments to their highly related passages , using entity linking . Then , the aligned table segments and passages are grouped as a fused block , which contains aggregated information from two modalities ; hence , compared to the previous documents , it contains richer context to benefit the following retrieval . We view the fused block as the basic unit to be retrieved , and instead of performing multiple runs of retrieval iteratively , the fusion retriever is used once to retrieve the top K fused blocks ; however , due to errors in fusion and retrieval , the retrieved top-1 fused block might not contain the necessary information . We thus also propose a cross-block reader based on a sparse-attention based transformer architecture ( Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) , which can process extremely long sequences efficiently . We use the cross-block reader to read all the top-K retrieved fused blocks jointly . Both strategies have proven effective compared to the baseline system : the best model combining the two strategies improves the accuracy of the baseline system by a huge margin . 2 BACKGROUND . The aim of an open QA system is to extract an answer to a question q from a given large corpus . Most open QA models are retriever-reader models , which extract answers in two steps : retrieval and reading . In the retrieval step , a retrieval model f is used to retrieve a set of passages from the text corpus . In the reading step , the reader is then used to extract the answer from them . Retrieval Function There are two commonly-used types of retrieval function f : sparse retrievers and dense retrievers . Our sparse retriever uses a unigram-based BM-25 score to retrieve an evidence unit b from the candidate pool B . Our dense retrieval function is a dual-encoder model ( Bromley et al. , 1994 ) , and we follow ( Lee et al. , 2019 ; Guu et al. , 2020 ) for the dual encoder design . The query and the passage are encoded with separate Transformers . As in ( Devlin et al. , 2019 ) , the vector corresponding to the first token , [ CLS ] , is used as a “ pooled ” representation of the sequence . The dense retrieval function is the dot product between hq = BERTQ ( q ) [ CLS ] and hb = BERTB ( b ) [ CLS ] for each evidence block b in the candidate corpus—i.e. , the scoring function is f ( q , b ) = hTq hb , which can viewed as finding the nearest neighbor in vector space . In the multi-hop open QA setting ( Yang et al. , 2018 ) , an iterative retrieval function ( Sun et al. , 2019 ; Min et al. , 2019 ; Ding et al. , 2019 ) is proposed , which defines the retrieval process as an auto-regressive formula . Our iterative retriever function is denoted as f ( [ q , b1 , · · · , bj−1 ] , bj ) , which appends the previous j− 1 rounds of retrieval to the original q in in the j-th round of retrieval . Beam search is used in test time . Single-Block Reader Due to the uncertainty in retrieval , the top-1 document might not always contain the answer . Existing models normally retrieve the top-k documents and feed them to the reader for span selection . The standard reader ( Chen et al. , 2017 ; Joshi et al. , 2017 ) aims to extract a span from each of the retrieved blocks bi and assign a confidence f ( q , bi ) fread ( a|q , bi ) to it , with f ( q , bi ) indicating the retrieval probability and fread ( a|q , bi ) denoting the span selection probability by reader . Multiple answers { a1 , · · · , ak } are ranked with this confidence score and the highest scored answer span â is the final answer . Note that the reader needs to run k times , once for each of the top-k retrievals . We refer to this model as the single-block reader and use it as our baseline . HybridQA HybridQA ( Chen et al. , 2020 ) , a closed-domain QA dataset , is the most related to ours . During the annotation of HybridQA , a table T and its relevant passages { P1 , · · · , PN } ( surrounding text and hyperlinked passage ) are given to a crowd worker to write questions which necessarily require both the passage and table information to answer . The original dataset contains 72K multi-hop questions paired with 13K tables with their paired passages . During training/testing time , the ground-truth tables and passages are given to a model , HYBRIDER , to find the final answer . HYBRIDER also serves as an important baseline in our paper . 3 TASK AND DATASET . In OTT-QA , the retrieval corpus consists of a set of table candidates BT and a set of passage candidates BP . The task is to answer question q by extracting answer strings from blocks b ∈ BT ∪ BP , where b can be either textual and tabular data . We adopt the standard exact match ( EM ) and F1 scores ( Yang et al. , 2018 ) for evaluation . Different from HybridQA , OTT-QA ’ s table candidates are web tables without hyperlinks provided . This decision was made to make the problem setting more general , as otherwise systems that solve OTT-QA could only be applied to high-quality data in Wikipedia . However , in OTT-QA , we provide hyperlinks in the training subset , but not dev/test set . Removing hyperlinks in tables makes the overall task much more challenging , but makes the final systems applicable to more general domains . Thus , an OTT-QA model needs to jointly retrieve both tables and text , without abusing gold hyperlinks , and then aggregate them to find the answer . Candidate Pool For our table collection BT , we extracted all Wikipedia regular tables with their metadata including page title , page section title , and section text . The metadata , denoted TM , is essential for de-contextualization . We obtain a table corpus containing over 400k high-quality tables with an average length of 320 words including metadata . For the text passage collection BP , we crawl English Wikipedia dump pages and filter out noisy pages . We follow HybridQA ( Chen et al. , 2020 ) and only keep a maximum of 12 sentences in the introduction section as the passage . We obtain a corpus containing over 5 million passages , with an average of 94 words . Notation We define each table as a matrix T , which consists of cells Ti , j with i specifying the row , and j specifying the column . Each cell Ti , j could be a number , date , phrase or even sentence due to its semi-structured nature . However , a single complete table with structured representation ( Herzig et al. , 2020 ) can easily exceed the 512-token limit , which poses great challenges to the downstream reader to process top-K retrieval . Hence we propose to decompose each table T into multiple rows Ri , which are combined with the headers , metadata , and global max/min information from the original table as a table segment . The table segment is used as the basic retrieval block in our paper . This decomposition procedure increases candidate BT from 400k to 5 million , making the retrieval problems even more fine-grained and more challenging . Our table segment representation is described in Appendix subsection B.1 . In summary , we build a candidate pool of 5 million table segments BT and a pool of 5 million passages BP . We denote as B as our full candidate pool , which our model needs to find the block b ( a table segment or a passage ) containing the answer span .
The paper provides a interesting direction in open question answering. In particular, it proposes an open QA problem over both tabular and textual data, and present a new large-scale dataset Open Table-and-Text Question Answering (OTT-QA) to evaluate performance on this task. Two techniques are introduced to address the challenge of retrieving and aggregating evidence for OTT-QA. Results show that the newly introduced techs bring improvements.
SP:f4a2e63fc2cd7787434a51f3a9511ed64b6a7e0d
FedBN: Federated Learning on Non-IID Features via Local Batch Normalization
1 INTRODUCTION . Federated learning ( FL ) , has gained popularity for various applications involving learning from distributed data . In FL , a cloud server ( the “ server ” ) can communicate with distributed data sources ( the “ clients ” ) , while the clients hold data separately . A major challenge in FL is the training data statistical heterogeneity among the clients ( Kairouz et al. , 2019 ; Li et al. , 2020b ) . It has been shown that standard federated methods such as FedAvg ( McMahan et al. , 2017 ) which are not designed particularly taking care of non-iid data significantly suffer from performance degradation or even diverge if deployed over non-iid samples ( Karimireddy et al. , 2019 ; Li et al. , 2018 ; 2020a ) . Recent studies have attempted to address the problem of FL on non-iid data . Most variants of FedAvg primarily tackle the issues of stability , client drift and heterogeneous label distribution over clients ( Li et al. , 2020b ; Karimireddy et al. , 2019 ; Zhao et al. , 2018 ) . Instead , we focus on the shift ∗Corresponding author . ro r E in the feature space , which has not yet been explored in the literature . Specifically , we consider that local data deviates in terms of the distribution in feature space , and identify this scenario as feature shift . This type of non-iid data is a critical problem in many real-world scenarios , typically in cases where the local devices are responisble for a heterogeneity in the feature distributions . For example in cancer diagnosis tasks , medical radiology images collected in different hospitals have uniformly distributed labels ( i.e. , the cancer types treated are quite similar across the hospitals ) . However , the image appearance can vary a lot due to different imaging machines and protocols used in hospitals , e.g. , different intensity and contrast . In this example , each hospital is a client and hospitals aim to collaboratively train a cancer detection model without sharing privacy-sensitive data . Tackling non-iid data with feature shift has been explored in classical centralized training in the context of domain adaptation . Here , an effective approach in practice is utilizing Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) : recent work has proposed BN as a tool to mitigate domain shifts in domain adaptation tasks with promising results achieved ( Li et al. , 2016 ; Liu et al. , 2020 ; Chang et al. , 2019 ) . Inspired by this , this paper proposes to apply BN for feature shift FL . To illustrate the idea , we present a toy example that illustrates how BN may help harmonizing local feature distributions . Observation of BN in a FL Toy Example : We consider a simple non-convex learning problem : we generate data x , y ∈ R with y = cos ( wtruex ) + , where x ∈ R is drawn iid from Gaussian distribution and is zero-mean Gaussian noise and consider models of the form fw ( x ) = cos ( wx ) with model parameter w ∈ R. Local data deviates in the variance of x . First , we illustrate that local batch normalization harmonizes local data distributions . We consider a simplified form of BN that normalizes the input by scaling it with γ , i.e. , the local empirical standard deviation , and a setting with 2 clients . As Fig . 1 shows , the local squared loss is very different between the two clients . Thus , averaging the model does not lead to a good model . However when applying local BN , the local training error surfaces become similar and averaging the models can be beneficial . To further illustrate the impact of BN , we plot the error surface for one client with respect to both model parameter w ∈ R and BN parameter γ ∈ R in Fig . 2 . The figure shows that for an optimal weight w∗1 , changing γ deteriorates the model quality . Similarly , for a given optimal BN parameter γ∗1 , changing w deteriorates the quality . In particular , the average model w = ( w ∗ 1 + w ∗ 2 ) /2 and average BN parameters γ = ( γ∗1 + γ ∗ 2 ) /2 has a high generalization error . At the same time , the average model w with local BN parameter γ∗1 performs very well . Motivated by the above insight and observation , this paper proposes a novel federated learning method , called FedBN , for addressing non-iid training data which keeps the client BN layers updated locally , without communicating , and aggregating them at the server . In practice , we can simply update the non-BN layers using FedAvg , without modifying any optimization or aggregation scheme . This approach has zero parameters to tune , requires minimal additional computational resources , and can be easily applied to arbitrary neural network architectures with BN layers in FL . Besides the benefit shown in the toy example , we also show the benefits in accelerating convergence by theoretically analyzing the convergence of FedBN in the over-parameterized regime . In addition , we have conducted extensive experiments on a benchmark and three real-world datasets . Compared to classical FedAvg , as well as the state-of-the-art for non-iid data ( FedProx ) , our novel method , FedBN , demonstrates significant practical improvements on the extensive experiments . 2 RELATED WORK . Techniques for Non-IID Challenges in Federated Learning : The widely known aggregation strategy in FL , FedAvg ( McMahan et al. , 2017 ) , often suffers when data is heterogeneous over local client . Empirical work addressing non-iid issues , mainly focus on label distribution skew , where a non-iid dataset is formed by partitioning a “ flat ” existing dataset based on the labels . FedProx ( Li et al. , 2020b ) , a recent framework tackled the heterogeneity by allowing partial information aggregation and adding a proximal term to FedAvg . Zhao et al . ( 2018 ) assumed a subset of the data is globally shared between all the clients , hence generalizes to the problem at hand . FedMA ( Wang et al. , 2020 ) proposed an aggregation strategy for non-iid data partition that shares global model in a layer-wise manner . However , so far there are only limited attempts considering non-iid induced from feature shift , which is common in medical data collecting from different equipment and natural image collected in various noisy environment . Very recently , FedRobust ( Reisizadeh et al. , 2020 ) assumes data follows an affine distribution shift and tackles this problem by learning the affine transformation . This hampers the generalization when we can not estimate the explicit affine transformation . Concurrently to our work , SiloBN Andreux et al . ( 2020 ) empirically shows that local clients keeping some untrainable BN parameters could improve robustness to data heterogeneity , but provides no theoretical analysis of the approach . FedBN instead keeps all BN parameters strictly local . Recently , an orthogonal approach to the non-iid problem has been proposed that focuses on improving the optimization mechanism ( Reddi et al. , 2020 ; Zhang et al. , 2020 ) . Batch Normalization in Deep Neural Networks : Batch Normalization ( Ioffe & Szegedy , 2015 ) is an indispensable component in many deep neural networks and has shown its success in neural network training . Relevant literature has uncovered a number of benefits given by batch normalization . Santurkar et al . ( 2018 ) showed that BN makes the optimization landscape significantly smoother . Luo et al . ( 2018 ) investigated an explicit regularization form of BN such that improving the robustness of optimization . Morcos et al . ( 2018 ) suggested that BN implicitly discourages single direction reliance , thus improving model generalizability . Li et al . ( 2018 ) took advantage of BN for tackling the domain adaptation problem . However , what a role BN is playing in the scope of federated learning , especially for non-iid training , still remains unexplored to date . 3 PRELIMINARY . Non-IID Data in Federated Learning : We introduce the concept of feature shift in federated learning as a novel category of client ’ s non-iid data distribution . So far , the categories of non-iid data considered according to Kairouz et al . ( 2019 ) ; Hsieh et al . ( 2019 ) can be described by the joint probability between features x and labels y on each client . We can rewrite Pi ( x , y ) as Pi ( y|x ) Pi ( x ) and Pi ( x|y ) Pi ( y ) . We define feature shift as the case that covers : 1 ) covariate shift : the marginal distributions Pi ( x ) varies across clients , even if Pi ( y|x ) is the same for all client ; and 2 ) concept shift : the conditional distribution Pi ( x|y ) varies across clients and P ( y ) is the same . Federated Averaging ( FedAvg ) : We establish our algorithm on FedAvg introduced by McMahan et al . ( 2017 ) which is the most popular existing and easiest to implement federated learning strategy , where clients collaboratively send updates of locally trained models to a global server . Each client runs a local copy of the global model on its local data . The global model ’ s weights are then updated with an average of local clients ’ updates and deployed back to the clients . This builds upon previous distributed learning work by not only supplying local models but also performing training locally on each device . Hence FedAvg potentially empowers clients ( especially clients with small dataset ) to collaboratively learn a shared prediction model while keeping all training data locally . Although FedAvg has shown successes in classical Federated Learning tasks , it suffers from slow convergence and low accuracy in most non-iid contents ( Li et al. , 2020b ; 2019 ) . 4 FEDERATED AVERAGING WITH LOCAL BATCH NORMALIZATION . 4.1 PROPOSED METHOD - FEDBN . We propose an efficient and effective learning strategy denoted FedBN . Similar to FedAvg , FedBN performs local updates and averages local models . However , FedBN assumes local models have BN layers and excludes their parameters from the averaging step . We present the full algorithm in Appendix C. This simple modification results in significant empirical improvements in non-iid settings . We provide an explanation for these improvements in a simplified scenario , in which we show that FedBN improves the convergence rate under feature shift . 4.2 PROBLEM SETUP . We assume N ∈ N clients to jointly train for T ∈ N epochs and to communicate after E ∈ N local iterations . Thus , the system has T/E communication rounds over the T epochs . For simplicity , we assume all clients to have M ∈ N training examples ( a difference in training examples can be account for by weighted averaging ( McMahan et al. , 2017 ) ) for a regression task , i.e. , each client i ∈ [ N ] ( [ N ] = { 1 , . . . , N } ) has training examples { ( xij , yij ) ∈ Rd×R : j ∈ [ M ] } . Furthermore , we assume a two-layer neural network with ReLU activations trained by gradient descent . Let vk ∈ Rd denote the parameters of the first layer , where k ∈ [ m ] and m is the width of the hidden layer . Let ‖ v ‖S , √ v > Sv denote the induced vector norm for a positive definite matrix S. We consider a non-iid setting in FL where local feature distributions differ—not label distribution , as considered , e.g. , in McMahan et al . ( 2017 ) ; Li et al . ( 2019 ) . To be more precise , we make the following assumption . Assumption 4.1 ( Data Distribution ) . For each client i ∈ [ N ] the inputs xij are centered ( Exi = 0 ) with covariance matrix Si = Exixi > , where Si is independent from the label y and may differ for each i ∈ [ N ] e.g. , Si are not all identity matrices , and for each index pair p 6= q , xp 6= κ ·xq for all κ ∈ R \ { 0 } . With Assumption 4.1 , the normalization of the first layer for client i is v > k x i ‖vk‖Si . FedBN with client- specified BN parameters trains a model f∗ : Rd → R parameterized by ( V , γ , c ) ∈ Rm×d × Rm×N × Rm , i.e. , f∗ ( x ; V , γ , c ) = 1√ m m∑ k=1 ck N∑ i=1 σ ( γk , i · v > k x ‖ vk ‖Si ) · 1 { x ∈ client i } , ( 1 ) where γ is the scaling parameter of BN and σ ( s ) = max { s , 0 } is the ReLU activation function , c is the top layer parameters of the network . Here , we omit learning the shift parameter of BN 1 . FedAvg instead trains a function f : Rd → R which is a special case of Eq . 1 with γk , i = γk for ∀i ∈ [ N ] . We take a random initialization of the parameters ( Salimans & Kingma , 2016 ) in our analysis : vk ( 0 ) ∼ N ( 0 , α2I ) , ck ∼ U { −1 , 1 } , and γk = γk , i = ‖vk ( 0 ) ‖2 /α , ( 2 ) where α2 controls the magnitude of vk at initialization . The initialization of the BN parameters γk and γk , i are independent of α . The parameters of the network f∗ ( x ; V , γ , c ) are obtained by minimizing the empirical risk with respect to the squared loss using gradient descent : L ( f∗ ) = 1 NM N∑ i=1 M∑ j=1 ( f∗ ( xij ) − yij ) 2 . ( 3 )
This work proposes an extremely simple approach to a well-know problem within Federated Learning: batch normalisation. Indeed, FL usually imply an averaging of different model parameters trained on different distributed devices. But what happen with the running statistics that some training methods have ? Such as batch norm and some optimisers ? Well, this work proposes to address the first issue by introducing a specific batch norm method named Local Batch Normalization (FedBN). Standard BN statistics cannot simply be aggregated due to strong variations potentially occurring when training data across the clients aren't IID distributed (i.e strong shift in the input representation). To alleviate this issue, the authors propose to exclude the BN parameters from the aggregation (i.e. each client has its own BN excluded from FL).
SP:3fc909ff04f888517dc1b7fdfad3ca019ead54b5
FedBN: Federated Learning on Non-IID Features via Local Batch Normalization
1 INTRODUCTION . Federated learning ( FL ) , has gained popularity for various applications involving learning from distributed data . In FL , a cloud server ( the “ server ” ) can communicate with distributed data sources ( the “ clients ” ) , while the clients hold data separately . A major challenge in FL is the training data statistical heterogeneity among the clients ( Kairouz et al. , 2019 ; Li et al. , 2020b ) . It has been shown that standard federated methods such as FedAvg ( McMahan et al. , 2017 ) which are not designed particularly taking care of non-iid data significantly suffer from performance degradation or even diverge if deployed over non-iid samples ( Karimireddy et al. , 2019 ; Li et al. , 2018 ; 2020a ) . Recent studies have attempted to address the problem of FL on non-iid data . Most variants of FedAvg primarily tackle the issues of stability , client drift and heterogeneous label distribution over clients ( Li et al. , 2020b ; Karimireddy et al. , 2019 ; Zhao et al. , 2018 ) . Instead , we focus on the shift ∗Corresponding author . ro r E in the feature space , which has not yet been explored in the literature . Specifically , we consider that local data deviates in terms of the distribution in feature space , and identify this scenario as feature shift . This type of non-iid data is a critical problem in many real-world scenarios , typically in cases where the local devices are responisble for a heterogeneity in the feature distributions . For example in cancer diagnosis tasks , medical radiology images collected in different hospitals have uniformly distributed labels ( i.e. , the cancer types treated are quite similar across the hospitals ) . However , the image appearance can vary a lot due to different imaging machines and protocols used in hospitals , e.g. , different intensity and contrast . In this example , each hospital is a client and hospitals aim to collaboratively train a cancer detection model without sharing privacy-sensitive data . Tackling non-iid data with feature shift has been explored in classical centralized training in the context of domain adaptation . Here , an effective approach in practice is utilizing Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) : recent work has proposed BN as a tool to mitigate domain shifts in domain adaptation tasks with promising results achieved ( Li et al. , 2016 ; Liu et al. , 2020 ; Chang et al. , 2019 ) . Inspired by this , this paper proposes to apply BN for feature shift FL . To illustrate the idea , we present a toy example that illustrates how BN may help harmonizing local feature distributions . Observation of BN in a FL Toy Example : We consider a simple non-convex learning problem : we generate data x , y ∈ R with y = cos ( wtruex ) + , where x ∈ R is drawn iid from Gaussian distribution and is zero-mean Gaussian noise and consider models of the form fw ( x ) = cos ( wx ) with model parameter w ∈ R. Local data deviates in the variance of x . First , we illustrate that local batch normalization harmonizes local data distributions . We consider a simplified form of BN that normalizes the input by scaling it with γ , i.e. , the local empirical standard deviation , and a setting with 2 clients . As Fig . 1 shows , the local squared loss is very different between the two clients . Thus , averaging the model does not lead to a good model . However when applying local BN , the local training error surfaces become similar and averaging the models can be beneficial . To further illustrate the impact of BN , we plot the error surface for one client with respect to both model parameter w ∈ R and BN parameter γ ∈ R in Fig . 2 . The figure shows that for an optimal weight w∗1 , changing γ deteriorates the model quality . Similarly , for a given optimal BN parameter γ∗1 , changing w deteriorates the quality . In particular , the average model w = ( w ∗ 1 + w ∗ 2 ) /2 and average BN parameters γ = ( γ∗1 + γ ∗ 2 ) /2 has a high generalization error . At the same time , the average model w with local BN parameter γ∗1 performs very well . Motivated by the above insight and observation , this paper proposes a novel federated learning method , called FedBN , for addressing non-iid training data which keeps the client BN layers updated locally , without communicating , and aggregating them at the server . In practice , we can simply update the non-BN layers using FedAvg , without modifying any optimization or aggregation scheme . This approach has zero parameters to tune , requires minimal additional computational resources , and can be easily applied to arbitrary neural network architectures with BN layers in FL . Besides the benefit shown in the toy example , we also show the benefits in accelerating convergence by theoretically analyzing the convergence of FedBN in the over-parameterized regime . In addition , we have conducted extensive experiments on a benchmark and three real-world datasets . Compared to classical FedAvg , as well as the state-of-the-art for non-iid data ( FedProx ) , our novel method , FedBN , demonstrates significant practical improvements on the extensive experiments . 2 RELATED WORK . Techniques for Non-IID Challenges in Federated Learning : The widely known aggregation strategy in FL , FedAvg ( McMahan et al. , 2017 ) , often suffers when data is heterogeneous over local client . Empirical work addressing non-iid issues , mainly focus on label distribution skew , where a non-iid dataset is formed by partitioning a “ flat ” existing dataset based on the labels . FedProx ( Li et al. , 2020b ) , a recent framework tackled the heterogeneity by allowing partial information aggregation and adding a proximal term to FedAvg . Zhao et al . ( 2018 ) assumed a subset of the data is globally shared between all the clients , hence generalizes to the problem at hand . FedMA ( Wang et al. , 2020 ) proposed an aggregation strategy for non-iid data partition that shares global model in a layer-wise manner . However , so far there are only limited attempts considering non-iid induced from feature shift , which is common in medical data collecting from different equipment and natural image collected in various noisy environment . Very recently , FedRobust ( Reisizadeh et al. , 2020 ) assumes data follows an affine distribution shift and tackles this problem by learning the affine transformation . This hampers the generalization when we can not estimate the explicit affine transformation . Concurrently to our work , SiloBN Andreux et al . ( 2020 ) empirically shows that local clients keeping some untrainable BN parameters could improve robustness to data heterogeneity , but provides no theoretical analysis of the approach . FedBN instead keeps all BN parameters strictly local . Recently , an orthogonal approach to the non-iid problem has been proposed that focuses on improving the optimization mechanism ( Reddi et al. , 2020 ; Zhang et al. , 2020 ) . Batch Normalization in Deep Neural Networks : Batch Normalization ( Ioffe & Szegedy , 2015 ) is an indispensable component in many deep neural networks and has shown its success in neural network training . Relevant literature has uncovered a number of benefits given by batch normalization . Santurkar et al . ( 2018 ) showed that BN makes the optimization landscape significantly smoother . Luo et al . ( 2018 ) investigated an explicit regularization form of BN such that improving the robustness of optimization . Morcos et al . ( 2018 ) suggested that BN implicitly discourages single direction reliance , thus improving model generalizability . Li et al . ( 2018 ) took advantage of BN for tackling the domain adaptation problem . However , what a role BN is playing in the scope of federated learning , especially for non-iid training , still remains unexplored to date . 3 PRELIMINARY . Non-IID Data in Federated Learning : We introduce the concept of feature shift in federated learning as a novel category of client ’ s non-iid data distribution . So far , the categories of non-iid data considered according to Kairouz et al . ( 2019 ) ; Hsieh et al . ( 2019 ) can be described by the joint probability between features x and labels y on each client . We can rewrite Pi ( x , y ) as Pi ( y|x ) Pi ( x ) and Pi ( x|y ) Pi ( y ) . We define feature shift as the case that covers : 1 ) covariate shift : the marginal distributions Pi ( x ) varies across clients , even if Pi ( y|x ) is the same for all client ; and 2 ) concept shift : the conditional distribution Pi ( x|y ) varies across clients and P ( y ) is the same . Federated Averaging ( FedAvg ) : We establish our algorithm on FedAvg introduced by McMahan et al . ( 2017 ) which is the most popular existing and easiest to implement federated learning strategy , where clients collaboratively send updates of locally trained models to a global server . Each client runs a local copy of the global model on its local data . The global model ’ s weights are then updated with an average of local clients ’ updates and deployed back to the clients . This builds upon previous distributed learning work by not only supplying local models but also performing training locally on each device . Hence FedAvg potentially empowers clients ( especially clients with small dataset ) to collaboratively learn a shared prediction model while keeping all training data locally . Although FedAvg has shown successes in classical Federated Learning tasks , it suffers from slow convergence and low accuracy in most non-iid contents ( Li et al. , 2020b ; 2019 ) . 4 FEDERATED AVERAGING WITH LOCAL BATCH NORMALIZATION . 4.1 PROPOSED METHOD - FEDBN . We propose an efficient and effective learning strategy denoted FedBN . Similar to FedAvg , FedBN performs local updates and averages local models . However , FedBN assumes local models have BN layers and excludes their parameters from the averaging step . We present the full algorithm in Appendix C. This simple modification results in significant empirical improvements in non-iid settings . We provide an explanation for these improvements in a simplified scenario , in which we show that FedBN improves the convergence rate under feature shift . 4.2 PROBLEM SETUP . We assume N ∈ N clients to jointly train for T ∈ N epochs and to communicate after E ∈ N local iterations . Thus , the system has T/E communication rounds over the T epochs . For simplicity , we assume all clients to have M ∈ N training examples ( a difference in training examples can be account for by weighted averaging ( McMahan et al. , 2017 ) ) for a regression task , i.e. , each client i ∈ [ N ] ( [ N ] = { 1 , . . . , N } ) has training examples { ( xij , yij ) ∈ Rd×R : j ∈ [ M ] } . Furthermore , we assume a two-layer neural network with ReLU activations trained by gradient descent . Let vk ∈ Rd denote the parameters of the first layer , where k ∈ [ m ] and m is the width of the hidden layer . Let ‖ v ‖S , √ v > Sv denote the induced vector norm for a positive definite matrix S. We consider a non-iid setting in FL where local feature distributions differ—not label distribution , as considered , e.g. , in McMahan et al . ( 2017 ) ; Li et al . ( 2019 ) . To be more precise , we make the following assumption . Assumption 4.1 ( Data Distribution ) . For each client i ∈ [ N ] the inputs xij are centered ( Exi = 0 ) with covariance matrix Si = Exixi > , where Si is independent from the label y and may differ for each i ∈ [ N ] e.g. , Si are not all identity matrices , and for each index pair p 6= q , xp 6= κ ·xq for all κ ∈ R \ { 0 } . With Assumption 4.1 , the normalization of the first layer for client i is v > k x i ‖vk‖Si . FedBN with client- specified BN parameters trains a model f∗ : Rd → R parameterized by ( V , γ , c ) ∈ Rm×d × Rm×N × Rm , i.e. , f∗ ( x ; V , γ , c ) = 1√ m m∑ k=1 ck N∑ i=1 σ ( γk , i · v > k x ‖ vk ‖Si ) · 1 { x ∈ client i } , ( 1 ) where γ is the scaling parameter of BN and σ ( s ) = max { s , 0 } is the ReLU activation function , c is the top layer parameters of the network . Here , we omit learning the shift parameter of BN 1 . FedAvg instead trains a function f : Rd → R which is a special case of Eq . 1 with γk , i = γk for ∀i ∈ [ N ] . We take a random initialization of the parameters ( Salimans & Kingma , 2016 ) in our analysis : vk ( 0 ) ∼ N ( 0 , α2I ) , ck ∼ U { −1 , 1 } , and γk = γk , i = ‖vk ( 0 ) ‖2 /α , ( 2 ) where α2 controls the magnitude of vk at initialization . The initialization of the BN parameters γk and γk , i are independent of α . The parameters of the network f∗ ( x ; V , γ , c ) are obtained by minimizing the empirical risk with respect to the squared loss using gradient descent : L ( f∗ ) = 1 NM N∑ i=1 M∑ j=1 ( f∗ ( xij ) − yij ) 2 . ( 3 )
This paper develops a modified version of FedAvg by local batch normalization that is tailored for federated learning with non-i.i.d. data. Different from most of existing work that consider the unbalanced labels, this paper uses unbalanced features to motivate the non-i.i.d. federated settings. Specifically, the unbalanced features are captured by the difference in local covariances.
SP:3fc909ff04f888517dc1b7fdfad3ca019ead54b5
Towards Robustness against Unsuspicious Adversarial Examples
Despite the remarkable success of deep neural networks , significant concerns have emerged about their robustness to adversarial perturbations to inputs . While most attacks aim to ensure that these are imperceptible , physical perturbation attacks typically aim for being unsuspicious , even if perceptible . However , there is no universal notion of what it means for adversarial examples to be unsuspicious . We propose an approach for modeling suspiciousness by leveraging cognitive salience . Specifically , we split an image into foreground ( salient region ) and background ( the rest ) , and allow significantly larger adversarial perturbations in the background , while ensuring that cognitive salience of background remains low . We describe how to compute the resulting non-salience-preserving dual-perturbation attacks on classifiers . We then experimentally demonstrate that our attacks indeed do not significantly change perceptual salience of the background , but are highly effective against classifiers robust to conventional attacks . Furthermore , we show that adversarial training with dual-perturbation attacks yields classifiers that are more robust to these than state-of-the-art robust learning approaches , and comparable in terms of robustness to conventional attacks . 1 INTRODUCTION . An observation by Szegedy et al . ( 2014 ) that state-of-the-art deep neural networks that exhibit exceptional performance in image classification are fragile in the face of small adversarial perturbations of inputs has received a great deal of attention . A series of approaches for designing adversarial examples followed ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ) , along with methods for defending against them ( Papernot et al. , 2016b ; Madry et al. , 2018 ) , and then new attacks that defeat prior defenses , and so on . Attacks can be roughly classified along three dimensions : 1 ) introducing small lp-norm-bounded perturbations , with the goal of these being imperceptible to humans ( Madry et al. , 2018 ) , 2 ) using non-lp-based constraints that capture perceptibility ( often called semantic perturbations ) ( Bhattad et al. , 2020 ) , and 3 ) modifying physical objects , such as stop signs ( Eykholt et al. , 2018 ) , in a way that does not arouse suspicion . One of the most common motivations for the study of adversarial examples is safety and security , such as the potential for attackers to compromise the safety of autonomous vehicles that rely on computer vision ( Eykholt et al. , 2018 ) . However , while imperceptibility is certainly sufficient for perturbations to be unsuspicious , it is far from necessary , as physical attacks demonstrate . On the other hand , while there are numerous formal definitions that capture whether noise is perceptible ( Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ) , what makes adversarial examples suspicious has been largely informal and subjective . We propose a simple formalization of an important aspect of what makes adversarial perturbations unsuspicious . Specifically , we make a distinction between image foreground and background , allowing significantly more noise in the background than the foreground . This idea stems from the notion of cognitive salience ( Borji et al. , 2015 ; Kmmerer et al. , 2017 ; He & Pugeault , 2018 ) , whereby an image can be partitioned into the two respective regions to reflect how much attention a human viewer pays to the different parts of the captured scene . In effect , we posit that perturbations in the foreground , when visible , will arouse significantly more suspicion ( by being cognitively more salient ) than perturbations made in the background . Our first contribution is a formal model of such dual-perturbation attacks , which is a generalization of the lp-norm-bounded attack models ( see , e.g. , Figure 1 ) , but explicitly aims to ensure that adversarial perturbation does not make the background highly salient . Second , we propose an algorithm for finding adversarial examples using this model , which is an adaptation of the PGD attack ( Madry et al. , 2018 ) . Third , we present a method for defending against dual-perturbation attacks based on the adversarial training framework ( Madry et al. , 2018 ) . Finally , we present an extensive experimental study that demonstrates that ( a ) the proposed attacks are significantly stronger than PGD , successfully defeating all state-of-the-art defenses , ( b ) proposed defenses using our attack model significantly outperform state-of-the-art alternatives , with relatively small performance degradation on nonadversarial instances , and ( c ) proposed defenses are comparable to , or better than alternatives even against traditional attacks , such as PGD . Related Work : Recent studies have shown that neural networks are vulnerable to adversarial examples . A variety of approaches have been proposed to produce adversarial examples ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Papernot et al. , 2016a ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ) . These approaches commonly generate adversarial perturbations within a bounded ` p norm so that the perturbations are imperceptible . A related thread has considered the problem of generating adversarial examples that are semantically imperceptible without being small in norm ( Brown et al. , 2018 ; Bhattad et al. , 2020 ) , for example , through small perturbations to the color scheme . However , none of these account for the perceptual distinction between the foreground and background of images . Numerous approaches have been proposed for defending neural networks against adversarial examples ( Papernot et al. , 2016b ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ; Cohen et al. , 2019 ; Madry et al. , 2018 ; Raghunathan et al. , 2018 ) . Predominantly , these use ` p-bounded perturbations as the threat model , and while some account for semantic perturbations ( e.g . Mohapatra et al . ( 2020 ) ) , none consider perceptually important difference in suspiciousness between foreground and background . Two recent approaches by Vaishnavi et al . ( 2019 ) and Brama & Grinshpoun ( 2020 ) have the strongest conceptual connection to our work . Both are defense-focused by either eliminating ( Vaishnavi et al. , 2019 ) or blurring ( Brama & Grinshpoun , 2020 ) the background region for robustness . However , they assume that we can reliably segment an image at prediction time , leaving the approach vulnerable to attacks on image segmentation ( Arnab et al. , 2018 ) . Xiao et al . ( 2020 ) propose to disentangle foreground and background signals on images but unsuspiciousness of their attacks is not ensured . 2 BACKGROUND . 2.1 ADVERSARIAL EXAMPLES AND ATTACKS . The problem of generating adversarial examples is commonly modeled as follows . We are given a a learned model hθ ( · ) parameterized by θ which maps an input x to a k-dimensional prediction , where k is the number of classes being predicted . The final predicted class yp is obtained by yp = arg maxi hθ ( x ) i , where hθ ( x ) i is the ith element of hθ ( x ) . Now , consider an input x along with a correct label y . The problem of identifying an adversarial example for x can be captured by the following optimization problem : max δ∈∆ ( ) L ( hθ ( x+ δ ) , y ) , ( 1 ) where L ( · ) is the adversary ’ s utility function ( for example , the loss function used to train the classifier hθ ) . ∆ ( ) is the feasible perturbation space which is commonly represented as a ` p ball : ∆ ( ) = { δ : ‖δ‖p ≤ } . A number of approaches have been proposed to solve the optimization problem shown in Eq . ( 1 ) , among which two are viewed as state of the art : CW attack developed by Carlini & Wagner ( 2017 ) , and Projected Gradient Descent ( PGD ) attack proposed in Madry et al . ( 2018 ) . In this work , we focus on the PGD attack with ` ∞ and ` 2 as the distance metrics . 2.2 ROBUST LEARNING . An important defense approach that has proved empirically effective even against adaptive attacks is adversarial training ( Szegedy et al. , 2014 ; Cohen et al. , 2019 ; Goodfellow et al. , 2015 ; Madry et al. , 2018 ) . The basic idea of adversarial training is to produce adversarial examples and incorporate these into the training process . Formally , adversarial training aims to solve the following robust learning problem : min θ 1 |D| ∑ x , y∈D max ‖δ‖p≤ L ( hθ ( x+ δ ) , y ) , ( 2 ) where D is the training dataset . In practice , this problem is commonly solved by iteratively using the following two steps ( Madry et al. , 2018 ) : 1 ) use a PGD ( or other ) attack to produce adversarial examples of the training data ; 2 ) use any optimizer to minimize the loss of those adversarial examples . It has been shown that adversarial training can significantly boost the adversarial robustness of a classifier against ` p attacks , and it can be scaled to neural networks with complex architectures . 3 DUAL-PERTURBATION ATTACKS . 3.1 MOTIVATION . Our threat model is motivated by the feature integration theory ( Treisman & Gelade , 1980 ) in cognitive science : regions that have features that are different from their surroundings are more likely to catch a viewer ’ s gaze . Such regions are called salient regions , or foreground , while the others are called background . Accordingly , for a given image , the semantics of the object of interest is more likely to be preserved in the foreground , as it catches more visual attention of a viewer compared to the background . If the foreground of an image is corrupted , then the semantics of the object of interest is broken . In contrast , the same extent of corruption in the background nevertheless preserves the overall semantic meaning of the scene captured ( see , e.g. , Figure 2 ) . Indeed , detection of salient regions , as well as the segmentation of foreground and background , have been extensively studied in computer vision ( Borji et al. , 2015 ) . These approaches either predict human fixations , which are sparse bubble-like salient regions sampled from a distribution ( Kmmerer et al. , 2017 ) , or salient objects that contain smooth connected areas in an image ( He & Pugeault , 2018 ) . Despite this important cognitive distinction between foreground and background , essentially all of the attacks on deep neural networks for image classification make no such distinction , even though a number of other semantic factors have been considered ( Bhattad et al. , 2020 ; Mohapatra et al. , 2020 ) . Rather , much of the focus has been on adversarial perturbations that are not noticeable to a human , but which are applied equally to the entire image . However , in security applications , the important issue is not merely that an attack can not be noticed , but that whatever observed is not suspicious . This is , indeed , the frame of reference for many high-profile physical attacks on image classification , which are clearly visible , but not suspicious because they hide in the “ human psyche ” , that is , are easily ignored ( Sharif et al. , 2016 ; Eykholt et al. , 2018 ) . The main goal of the threat model we introduce next is therefore to capture more precisely the notion that an adversarial example is not suspicious by leveraging the cognitive distinction between foreground and background of an image .
I like the idea to check whether it might be possible that noise can be injected selectively in areas where it is likely to make the adversarial example less suspicious and thus it might be possible to inject more noise in those directions. But the challenge is that this might increase the saliency of those areas. The authors propose to use recent work from DeepGazeII to detect saliencies of various pixels.
SP:40e6f3c9b45c37a5580314fde5407e7ceab19fa9
Towards Robustness against Unsuspicious Adversarial Examples
Despite the remarkable success of deep neural networks , significant concerns have emerged about their robustness to adversarial perturbations to inputs . While most attacks aim to ensure that these are imperceptible , physical perturbation attacks typically aim for being unsuspicious , even if perceptible . However , there is no universal notion of what it means for adversarial examples to be unsuspicious . We propose an approach for modeling suspiciousness by leveraging cognitive salience . Specifically , we split an image into foreground ( salient region ) and background ( the rest ) , and allow significantly larger adversarial perturbations in the background , while ensuring that cognitive salience of background remains low . We describe how to compute the resulting non-salience-preserving dual-perturbation attacks on classifiers . We then experimentally demonstrate that our attacks indeed do not significantly change perceptual salience of the background , but are highly effective against classifiers robust to conventional attacks . Furthermore , we show that adversarial training with dual-perturbation attacks yields classifiers that are more robust to these than state-of-the-art robust learning approaches , and comparable in terms of robustness to conventional attacks . 1 INTRODUCTION . An observation by Szegedy et al . ( 2014 ) that state-of-the-art deep neural networks that exhibit exceptional performance in image classification are fragile in the face of small adversarial perturbations of inputs has received a great deal of attention . A series of approaches for designing adversarial examples followed ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ) , along with methods for defending against them ( Papernot et al. , 2016b ; Madry et al. , 2018 ) , and then new attacks that defeat prior defenses , and so on . Attacks can be roughly classified along three dimensions : 1 ) introducing small lp-norm-bounded perturbations , with the goal of these being imperceptible to humans ( Madry et al. , 2018 ) , 2 ) using non-lp-based constraints that capture perceptibility ( often called semantic perturbations ) ( Bhattad et al. , 2020 ) , and 3 ) modifying physical objects , such as stop signs ( Eykholt et al. , 2018 ) , in a way that does not arouse suspicion . One of the most common motivations for the study of adversarial examples is safety and security , such as the potential for attackers to compromise the safety of autonomous vehicles that rely on computer vision ( Eykholt et al. , 2018 ) . However , while imperceptibility is certainly sufficient for perturbations to be unsuspicious , it is far from necessary , as physical attacks demonstrate . On the other hand , while there are numerous formal definitions that capture whether noise is perceptible ( Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ) , what makes adversarial examples suspicious has been largely informal and subjective . We propose a simple formalization of an important aspect of what makes adversarial perturbations unsuspicious . Specifically , we make a distinction between image foreground and background , allowing significantly more noise in the background than the foreground . This idea stems from the notion of cognitive salience ( Borji et al. , 2015 ; Kmmerer et al. , 2017 ; He & Pugeault , 2018 ) , whereby an image can be partitioned into the two respective regions to reflect how much attention a human viewer pays to the different parts of the captured scene . In effect , we posit that perturbations in the foreground , when visible , will arouse significantly more suspicion ( by being cognitively more salient ) than perturbations made in the background . Our first contribution is a formal model of such dual-perturbation attacks , which is a generalization of the lp-norm-bounded attack models ( see , e.g. , Figure 1 ) , but explicitly aims to ensure that adversarial perturbation does not make the background highly salient . Second , we propose an algorithm for finding adversarial examples using this model , which is an adaptation of the PGD attack ( Madry et al. , 2018 ) . Third , we present a method for defending against dual-perturbation attacks based on the adversarial training framework ( Madry et al. , 2018 ) . Finally , we present an extensive experimental study that demonstrates that ( a ) the proposed attacks are significantly stronger than PGD , successfully defeating all state-of-the-art defenses , ( b ) proposed defenses using our attack model significantly outperform state-of-the-art alternatives , with relatively small performance degradation on nonadversarial instances , and ( c ) proposed defenses are comparable to , or better than alternatives even against traditional attacks , such as PGD . Related Work : Recent studies have shown that neural networks are vulnerable to adversarial examples . A variety of approaches have been proposed to produce adversarial examples ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Papernot et al. , 2016a ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ) . These approaches commonly generate adversarial perturbations within a bounded ` p norm so that the perturbations are imperceptible . A related thread has considered the problem of generating adversarial examples that are semantically imperceptible without being small in norm ( Brown et al. , 2018 ; Bhattad et al. , 2020 ) , for example , through small perturbations to the color scheme . However , none of these account for the perceptual distinction between the foreground and background of images . Numerous approaches have been proposed for defending neural networks against adversarial examples ( Papernot et al. , 2016b ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ; Cohen et al. , 2019 ; Madry et al. , 2018 ; Raghunathan et al. , 2018 ) . Predominantly , these use ` p-bounded perturbations as the threat model , and while some account for semantic perturbations ( e.g . Mohapatra et al . ( 2020 ) ) , none consider perceptually important difference in suspiciousness between foreground and background . Two recent approaches by Vaishnavi et al . ( 2019 ) and Brama & Grinshpoun ( 2020 ) have the strongest conceptual connection to our work . Both are defense-focused by either eliminating ( Vaishnavi et al. , 2019 ) or blurring ( Brama & Grinshpoun , 2020 ) the background region for robustness . However , they assume that we can reliably segment an image at prediction time , leaving the approach vulnerable to attacks on image segmentation ( Arnab et al. , 2018 ) . Xiao et al . ( 2020 ) propose to disentangle foreground and background signals on images but unsuspiciousness of their attacks is not ensured . 2 BACKGROUND . 2.1 ADVERSARIAL EXAMPLES AND ATTACKS . The problem of generating adversarial examples is commonly modeled as follows . We are given a a learned model hθ ( · ) parameterized by θ which maps an input x to a k-dimensional prediction , where k is the number of classes being predicted . The final predicted class yp is obtained by yp = arg maxi hθ ( x ) i , where hθ ( x ) i is the ith element of hθ ( x ) . Now , consider an input x along with a correct label y . The problem of identifying an adversarial example for x can be captured by the following optimization problem : max δ∈∆ ( ) L ( hθ ( x+ δ ) , y ) , ( 1 ) where L ( · ) is the adversary ’ s utility function ( for example , the loss function used to train the classifier hθ ) . ∆ ( ) is the feasible perturbation space which is commonly represented as a ` p ball : ∆ ( ) = { δ : ‖δ‖p ≤ } . A number of approaches have been proposed to solve the optimization problem shown in Eq . ( 1 ) , among which two are viewed as state of the art : CW attack developed by Carlini & Wagner ( 2017 ) , and Projected Gradient Descent ( PGD ) attack proposed in Madry et al . ( 2018 ) . In this work , we focus on the PGD attack with ` ∞ and ` 2 as the distance metrics . 2.2 ROBUST LEARNING . An important defense approach that has proved empirically effective even against adaptive attacks is adversarial training ( Szegedy et al. , 2014 ; Cohen et al. , 2019 ; Goodfellow et al. , 2015 ; Madry et al. , 2018 ) . The basic idea of adversarial training is to produce adversarial examples and incorporate these into the training process . Formally , adversarial training aims to solve the following robust learning problem : min θ 1 |D| ∑ x , y∈D max ‖δ‖p≤ L ( hθ ( x+ δ ) , y ) , ( 2 ) where D is the training dataset . In practice , this problem is commonly solved by iteratively using the following two steps ( Madry et al. , 2018 ) : 1 ) use a PGD ( or other ) attack to produce adversarial examples of the training data ; 2 ) use any optimizer to minimize the loss of those adversarial examples . It has been shown that adversarial training can significantly boost the adversarial robustness of a classifier against ` p attacks , and it can be scaled to neural networks with complex architectures . 3 DUAL-PERTURBATION ATTACKS . 3.1 MOTIVATION . Our threat model is motivated by the feature integration theory ( Treisman & Gelade , 1980 ) in cognitive science : regions that have features that are different from their surroundings are more likely to catch a viewer ’ s gaze . Such regions are called salient regions , or foreground , while the others are called background . Accordingly , for a given image , the semantics of the object of interest is more likely to be preserved in the foreground , as it catches more visual attention of a viewer compared to the background . If the foreground of an image is corrupted , then the semantics of the object of interest is broken . In contrast , the same extent of corruption in the background nevertheless preserves the overall semantic meaning of the scene captured ( see , e.g. , Figure 2 ) . Indeed , detection of salient regions , as well as the segmentation of foreground and background , have been extensively studied in computer vision ( Borji et al. , 2015 ) . These approaches either predict human fixations , which are sparse bubble-like salient regions sampled from a distribution ( Kmmerer et al. , 2017 ) , or salient objects that contain smooth connected areas in an image ( He & Pugeault , 2018 ) . Despite this important cognitive distinction between foreground and background , essentially all of the attacks on deep neural networks for image classification make no such distinction , even though a number of other semantic factors have been considered ( Bhattad et al. , 2020 ; Mohapatra et al. , 2020 ) . Rather , much of the focus has been on adversarial perturbations that are not noticeable to a human , but which are applied equally to the entire image . However , in security applications , the important issue is not merely that an attack can not be noticed , but that whatever observed is not suspicious . This is , indeed , the frame of reference for many high-profile physical attacks on image classification , which are clearly visible , but not suspicious because they hide in the “ human psyche ” , that is , are easily ignored ( Sharif et al. , 2016 ; Eykholt et al. , 2018 ) . The main goal of the threat model we introduce next is therefore to capture more precisely the notion that an adversarial example is not suspicious by leveraging the cognitive distinction between foreground and background of an image .
The paper studies threat models for images which take into account the foreground and background within the image. Specifically, they use DeepGaze II to identify pixels as either foreground or background, and use an Lp threat model with a larger radius in the background and a smaller radius in the foreground. The results are largely what one would expect: defenses for different threat models perform poorly against this attack, in comparison to adversarial training on adversarial examples generated by the attack. These attacks have good foreground score, though this is according to the same DeepGaze II model used to generate the examples to begin with.
SP:40e6f3c9b45c37a5580314fde5407e7ceab19fa9
Probabilistic Numeric Convolutional Neural Networks
1 INTRODUCTION . Standard convolutional neural networks are defined on a regular input grid . For continuous signals like time series and images , these elements correspond to regular samples of an underlying function f defined on a continuous domain . In this case , the standard convolutional layer of a neural network is a numerical approximation of a continuous convolution operator A. Coherently defined networks on continuous functions should only depend on the input function f , and not on spurious shortcut features ( Geirhos et al. , 2020 ) such as the sampling locations or sampling density , which enable overfitting and reduce robustness to changes in the sampling procedure . Each application of A in a standard neural network incurs some discretization error which is determined by the sampling resolution . In some sense , this error is unavoidable because the features f ( ` ) at the layers ` depend on the values of the input function f at regions that have not been observed . For input signals which are sampled at a low resolution , or even sampled irregularly such as with the sporadic measurements of patient vitals data in ICUs or dispersed sensors for measuring ocean currents , this discretization error can not be neglected . Simply filling in the missing data with zeros or imputing the values is not sufficient since many different imputations are possible , each of which can affect the outcomes of the network . Probabilistic numerics is an emergent field that studies discretization errors in numerical algorithms using probability theory ( Cockayne et al. , 2019 ) . Here we build upon these ideas to quantify the dependence of the network on the regions in the input which are unknown , and integrate this uncertainty into the computation of the network . To do so , we replace the discretely evaluated feature maps { f ( ` ) ( xi ) } Ni=1 with Gaussian processes : distributions over the continuous function f ( ` ) that track the most likely values as well as the uncertainty . On this Gaussian process feature representation , we need not resort to discretizing the convolution operator A as in a standard convnet , but instead we can apply the continuous convolution operator directly . If a given feature is a Gaussian process , then applying linear operators yields a new Gaussian process with transformed mean and covariance functions . The dependence of Af on regions of f which are not known translates into ∗Work done during internship at Qualcomm AI Research †Qualcomm AI Research is an initiative of Qualcomm Technologies , Inc. the uncertainty represented in the transformed covariance function , the analogue of the discretization error in a CNN , which is now tracked explicitly . We call the resulting model Probabilistic Numeric Convolutional Neural Network ( PNCNN ) . 2 RELATED WORK . Over the years there have been many successful convolutional approaches for ungridded data such as GCN ( Kipf and Welling , 2016 ) , PointNet ( Qi et al. , 2017 ) , Transformer ( Vaswani et al. , 2017 ) , Deep Sets ( Zaheer et al. , 2017 ) , SplineCNN ( Fey et al. , 2018 ) , PCNN ( Atzmon et al. , 2018 ) , PointConv ( Wu et al. , 2019 ) , KPConv ( Thomas et al. , 2019 ) and many others ( de Haan et al. , 2020 ; Finzi et al. , 2020 ; Schütt et al. , 2017 ; Wang et al. , 2018 ) . However , the target domains of sets , graphs , and point clouds are intrinsically discrete and for continuous data each of these methods fail to take full advantage of the assumption that the underlying signal is continuous . Furthermore , none of these approaches reason about the underlying signal probabilistically . In a separate line of work there are several approaches tackling irregularly spaced time series with RNNs ( Che et al. , 2018 ) , Neural ODEs ( Rubanova et al. , 2019 ) , imputation to a regular grid ( Li and Marlin , 2016 ; Futoma et al. , 2017 ; Shukla and Marlin , 2019 ; Fortuin et al. , 2020 ) , set functions ( Horn et al. , 2019 ) and attention ( Shukla and Marlin , 2020 ) . Additionally there are several works exploring reconstruction of images from incomplete observations for downstream classification ( Huijben et al. , 2019 ; Li and Marlin , 2020 ) . Most similar to our method are the end-to-end Gaussian process adapter ( Li and Marlin , 2016 ) and the multi-task Gaussian process RNN classifier ( Futoma et al. , 2017 ) . In these two works , a Gaussian process is fit to an irregularly spaced time series and sampled imputations from this process are fed into a separate RNN classifier . Unlike our approach where the classifier operates directly on a continuous and probabilistic signal , in these works the classifier operates on a deterministic signal on a regular grid and can not reason probabilistically about discretization errors . Finally , while superficially similar to Deep GPs ( Damianou and Lawrence , 2013 ) or Deep Differential Gaussian Process Flows ( Hegde et al. , 2018 ) , our PNCNNs tackle fundamentally different kinds of problems like image classification1 , and our GPs represent epistemic uncertainty over the values of the feature maps rather than the parameters of the network . 3 BACKGROUND . Probabilistic Numerics : We draw inspiration for our approach from the community of probabilistic numerics where the error in numerical algorithms are modeled probabilistically , and typically with a Gaussian process . In this framework , only a finite number of input function calls can be made , and therefore the numerical algorithm can be viewed as an autonomous agent which has epistemic uncertainty over the values of the input . A well known example is Bayesian Monte Carlo where a Gaussian process is used to model the error in the numerical estimation of an integral and optimally select a rule for its computation ( Minka , 2000 ; Rasmussen and Ghahramani , 2003 ) . Probabilistic numerics has been applied widely to numerical problems such as the inversion of a matrix ( Hennig , 2015 ) , the solution of an ODE ( Schober et al. , 2019 ) , a meshless solution to boundary value PDEs ( Cockayne et al. , 2016 ) , and other numerical problems ( Cockayne et al. , 2019 ) . To our knowledge , we are the first to construct a probabilistic numeric method for convolutional neural networks . Gaussian Processes : We are interested in operating on the continuous function f ( x ) underlying the input , but in practice we have access only to a collection of the values of that function sampled on a finite number of points { xi } Ni=1 . Classical interpolation theory reconstructs f deterministically by assuming a certain structure of the signal in the frequency domain . Gaussian processes give a way of modeling our beliefs about values that have not been observed ( Rasmussen et al. , 2006 ) , as reviewed in appendix A . These beliefs are encoded into a prior covariance k of the GP f ∼ GP ( 0 , k ) and updated upon seeing data with Bayesian inference . Explicitly , given a set of sampling locations x = { xi } Ni=1 and noisy observations y = { yi } Ni=1 sampled yi ∼ N ( f ( xi ) , σ2i ) , using Bayes rule 1While GPs can be applied directly to image classification , they are not well suited to this task even with convolutional structure baked in , as shown in Kumar et al . ( 2018 ) . Input Data one can compute the posterior distribution f |y , x ∼ GP ( µp , kp ) , which captures our epistemic uncertainty about the values between observations . The posterior mean and covariance are given by µp ( x ) = k ( x ) > [ K + S ] −1y , kp ( x , x ′ ) = k ( x , x′ ) − k ( x ) > [ K + S ] −1k ( x′ ) , ( 1 ) where Kij = k ( xi , xj ) , k ( x ) i = k ( x , xi ) and S = diag ( σ2i ) . Below we shall choose the RBF kernel2 as prior covariance , due to its convenient analytical properties : kRBF ( x , x′ ) = aN ( x ; x′ , l2I ) = a ( 2πl2 ) − d2 exp ( − 12l2 ||x− x′||2 ) . In typical applications of GPs to machine learning tasks such as regression , the function f that we want to predict is already the regression model . In contrast , here we use GPs as a way of representing our beliefs and epistemic uncertainty about the values of both the input function and the intermediate feature maps of a neural network . 4 PROBABILISTIC NUMERIC CONVOLUTIONAL NEURAL NETWORKS . 4.1 OVERVIEW . Given an input signal f : X → Rc , we define a network with layers that act directly on this continuous input signal . We define our neural network recursively from the input f ( 0 ) = f , as a series of L continuous convolutions A ( ` ) with pointwise ReLU nonlinearities and weight matrices which mix only channels ( known as 1× 1 convolutions ) M ∈ Rc×c : f ( ` +1 ) = M ( ` ) ReLU [ A ( ` ) f ( ` ) ] , ( 2 ) and a final global average pooling layer P which acts channel-wise as natural generalization of the discrete case : P ( f ( L ) ) α = ∫ f ( L ) α ( x ) dx for each α = 1 , 2 , . . . , c. Denoting the space of functions on X with c channels byHc , the convolution operatorsA ( ` ) are linear operators fromHc ` toHc ` +1 . Like in ordinary convolutional neural networks , the layers build up increasingly more expressive spatial features and depend on the parameters in A ( ` ) and M ( ` ) . Unlike ordinary convolutional networks , these layers are well defined operations on the underlying continuous signal . While it is clear that such a network can be defined abstractly , the exact values of the function f ( L ) can not be computed as the operators depend on unknown values of the input . However , by adapting a probabilistic description we can formulate our ignorance of f ( 0 ) with a Gaussian process and see how the uncertainties propagate through the layers of the network , yielding a probabilistic output . Before delving into details , we outline the key components of equation 2 that make this possible . Continuous Convolutional Layers : Crucially , we consider continuous convolution operators A that can be applied to input Gaussian process f ∼ GP ( µp , kp ) in closed form . The output is another Gaussian process with a transformed mean and covariance Af ∼ GP ( Aµp , AkpA′ ) where A′ acts 2For convenience , we include the additional scale factor ( 2πl2 ) d/2 relative to the usual definition . to the left on the primed argument of kp ( x , x′ ) .3 In section 4.2 we show how to parametrize these continuous convolutions in terms of the flow of a PDE and show how they can be applied to the RBF kernel exactly in closed form . Probabilistic ReLUs : Applying the ReLU nonlinearity to the GP yields a new non Gaussian stochastic process h ( ` ) = ReLU [ A ( ` ) f ( ` ) ] , and we show in section 4.5 that the mean and covariance of this process has a closed form solution which can be computed . Channel Mixing and Central Limit Theorem : The activations h ( ` ) are not Gaussian ; however , for a large number of weakly dependent channels we argue that f ( ` +1 ) = M ( ` ) h ( ` ) is approximately distributed as a Gaussian Process in section 4.5 . Measurement and Projection to RBF Gaussian Process : While f ( ` +1 ) is approximately a Gaussian process , the mean and covariance functions have a complicated form . Instead of using these functions directly , we take measurements of the mean and variance of this process and feed them in as noisy observations to a fresh RBF kernel GP , allowing us to repeat the process and build up multiple layers without increasing complexity . The Gaussian process feature maps in the final layer f ( L ) are aggregated spatially by the integral pooling P which can also be applied in closed form ( see appendix D ) , to yield a Gaussian output . Assembling these components , we implement the end to end trainable Probabilistic Numeric Convolutional Neural Network which integrates a probabilistic description of missing data and discretization error inherent to continuous signals . The layers of the network are shown in figure 1 .
This work presents an uncertainty aware continuous convolutional layers for learning from continuous signals like time series/images. This work is most useful in the setting of irregularly sampled data. Gaussian processes (GP) are used to represent the irregularly sampled input. The proposed continuous convolutional layers can be directly applied to input Gaussian Process in a closed form, which subsequently outputs another GP with transformed mean and variance. Finally, the continuous convolutional layers are parameterized in terms of the flow of a PDE. The use of GP for feature representation and the ability of continuous convolutional layers to take GP as input provides the model with the ability to propagate uncertainty.
SP:70ffdb2504b0c72a7be46dec6a519b9717fb7d41
Probabilistic Numeric Convolutional Neural Networks
1 INTRODUCTION . Standard convolutional neural networks are defined on a regular input grid . For continuous signals like time series and images , these elements correspond to regular samples of an underlying function f defined on a continuous domain . In this case , the standard convolutional layer of a neural network is a numerical approximation of a continuous convolution operator A. Coherently defined networks on continuous functions should only depend on the input function f , and not on spurious shortcut features ( Geirhos et al. , 2020 ) such as the sampling locations or sampling density , which enable overfitting and reduce robustness to changes in the sampling procedure . Each application of A in a standard neural network incurs some discretization error which is determined by the sampling resolution . In some sense , this error is unavoidable because the features f ( ` ) at the layers ` depend on the values of the input function f at regions that have not been observed . For input signals which are sampled at a low resolution , or even sampled irregularly such as with the sporadic measurements of patient vitals data in ICUs or dispersed sensors for measuring ocean currents , this discretization error can not be neglected . Simply filling in the missing data with zeros or imputing the values is not sufficient since many different imputations are possible , each of which can affect the outcomes of the network . Probabilistic numerics is an emergent field that studies discretization errors in numerical algorithms using probability theory ( Cockayne et al. , 2019 ) . Here we build upon these ideas to quantify the dependence of the network on the regions in the input which are unknown , and integrate this uncertainty into the computation of the network . To do so , we replace the discretely evaluated feature maps { f ( ` ) ( xi ) } Ni=1 with Gaussian processes : distributions over the continuous function f ( ` ) that track the most likely values as well as the uncertainty . On this Gaussian process feature representation , we need not resort to discretizing the convolution operator A as in a standard convnet , but instead we can apply the continuous convolution operator directly . If a given feature is a Gaussian process , then applying linear operators yields a new Gaussian process with transformed mean and covariance functions . The dependence of Af on regions of f which are not known translates into ∗Work done during internship at Qualcomm AI Research †Qualcomm AI Research is an initiative of Qualcomm Technologies , Inc. the uncertainty represented in the transformed covariance function , the analogue of the discretization error in a CNN , which is now tracked explicitly . We call the resulting model Probabilistic Numeric Convolutional Neural Network ( PNCNN ) . 2 RELATED WORK . Over the years there have been many successful convolutional approaches for ungridded data such as GCN ( Kipf and Welling , 2016 ) , PointNet ( Qi et al. , 2017 ) , Transformer ( Vaswani et al. , 2017 ) , Deep Sets ( Zaheer et al. , 2017 ) , SplineCNN ( Fey et al. , 2018 ) , PCNN ( Atzmon et al. , 2018 ) , PointConv ( Wu et al. , 2019 ) , KPConv ( Thomas et al. , 2019 ) and many others ( de Haan et al. , 2020 ; Finzi et al. , 2020 ; Schütt et al. , 2017 ; Wang et al. , 2018 ) . However , the target domains of sets , graphs , and point clouds are intrinsically discrete and for continuous data each of these methods fail to take full advantage of the assumption that the underlying signal is continuous . Furthermore , none of these approaches reason about the underlying signal probabilistically . In a separate line of work there are several approaches tackling irregularly spaced time series with RNNs ( Che et al. , 2018 ) , Neural ODEs ( Rubanova et al. , 2019 ) , imputation to a regular grid ( Li and Marlin , 2016 ; Futoma et al. , 2017 ; Shukla and Marlin , 2019 ; Fortuin et al. , 2020 ) , set functions ( Horn et al. , 2019 ) and attention ( Shukla and Marlin , 2020 ) . Additionally there are several works exploring reconstruction of images from incomplete observations for downstream classification ( Huijben et al. , 2019 ; Li and Marlin , 2020 ) . Most similar to our method are the end-to-end Gaussian process adapter ( Li and Marlin , 2016 ) and the multi-task Gaussian process RNN classifier ( Futoma et al. , 2017 ) . In these two works , a Gaussian process is fit to an irregularly spaced time series and sampled imputations from this process are fed into a separate RNN classifier . Unlike our approach where the classifier operates directly on a continuous and probabilistic signal , in these works the classifier operates on a deterministic signal on a regular grid and can not reason probabilistically about discretization errors . Finally , while superficially similar to Deep GPs ( Damianou and Lawrence , 2013 ) or Deep Differential Gaussian Process Flows ( Hegde et al. , 2018 ) , our PNCNNs tackle fundamentally different kinds of problems like image classification1 , and our GPs represent epistemic uncertainty over the values of the feature maps rather than the parameters of the network . 3 BACKGROUND . Probabilistic Numerics : We draw inspiration for our approach from the community of probabilistic numerics where the error in numerical algorithms are modeled probabilistically , and typically with a Gaussian process . In this framework , only a finite number of input function calls can be made , and therefore the numerical algorithm can be viewed as an autonomous agent which has epistemic uncertainty over the values of the input . A well known example is Bayesian Monte Carlo where a Gaussian process is used to model the error in the numerical estimation of an integral and optimally select a rule for its computation ( Minka , 2000 ; Rasmussen and Ghahramani , 2003 ) . Probabilistic numerics has been applied widely to numerical problems such as the inversion of a matrix ( Hennig , 2015 ) , the solution of an ODE ( Schober et al. , 2019 ) , a meshless solution to boundary value PDEs ( Cockayne et al. , 2016 ) , and other numerical problems ( Cockayne et al. , 2019 ) . To our knowledge , we are the first to construct a probabilistic numeric method for convolutional neural networks . Gaussian Processes : We are interested in operating on the continuous function f ( x ) underlying the input , but in practice we have access only to a collection of the values of that function sampled on a finite number of points { xi } Ni=1 . Classical interpolation theory reconstructs f deterministically by assuming a certain structure of the signal in the frequency domain . Gaussian processes give a way of modeling our beliefs about values that have not been observed ( Rasmussen et al. , 2006 ) , as reviewed in appendix A . These beliefs are encoded into a prior covariance k of the GP f ∼ GP ( 0 , k ) and updated upon seeing data with Bayesian inference . Explicitly , given a set of sampling locations x = { xi } Ni=1 and noisy observations y = { yi } Ni=1 sampled yi ∼ N ( f ( xi ) , σ2i ) , using Bayes rule 1While GPs can be applied directly to image classification , they are not well suited to this task even with convolutional structure baked in , as shown in Kumar et al . ( 2018 ) . Input Data one can compute the posterior distribution f |y , x ∼ GP ( µp , kp ) , which captures our epistemic uncertainty about the values between observations . The posterior mean and covariance are given by µp ( x ) = k ( x ) > [ K + S ] −1y , kp ( x , x ′ ) = k ( x , x′ ) − k ( x ) > [ K + S ] −1k ( x′ ) , ( 1 ) where Kij = k ( xi , xj ) , k ( x ) i = k ( x , xi ) and S = diag ( σ2i ) . Below we shall choose the RBF kernel2 as prior covariance , due to its convenient analytical properties : kRBF ( x , x′ ) = aN ( x ; x′ , l2I ) = a ( 2πl2 ) − d2 exp ( − 12l2 ||x− x′||2 ) . In typical applications of GPs to machine learning tasks such as regression , the function f that we want to predict is already the regression model . In contrast , here we use GPs as a way of representing our beliefs and epistemic uncertainty about the values of both the input function and the intermediate feature maps of a neural network . 4 PROBABILISTIC NUMERIC CONVOLUTIONAL NEURAL NETWORKS . 4.1 OVERVIEW . Given an input signal f : X → Rc , we define a network with layers that act directly on this continuous input signal . We define our neural network recursively from the input f ( 0 ) = f , as a series of L continuous convolutions A ( ` ) with pointwise ReLU nonlinearities and weight matrices which mix only channels ( known as 1× 1 convolutions ) M ∈ Rc×c : f ( ` +1 ) = M ( ` ) ReLU [ A ( ` ) f ( ` ) ] , ( 2 ) and a final global average pooling layer P which acts channel-wise as natural generalization of the discrete case : P ( f ( L ) ) α = ∫ f ( L ) α ( x ) dx for each α = 1 , 2 , . . . , c. Denoting the space of functions on X with c channels byHc , the convolution operatorsA ( ` ) are linear operators fromHc ` toHc ` +1 . Like in ordinary convolutional neural networks , the layers build up increasingly more expressive spatial features and depend on the parameters in A ( ` ) and M ( ` ) . Unlike ordinary convolutional networks , these layers are well defined operations on the underlying continuous signal . While it is clear that such a network can be defined abstractly , the exact values of the function f ( L ) can not be computed as the operators depend on unknown values of the input . However , by adapting a probabilistic description we can formulate our ignorance of f ( 0 ) with a Gaussian process and see how the uncertainties propagate through the layers of the network , yielding a probabilistic output . Before delving into details , we outline the key components of equation 2 that make this possible . Continuous Convolutional Layers : Crucially , we consider continuous convolution operators A that can be applied to input Gaussian process f ∼ GP ( µp , kp ) in closed form . The output is another Gaussian process with a transformed mean and covariance Af ∼ GP ( Aµp , AkpA′ ) where A′ acts 2For convenience , we include the additional scale factor ( 2πl2 ) d/2 relative to the usual definition . to the left on the primed argument of kp ( x , x′ ) .3 In section 4.2 we show how to parametrize these continuous convolutions in terms of the flow of a PDE and show how they can be applied to the RBF kernel exactly in closed form . Probabilistic ReLUs : Applying the ReLU nonlinearity to the GP yields a new non Gaussian stochastic process h ( ` ) = ReLU [ A ( ` ) f ( ` ) ] , and we show in section 4.5 that the mean and covariance of this process has a closed form solution which can be computed . Channel Mixing and Central Limit Theorem : The activations h ( ` ) are not Gaussian ; however , for a large number of weakly dependent channels we argue that f ( ` +1 ) = M ( ` ) h ( ` ) is approximately distributed as a Gaussian Process in section 4.5 . Measurement and Projection to RBF Gaussian Process : While f ( ` +1 ) is approximately a Gaussian process , the mean and covariance functions have a complicated form . Instead of using these functions directly , we take measurements of the mean and variance of this process and feed them in as noisy observations to a fresh RBF kernel GP , allowing us to repeat the process and build up multiple layers without increasing complexity . The Gaussian process feature maps in the final layer f ( L ) are aggregated spatially by the integral pooling P which can also be applied in closed form ( see appendix D ) , to yield a Gaussian output . Assembling these components , we implement the end to end trainable Probabilistic Numeric Convolutional Neural Network which integrates a probabilistic description of missing data and discretization error inherent to continuous signals . The layers of the network are shown in figure 1 .
The paper considers the problem of using CNNs on an irregularly sampled grid. It proposes to incorporate the numerical uncertainty related to the disretisation of the domain using an approach inspired by probabilistic numerics. This involves defining continuous convolutional layers as affine transformations of the input GP and use rectified GPs to include the nonlinearity in the mapping. The resulting non-Gaussian distribution is then approximated with another GP in each layer. These are then approximated with a GP with an RBF kernel using Monte Carlo to produce observations with input dependent noise. The model is trained using MAP estimation.
SP:70ffdb2504b0c72a7be46dec6a519b9717fb7d41
Uncertainty Estimation in Autoregressive Structured Prediction
1 INTRODUCTION . Neural Networks ( NNs ) have become the dominant approach in numerous applications ( Simonyan & Zisserman , 2015 ; Mikolov et al. , 2013 ; 2010 ; Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Hinton et al. , 2012 ) and are being widely deployed in production . As a consequence , predictive uncertainty estimation is becoming an increasingly important research area , as it enables improved safety in automated decision making ( Amodei et al. , 2016 ) . Important advancements have been the definition of baseline tasks and metrics ( Hendrycks & Gimpel , 2016 ) and the development of ensemble approaches , such as Monte-Carlo Dropout ( Gal & Ghahramani , 2016 ) and Deep Ensembles ( Lakshminarayanan et al. , 2017 ) 1 . Ensemble-based uncertainty estimates have been successfully applied to detecting misclassifications , out-of-distribution inputs and adversarial attacks ( Carlini & Wagner , 2017 ; Smith & Gal , 2018 ; Malinin & Gales , 2019 ) and to active learning ( Kirsch et al. , 2019 ) . Crucially , they allow total uncertainty to be decomposed into data uncertainty , the intrinsic uncertainty associated with the task , and knowledge uncertainty , which is the model ’ s uncertainty in the prediction due to a lack of understanding of the data ( Malinin , 2019 ) 2 . Estimates of knowledge uncertainty are particularly useful for detecting anomalous and unfamiliar inputs ( Kirsch et al. , 2019 ; Smith & Gal , 2018 ; Malinin & Gales , 2019 ; Malinin , 2019 ) . Despite recent advances , most work on uncertainty estimation has focused on unstructured tasks , such as image classification . Meanwhile , uncertainty estimation within a general , unsupervised , probabilistically interpretable ensemble-based framework for structured prediction tasks , such as language modelling , machine translation ( MT ) and speech recognition ( ASR ) , has received little attention . Previous work has examined bespoke supervised confidence estimation techniques for each task separately ( Evermann & Woodland , 2000 ; Liao & Gales , 2007 ; Ragni et al. , 2018 ; Chen et al. , 2017 ; Koehn , 2009 ; Kumar & Sarawagi , 2019 ) which construct an `` error-detection '' model on top of the original ASR/NMT system . While useful , these approaches suffer from a range of limitations . Firstly , they require a token-level supervision , typically obtained via minimum edit-distance alignment to a ground-truth transcription ( ASR ) or translation ( NMT ) , which can itself by noisy . Secondly , such token-level supervision is generally inappropriate for translation , as it doesn ’ t account for the validity of re-arrangements . Thirdly , we are unable to determine whether the error is due to knowledge or 1An in-depth comparison of ensemble methods was conducted in ( Ashukha et al. , 2020 ; Ovadia et al. , 2019 ) 2Data and Knowledge Uncertainty are sometimes also called Aleatoric and Epistemic uncertainty . data uncertainty . Finally , this model is itself subject to the pitfalls of the original system - domain shift , noise , etc . Thus , unsupervised uncertainty-estimation methods are more desirable . Recently , however , initial investigations into unsupervised uncertainty estimation for structured prediction have appeared . The nature of data uncertainty for translation tasks was examined in ( Ott et al. , 2018a ) . Estimation of sequence and word-level uncertainty estimates via Monte-Carlo Dropout ensembles has been investigated for machine translation ( Xiao et al. , 2019 ; Wang et al. , 2019 ; Fomicheva et al. , 2020 ) . However , these works focus on machine translation , consider only a small range of uncertainty adhoc measures , provide limited theoretical analysis of their properties and do not make explicit their limitations . Furthermore , they don ’ t identify or tackle challenges in estimating uncertainty arising from exponentially large output space . Finally , to our knowledge , no work has examined uncertainty estimation for autoregressive ASR models . This work examines uncertainty estimation for structured prediction tasks within a general , probabilistically interpretable ensemble-based framework . The five core contributions are as follows . First , we derive information-theoretic measures of both total uncertainty and knowledge uncertainty at both the token level and the sequence level , make explicit the challenges involved and state any assumptions made . Secondly , we introduce a novel uncertainty measure , reverse mutual information , which has a set of desirable attributes for structured uncertainty . Third , we examine a range of Monte-Carlo approximations for sequence-level uncertainty . Fourth , for structured tasks there is a choice of how ensembles of models can be combined ; we examine how this choice impacts predictive performance and derived uncertainty measures . Fifth , we explore the practical challenges associated with obtaining uncertainty estimates for structured predictions tasks and provide performance baselines for tokenlevel and sequence-level error detection , and out-of-domain ( OOD ) input detection on the WMT ’ 14 English-French and WMT ’ 17 English-German translation datasets and the LibriSpeech ASR dataset . 2 UNCERTAINTY FOR STRUCTURED PREDICTION . In this section we develop an ensemble-based uncertainty estimation framework for structured prediction and introduce a novel uncertainty measure . We take a Bayesian viewpoint on ensembles , as it yields an elegant probabilistic framework within which interpretable uncertainty estimates can be obtained . The core of the Bayesian approach is to treat the model parameters θ as random variables and place a prior p ( θ ) over them to compute a posterior p ( θ|D ) via Bayes ’ rule , where D is the training data . Unfortunately , exact Bayesian inference is intractable for neural networks and it is necessary to consider an explicit or implicit approximation q ( θ ) to the true posterior p ( θ|D ) to generate an ensemble . A number of different approaches to generating ensembles have been developed , such as Monte-Carlo Dropout ( Gal & Ghahramani , 2016 ) and DeepEnsembles ( Lakshminarayanan et al. , 2017 ) . An overview is available in ( Ashukha et al. , 2020 ; Ovadia et al. , 2019 ) . Consider an ensemble of models { P ( y|x ; θ ( m ) ) } Mm=1 sampled from an approximate posterior q ( θ ) , where each model captures the mapping between variable-length sequences of inputs { x1 , · · · , xT } = x ∈ X and targets { y1 , · · · , yL } = y ∈ Y , where xt ∈ { w1 , · · · , wV } , yl ∈ { ω1 , · · · , ωK } . The predictive posterior is obtained by taking the expectation over the ensemble : P ( y|x , D ) = Eq ( θ ) [ P ( y|x , θ ) ] ≈ 1 M M∑ m=1 P ( y|x , θ ( m ) ) , θ ( m ) ∼ q ( θ ) ≈ p ( θ|D ) ( 1 ) The total uncertainty in the prediction of y is given by the entropy of the predictive posterior . H [ P ( y|x , D ) ] ︸ ︷︷ ︸ Total Uncertainty = EP ( y|x , D ) [ − ln P ( y|x , D ) ] = − ∑ y∈Y P ( y|x , D ) ln P ( y|x , D ) ( 2 ) The sources of uncertainty can be decomposed via the mutual information I between θ and y : I [ y , θ|x , D ] ︸ ︷︷ ︸ Know . Uncertainty =Eq ( θ ) [ EP ( y|x , θ ) [ ln P ( y|x , θ ) P ( y|x , D ) ] ] = Ĥ [ P ( y|x , D ) ] ︸ ︷︷ ︸ Total Uncertainty −Eq ( θ ) [ Ĥ [ P ( y|x , θ ) ] ] ︸ ︷︷ ︸ Expected Data Uncertainty ( 3 ) Mutual information ( MI ) is a measure of ‘ disagreement ’ between models in the ensemble , and therefore a measure of knowledge uncertainty ( Malinin , 2019 ) . It can be expressed as the difference between the entropy of the predictive posterior and the expected entropy of each model in the ensemble . The former is a measure of total uncertainty and the latter is a measure of data uncertainty ( Depeweg et al. , 2017 ) . Another measure of ensemble diversity is the expected pairwise KL-divergence ( EPKL ) : K [ y , θ|x , D ] = Eq ( θ ) q ( θ̃ ) [ EP ( y|x , θ ) [ ln P ( y|x , θ ) P ( y|x , θ̃ ) ] ] q ( θ ) ≈ p ( θ|D ) ( 4 ) where q ( θ ) = q ( θ̃ ) and θ̃ is a dummy variable . This measure is an upper bound on the mutual information , obtainable via Jensen ’ s inequality . A novel measure of diversity which we introduce in this work is the reverse mutual information ( RMI ) between each model and the predictive posterior : M [ y , θ|x , D ] = Eq ( θ ) [ EP ( y|x , D ) [ ln P ( y|x , D ) P ( y|x , θ ) ] ] , q ( θ ) ≈ p ( θ|D ) ( 5 ) This is the reverse-KL divergence counterpart to the mutual information ( 3 ) , and has not been previously explored . As will be shown in the next section , RMI is particularly attractive for estimating uncertainty in structured prediction . Interestingly , RMI is the difference between EPKL and MI : M [ y , θ|x , D ] = K [ y , θ|x , D ] − I [ y , θ|x , D ] ≥ 0 ( 6 ) While mutual information , EPKL and RMI yield estimates of knowledge uncertainty , only mutual information ‘ cleanly ’ decomposes into total and data uncertainty . EPKL and RMI do not yield clean measures of total and data uncertainty , respectively . For details see appendix A . Unfortunately , we can not in practice construct a model which directly yields a distribution over an infinite set of variable-length sequences y ∈ Y . Neither can we take expectations over the this set . Instead , autoregressive models are used to factorize the joint distribution over y into a product of conditionals over a finite set of classes , such as words or BPE tokens ( Sennrich et al. , 2015 ) . P ( y|x , θ ) = L∏ l=1 P ( yl|y < l , x ; θ ) , xt ∈ { w1 , · · · , wV } , yl ∈ { ω1 , · · · , ωK } ( 7 ) Here the distribution over each yl is conditioned on all the previous y < l = { y1 , · · · , yl−1 } , which we shall refer to as the context . This set of conditional independence assumptions allows us to define a model on the finite space YL . This formulation describes all machine translation ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ) , end-to-end speech recognition ( Chan et al. , 2015 ) and other related tasks . Alternative factorization orders , representing different conditional independence assumptions , can be considered . However , without loss of generality , we will use the standard factorization . For these models uncertainty estimation can be examined at two levels - the token level , which considers uncertainty in the prediction of a single yl , and the sequence level , which considers the uncertainty of predicting the entire sequence y. Token-level uncertainty estimation for autoregressive models is isomorphic to un-structured uncertainty estimation with additional conditioning on the context y < l , and so is presented in appendix A.1 . Instead , we focus on discussing sequence-level uncertainty estimation in autoregressive models . We have chosen to focus on autoregressive models as they present interesting challenges , are more general than models with stronger conditional independence assumptions , and are widely applied to tasks of practical value . We emphasize that the proposed ensemble-based approach is general and can be applied to structured tasks with different conditional independence assumptions ( Graves et al. , 2006 ; Gales & Young , 2008 ; Gu et al. , 2017 )
This paper proposes two different measures of knowledge (epistemic) uncertainty in structured prediction with an autoregressive model and discusses how to compute their approximations. The main contribution is the proposed reverse mutual information (RMI) as a measure of epistemic uncertainty in structured prediction. Experiments on benchmark datasets demonstrate the effectiveness of the proposed method in error detection and OOD detection.
SP:c73fc3212d75833f5f54e4d76326b759fa9442c4
Uncertainty Estimation in Autoregressive Structured Prediction
1 INTRODUCTION . Neural Networks ( NNs ) have become the dominant approach in numerous applications ( Simonyan & Zisserman , 2015 ; Mikolov et al. , 2013 ; 2010 ; Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Hinton et al. , 2012 ) and are being widely deployed in production . As a consequence , predictive uncertainty estimation is becoming an increasingly important research area , as it enables improved safety in automated decision making ( Amodei et al. , 2016 ) . Important advancements have been the definition of baseline tasks and metrics ( Hendrycks & Gimpel , 2016 ) and the development of ensemble approaches , such as Monte-Carlo Dropout ( Gal & Ghahramani , 2016 ) and Deep Ensembles ( Lakshminarayanan et al. , 2017 ) 1 . Ensemble-based uncertainty estimates have been successfully applied to detecting misclassifications , out-of-distribution inputs and adversarial attacks ( Carlini & Wagner , 2017 ; Smith & Gal , 2018 ; Malinin & Gales , 2019 ) and to active learning ( Kirsch et al. , 2019 ) . Crucially , they allow total uncertainty to be decomposed into data uncertainty , the intrinsic uncertainty associated with the task , and knowledge uncertainty , which is the model ’ s uncertainty in the prediction due to a lack of understanding of the data ( Malinin , 2019 ) 2 . Estimates of knowledge uncertainty are particularly useful for detecting anomalous and unfamiliar inputs ( Kirsch et al. , 2019 ; Smith & Gal , 2018 ; Malinin & Gales , 2019 ; Malinin , 2019 ) . Despite recent advances , most work on uncertainty estimation has focused on unstructured tasks , such as image classification . Meanwhile , uncertainty estimation within a general , unsupervised , probabilistically interpretable ensemble-based framework for structured prediction tasks , such as language modelling , machine translation ( MT ) and speech recognition ( ASR ) , has received little attention . Previous work has examined bespoke supervised confidence estimation techniques for each task separately ( Evermann & Woodland , 2000 ; Liao & Gales , 2007 ; Ragni et al. , 2018 ; Chen et al. , 2017 ; Koehn , 2009 ; Kumar & Sarawagi , 2019 ) which construct an `` error-detection '' model on top of the original ASR/NMT system . While useful , these approaches suffer from a range of limitations . Firstly , they require a token-level supervision , typically obtained via minimum edit-distance alignment to a ground-truth transcription ( ASR ) or translation ( NMT ) , which can itself by noisy . Secondly , such token-level supervision is generally inappropriate for translation , as it doesn ’ t account for the validity of re-arrangements . Thirdly , we are unable to determine whether the error is due to knowledge or 1An in-depth comparison of ensemble methods was conducted in ( Ashukha et al. , 2020 ; Ovadia et al. , 2019 ) 2Data and Knowledge Uncertainty are sometimes also called Aleatoric and Epistemic uncertainty . data uncertainty . Finally , this model is itself subject to the pitfalls of the original system - domain shift , noise , etc . Thus , unsupervised uncertainty-estimation methods are more desirable . Recently , however , initial investigations into unsupervised uncertainty estimation for structured prediction have appeared . The nature of data uncertainty for translation tasks was examined in ( Ott et al. , 2018a ) . Estimation of sequence and word-level uncertainty estimates via Monte-Carlo Dropout ensembles has been investigated for machine translation ( Xiao et al. , 2019 ; Wang et al. , 2019 ; Fomicheva et al. , 2020 ) . However , these works focus on machine translation , consider only a small range of uncertainty adhoc measures , provide limited theoretical analysis of their properties and do not make explicit their limitations . Furthermore , they don ’ t identify or tackle challenges in estimating uncertainty arising from exponentially large output space . Finally , to our knowledge , no work has examined uncertainty estimation for autoregressive ASR models . This work examines uncertainty estimation for structured prediction tasks within a general , probabilistically interpretable ensemble-based framework . The five core contributions are as follows . First , we derive information-theoretic measures of both total uncertainty and knowledge uncertainty at both the token level and the sequence level , make explicit the challenges involved and state any assumptions made . Secondly , we introduce a novel uncertainty measure , reverse mutual information , which has a set of desirable attributes for structured uncertainty . Third , we examine a range of Monte-Carlo approximations for sequence-level uncertainty . Fourth , for structured tasks there is a choice of how ensembles of models can be combined ; we examine how this choice impacts predictive performance and derived uncertainty measures . Fifth , we explore the practical challenges associated with obtaining uncertainty estimates for structured predictions tasks and provide performance baselines for tokenlevel and sequence-level error detection , and out-of-domain ( OOD ) input detection on the WMT ’ 14 English-French and WMT ’ 17 English-German translation datasets and the LibriSpeech ASR dataset . 2 UNCERTAINTY FOR STRUCTURED PREDICTION . In this section we develop an ensemble-based uncertainty estimation framework for structured prediction and introduce a novel uncertainty measure . We take a Bayesian viewpoint on ensembles , as it yields an elegant probabilistic framework within which interpretable uncertainty estimates can be obtained . The core of the Bayesian approach is to treat the model parameters θ as random variables and place a prior p ( θ ) over them to compute a posterior p ( θ|D ) via Bayes ’ rule , where D is the training data . Unfortunately , exact Bayesian inference is intractable for neural networks and it is necessary to consider an explicit or implicit approximation q ( θ ) to the true posterior p ( θ|D ) to generate an ensemble . A number of different approaches to generating ensembles have been developed , such as Monte-Carlo Dropout ( Gal & Ghahramani , 2016 ) and DeepEnsembles ( Lakshminarayanan et al. , 2017 ) . An overview is available in ( Ashukha et al. , 2020 ; Ovadia et al. , 2019 ) . Consider an ensemble of models { P ( y|x ; θ ( m ) ) } Mm=1 sampled from an approximate posterior q ( θ ) , where each model captures the mapping between variable-length sequences of inputs { x1 , · · · , xT } = x ∈ X and targets { y1 , · · · , yL } = y ∈ Y , where xt ∈ { w1 , · · · , wV } , yl ∈ { ω1 , · · · , ωK } . The predictive posterior is obtained by taking the expectation over the ensemble : P ( y|x , D ) = Eq ( θ ) [ P ( y|x , θ ) ] ≈ 1 M M∑ m=1 P ( y|x , θ ( m ) ) , θ ( m ) ∼ q ( θ ) ≈ p ( θ|D ) ( 1 ) The total uncertainty in the prediction of y is given by the entropy of the predictive posterior . H [ P ( y|x , D ) ] ︸ ︷︷ ︸ Total Uncertainty = EP ( y|x , D ) [ − ln P ( y|x , D ) ] = − ∑ y∈Y P ( y|x , D ) ln P ( y|x , D ) ( 2 ) The sources of uncertainty can be decomposed via the mutual information I between θ and y : I [ y , θ|x , D ] ︸ ︷︷ ︸ Know . Uncertainty =Eq ( θ ) [ EP ( y|x , θ ) [ ln P ( y|x , θ ) P ( y|x , D ) ] ] = Ĥ [ P ( y|x , D ) ] ︸ ︷︷ ︸ Total Uncertainty −Eq ( θ ) [ Ĥ [ P ( y|x , θ ) ] ] ︸ ︷︷ ︸ Expected Data Uncertainty ( 3 ) Mutual information ( MI ) is a measure of ‘ disagreement ’ between models in the ensemble , and therefore a measure of knowledge uncertainty ( Malinin , 2019 ) . It can be expressed as the difference between the entropy of the predictive posterior and the expected entropy of each model in the ensemble . The former is a measure of total uncertainty and the latter is a measure of data uncertainty ( Depeweg et al. , 2017 ) . Another measure of ensemble diversity is the expected pairwise KL-divergence ( EPKL ) : K [ y , θ|x , D ] = Eq ( θ ) q ( θ̃ ) [ EP ( y|x , θ ) [ ln P ( y|x , θ ) P ( y|x , θ̃ ) ] ] q ( θ ) ≈ p ( θ|D ) ( 4 ) where q ( θ ) = q ( θ̃ ) and θ̃ is a dummy variable . This measure is an upper bound on the mutual information , obtainable via Jensen ’ s inequality . A novel measure of diversity which we introduce in this work is the reverse mutual information ( RMI ) between each model and the predictive posterior : M [ y , θ|x , D ] = Eq ( θ ) [ EP ( y|x , D ) [ ln P ( y|x , D ) P ( y|x , θ ) ] ] , q ( θ ) ≈ p ( θ|D ) ( 5 ) This is the reverse-KL divergence counterpart to the mutual information ( 3 ) , and has not been previously explored . As will be shown in the next section , RMI is particularly attractive for estimating uncertainty in structured prediction . Interestingly , RMI is the difference between EPKL and MI : M [ y , θ|x , D ] = K [ y , θ|x , D ] − I [ y , θ|x , D ] ≥ 0 ( 6 ) While mutual information , EPKL and RMI yield estimates of knowledge uncertainty , only mutual information ‘ cleanly ’ decomposes into total and data uncertainty . EPKL and RMI do not yield clean measures of total and data uncertainty , respectively . For details see appendix A . Unfortunately , we can not in practice construct a model which directly yields a distribution over an infinite set of variable-length sequences y ∈ Y . Neither can we take expectations over the this set . Instead , autoregressive models are used to factorize the joint distribution over y into a product of conditionals over a finite set of classes , such as words or BPE tokens ( Sennrich et al. , 2015 ) . P ( y|x , θ ) = L∏ l=1 P ( yl|y < l , x ; θ ) , xt ∈ { w1 , · · · , wV } , yl ∈ { ω1 , · · · , ωK } ( 7 ) Here the distribution over each yl is conditioned on all the previous y < l = { y1 , · · · , yl−1 } , which we shall refer to as the context . This set of conditional independence assumptions allows us to define a model on the finite space YL . This formulation describes all machine translation ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ) , end-to-end speech recognition ( Chan et al. , 2015 ) and other related tasks . Alternative factorization orders , representing different conditional independence assumptions , can be considered . However , without loss of generality , we will use the standard factorization . For these models uncertainty estimation can be examined at two levels - the token level , which considers uncertainty in the prediction of a single yl , and the sequence level , which considers the uncertainty of predicting the entire sequence y. Token-level uncertainty estimation for autoregressive models is isomorphic to un-structured uncertainty estimation with additional conditioning on the context y < l , and so is presented in appendix A.1 . Instead , we focus on discussing sequence-level uncertainty estimation in autoregressive models . We have chosen to focus on autoregressive models as they present interesting challenges , are more general than models with stronger conditional independence assumptions , and are widely applied to tasks of practical value . We emphasize that the proposed ensemble-based approach is general and can be applied to structured tasks with different conditional independence assumptions ( Graves et al. , 2006 ; Gales & Young , 2008 ; Gu et al. , 2017 )
This work introduce rigorous information-theoretic measures for structured prediction tasks. It proposed metrics for both `"total uncertainty" (entropy) and "knowledge uncertainty" (MI, EPKL and RMI) on the sequence level, introduced efficient Monte-Carlo approaches to estimate them in practice. Finally, author conducted thorough experiment to evaluate the effect of ensemble strategy and choice of metric for error detection and OOD detection in ASR and NMT.
SP:c73fc3212d75833f5f54e4d76326b759fa9442c4
Pre-Training by Completing Point Clouds
1 INTRODUCTION . Point clouds are a natural representation of 3D objects . Recently , there has been a flurry of exciting new point cloud models in areas such as segmentation ( Landrieu & Simonovsky , 2018 ; Yang et al. , 2019a ; Hu et al. , 2020a ) and object detection ( Zhou & Tuzel , 2018 ; Lang et al. , 2019 ; Wang et al. , 2020b ) . Current 3D sensing modalities ( i.e. , 3D scanners , stereo cameras , lidars ) have enabled the creation of large repositories of point cloud data ( Rusu & Cousins , 2011 ; Hackel et al. , 2017 ) . However , annotating point clouds is challenging as : ( 1 ) Point cloud data can be sparse and at low resolutions , making the identity of points ambiguous ; ( 2 ) Datasets that are not sparse can easily reach hundreds of millions of points ( e.g. , small dense point clouds for object classification ( Zhou & Neumann , 2013 ) and large vast point clouds for 3D reconstruction ( Zolanvari et al. , 2019 ) ) ; ( 3 ) Labelling individual points or drawing 3D bounding boxes are both more complex and timeconsuming compared with annotating 2D images ( Wang et al. , 2019a ) . Since most methods require dense supervision , the lack of annotated point cloud data impedes the development of novel models . On the other hand , because of the rapid development of 3D sensors , unlabelled point cloud datasets are abundant . Recent work has developed unsupervised pre-training methods to learn initialization for point cloud models . These are based on designing novel generative adversarial networks ( GANs ) ( Wu et al. , 2016 ; Han et al. , 2019 ; Achlioptas et al. , 2018 ) and autoencoders ( Hassani & Haley , 2019 ; Li et al. , 2018a ; Yang et al. , 2018 ) . However , completely unsupervised pre-training methods have been recently outperformed by the self-supervised pre-training techniques of ( Sauder & Sievers , 2019 ) and ( Alliegro et al. , 2020 ) . Both methods work by first voxelizing point clouds , then splitting each axis into k parts , yielding k3 voxels . Then , voxels are randomly permuted , and a model is trained to rearrange the permuted voxels back to their original positions . The intuition is that such a model learns the spatial configuration of objects and scenes . However , such random permutation destroys all spatial information that the model could have used to predict the final object point cloud . Our insight is that partial point-cloud masking is a good candidate for pre-training in point-clouds because of two reasons : ( 1 ) The pre-trained model requires spatial and semantic understanding of the input point clouds to be able to reconstruct masked shapes . ( 2 ) Mask-based completion tasks have become the de facto standard for learning pre-trained representations in natural language processing ( NLP ) ( Mikolov et al. , 2013 ; Devlin et al. , 2018 ; Peters et al. , 2018 ) . Different from random permutations , masking respects the spatial constraints that are naturally encoded in point clouds of real-world objects and scenes . Given this insight , we propose Occlusion Completion ( OcCo ) a self-supervised pre-training method that consists of ( a ) a mechanism to generate occluded point clouds , and ( b ) a completion task to reconstruct the occluded point cloud . Specifically , in ( a ) point clouds are generated by determining what part of objects would be occluded if the underlying object was observed from a particular view-point . In fact , many point clouds generated from a fixed 3D sensor will have occlusions exactly like this . Given an occluded point cloud , the goal of the completion task ( b ) is to learn a model that accurately reconstructs the missing parts of the point cloud . For a model to perform this task well , it needs to learn to encode localized structural information , based on the context and geometry of partial objects . This is something that is useful for any point cloud model to know , even if used only for classification or segmentation . We demonstrate that the weights learned by our pre-training method on a single unsupervised dataset can be used as initialization for models in downstream tasks ( e.g. , object classification , part and semantic segmentation ) to improve them , even on completely different datasets . Specifically our pre-training technique : ( i ) leads to improved generalization over prior baselines on the downstream tasks of object classification , object part and scene semantic segmentation ; ( ii ) speeds up model convergence , in some cases , by up to 5× ; ( iii ) maintains improvements as the size of the labelled downstream dataset decreases ; ( iv ) can be used for a variety of state-of-the-art point cloud models . 2 OCCLUSION COMPLETION . We now introduce Occlusion Completion ( OcCo ) . Our approach is shown in Figure 1 . Our main insight is that by continually occluding point clouds and learning a model c ( · ) to complete them , the weights of the completion model can be used as initialization for downstream tasks ( e.g. , classification , segmentation ) , speeding up training and improving generalization over other initialization techniques . Throughout we assume point clouds P are sets of points in 3D Euclidean space , P = { p1 , p2 , ... , pn } , where each point pi is a vector of coordinates ( xi , yi , zi ) and features ( e.g . color and normal ) . We begin by describing the components that make up our occlusion mapping o ( · ) . Then we detail how to learn a completion model c ( · ) , giving pseudocode and the architectural details in appendix . Finally we discuss the criteria on validating the effectiveness of a pre-training model for 3D point clouds . 2.1 GENERATING OCCLUSIONS . We first describe a randomized occlusion mapping o : P → P ( where P is the space of all point clouds ) from a full point cloud P to an occluded point cloud P̃ . We will do so by determining which points are occluded when the point cloud is viewed from a particular camera position . This requires three steps : ( 1 ) A projection of the point cloud ( in a world reference frame ) into the coordinates of a camera reference frame ; ( 2 ) Determining which points are occluded based on the camera view-points ; ( 3 ) Mapping the points back from the camera reference frame to the world reference frame . Viewing the point cloud from a camera . A camera defines a projection from a 3D world reference frame into a distinctive 3D camera reference frame . It does so by specifying a camera model and a camera view-point from which the projection occurs . The simplest camera model is the pinhole camera , and view-point projection for it is given by a simple linear equation : [ xcam ycam zcam ] = [ f γ w/2 0 f h/2 0 0 1 ] ︸ ︷︷ ︸ intrinsic [ K ] [ r1 r2 r3 t1 r4 r5 r6 t2 r7 r8 r9 t3 ] ︸ ︷︷ ︸ rotation | translation [ R | t ] xyz 1 . ( 1 ) In the above , ( x , y , z ) are the original point cloud coordinates , the matrix including r and t entries is the concatenation of a 3D rotation matrix with a 3D translation vector , and the final matrix to the left is the camera intrinsic matrix ( f specifies the camera focal length , γ is the skewness between the x and y axes in the camera , and w , h are the width and height of the camera image ) . Given these , the final coordinates ( xcam , ycam , zcam ) are the positions of the point in the camera reference frame . We will refer to the intrinsic matrix as K and the rotation/translation matrix as [ R|t ] . Determining occluded points . We can think of the point ( xcam , ycam , zcam ) in multiple ways : ( a ) as a 3D point in the camera reference frame , ( b ) as a 2D pixel with coordinates ( fxcam/zcam , fycam/zcam ) with a depth of zcam . In this way , some 2D points resulting from the projection may be occluded by others if they have the same pixel coordinates , but appear at a larger depth . To determine which points are occluded , we first use Delaunay triangulation to reconstruct a polygon mesh from the points , and remove the points which belong to the hidden surfaces that are determined via z-buffering . Mapping back from camera frame to world frame . Once occluded points are removed , we reproject the point cloud to the original world reference frame , via the following linear transformation : x ′ y′ z′ 1 = r1 r2 r3 t1r4 r5 r6 t2r7 r8 r9 t3 0 0 0 1 > ︸ ︷︷ ︸ [ R | t 0 | 1 ] > 1/f −γ/f 2 ( γh− fw ) / ( 2f2 ) 0 0 1/f −h/ ( 2f ) 0 0 0 1 0 0 0 0 1 ︸ ︷︷ ︸ [ K−1 0 0 1 ] xcamycamzcam 1 . ( 2 ) Our randomized occlusion mapping o ( · ) is constructed as follows . Fix an initial point cloud P . Given a camera intrinsics matrix K , sample rotation/translation matrices [ [ R1|t1 ] , . . . , [ RV |tV ] ] , where V is the number of views . For each view v ∈ [ V ] , project P into the camera frame of that view-point using eq . ( 1 ) , find occluded points and remove them , then map the rest back to the world reference using eq . ( 2 ) . This yields the final occluded world frame point cloud for view-point v : P̃v . 2.2 THE COMPLETION TASK . Given an occluded point cloud P̃ produced by o ( · ) , the goal of the completion task is to learn a completion mapping c : P → P from P̃ to a completed point cloud P . We say that a completion mapping is accurate w.r.t . loss ` ( · , · ) if EP̃∼o ( P ) ` ( c ( P̃ ) , P ) → 0 . The structure of the completion model c ( · ) is an “ encoder-decoder ” network ( Dai et al. , 2017b ; Yuan et al. , 2018 ; Tchapmi et al. , 2019 ; Wang et al. , 2020a ) . The encoder maps an occluded point cloud to a vector , and the decoder reconstructs the full shape . After pre-training , the encoder weights can be used as initialization for downstream tasks . In appendix we gives pseudocode for OcCo and describes the architectures . 3 EXPERIMENTS . 3.1 PRE-TRAINING AND DOWNSTREAM TRAINING DETAILS . We evaluate how OcCo improves the learning and generalization of a number of classification and segmentation tasks . Here we describe the details of training in each setting . OcCo pre-training . For all experiments , we will use a single pre-training dataset based on ModelNet40 ( Wu et al. , 2015 ) . It includes 12,311 synthesized objects from 40 object categories , divided into 9,843 training objects and 2,468 testing objects . To construct the pre-training dataset , we generate occluded point clouds based on the training objects with a fixed camera intrinsics { f = 1000 , γ = 0 , ω = 1600 , h = 1200 } , 10 random selected viewpoints and zero translation . Figure 2 shows examples of the resulting occluded point clouds . Given these , we train an “ encoderdecoder ” style completion model c ( · ) . For encoders , similar to prior completion models ( Tchapmi et al. , 2019 ; Wang et al. , 2020a ; Wen et al. , 2020a ) , we consider PointNet ( Qi et al. , 2017a ) , PCN ( Yuan et al. , 2018 ) and DGCNN ( Wang et al. , 2019b ) . These networks encode an occluded point cloud into a 1024-dimensional vector . We adapted the folding-based decoder from ( Yuan et al. , 2018 ) to complete the point clouds in a two-stage procedure . We use the Chamfer Distance ( CD ) as our loss function ` ( · , · ) . We use Adam ( Kingma & Ba , 2015 ) with an initial learning rate of 1e-4 , decayed by 0.7 every 10 epochs to a minimum value of 1e-6 , for a total of 50 epochs . We use a batch size of 32 and set the momentum in the batch normalisation to be 0.9 . Few-shot learning . We use ModelNet40 and Syndey10 ( De Deuge et al. , 2013 ) for “ K-way N - shot ” learning . During training , K classes are randomly selected and for each class we sample N random samples , then the model is tested on the same K classes . As in Sharma & Kaul ( 2020 ) , we represent each object with 100 points . We use the same training settings as used in the next paragraph . Object classification . We use three 3D object recognition benchmarks : ModelNet40 , ScanNet10 ( Qin et al. , 2019 ) and ScanObjectNN ( Uy et al. , 2019 ) ; we describe them in the appendix . All objects are represented with 1024 points . We use the same training settings as the original works . Concretely , for PCN and PointNet , we use the Adam optimizer with an initial learning rate 1e-3 , decayed by 0.7 every 20 epochs to a minimum value of 1e-5 . For DGCNN , we use the SGD optimizer with a momentum of 0.9 and a weight decay of 1e-4 . The learning rate starts from 0.1 and then reduces using cosine annealing Loshchilov & Hutter ( 2017 ) with a minimum value of 1e-3 . We use dropout Srivastava et al . ( 2014 ) in the fully connected layers before the softmax output layer . The dropout rate of PointNet and PCN is set to 0.7 , and is 0.5 for DGCNN . For all three models , we train them for 200 epochs with a batch size of 32 . We report the results based on three runs . Part segmentation . We use the ShapeNetPart ( Armeni et al. , 2016 ) benchmark for object part segmentation . This dataset contains 16,881 objects from 16 categories , and has 50 parts in total . Each object is represented with 2048 points , and we use the same training settings as the original work . Semantic segmentation . We use the S3DIS benchmark ( Armeni et al. , 2016 ) for semantic indoor scene segmentation . It contains 3D scans collected via Matterport scanners in 6 different places , encompassing 271 rooms . Each point , described by a 9-dimensional vector ( including coordinates , RGB values and normalised location ) , is labeled as one of 13 semantic categories ( e.g . chair , table and floor ) . We use the same preprocessing procedures and training settings as the original work .
This paper proposes a better pre-trained prior for a variety of downstream applications in point cloud analysis. The workflow of the pre-training mechanism is to first 1) generate occluded points that result from view occlusion and then 2) optimize the encoder to learn how to complete the occluded points from the partial point cloud. In downstream applications, the obtained encoder will be used as the initial weights in the network training. Empirical experiments have shown that such a pre-train mechanism can improve initialization over prior baselines and benefit a variety of tasks even with a large domain gap.
SP:4673d78e21f98a766c4340809623e54d165f69d9
Pre-Training by Completing Point Clouds
1 INTRODUCTION . Point clouds are a natural representation of 3D objects . Recently , there has been a flurry of exciting new point cloud models in areas such as segmentation ( Landrieu & Simonovsky , 2018 ; Yang et al. , 2019a ; Hu et al. , 2020a ) and object detection ( Zhou & Tuzel , 2018 ; Lang et al. , 2019 ; Wang et al. , 2020b ) . Current 3D sensing modalities ( i.e. , 3D scanners , stereo cameras , lidars ) have enabled the creation of large repositories of point cloud data ( Rusu & Cousins , 2011 ; Hackel et al. , 2017 ) . However , annotating point clouds is challenging as : ( 1 ) Point cloud data can be sparse and at low resolutions , making the identity of points ambiguous ; ( 2 ) Datasets that are not sparse can easily reach hundreds of millions of points ( e.g. , small dense point clouds for object classification ( Zhou & Neumann , 2013 ) and large vast point clouds for 3D reconstruction ( Zolanvari et al. , 2019 ) ) ; ( 3 ) Labelling individual points or drawing 3D bounding boxes are both more complex and timeconsuming compared with annotating 2D images ( Wang et al. , 2019a ) . Since most methods require dense supervision , the lack of annotated point cloud data impedes the development of novel models . On the other hand , because of the rapid development of 3D sensors , unlabelled point cloud datasets are abundant . Recent work has developed unsupervised pre-training methods to learn initialization for point cloud models . These are based on designing novel generative adversarial networks ( GANs ) ( Wu et al. , 2016 ; Han et al. , 2019 ; Achlioptas et al. , 2018 ) and autoencoders ( Hassani & Haley , 2019 ; Li et al. , 2018a ; Yang et al. , 2018 ) . However , completely unsupervised pre-training methods have been recently outperformed by the self-supervised pre-training techniques of ( Sauder & Sievers , 2019 ) and ( Alliegro et al. , 2020 ) . Both methods work by first voxelizing point clouds , then splitting each axis into k parts , yielding k3 voxels . Then , voxels are randomly permuted , and a model is trained to rearrange the permuted voxels back to their original positions . The intuition is that such a model learns the spatial configuration of objects and scenes . However , such random permutation destroys all spatial information that the model could have used to predict the final object point cloud . Our insight is that partial point-cloud masking is a good candidate for pre-training in point-clouds because of two reasons : ( 1 ) The pre-trained model requires spatial and semantic understanding of the input point clouds to be able to reconstruct masked shapes . ( 2 ) Mask-based completion tasks have become the de facto standard for learning pre-trained representations in natural language processing ( NLP ) ( Mikolov et al. , 2013 ; Devlin et al. , 2018 ; Peters et al. , 2018 ) . Different from random permutations , masking respects the spatial constraints that are naturally encoded in point clouds of real-world objects and scenes . Given this insight , we propose Occlusion Completion ( OcCo ) a self-supervised pre-training method that consists of ( a ) a mechanism to generate occluded point clouds , and ( b ) a completion task to reconstruct the occluded point cloud . Specifically , in ( a ) point clouds are generated by determining what part of objects would be occluded if the underlying object was observed from a particular view-point . In fact , many point clouds generated from a fixed 3D sensor will have occlusions exactly like this . Given an occluded point cloud , the goal of the completion task ( b ) is to learn a model that accurately reconstructs the missing parts of the point cloud . For a model to perform this task well , it needs to learn to encode localized structural information , based on the context and geometry of partial objects . This is something that is useful for any point cloud model to know , even if used only for classification or segmentation . We demonstrate that the weights learned by our pre-training method on a single unsupervised dataset can be used as initialization for models in downstream tasks ( e.g. , object classification , part and semantic segmentation ) to improve them , even on completely different datasets . Specifically our pre-training technique : ( i ) leads to improved generalization over prior baselines on the downstream tasks of object classification , object part and scene semantic segmentation ; ( ii ) speeds up model convergence , in some cases , by up to 5× ; ( iii ) maintains improvements as the size of the labelled downstream dataset decreases ; ( iv ) can be used for a variety of state-of-the-art point cloud models . 2 OCCLUSION COMPLETION . We now introduce Occlusion Completion ( OcCo ) . Our approach is shown in Figure 1 . Our main insight is that by continually occluding point clouds and learning a model c ( · ) to complete them , the weights of the completion model can be used as initialization for downstream tasks ( e.g. , classification , segmentation ) , speeding up training and improving generalization over other initialization techniques . Throughout we assume point clouds P are sets of points in 3D Euclidean space , P = { p1 , p2 , ... , pn } , where each point pi is a vector of coordinates ( xi , yi , zi ) and features ( e.g . color and normal ) . We begin by describing the components that make up our occlusion mapping o ( · ) . Then we detail how to learn a completion model c ( · ) , giving pseudocode and the architectural details in appendix . Finally we discuss the criteria on validating the effectiveness of a pre-training model for 3D point clouds . 2.1 GENERATING OCCLUSIONS . We first describe a randomized occlusion mapping o : P → P ( where P is the space of all point clouds ) from a full point cloud P to an occluded point cloud P̃ . We will do so by determining which points are occluded when the point cloud is viewed from a particular camera position . This requires three steps : ( 1 ) A projection of the point cloud ( in a world reference frame ) into the coordinates of a camera reference frame ; ( 2 ) Determining which points are occluded based on the camera view-points ; ( 3 ) Mapping the points back from the camera reference frame to the world reference frame . Viewing the point cloud from a camera . A camera defines a projection from a 3D world reference frame into a distinctive 3D camera reference frame . It does so by specifying a camera model and a camera view-point from which the projection occurs . The simplest camera model is the pinhole camera , and view-point projection for it is given by a simple linear equation : [ xcam ycam zcam ] = [ f γ w/2 0 f h/2 0 0 1 ] ︸ ︷︷ ︸ intrinsic [ K ] [ r1 r2 r3 t1 r4 r5 r6 t2 r7 r8 r9 t3 ] ︸ ︷︷ ︸ rotation | translation [ R | t ] xyz 1 . ( 1 ) In the above , ( x , y , z ) are the original point cloud coordinates , the matrix including r and t entries is the concatenation of a 3D rotation matrix with a 3D translation vector , and the final matrix to the left is the camera intrinsic matrix ( f specifies the camera focal length , γ is the skewness between the x and y axes in the camera , and w , h are the width and height of the camera image ) . Given these , the final coordinates ( xcam , ycam , zcam ) are the positions of the point in the camera reference frame . We will refer to the intrinsic matrix as K and the rotation/translation matrix as [ R|t ] . Determining occluded points . We can think of the point ( xcam , ycam , zcam ) in multiple ways : ( a ) as a 3D point in the camera reference frame , ( b ) as a 2D pixel with coordinates ( fxcam/zcam , fycam/zcam ) with a depth of zcam . In this way , some 2D points resulting from the projection may be occluded by others if they have the same pixel coordinates , but appear at a larger depth . To determine which points are occluded , we first use Delaunay triangulation to reconstruct a polygon mesh from the points , and remove the points which belong to the hidden surfaces that are determined via z-buffering . Mapping back from camera frame to world frame . Once occluded points are removed , we reproject the point cloud to the original world reference frame , via the following linear transformation : x ′ y′ z′ 1 = r1 r2 r3 t1r4 r5 r6 t2r7 r8 r9 t3 0 0 0 1 > ︸ ︷︷ ︸ [ R | t 0 | 1 ] > 1/f −γ/f 2 ( γh− fw ) / ( 2f2 ) 0 0 1/f −h/ ( 2f ) 0 0 0 1 0 0 0 0 1 ︸ ︷︷ ︸ [ K−1 0 0 1 ] xcamycamzcam 1 . ( 2 ) Our randomized occlusion mapping o ( · ) is constructed as follows . Fix an initial point cloud P . Given a camera intrinsics matrix K , sample rotation/translation matrices [ [ R1|t1 ] , . . . , [ RV |tV ] ] , where V is the number of views . For each view v ∈ [ V ] , project P into the camera frame of that view-point using eq . ( 1 ) , find occluded points and remove them , then map the rest back to the world reference using eq . ( 2 ) . This yields the final occluded world frame point cloud for view-point v : P̃v . 2.2 THE COMPLETION TASK . Given an occluded point cloud P̃ produced by o ( · ) , the goal of the completion task is to learn a completion mapping c : P → P from P̃ to a completed point cloud P . We say that a completion mapping is accurate w.r.t . loss ` ( · , · ) if EP̃∼o ( P ) ` ( c ( P̃ ) , P ) → 0 . The structure of the completion model c ( · ) is an “ encoder-decoder ” network ( Dai et al. , 2017b ; Yuan et al. , 2018 ; Tchapmi et al. , 2019 ; Wang et al. , 2020a ) . The encoder maps an occluded point cloud to a vector , and the decoder reconstructs the full shape . After pre-training , the encoder weights can be used as initialization for downstream tasks . In appendix we gives pseudocode for OcCo and describes the architectures . 3 EXPERIMENTS . 3.1 PRE-TRAINING AND DOWNSTREAM TRAINING DETAILS . We evaluate how OcCo improves the learning and generalization of a number of classification and segmentation tasks . Here we describe the details of training in each setting . OcCo pre-training . For all experiments , we will use a single pre-training dataset based on ModelNet40 ( Wu et al. , 2015 ) . It includes 12,311 synthesized objects from 40 object categories , divided into 9,843 training objects and 2,468 testing objects . To construct the pre-training dataset , we generate occluded point clouds based on the training objects with a fixed camera intrinsics { f = 1000 , γ = 0 , ω = 1600 , h = 1200 } , 10 random selected viewpoints and zero translation . Figure 2 shows examples of the resulting occluded point clouds . Given these , we train an “ encoderdecoder ” style completion model c ( · ) . For encoders , similar to prior completion models ( Tchapmi et al. , 2019 ; Wang et al. , 2020a ; Wen et al. , 2020a ) , we consider PointNet ( Qi et al. , 2017a ) , PCN ( Yuan et al. , 2018 ) and DGCNN ( Wang et al. , 2019b ) . These networks encode an occluded point cloud into a 1024-dimensional vector . We adapted the folding-based decoder from ( Yuan et al. , 2018 ) to complete the point clouds in a two-stage procedure . We use the Chamfer Distance ( CD ) as our loss function ` ( · , · ) . We use Adam ( Kingma & Ba , 2015 ) with an initial learning rate of 1e-4 , decayed by 0.7 every 10 epochs to a minimum value of 1e-6 , for a total of 50 epochs . We use a batch size of 32 and set the momentum in the batch normalisation to be 0.9 . Few-shot learning . We use ModelNet40 and Syndey10 ( De Deuge et al. , 2013 ) for “ K-way N - shot ” learning . During training , K classes are randomly selected and for each class we sample N random samples , then the model is tested on the same K classes . As in Sharma & Kaul ( 2020 ) , we represent each object with 100 points . We use the same training settings as used in the next paragraph . Object classification . We use three 3D object recognition benchmarks : ModelNet40 , ScanNet10 ( Qin et al. , 2019 ) and ScanObjectNN ( Uy et al. , 2019 ) ; we describe them in the appendix . All objects are represented with 1024 points . We use the same training settings as the original works . Concretely , for PCN and PointNet , we use the Adam optimizer with an initial learning rate 1e-3 , decayed by 0.7 every 20 epochs to a minimum value of 1e-5 . For DGCNN , we use the SGD optimizer with a momentum of 0.9 and a weight decay of 1e-4 . The learning rate starts from 0.1 and then reduces using cosine annealing Loshchilov & Hutter ( 2017 ) with a minimum value of 1e-3 . We use dropout Srivastava et al . ( 2014 ) in the fully connected layers before the softmax output layer . The dropout rate of PointNet and PCN is set to 0.7 , and is 0.5 for DGCNN . For all three models , we train them for 200 epochs with a batch size of 32 . We report the results based on three runs . Part segmentation . We use the ShapeNetPart ( Armeni et al. , 2016 ) benchmark for object part segmentation . This dataset contains 16,881 objects from 16 categories , and has 50 parts in total . Each object is represented with 2048 points , and we use the same training settings as the original work . Semantic segmentation . We use the S3DIS benchmark ( Armeni et al. , 2016 ) for semantic indoor scene segmentation . It contains 3D scans collected via Matterport scanners in 6 different places , encompassing 271 rooms . Each point , described by a 9-dimensional vector ( including coordinates , RGB values and normalised location ) , is labeled as one of 13 semantic categories ( e.g . chair , table and floor ) . We use the same preprocessing procedures and training settings as the original work .
The paper considers the problem of training networks for point cloud processing through a point cloud completion task. Given a point cloud, it is rendered from a set of viewpoints and for each viewpoint the set of visible points is determine. A network is then trained to generate the full point cloud from the partially observed point cloud for a given view. Here, an encoder-decoder architecture is used, where the encoder corresponds to the network that should be pre-trained. Experimental results show that the proposed method outperforms two baselines for three tasks (object classification, object part segmentation, and semantic segmentation), when using less training data, and that the pre-training on the occlusion task leads to faster convergence.
SP:4673d78e21f98a766c4340809623e54d165f69d9
Quantum Deformed Neural Networks
We develop a new quantum neural network layer designed to run efficiently on a quantum computer but that can be simulated on a classical computer when restricted in the way it entangles input states . We first ask how a classical neural network architecture , both fully connected or convolutional , can be executed on a quantum computer using quantum phase estimation . We then deform the classical layer into a quantum design which entangles activations and weights into quantum superpositions . While the full model would need the exponential speedups delivered by a quantum computer , a restricted class of designs represent interesting new classical network layers that still use quantum features . We show that these quantum deformed neural networks can be trained and executed on normal data such as images , and even classically deliver modest improvements over standard architectures . 1 INTRODUCTION . Quantum mechanics ( QM ) is the most accurate description for physical phenomena at very small scales , such as the behavior of molecules , atoms and subatomic particles . QM has a huge impact on our every day lives through technologies such as lasers , transistors ( and thus microchips ) , superconductors and MRI . A recent view of QM has formulated it as a ( Bayesian ) statistical methodology that only describes our subjective view of the ( quantum ) world , and how we update that view in light of evidence ( i.e . measurements ) ( ; t Hooft , 2016 ; Fuchs & Schack , 2013 ) . This is in perfect analogy to the classical Bayesian view , a statistical paradigm extensively used in artificial intelligence where we maintain probabilities to represent our beliefs for events in the world . The philosophy of this paper will be to turn this argument on its head . If we can view QM as just another consistent statistical theory that happens to describe nature at small scales , then we can also use this theory to describe classical signals by endowing them with a Hilbert space structure . In some sense , the ’ only ’ difference with Bayesian statistics is that the positive probabilities are replaced with complex ’ amplitudes ’ . This however has the dramatic effect that , unlike in classical statistics , interference between events now becomes a possibility . In this paper we show that this point of view uncovers new architectures and potential speedups for running neural networks on quantum computers . We shall restrict our attention here to binary neural networks . We will introduce a new class of quantum neural networks and interpret them as generalizations of probabilistic binary neural networks , discussing potential speedups by running the models on a quantum computer . Then we will devise classically efficient algorithms to train the networks for a restricted set of quantum circuits . We present results of classical simulations of the quantum neural networks on real world data sizes and related gains in accuracy due to the quantum deformations . Contrary to almost all other works on quantum deep learning , our quantum neural networks can be simulated for practical classical problems , such as images or sound . The quantum nature of our models is there to increase the flexibility of the model-class and add new operators to the toolbox of the deep learning researcher , some of which may only reach their full potential when quantum computing becomes ubiquitous . 1.1 RELATED WORK . In Farhi & Neven ( 2018 ) variational quantum circuits that can be learnt via stochastic gradient descent were introduced . Their performance could be studied only on small input tasks such as classifying 4 × 4 images , due to the exponential memory requirement to simulate those circuits . Other works on variational quantum circuits for neural networks are Verdon et al . ( 2018 ) ; Beer et al . ( 2019 ) . Their focus is similarly on the implementation on near term quantum devices and these models can not be efficiently run on a classical computer . Exceptions are models which use tensor network simulations ( Cong et al. , 2019 ; Huggins et al. , 2019 ) where the model can be scaled to 8×8 image data with 2 classes , at the price of constraining the geometry of the quantum circuit ( Huggins et al. , 2019 ) . The quantum deformed neural networks introduced in this paper are instead a class of variational quantum circuits that can be scaled to the size of data that are used in traditional neural networks as we demonstrate in section 4.2 . Another line of work directly uses tensor networks as full precision machine learning models that can be scaled to the size of real data ( Miles Stoudenmire & Schwab , 2016 ; Liu et al. , 2017 ; Levine et al. , 2017 ; Levine et al. , 2019 ) . However the constraints on the network geometry to allow for efficient contractions limit the expressivity and performance of the models . See however Cheng et al . ( 2020 ) for recent promising developments . Further , the tensor networks studied in these works are not unitary maps and do not directly relate to implementations on quantum computers . A large body of work in quantum machine learning focuses on using quantum computing to provide speedups to classical machine learning tasks ( Biamonte et al. , 2017 ; Ciliberto et al. , 2018 ; Wiebe et al. , 2014 ) , culminating in the discovery of quantum inspired speedups in classical algorithms ( Tang , 2019 ) . In particular , ( Allcock et al. , 2018 ; Cao et al. , 2017 ; Schuld et al. , 2015 ; Kerenidis et al. , 2019 ) discuss quantum simulations of classical neural networks with the goal of improving the efficiency of classical models on a quantum computer . Our models differ from these works in two ways : i ) we use quantum wave-functions to model weight uncertainty , in a way that is reminiscent of Bayesian models ; ii ) we design our network layers in a way that may only reach its full potential on a quantum computer due to exponential speedups , but at the same time can , for a restricted class of layer designs , be simulated on a classical computer and provide inspiration for new neural architectures . Finally , quantum methods for accelerating Bayesian inference have been discussed in Zhao et al . ( 2019b ; a ) but only for Gaussian processes while in this work we shall discuss relations to Bayesian neural networks . 2 GENERALIZED PROBABILISTIC BINARY NEURAL NETWORKS . Binary neural networks are neural networks where both weights and activations are binary . Let B = { 0 , 1 } . A fully connected binary neural network layer maps the N ` activations h ( ` ) at level ` to the N ` +1 activations h ( ` +1 ) at level ` + 1 using weights W ( ` ) ∈ BN ` N ` +1 : h ( ` +1 ) j = f ( W ( ` ) , h ( ` ) ) = τ ( 1 N ` + 1 N∑̀ i=1 W ( ` ) j , i h ( ` ) i ) , τ ( x ) = { 0 x < 12 1 x ≥ 12 . ( 1 ) We divide by N ` + 1 since the sum can take the N ` + 1 values { 0 , . . . , N ` } . We do not explicitly consider biases which can be introduced by fixing some activations to 1 . In a classification model h ( 0 ) = x is the input and the last activation function is typically replaced by a softmax which produces output probabilities p ( y|x , W ) , where W denotes the collection of weights of the network . Given M input/output pairs X = ( x1 , . . . , xM ) , Y = ( y1 , . . . , yM ) , a frequentist approach would determine the binary weights so that the likelihood p ( Y |X , W ) = ∏M i=1 p ( yi|xi , W ) is maximized . Here we consider discrete or quantized weights and take the approach of variational optimization Staines & Barber ( 2012 ) , which introduces a weight distribution qθ ( W ) to devise a surrogate differential objective . For an objective O ( W ) , one has the bound maxW∈BN O ( W ) ≥ Eqθ ( W ) [ O ( W ) ] , and the parameters of qθ ( W ) are adjusted to maximize the lower bound . In our case we consider the objective : max W∈BN log p ( Y |X , W ) ≥ L : = Eqθ ( W ) [ log p ( Y |X , W ) ] = M∑ i=1 Eqθ ( W ) [ log p ( yi|xi , W ) ] . ( 2 ) While the optimal solution to equation 2 is a Dirac measure , one can add a regularization termR ( θ ) to keep q soft . In appendix A we review the connection with Bayesian deep learning , where qθ ( W ) is the approximate posterior , R ( θ ) is the KL divergence between qθ ( W ) and the prior over weights , and the objective is derived by maximizing the evidence lower bound . In both variational Bayes and variational optimization frameworks for binary networks , we have a variational distribution q ( W ) and probabilistic layers where activations are random variables . We consider an approximate posterior factorized over the layers : q ( W ) = ∏L ` =1 q ( ` ) ( W ( ` ) ) . If h ( ` ) ∼ p ( ` ) , equation 1 leads to the following recursive definition of distributions : p ( ` +1 ) ( h ( ` +1 ) ) = ∑ h∈BN ` ∑ W∈BN ` N ` +1 δ ( h ( ` +1 ) − f ( W ( ` ) , h ( ` ) ) ) p ( ` ) ( h ( ` ) ) q ( ` ) ( W ( ` ) ) . ( 3 ) We use the shorthand p ( ` ) ( h ( ` ) ) for p ( ` ) ( h ( ` ) |x ) and the x dependence is understood . The average appearing in equation 2 can be written as an average over the network output distribution : Eqθ ( W ) [ log p ( yi|xi , W ) ] = −Ep ( L ) ( h ( L ) ) [ gi ( yi , h ( L ) ) ] , ( 4 ) where the function gi is typically MSE for regression and cross-entropy for classification . In previous works ( Shayer et al. , 2017 ; Peters & Welling , 2018 ) , the approximate posterior was taken to be factorized : q ( W ( ` ) ) = ∏ ij qi , j ( W ( ` ) i , j ) , which results in a factorized activation distribution as well : p ( ` ) ( h ( ` ) ) = ∏ i p ( ` ) i ( h ( ` ) i ) . ( Shayer et al. , 2017 ; Peters & Welling , 2018 ) used the local reparameterization trick Kingma et al . ( 2015 ) to sample activations at each layer . The quantum neural network we introduce below will naturally give a way to sample efficiently from complex distributions and in view of that we here generalize the setting : we act with a stochastic matrix Sφ ( h′ , W ′|h , W ) which depends on parameters φ and correlates the weights and the input activations to a layer as follows : πφ , θ ( h ′ , W ′ ) = ∑ h∈BN ∑ W∈BNM Sφ ( h ′ , W ′|h , W ) p ( h ) qθ ( W ) . ( 5 ) To avoid redundancy , we still take qθ ( W ) to be factorized and let S create correlation among the weights as well . The choice of S will be related to the choice of a unitary matrix D in the quantum circuit of the quantum neural network . A layer is now made of the two operations , Sφ and the layer map f , resulting in the following output distribution : p ( ` +1 ) ( h ( ` +1 ) ) = ∑ h∈BN ` ∑ W∈BN ` N ` +1 δ ( h ( ` +1 ) − f ( W ( ` ) , h ( ` ) ) ) π ( ` ) φ , θ ( h ( ` ) , W ( ` ) ) , ( 6 ) which allows one to compute the network output recursively . Both the parameters φ and θ will be learned to solve the following optimization problem : min θ , φ R ( θ ) +R′ ( φ ) − L . ( 7 ) whereR ( θ ) , R′ ( φ ) are regularization terms for the parameters θ , φ . We call this model a generalized probabilistic binary neural network , with φ deformation parameters chosen such that φ = 0 gives back the standard probabilistic binary neural network . To study this model on a classical computer we need to choose S which leads to an efficient sampling algorithm for πφ , θ . In general , one could use Markov Chain Monte Carlo , but there exists situations for which the mixing time of the chain grows exponentially in the size of the problem ( Levin & Peres , 2017 ) . In the next section we will show how quantum mechanics can enlarge the set of probabilistic binary neural networks that can be efficiently executed and in the subsequent sections we will show experimental results for a restricted class of correlated distributions inspired by quantum circuits that can be simulated classically .
The authors introduced the idea of quantum deformed neural network (DQNN) which allows substitution of the positive probabilities in Baysian statistics with complex amplitude inspired by Born representation of quantum wavefunction, thus allowing interference phenomena leading to possible speed up for running neural networks on quantum computers. Combining the complex amplitude and binary neural network the author introduces a new class of quantum neural networks which are the generalized probabilistic neural network. Then, they argue that this class of DQNN can efficiently run on quantum computers using phase estimation algorithms which scale linearly with the number of qubits. By creating entanglement between the activation and weights they show that this new form of DQNN can be simulated on classical computers for certain classes of problems that hold low entanglement. As a numerical experiment they show modest gain in accuracy on real world data both MNIST and fashion MNITS data.
SP:efef763fd83336660ba89b2070325cca5b989fe4
Quantum Deformed Neural Networks
We develop a new quantum neural network layer designed to run efficiently on a quantum computer but that can be simulated on a classical computer when restricted in the way it entangles input states . We first ask how a classical neural network architecture , both fully connected or convolutional , can be executed on a quantum computer using quantum phase estimation . We then deform the classical layer into a quantum design which entangles activations and weights into quantum superpositions . While the full model would need the exponential speedups delivered by a quantum computer , a restricted class of designs represent interesting new classical network layers that still use quantum features . We show that these quantum deformed neural networks can be trained and executed on normal data such as images , and even classically deliver modest improvements over standard architectures . 1 INTRODUCTION . Quantum mechanics ( QM ) is the most accurate description for physical phenomena at very small scales , such as the behavior of molecules , atoms and subatomic particles . QM has a huge impact on our every day lives through technologies such as lasers , transistors ( and thus microchips ) , superconductors and MRI . A recent view of QM has formulated it as a ( Bayesian ) statistical methodology that only describes our subjective view of the ( quantum ) world , and how we update that view in light of evidence ( i.e . measurements ) ( ; t Hooft , 2016 ; Fuchs & Schack , 2013 ) . This is in perfect analogy to the classical Bayesian view , a statistical paradigm extensively used in artificial intelligence where we maintain probabilities to represent our beliefs for events in the world . The philosophy of this paper will be to turn this argument on its head . If we can view QM as just another consistent statistical theory that happens to describe nature at small scales , then we can also use this theory to describe classical signals by endowing them with a Hilbert space structure . In some sense , the ’ only ’ difference with Bayesian statistics is that the positive probabilities are replaced with complex ’ amplitudes ’ . This however has the dramatic effect that , unlike in classical statistics , interference between events now becomes a possibility . In this paper we show that this point of view uncovers new architectures and potential speedups for running neural networks on quantum computers . We shall restrict our attention here to binary neural networks . We will introduce a new class of quantum neural networks and interpret them as generalizations of probabilistic binary neural networks , discussing potential speedups by running the models on a quantum computer . Then we will devise classically efficient algorithms to train the networks for a restricted set of quantum circuits . We present results of classical simulations of the quantum neural networks on real world data sizes and related gains in accuracy due to the quantum deformations . Contrary to almost all other works on quantum deep learning , our quantum neural networks can be simulated for practical classical problems , such as images or sound . The quantum nature of our models is there to increase the flexibility of the model-class and add new operators to the toolbox of the deep learning researcher , some of which may only reach their full potential when quantum computing becomes ubiquitous . 1.1 RELATED WORK . In Farhi & Neven ( 2018 ) variational quantum circuits that can be learnt via stochastic gradient descent were introduced . Their performance could be studied only on small input tasks such as classifying 4 × 4 images , due to the exponential memory requirement to simulate those circuits . Other works on variational quantum circuits for neural networks are Verdon et al . ( 2018 ) ; Beer et al . ( 2019 ) . Their focus is similarly on the implementation on near term quantum devices and these models can not be efficiently run on a classical computer . Exceptions are models which use tensor network simulations ( Cong et al. , 2019 ; Huggins et al. , 2019 ) where the model can be scaled to 8×8 image data with 2 classes , at the price of constraining the geometry of the quantum circuit ( Huggins et al. , 2019 ) . The quantum deformed neural networks introduced in this paper are instead a class of variational quantum circuits that can be scaled to the size of data that are used in traditional neural networks as we demonstrate in section 4.2 . Another line of work directly uses tensor networks as full precision machine learning models that can be scaled to the size of real data ( Miles Stoudenmire & Schwab , 2016 ; Liu et al. , 2017 ; Levine et al. , 2017 ; Levine et al. , 2019 ) . However the constraints on the network geometry to allow for efficient contractions limit the expressivity and performance of the models . See however Cheng et al . ( 2020 ) for recent promising developments . Further , the tensor networks studied in these works are not unitary maps and do not directly relate to implementations on quantum computers . A large body of work in quantum machine learning focuses on using quantum computing to provide speedups to classical machine learning tasks ( Biamonte et al. , 2017 ; Ciliberto et al. , 2018 ; Wiebe et al. , 2014 ) , culminating in the discovery of quantum inspired speedups in classical algorithms ( Tang , 2019 ) . In particular , ( Allcock et al. , 2018 ; Cao et al. , 2017 ; Schuld et al. , 2015 ; Kerenidis et al. , 2019 ) discuss quantum simulations of classical neural networks with the goal of improving the efficiency of classical models on a quantum computer . Our models differ from these works in two ways : i ) we use quantum wave-functions to model weight uncertainty , in a way that is reminiscent of Bayesian models ; ii ) we design our network layers in a way that may only reach its full potential on a quantum computer due to exponential speedups , but at the same time can , for a restricted class of layer designs , be simulated on a classical computer and provide inspiration for new neural architectures . Finally , quantum methods for accelerating Bayesian inference have been discussed in Zhao et al . ( 2019b ; a ) but only for Gaussian processes while in this work we shall discuss relations to Bayesian neural networks . 2 GENERALIZED PROBABILISTIC BINARY NEURAL NETWORKS . Binary neural networks are neural networks where both weights and activations are binary . Let B = { 0 , 1 } . A fully connected binary neural network layer maps the N ` activations h ( ` ) at level ` to the N ` +1 activations h ( ` +1 ) at level ` + 1 using weights W ( ` ) ∈ BN ` N ` +1 : h ( ` +1 ) j = f ( W ( ` ) , h ( ` ) ) = τ ( 1 N ` + 1 N∑̀ i=1 W ( ` ) j , i h ( ` ) i ) , τ ( x ) = { 0 x < 12 1 x ≥ 12 . ( 1 ) We divide by N ` + 1 since the sum can take the N ` + 1 values { 0 , . . . , N ` } . We do not explicitly consider biases which can be introduced by fixing some activations to 1 . In a classification model h ( 0 ) = x is the input and the last activation function is typically replaced by a softmax which produces output probabilities p ( y|x , W ) , where W denotes the collection of weights of the network . Given M input/output pairs X = ( x1 , . . . , xM ) , Y = ( y1 , . . . , yM ) , a frequentist approach would determine the binary weights so that the likelihood p ( Y |X , W ) = ∏M i=1 p ( yi|xi , W ) is maximized . Here we consider discrete or quantized weights and take the approach of variational optimization Staines & Barber ( 2012 ) , which introduces a weight distribution qθ ( W ) to devise a surrogate differential objective . For an objective O ( W ) , one has the bound maxW∈BN O ( W ) ≥ Eqθ ( W ) [ O ( W ) ] , and the parameters of qθ ( W ) are adjusted to maximize the lower bound . In our case we consider the objective : max W∈BN log p ( Y |X , W ) ≥ L : = Eqθ ( W ) [ log p ( Y |X , W ) ] = M∑ i=1 Eqθ ( W ) [ log p ( yi|xi , W ) ] . ( 2 ) While the optimal solution to equation 2 is a Dirac measure , one can add a regularization termR ( θ ) to keep q soft . In appendix A we review the connection with Bayesian deep learning , where qθ ( W ) is the approximate posterior , R ( θ ) is the KL divergence between qθ ( W ) and the prior over weights , and the objective is derived by maximizing the evidence lower bound . In both variational Bayes and variational optimization frameworks for binary networks , we have a variational distribution q ( W ) and probabilistic layers where activations are random variables . We consider an approximate posterior factorized over the layers : q ( W ) = ∏L ` =1 q ( ` ) ( W ( ` ) ) . If h ( ` ) ∼ p ( ` ) , equation 1 leads to the following recursive definition of distributions : p ( ` +1 ) ( h ( ` +1 ) ) = ∑ h∈BN ` ∑ W∈BN ` N ` +1 δ ( h ( ` +1 ) − f ( W ( ` ) , h ( ` ) ) ) p ( ` ) ( h ( ` ) ) q ( ` ) ( W ( ` ) ) . ( 3 ) We use the shorthand p ( ` ) ( h ( ` ) ) for p ( ` ) ( h ( ` ) |x ) and the x dependence is understood . The average appearing in equation 2 can be written as an average over the network output distribution : Eqθ ( W ) [ log p ( yi|xi , W ) ] = −Ep ( L ) ( h ( L ) ) [ gi ( yi , h ( L ) ) ] , ( 4 ) where the function gi is typically MSE for regression and cross-entropy for classification . In previous works ( Shayer et al. , 2017 ; Peters & Welling , 2018 ) , the approximate posterior was taken to be factorized : q ( W ( ` ) ) = ∏ ij qi , j ( W ( ` ) i , j ) , which results in a factorized activation distribution as well : p ( ` ) ( h ( ` ) ) = ∏ i p ( ` ) i ( h ( ` ) i ) . ( Shayer et al. , 2017 ; Peters & Welling , 2018 ) used the local reparameterization trick Kingma et al . ( 2015 ) to sample activations at each layer . The quantum neural network we introduce below will naturally give a way to sample efficiently from complex distributions and in view of that we here generalize the setting : we act with a stochastic matrix Sφ ( h′ , W ′|h , W ) which depends on parameters φ and correlates the weights and the input activations to a layer as follows : πφ , θ ( h ′ , W ′ ) = ∑ h∈BN ∑ W∈BNM Sφ ( h ′ , W ′|h , W ) p ( h ) qθ ( W ) . ( 5 ) To avoid redundancy , we still take qθ ( W ) to be factorized and let S create correlation among the weights as well . The choice of S will be related to the choice of a unitary matrix D in the quantum circuit of the quantum neural network . A layer is now made of the two operations , Sφ and the layer map f , resulting in the following output distribution : p ( ` +1 ) ( h ( ` +1 ) ) = ∑ h∈BN ` ∑ W∈BN ` N ` +1 δ ( h ( ` +1 ) − f ( W ( ` ) , h ( ` ) ) ) π ( ` ) φ , θ ( h ( ` ) , W ( ` ) ) , ( 6 ) which allows one to compute the network output recursively . Both the parameters φ and θ will be learned to solve the following optimization problem : min θ , φ R ( θ ) +R′ ( φ ) − L . ( 7 ) whereR ( θ ) , R′ ( φ ) are regularization terms for the parameters θ , φ . We call this model a generalized probabilistic binary neural network , with φ deformation parameters chosen such that φ = 0 gives back the standard probabilistic binary neural network . To study this model on a classical computer we need to choose S which leads to an efficient sampling algorithm for πφ , θ . In general , one could use Markov Chain Monte Carlo , but there exists situations for which the mixing time of the chain grows exponentially in the size of the problem ( Levin & Peres , 2017 ) . In the next section we will show how quantum mechanics can enlarge the set of probabilistic binary neural networks that can be efficiently executed and in the subsequent sections we will show experimental results for a restricted class of correlated distributions inspired by quantum circuits that can be simulated classically .
The fundamental idea in this paper is to endow classical signals with a complex Hilberspace structure so as to harness the probabilistic nature of quantum mechaniscs for pattern recognition based on quantum computing principles. Following this idea, the authors consider (probabiistic) binary neural networks and develop a corresponding kind of quantum neural networks building on the concept of quantum phase estimation. They (convincingly) argue that this idea would make good use of the exponential speedup offered by quantum computers but can still be implemented on classical, digital devices. Experiments with image data corroborate this claim and demonstrate that simulations of the proposed quantum deformation showed improved accuracies when compared to classical probabilistic binary neural networks.
SP:efef763fd83336660ba89b2070325cca5b989fe4
Attention-driven Robotic Manipulation
1 INTRODUCTION . Despite their potential , continuous-control reinforcement learning ( RL ) algorithms have many flaws : they are notoriously data hungry , often fail with sparse rewards , and struggle with long-horizon tasks . The algorithms for both discrete and continuous RL are almost always evaluated on benchmarks that give shaped rewards ( Brockman et al. , 2016 ; Tassa et al. , 2018 ) , a privilege that is not feasible for training real-world robotic application across a broad range of tasks . Motivated by the observation that humans focus their gaze close to objects being manipulated ( Land et al. , 1999 ) , we propose an Attention-driven Robotic Manipulation ( ARM ) algorithm that consists of a series of algorithmagnostic components , that when combined , results in a method that is able to perform a range of challenging , sparsely-rewarded manipulation tasks . Our algorithm operates through a pipeline of modules : our novel Q-attention module first extracts interesting pixel locations from RGB and point cloud inputs by treating images as an environment , and pixel locations as actions . Using the pixel locations we crop the RGB and point cloud inputs , significantly reducing input size , and feed this to a next-best-pose continuous-control agent that outputs 6D poses , which is trained with our novel confidence-aware critic . These goal poses are then used by a control algorithm that continuously outputs motor velocities . As is common with sparsely-rewarded tasks , we improve initial exploration through the use of demonstrations . However , rather than simply inserting these directly into the replay buffer , we use a keyframe discovery strategy that chooses interesting keyframes along demonstration trajectories that is fundamental to training our Q-attention module . Rather than storing the transition from an initial state to a keyframe state , we use our demo augmentation method which also stores the transition from intermediate points along a trajectories to the keyframe states ; thus greatly increasing the proportion of initial demo transitions in the replay buffer . All of these improvements result in an algorithm that starkly outperforms other state-of-the-art methods when evaluated on 10 RLBench ( James et al. , 2020 ) tasks ( Figure 1 ) that range in difficulty . To summarise , we propose the following contributions : ( 1 ) An off-policy hard attention mechanism that is learned via Q-Learning , rather than the on-policy hard attention and soft attention that is commonly seen in the NLP and vision community ; ( 2 ) A confidence-aware Q function that predicts pixel-wise Q values and confidence values , resulting in improved convergence times ; ( 3 ) A keyframe discovery strategy and demo augmentation method that go hand-in-hand to improve the utilisation of demonstrations in RL . 2 RELATED WORK . The use of reinforcement learning ( RL ) is prevalent in many areas of robotics , including legged robots ( Kohl & Stone , 2004 ; Hwangbo et al. , 2019 ) , aerial vehicles ( Sadeghi & Levine , 2017 ) , and manipulation tasks , such as pushing ( Finn & Levine , 2017 ) , peg insertion ( Levine et al. , 2016 ; Zeng et al. , 2018 ; Lee et al. , 2019 ) , throwing ( Ghadirzadeh et al. , 2017 ; Zeng et al. , 2020 ) , ballin-cup ( Kober & Peters , 2009 ) , cloth manipulation ( Matas et al. , 2018 ) , and grasping ( Kalashnikov et al. , 2018 ; James et al. , 2019b ) . Despite the abundance of work in this area , there has yet to be a general manipulation method that can tackle a range of challenging , sparsely-rewarded tasks without needing access to privileged simulation-only abilities ( e.g . reset to demonstrations ( Nair et al. , 2018 ) , asymmetric actor-critic ( Pinto et al. , 2018 ) , reward shaping ( Rajeswaran et al. , 2018 ) , and auxiliary tasks ( James et al. , 2017 ) ) . Crucial to our method is the proposed Q-attention . Soft and hard attention are prominent methods in both natural language processing ( NLP ) ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and computer vision ( Xu et al. , 2015 ; Zhang et al. , 2019 ) . Soft attention deterministically multiplies an attention map over the image feature map , whilst hard attention uses the attention map stochastically to sample one or a few features on the feature map ( which is optimised by maximising an approximate variational lower bound or equivalently via ( on-policy ) REINFORCE ( Williams , 1992 ) ) . Given that we perform non-differentiable cropping , our Q-attention is closest to hard attention , but with the distinction that we learn this in an off-policy way . This is key , as ‘ traditional ’ hard attention is unable to be used in an off-policy setting . We therefore see Q-attention as an off-policy hard attention . We elaborate further on these differences in Section 4.1 . Our proposed confidence-aware critic ( used to train the next-best pose agent ) takes its inspiration from the pose estimation community ( Wang et al. , 2019 ; Wada et al. , 2020 ) . There exists a small amount of work in estimating uncertainty with Q-learning in discrete domains ( Clements et al. , 2019 ; Hoel et al. , 2020 ) ; our work uses a continuous Q-function to predict both Q and confidence values for each pixel , which lead to improved stability when training , and is not used during action selection . Our approach makes use of demonstrations , which has been applied in a number of works ( Vecerik et al. , 2017 ; Matas et al. , 2018 ; Kalashnikov et al. , 2018 ; Nair et al. , 2018 ) , but while successful , they make limited use of the demonstrations and still can take many samples to converge . Rather than simply inserting these directly into the replay buffer , we instead make sure of our keyframe discovery and demo augmentation to maximise demonstration utility . 3 BACKGROUND . The reinforcement learning paradigm assumes an agent interacting with an environment consisting of states s ∈ S , actions a ∈ A , and a reward function R ( st , at ) , where st and at are the state and action at time step t respectively . The goal of the agent is then to discover a policy π that results in maximising the expectation of the sum of discounted rewards : Eπ [ ∑ t γ tR ( st , at ) ] , where future rewards are weighted with respect to the discount factor γ ∈ [ 0 , 1 ) . Each policy π has a corresponding value function Q ( s , a ) , which represents the expected return when following the policy after taking action a in state s. Our Q-attention module builds from Deep Q-learning ( Mnih et al. , 2015 ) , a method that approximated the value function Qθ , with a deep convolutional network , whose parameters θ are optimised by sampling mini-batches from a replay buffer D and using stochastic gradient descent to minimise the loss : E ( st , at , st+1 ) ∼D [ ( r + γmaxa′Qθ′ ( st+1 , a′ ) − Qθ ( st , at ) ) 2 ] , where Qθ′ is a target network ; a periodic copy of the online network Qθ which is not directly optimised . Our next-best pose agent builds upon SAC ( Haarnoja et al. , 2018 ) , however , the agent is compatible with any off-policy , continuous-control RL algorithm . SAC is a maximum entropy RL algorithm that , in addition to maximising the sum of rewards , also maximises the entropy of a policy : Eπ [ ∑ t γ t [ R ( st , at ) +αH ( π ( ·|st ) ) ] ] , where α is a temperature parameter that determines the relative importance between the entropy and reward . The goal then becomes to maximise a soft Q-function by minimising the following Bellman residual : JQ ( θ ) = E ( st , at , st+1 ) ∼D [ ( ( r+ γQθ′ ( st+1 , πφ ( st+1 ) ) − α log πφ ( at|st ) ) −Qθ ( st , at ) ) 2 ] . ( 1 ) The policy is updated towards the Boltzmann policy with temperature α , with the Q-function taking the role of ( negative ) energy . Specifically , the goal is to minimise the Kullback-Leibler divergence between the policy and the Boltzman policy : πnew = arg min π′∈Π DKL ( π′ ( ·|st ) ‖ 1 α exp ( Q πold ( st , · ) ) Zπold ( st ) ) . ( 2 ) Minimising the expected KL-divergence to learn the policy parameters was shown to be equivalent to maximising the expected value of the soft Qfunction : Jπ ( φ ) = E st∼D [ E a∼πφ [ α log ( πφ ( at|st ) ) −Qπρ ( st , at ) ] ] . ( 3 ) 4 METHOD . Our method can be split into a 3-phase pipeline . Phase 1 ( Section 4.1 ) consists of a high-level pixel agent that selects areas of interest using our novel Q-attention module . Phase 2 ( Section 4.2 ) consists of a next-best pose prediction phase where the pixel location from the previous phase is used to crop the incoming observations and then predict a 6D pose . Finally , phase 3 ( Section 4.3 ) is a low-level control agent that accepts the predicted next-best pose and executes a series of actions to reach the given goal . Before training , we fill the replay buffer with demonstrations using our keyframe discovery and demo augmentation strategy ( Section 4.4 ) that significantly improves training speed . The full pipeline is summarised in Figure 2 and Algorithm 1 . All experiments are run in RLBench ( James et al. , 2020 ) , a large-scale benchmark and learning environment for vision-guided manipulation built around CoppeliaSim ( Rohmer et al. , 2013 ) and PyRep ( James et al. , 2019a ) . At each time step , we extract an observation from the front-facing camera that consists of an RGB image b and a depth image d , along with proprioceptive information z from the arm ( consisting of end-effector pose and gripper open/close state ) . Using known camera intrinsics and extrinsics , we process each depth image to produce a point cloud p ( in world coordinates ) projected from the view of the front-facing camera , producing a ( H ×W × 3 ) ‘ image ’ . 4.1 Q-ATTENTION . Motivated by the role of vision and eye movement in the control of human activities ( Land et al. , 1999 ) , we propose a Q-attention module that , given RGB and organised point cloud inputs , outputs 2D pixel locations of the next area of interest . With these pixel locations , we crop the RGB and organised point cloud inputs and thus drastically reduce the input size to the next stage of the pipeline . Our Q-attention is explicitly learned via Q-learning , where images are treated as the ‘ environment ’ , and pixel locations are treated as the ‘ actions ’ . Given our Q-attention function QAθ , we extract the coordinates of pixels with the highest value : ( xt , yt ) = argmax2D a′ QAθ ( st , a ′ ) . ( 4 ) The parameters of the Q-attention are optimised by using stochastic gradient descent to minimise the loss : JQA ( θ ) = E ( st , at , st+1 ) ∼D [ ( r+ γmax2D a′ QAθ′ ( st+1 , a ′ ) −QAθ ( st , at ) ) 2 + ‖QA‖ ] , ( 5 ) where s = ( b , p ) , QAθ′ is the target Q-function , and ‖QA‖ is an L2 loss on the per-pixel output of the Q function ( which we call Q regularisation ) ; in practice , we found that this leads to increased robustness against the common problem of overestimation of Q values . The Q-attention network follows a light-weight U-Net style architecture ( Ronneberger et al. , 2015 ) , which is summarised in Figure 2 . Example per-pixel outputs of the Q-attention are shown in Figure 3 . With the suggested coordinates from Q-attention , we perform a ( 16 × 16 ) crop on both the ( 128 × 128 ) RGB and organised point cloud data : b′ , p′ = crop ( b , p , ( x , y ) ) . Notably , there is no explicit reward for choosing a pixel , but instead an implicit reward that comes from the output of the method pipeline as a whole ( i.e . the same reward signal is used to train both the Q-attention and the next-best pose agent ) . This leads to a cyclic dependency between the two agents : the lower-level next-best pose agent relies on receiving good crops from the Q-attention agent , whilst the Q-attention agent needs the next-best pose agent to perform well in order to get its implicit reward . This is where delicate handling of demonstrations is key , which we discuss in Section 4.4 . The module shares similar human-inspired motivation to the attention seen in NLP ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and computer vision ( Xu et al. , 2015 ; Zhang et al. , 2019 ) , but differs in its formulation . Soft attention multiplies an attention map over the image feature map , whilst hard attention uses the attention map to sample one or a few features on the feature maps or inputs . Given that we perform non-differentiable cropping , we categorise our Q-attention as hard attention , but with 2 core differences : ( 1 ) most importantly , ‘ traditional ’ hard attention is optimised ( on-policy ) by maximising an approximate variational lower bound or equivalently via REINFORCE ( Williams , 1992 ) , whereas our Q-attention is trained off-policy ; this is crucial because our demonstration data , by definition , is off-policy , and therefore renders existing hard attention approaches unusable for demonstration-driven RL . ( 2 ) The output of ‘ traditional ’ hard attention carry different semantics : a score function in the case of REINFORCE hard attention , and Q-value ( expected cumulative reward of choosing that crop ) in the case of Q-attention .
This work focuses on sparse-reward robotic manipulation tasks from image and point cloud inputs, given a few demonstrations, and proposes an algorithm that consists of a Q-attention module and a confidence-aware critic. The Q-attention module is an RL agent, which takes image and point cloud inputs with pixel positions as actions. The image and point cloud observations are then cropped, centered at this pixel position output, and passed down the pipeline to the critic. To make the best use of the demonstrations, the replay buffer is initialized with the demonstrations and further augmented with transitions from demo states, chosen through a keyframe selection process.
SP:ef1d9ed2d961186f3bcc7bcb6f58cdd9fa57ecca
Attention-driven Robotic Manipulation
1 INTRODUCTION . Despite their potential , continuous-control reinforcement learning ( RL ) algorithms have many flaws : they are notoriously data hungry , often fail with sparse rewards , and struggle with long-horizon tasks . The algorithms for both discrete and continuous RL are almost always evaluated on benchmarks that give shaped rewards ( Brockman et al. , 2016 ; Tassa et al. , 2018 ) , a privilege that is not feasible for training real-world robotic application across a broad range of tasks . Motivated by the observation that humans focus their gaze close to objects being manipulated ( Land et al. , 1999 ) , we propose an Attention-driven Robotic Manipulation ( ARM ) algorithm that consists of a series of algorithmagnostic components , that when combined , results in a method that is able to perform a range of challenging , sparsely-rewarded manipulation tasks . Our algorithm operates through a pipeline of modules : our novel Q-attention module first extracts interesting pixel locations from RGB and point cloud inputs by treating images as an environment , and pixel locations as actions . Using the pixel locations we crop the RGB and point cloud inputs , significantly reducing input size , and feed this to a next-best-pose continuous-control agent that outputs 6D poses , which is trained with our novel confidence-aware critic . These goal poses are then used by a control algorithm that continuously outputs motor velocities . As is common with sparsely-rewarded tasks , we improve initial exploration through the use of demonstrations . However , rather than simply inserting these directly into the replay buffer , we use a keyframe discovery strategy that chooses interesting keyframes along demonstration trajectories that is fundamental to training our Q-attention module . Rather than storing the transition from an initial state to a keyframe state , we use our demo augmentation method which also stores the transition from intermediate points along a trajectories to the keyframe states ; thus greatly increasing the proportion of initial demo transitions in the replay buffer . All of these improvements result in an algorithm that starkly outperforms other state-of-the-art methods when evaluated on 10 RLBench ( James et al. , 2020 ) tasks ( Figure 1 ) that range in difficulty . To summarise , we propose the following contributions : ( 1 ) An off-policy hard attention mechanism that is learned via Q-Learning , rather than the on-policy hard attention and soft attention that is commonly seen in the NLP and vision community ; ( 2 ) A confidence-aware Q function that predicts pixel-wise Q values and confidence values , resulting in improved convergence times ; ( 3 ) A keyframe discovery strategy and demo augmentation method that go hand-in-hand to improve the utilisation of demonstrations in RL . 2 RELATED WORK . The use of reinforcement learning ( RL ) is prevalent in many areas of robotics , including legged robots ( Kohl & Stone , 2004 ; Hwangbo et al. , 2019 ) , aerial vehicles ( Sadeghi & Levine , 2017 ) , and manipulation tasks , such as pushing ( Finn & Levine , 2017 ) , peg insertion ( Levine et al. , 2016 ; Zeng et al. , 2018 ; Lee et al. , 2019 ) , throwing ( Ghadirzadeh et al. , 2017 ; Zeng et al. , 2020 ) , ballin-cup ( Kober & Peters , 2009 ) , cloth manipulation ( Matas et al. , 2018 ) , and grasping ( Kalashnikov et al. , 2018 ; James et al. , 2019b ) . Despite the abundance of work in this area , there has yet to be a general manipulation method that can tackle a range of challenging , sparsely-rewarded tasks without needing access to privileged simulation-only abilities ( e.g . reset to demonstrations ( Nair et al. , 2018 ) , asymmetric actor-critic ( Pinto et al. , 2018 ) , reward shaping ( Rajeswaran et al. , 2018 ) , and auxiliary tasks ( James et al. , 2017 ) ) . Crucial to our method is the proposed Q-attention . Soft and hard attention are prominent methods in both natural language processing ( NLP ) ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and computer vision ( Xu et al. , 2015 ; Zhang et al. , 2019 ) . Soft attention deterministically multiplies an attention map over the image feature map , whilst hard attention uses the attention map stochastically to sample one or a few features on the feature map ( which is optimised by maximising an approximate variational lower bound or equivalently via ( on-policy ) REINFORCE ( Williams , 1992 ) ) . Given that we perform non-differentiable cropping , our Q-attention is closest to hard attention , but with the distinction that we learn this in an off-policy way . This is key , as ‘ traditional ’ hard attention is unable to be used in an off-policy setting . We therefore see Q-attention as an off-policy hard attention . We elaborate further on these differences in Section 4.1 . Our proposed confidence-aware critic ( used to train the next-best pose agent ) takes its inspiration from the pose estimation community ( Wang et al. , 2019 ; Wada et al. , 2020 ) . There exists a small amount of work in estimating uncertainty with Q-learning in discrete domains ( Clements et al. , 2019 ; Hoel et al. , 2020 ) ; our work uses a continuous Q-function to predict both Q and confidence values for each pixel , which lead to improved stability when training , and is not used during action selection . Our approach makes use of demonstrations , which has been applied in a number of works ( Vecerik et al. , 2017 ; Matas et al. , 2018 ; Kalashnikov et al. , 2018 ; Nair et al. , 2018 ) , but while successful , they make limited use of the demonstrations and still can take many samples to converge . Rather than simply inserting these directly into the replay buffer , we instead make sure of our keyframe discovery and demo augmentation to maximise demonstration utility . 3 BACKGROUND . The reinforcement learning paradigm assumes an agent interacting with an environment consisting of states s ∈ S , actions a ∈ A , and a reward function R ( st , at ) , where st and at are the state and action at time step t respectively . The goal of the agent is then to discover a policy π that results in maximising the expectation of the sum of discounted rewards : Eπ [ ∑ t γ tR ( st , at ) ] , where future rewards are weighted with respect to the discount factor γ ∈ [ 0 , 1 ) . Each policy π has a corresponding value function Q ( s , a ) , which represents the expected return when following the policy after taking action a in state s. Our Q-attention module builds from Deep Q-learning ( Mnih et al. , 2015 ) , a method that approximated the value function Qθ , with a deep convolutional network , whose parameters θ are optimised by sampling mini-batches from a replay buffer D and using stochastic gradient descent to minimise the loss : E ( st , at , st+1 ) ∼D [ ( r + γmaxa′Qθ′ ( st+1 , a′ ) − Qθ ( st , at ) ) 2 ] , where Qθ′ is a target network ; a periodic copy of the online network Qθ which is not directly optimised . Our next-best pose agent builds upon SAC ( Haarnoja et al. , 2018 ) , however , the agent is compatible with any off-policy , continuous-control RL algorithm . SAC is a maximum entropy RL algorithm that , in addition to maximising the sum of rewards , also maximises the entropy of a policy : Eπ [ ∑ t γ t [ R ( st , at ) +αH ( π ( ·|st ) ) ] ] , where α is a temperature parameter that determines the relative importance between the entropy and reward . The goal then becomes to maximise a soft Q-function by minimising the following Bellman residual : JQ ( θ ) = E ( st , at , st+1 ) ∼D [ ( ( r+ γQθ′ ( st+1 , πφ ( st+1 ) ) − α log πφ ( at|st ) ) −Qθ ( st , at ) ) 2 ] . ( 1 ) The policy is updated towards the Boltzmann policy with temperature α , with the Q-function taking the role of ( negative ) energy . Specifically , the goal is to minimise the Kullback-Leibler divergence between the policy and the Boltzman policy : πnew = arg min π′∈Π DKL ( π′ ( ·|st ) ‖ 1 α exp ( Q πold ( st , · ) ) Zπold ( st ) ) . ( 2 ) Minimising the expected KL-divergence to learn the policy parameters was shown to be equivalent to maximising the expected value of the soft Qfunction : Jπ ( φ ) = E st∼D [ E a∼πφ [ α log ( πφ ( at|st ) ) −Qπρ ( st , at ) ] ] . ( 3 ) 4 METHOD . Our method can be split into a 3-phase pipeline . Phase 1 ( Section 4.1 ) consists of a high-level pixel agent that selects areas of interest using our novel Q-attention module . Phase 2 ( Section 4.2 ) consists of a next-best pose prediction phase where the pixel location from the previous phase is used to crop the incoming observations and then predict a 6D pose . Finally , phase 3 ( Section 4.3 ) is a low-level control agent that accepts the predicted next-best pose and executes a series of actions to reach the given goal . Before training , we fill the replay buffer with demonstrations using our keyframe discovery and demo augmentation strategy ( Section 4.4 ) that significantly improves training speed . The full pipeline is summarised in Figure 2 and Algorithm 1 . All experiments are run in RLBench ( James et al. , 2020 ) , a large-scale benchmark and learning environment for vision-guided manipulation built around CoppeliaSim ( Rohmer et al. , 2013 ) and PyRep ( James et al. , 2019a ) . At each time step , we extract an observation from the front-facing camera that consists of an RGB image b and a depth image d , along with proprioceptive information z from the arm ( consisting of end-effector pose and gripper open/close state ) . Using known camera intrinsics and extrinsics , we process each depth image to produce a point cloud p ( in world coordinates ) projected from the view of the front-facing camera , producing a ( H ×W × 3 ) ‘ image ’ . 4.1 Q-ATTENTION . Motivated by the role of vision and eye movement in the control of human activities ( Land et al. , 1999 ) , we propose a Q-attention module that , given RGB and organised point cloud inputs , outputs 2D pixel locations of the next area of interest . With these pixel locations , we crop the RGB and organised point cloud inputs and thus drastically reduce the input size to the next stage of the pipeline . Our Q-attention is explicitly learned via Q-learning , where images are treated as the ‘ environment ’ , and pixel locations are treated as the ‘ actions ’ . Given our Q-attention function QAθ , we extract the coordinates of pixels with the highest value : ( xt , yt ) = argmax2D a′ QAθ ( st , a ′ ) . ( 4 ) The parameters of the Q-attention are optimised by using stochastic gradient descent to minimise the loss : JQA ( θ ) = E ( st , at , st+1 ) ∼D [ ( r+ γmax2D a′ QAθ′ ( st+1 , a ′ ) −QAθ ( st , at ) ) 2 + ‖QA‖ ] , ( 5 ) where s = ( b , p ) , QAθ′ is the target Q-function , and ‖QA‖ is an L2 loss on the per-pixel output of the Q function ( which we call Q regularisation ) ; in practice , we found that this leads to increased robustness against the common problem of overestimation of Q values . The Q-attention network follows a light-weight U-Net style architecture ( Ronneberger et al. , 2015 ) , which is summarised in Figure 2 . Example per-pixel outputs of the Q-attention are shown in Figure 3 . With the suggested coordinates from Q-attention , we perform a ( 16 × 16 ) crop on both the ( 128 × 128 ) RGB and organised point cloud data : b′ , p′ = crop ( b , p , ( x , y ) ) . Notably , there is no explicit reward for choosing a pixel , but instead an implicit reward that comes from the output of the method pipeline as a whole ( i.e . the same reward signal is used to train both the Q-attention and the next-best pose agent ) . This leads to a cyclic dependency between the two agents : the lower-level next-best pose agent relies on receiving good crops from the Q-attention agent , whilst the Q-attention agent needs the next-best pose agent to perform well in order to get its implicit reward . This is where delicate handling of demonstrations is key , which we discuss in Section 4.4 . The module shares similar human-inspired motivation to the attention seen in NLP ( Bahdanau et al. , 2015 ; Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and computer vision ( Xu et al. , 2015 ; Zhang et al. , 2019 ) , but differs in its formulation . Soft attention multiplies an attention map over the image feature map , whilst hard attention uses the attention map to sample one or a few features on the feature maps or inputs . Given that we perform non-differentiable cropping , we categorise our Q-attention as hard attention , but with 2 core differences : ( 1 ) most importantly , ‘ traditional ’ hard attention is optimised ( on-policy ) by maximising an approximate variational lower bound or equivalently via REINFORCE ( Williams , 1992 ) , whereas our Q-attention is trained off-policy ; this is crucial because our demonstration data , by definition , is off-policy , and therefore renders existing hard attention approaches unusable for demonstration-driven RL . ( 2 ) The output of ‘ traditional ’ hard attention carry different semantics : a score function in the case of REINFORCE hard attention , and Q-value ( expected cumulative reward of choosing that crop ) in the case of Q-attention .
Motivated by the fact that RL algorithms are notoriously sample inefficient from pixels and that humans use attention, the authors propose Attention-driven Robotic Manipulation (ARM), which they claim can be applied to several robotics tasks without prior task knowledge. Compared to current methods which fail to train, ARM trains in only a few hours and is successful at the end manipulation tasks. The authors’ main algorithmic improvements with ARM include 1) a Q-attention agent that extracts interesting pixel locations with an explicit attention module, 2) a confidence-aware critic that leads to increased stability of training, and 3) a data augmentation strategy around expert demonstrations.
SP:ef1d9ed2d961186f3bcc7bcb6f58cdd9fa57ecca
Clearing the Path for Truly Semantic Representation Learning
1 INTRODUCTION . The task of unsupervised learning of interpretable data representations has a long history . From classical approaches using linear algebra e.g . via Principle Component Analysis ( PCA ) ( Pearson , 1901 ) or statistical methods such as Independent Component Analysis ( ICA ) ( Comon , 1994 ) all the way to more recent approaches that rely on deep learning architectures . The cornerstone architecture is the Variational Autoencoder ( Kingma & Welling , 2014 ) ( VAE ) which clearly demonstrated both high semantic quality as well as good performance in terms of disentanglement . Until today , derivates of VAEs ( Higgins et al. , 2017 ; Kim & Mnih , 2018a ; Chen et al. , 2018 ; Kumar et al. , 2017 ) excel over other architectures in terms of disentanglement metrics . The extent of VAE ’ s success even prompted recent deeper analyses of its inner workings ( Rolinek et al. , 2019 ; Burgess et al. , 2018 ; Chen et al. , 2018 ; Mathieu et al. , 2018 ) . If we treat the overloaded term disentanglement to the highest of its aspirations , as the ability to recover the true generating factors of data , fundamental problems arise . As explained byLocatello et al . ( 2019 ) , already the concept of generative factors is compromised from a statistical perspective : two ( or in fact infinitely many ) sets of generative factors can generate statistically indistinguishable datasets . Yet , the scores on the disentanglement benchmarks are high and continue to rise . This apparent contradiction needs a resolution . In this work , we claim that all leading disentanglement architectures can be fooled by the same trick . Namely , by introducing a small change of the correlation structure , which , however , perfectly preserves the set of generative factors . To that end , we provide an alternative version of the standard disentanglement datasets in which each image undergoes a modification barely visible to a human eye . We report drastic drops of disentanglement performance on the altered datasets . On a technical level , we build on the findings by Rolinek et al . ( 2019 ) who argued that VAEs recover the nonlinear principle components of the datasets ; in other words nonlinearly computed scalars that are the sources of variance in the sense of classical PCA . The small modifications of the datasets we propose , aim to change the leading principle component by adding modest variance to an alternative Datasets will be released here : https : //sites.google.com/view/sem-rep-learning candidate . The “ to-be ” leading principle component is specific to each dataset but it is determined in a consistent fashion . With the greedy algorithm for discovering the linear PCA components in mind , we can see that any change in the leading principle component is reflected also in the others . As a result , the overall alignment changes and the generating factors get entangled leading to low disentanglement scores . We demonstrate that , even though the viewpoint of ( Rolinek et al. , 2019 ) only has theoretical support for the ( β ) -VAE , it empirically transfers to other architectures . Overall , we want to encourage evaluating new disentanglement approaches on the proposed datasets , in which the generative factors are intact but the correlation structure is less favorable for the principle component discovery ingrained in VAE-style architectures . We hope that providing a more sound experimental setup will clear the path for a new set of disentanglement approaches . 2 RELATED WORK . The related work can be categorized in three research questions : i ) defining disentanglement and metrics capturing the quality of latent representations ; ii ) architecture development for unsupervised learning of disentangled representations ; and iii ) understanding the inner workings of existing architectures , as for example of β-VAEs . This paper is building upon results from all three lines of work . Defining disentanglement . Defining the term disentangled representation is an open question ( Higgins et al. , 2018 ) . The presence of learned representations in machine learning downstream tasks , such as object recognition , natural language processing and others , created the need to “ disentangle the factors of variation ” ( Bengio et al. , 2013 ) very early on . This vague interpretation of disentanglement is inspired by the existence of a low dimensional manifold that captures the variance of higher dimensional data . As such , finding a factorized , statistically independent representation became a core ingredient of disentangled representation learning and dates back to classical ICA models ( Comon , 1994 ; Bell & Sejnowski , 1995 ) . For some tasks , the desired feature of a disentangled representation is that it is semantically meaningful . Prominent examples can be found in computer vision ( Shu et al. , 2017 ; Liao et al. , 2020 ) and in research addressing interpretability of machine learning models ( Adel et al. , 2018 ; Kim , 2019 ) . Based on group theory and symmetry transformations , ( Higgins et al. , 2018 ) provides the “ first principled definition of a disentangled representation ” . Closely related to this concept is also the field of causality in machine learning ( Schölkopf , 2019 ; Suter et al. , 2019 ) , more specifically the search for causal generative models ( Besserve et al. , 2018 ; 2020 ) . Architecture development . The leading architectures for disentangled representation learning are based on VAEs ( Kingma & Welling , 2014 ) . Despite originally developed as a generative modeling architecture , its variants have proven to excel at representation learning tasks . First of all the β-VAE ( Higgins et al. , 2017 ) , which exposes the trade-off between reconstruction and regularization via the additional hyperparameter , performs remarkably well . Other architectures have been proposed that additionally encourage statistical independence in the latent space , e.g . FactorVAE ( Kim & Mnih , 2018b ) and β-TC-VAE ( Chen et al. , 2018 ) . The DIP-VAE ( Kumar et al. , 2017 ) suggests using moment-matching to close the distribution gap introduced in the original VAE paper . As the architectures developed , so did the metrics used for measuring the disentanglement quality of representations ( Chen et al. , 2018 ; Kim & Mnih , 2018b ; Higgins et al. , 2017 ; Kumar et al. , 2017 ) . Understanding inner workings . With the rising success and development of VAE based architectures , the question of understanding their inner working principles became dominant in the community . One line of work searches for an answer to the question why these models disentangle ( Burgess et al. , 2018 ) . Another , closely related line of work shows up and tightens the connection between the vanilla ( β- ) VAE objective and ( probabilistic ) PCA ( Tipping & Bishop , 1999 ) ( Rolinek et al. , 2019 ; Lucas et al. , 2019 ) . Building on such findings , novel approaches for model selection were proposed ( Duan et al. , 2020 ) , emphasizing the value of thoroughly understanding the working principles of these methods . On a less technical side , ( Locatello et al. , 2019 ) conducted a broad set of experiments , questioning the relevance of models given the variance over restarts and the choice of hyperparameter . They also formalized the necessity of inductive bias as a strict requirement for unsupervised learning of disentangled representations . Our experiments are built on their code-base . 3 BACKGROUND . 3.1 QUANTIFYING DISENTANGLEMENT . Among the different viewpoints on disentanglement , we follow recent literature and focus on the connection between the discovered data representation and a set of generative factors . Multiple metrics have been proposed to quantify this connection . Most of them are based on the understanding that , ideally , each generative factor is encoded in precisely one latent variable . This was captured concisely by Chen et al . ( 2018 ) who proposed the Mutual Information Gap ( MIG ) , the mean ( over the Nw generative factors ) normalized difference of the two highest mutual information values between a latent coordinate and the single generating factor : 1 Nw Nw∑ i=0 1 H ( wi ) ( max k I ( wi ; zk ) −max k 6=k′ I ( wi ; zk ) ) , ( 1 ) where k′ = argmaxκ I ( wi , zκ ) . More details about MIG , its implementations , and an extension to discrete variables can be found in ( Chen et al. , 2018 ; Rolinek et al. , 2019 ) . While multiple other metrics were proposed such as SAPScore ( Kumar et al. , 2017 ) , FactorVAEScore ( Kim & Mnih , 2018a ) and DCI Score ( Eastwood & Williams , 2018 ) ( see the supplementary material of Klindt et al . ( 2020 ) ) , in this work , we focus primarily on MIG . 3.2 VARIATIONAL AUTOENCODERS AND THE MYSTERY OF A SPECIFIC ALIGNMENT . Variational autoencoders hide many intricacies and attempting to compress their exposition would not do them justice . For this reason , we limit ourselves to what is crucial for understanding this work : the objective functions . For well-presented full descriptions of VAEs , we refer the readers to ( Doersch , 2016 ) . As it is common in generative models , VAEs aim to maximize the log-likelihood objective N∑ i=1 log p ( x ( i ) ) , ( 2 ) in which { x ( i ) } Ni=1 = X is a dataset consisting of N i.i.d . samples x ( i ) of a multivariate random variable X that follows the true data distribution . The quantity p ( x ( i ) ) captures the probability density of generating the training data point x ( i ) under the current parameters of the model . This objective is , however , intractable in its general form . For this reason , Kingma & Welling ( 2014 ) follow the standard technique of variational inference and introduce a tractable Evidence Lower Bound ( ELBO ) : Eq ( z|x ( i ) ) log p ( x ( i ) | z ) +DKL ( q ( z | x ( i ) ) ‖ p ( z ) ) . ( 3 ) Here , z are the latent variables used to generate samples from X via a parameterized stochastic decoder q ( x ( i ) | z ) . The fundamental question of “ How do these objectives promote disentanglement ? ” was first asked by Burgess et al . ( 2018 ) . This is indeed far from obvious ; in disentanglement the aim to encode a fixed generative factor in precisely one latent variable . From a geometric viewpoint this requires the latent representation to be axis-aligned ( one axis corresponding to one generative factor ) . This question becomes yet more intriguing after noticing ( and formally proving ) that both objective functions ( 2 ) and ( 3 ) are invariant under rotations ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ) . In other words , any rotation of a fixed latent representation results in the same value of the objective function and yet β-VAEs consistently produce representations that are axis-aligned and in effect are isolating the generative factor into individual latent variables . 3.3 RESOLUTION VIA NON-LINEAR CONNECTIONS TO PCA . A mechanistic answer to the question raised in the previous subsection was given by Rolinek et al . ( 2019 ) . The formal argument showed that under specific conditions which are typical for β-VAEs ( called polarized regime ) , the model locally performs PCA in the sense of aligning the “ sources of variance ” with the local axes . The resulting global alignment often coincides with finding nonlinear principal components of the dataset ( see Fig . 1 ) . This behavior stems from the convenient but uninformed choice of a diagonal posterior , which breaks the symmetry of ( 2 ) and ( 3 ) . This connection with PCA was also reported by Stuehmer et al . ( 2020 ) , alternatively formalized by Lucas et al . ( 2019 ) and converted into performance improvements in an unsupervised setting by Duan et al . ( 2020 ) . Since our dataset perturbation method is based on this interpretation of the VAE , we offer further context . In more technical terms , Rolinek et al . ( 2019 ) simplify the closed-form KL-term of the objective ( 3 ) under the assumption of polarized regime into the form LKL ( x ( i ) ) ≈ 1 2 ∑ j∈Va µ2j ( x ( i ) ) − log ( σ2j ( x ( i ) ) ) , ( 4 ) where Va is the set of active latent variables , µ2j ( x ( i ) ) is the mean embedding of input x ( i ) and σ2j ( x ( i ) ) the corresponding term in the diagonal posterior which also plays the role of noise applied to the latent variable j . This form of the objective , when studied independently , lends itself to an alternative viewpoint . When the only “ moving part ” in the model is the alignment of the latent representation , i.e . application of a rotation matrix , the induced optimization problem has the following interpretation1 : Distribute a fixed amount of noise among the latent variables such that the L2 reconstruction error increases the least . This extracted problem can be solved in closed form and the solution is based on isolating sources of variance . Intuitively , important scalar factors whose preservation is crucial for reconstruction , need to be captured with high precision ( low noise ) . For that , it is economic to isolate them from other factors . This high-level connection with PCA is then further formalized by Rolinek et al . ( 2019 ) . One less obvious observation is that the “ isolation ” of different sources of variance relies on the accuracy of the linearization of the decoder at around a fixed µ ( x ( i ) ) . Since in many datasets the local and global correlation structure is nearly identical , β-VAE recover sound global principle components . If , however , the local structure obeys a different “ natural ” alignment , the Variational autoencoder prefers it to the global one as captured in a synthetic experiment displayed in Fig . 1 . The sensitivity of β-VAE ’ s global representation to small local changes is precisely our point of attack . 1the precise formal statement can be found in ( Rolinek et al. , 2019 , Equations ( 22 ) and ( 23 ) )
This work aims to demonstrate that VAE-based architectures can take advantage of inherent correlation between data to produce representations. They claim that small perturbations of the data prevent these architectures from taking advantage of such correlations resulting in failure to produce disentangled representations. This work therefore claims that the perturbed datasets should be used to design and learn models that can discover the true structure of the data
SP:02105a375c2a75e53b103af0a9f58dbd2df943e5
Clearing the Path for Truly Semantic Representation Learning
1 INTRODUCTION . The task of unsupervised learning of interpretable data representations has a long history . From classical approaches using linear algebra e.g . via Principle Component Analysis ( PCA ) ( Pearson , 1901 ) or statistical methods such as Independent Component Analysis ( ICA ) ( Comon , 1994 ) all the way to more recent approaches that rely on deep learning architectures . The cornerstone architecture is the Variational Autoencoder ( Kingma & Welling , 2014 ) ( VAE ) which clearly demonstrated both high semantic quality as well as good performance in terms of disentanglement . Until today , derivates of VAEs ( Higgins et al. , 2017 ; Kim & Mnih , 2018a ; Chen et al. , 2018 ; Kumar et al. , 2017 ) excel over other architectures in terms of disentanglement metrics . The extent of VAE ’ s success even prompted recent deeper analyses of its inner workings ( Rolinek et al. , 2019 ; Burgess et al. , 2018 ; Chen et al. , 2018 ; Mathieu et al. , 2018 ) . If we treat the overloaded term disentanglement to the highest of its aspirations , as the ability to recover the true generating factors of data , fundamental problems arise . As explained byLocatello et al . ( 2019 ) , already the concept of generative factors is compromised from a statistical perspective : two ( or in fact infinitely many ) sets of generative factors can generate statistically indistinguishable datasets . Yet , the scores on the disentanglement benchmarks are high and continue to rise . This apparent contradiction needs a resolution . In this work , we claim that all leading disentanglement architectures can be fooled by the same trick . Namely , by introducing a small change of the correlation structure , which , however , perfectly preserves the set of generative factors . To that end , we provide an alternative version of the standard disentanglement datasets in which each image undergoes a modification barely visible to a human eye . We report drastic drops of disentanglement performance on the altered datasets . On a technical level , we build on the findings by Rolinek et al . ( 2019 ) who argued that VAEs recover the nonlinear principle components of the datasets ; in other words nonlinearly computed scalars that are the sources of variance in the sense of classical PCA . The small modifications of the datasets we propose , aim to change the leading principle component by adding modest variance to an alternative Datasets will be released here : https : //sites.google.com/view/sem-rep-learning candidate . The “ to-be ” leading principle component is specific to each dataset but it is determined in a consistent fashion . With the greedy algorithm for discovering the linear PCA components in mind , we can see that any change in the leading principle component is reflected also in the others . As a result , the overall alignment changes and the generating factors get entangled leading to low disentanglement scores . We demonstrate that , even though the viewpoint of ( Rolinek et al. , 2019 ) only has theoretical support for the ( β ) -VAE , it empirically transfers to other architectures . Overall , we want to encourage evaluating new disentanglement approaches on the proposed datasets , in which the generative factors are intact but the correlation structure is less favorable for the principle component discovery ingrained in VAE-style architectures . We hope that providing a more sound experimental setup will clear the path for a new set of disentanglement approaches . 2 RELATED WORK . The related work can be categorized in three research questions : i ) defining disentanglement and metrics capturing the quality of latent representations ; ii ) architecture development for unsupervised learning of disentangled representations ; and iii ) understanding the inner workings of existing architectures , as for example of β-VAEs . This paper is building upon results from all three lines of work . Defining disentanglement . Defining the term disentangled representation is an open question ( Higgins et al. , 2018 ) . The presence of learned representations in machine learning downstream tasks , such as object recognition , natural language processing and others , created the need to “ disentangle the factors of variation ” ( Bengio et al. , 2013 ) very early on . This vague interpretation of disentanglement is inspired by the existence of a low dimensional manifold that captures the variance of higher dimensional data . As such , finding a factorized , statistically independent representation became a core ingredient of disentangled representation learning and dates back to classical ICA models ( Comon , 1994 ; Bell & Sejnowski , 1995 ) . For some tasks , the desired feature of a disentangled representation is that it is semantically meaningful . Prominent examples can be found in computer vision ( Shu et al. , 2017 ; Liao et al. , 2020 ) and in research addressing interpretability of machine learning models ( Adel et al. , 2018 ; Kim , 2019 ) . Based on group theory and symmetry transformations , ( Higgins et al. , 2018 ) provides the “ first principled definition of a disentangled representation ” . Closely related to this concept is also the field of causality in machine learning ( Schölkopf , 2019 ; Suter et al. , 2019 ) , more specifically the search for causal generative models ( Besserve et al. , 2018 ; 2020 ) . Architecture development . The leading architectures for disentangled representation learning are based on VAEs ( Kingma & Welling , 2014 ) . Despite originally developed as a generative modeling architecture , its variants have proven to excel at representation learning tasks . First of all the β-VAE ( Higgins et al. , 2017 ) , which exposes the trade-off between reconstruction and regularization via the additional hyperparameter , performs remarkably well . Other architectures have been proposed that additionally encourage statistical independence in the latent space , e.g . FactorVAE ( Kim & Mnih , 2018b ) and β-TC-VAE ( Chen et al. , 2018 ) . The DIP-VAE ( Kumar et al. , 2017 ) suggests using moment-matching to close the distribution gap introduced in the original VAE paper . As the architectures developed , so did the metrics used for measuring the disentanglement quality of representations ( Chen et al. , 2018 ; Kim & Mnih , 2018b ; Higgins et al. , 2017 ; Kumar et al. , 2017 ) . Understanding inner workings . With the rising success and development of VAE based architectures , the question of understanding their inner working principles became dominant in the community . One line of work searches for an answer to the question why these models disentangle ( Burgess et al. , 2018 ) . Another , closely related line of work shows up and tightens the connection between the vanilla ( β- ) VAE objective and ( probabilistic ) PCA ( Tipping & Bishop , 1999 ) ( Rolinek et al. , 2019 ; Lucas et al. , 2019 ) . Building on such findings , novel approaches for model selection were proposed ( Duan et al. , 2020 ) , emphasizing the value of thoroughly understanding the working principles of these methods . On a less technical side , ( Locatello et al. , 2019 ) conducted a broad set of experiments , questioning the relevance of models given the variance over restarts and the choice of hyperparameter . They also formalized the necessity of inductive bias as a strict requirement for unsupervised learning of disentangled representations . Our experiments are built on their code-base . 3 BACKGROUND . 3.1 QUANTIFYING DISENTANGLEMENT . Among the different viewpoints on disentanglement , we follow recent literature and focus on the connection between the discovered data representation and a set of generative factors . Multiple metrics have been proposed to quantify this connection . Most of them are based on the understanding that , ideally , each generative factor is encoded in precisely one latent variable . This was captured concisely by Chen et al . ( 2018 ) who proposed the Mutual Information Gap ( MIG ) , the mean ( over the Nw generative factors ) normalized difference of the two highest mutual information values between a latent coordinate and the single generating factor : 1 Nw Nw∑ i=0 1 H ( wi ) ( max k I ( wi ; zk ) −max k 6=k′ I ( wi ; zk ) ) , ( 1 ) where k′ = argmaxκ I ( wi , zκ ) . More details about MIG , its implementations , and an extension to discrete variables can be found in ( Chen et al. , 2018 ; Rolinek et al. , 2019 ) . While multiple other metrics were proposed such as SAPScore ( Kumar et al. , 2017 ) , FactorVAEScore ( Kim & Mnih , 2018a ) and DCI Score ( Eastwood & Williams , 2018 ) ( see the supplementary material of Klindt et al . ( 2020 ) ) , in this work , we focus primarily on MIG . 3.2 VARIATIONAL AUTOENCODERS AND THE MYSTERY OF A SPECIFIC ALIGNMENT . Variational autoencoders hide many intricacies and attempting to compress their exposition would not do them justice . For this reason , we limit ourselves to what is crucial for understanding this work : the objective functions . For well-presented full descriptions of VAEs , we refer the readers to ( Doersch , 2016 ) . As it is common in generative models , VAEs aim to maximize the log-likelihood objective N∑ i=1 log p ( x ( i ) ) , ( 2 ) in which { x ( i ) } Ni=1 = X is a dataset consisting of N i.i.d . samples x ( i ) of a multivariate random variable X that follows the true data distribution . The quantity p ( x ( i ) ) captures the probability density of generating the training data point x ( i ) under the current parameters of the model . This objective is , however , intractable in its general form . For this reason , Kingma & Welling ( 2014 ) follow the standard technique of variational inference and introduce a tractable Evidence Lower Bound ( ELBO ) : Eq ( z|x ( i ) ) log p ( x ( i ) | z ) +DKL ( q ( z | x ( i ) ) ‖ p ( z ) ) . ( 3 ) Here , z are the latent variables used to generate samples from X via a parameterized stochastic decoder q ( x ( i ) | z ) . The fundamental question of “ How do these objectives promote disentanglement ? ” was first asked by Burgess et al . ( 2018 ) . This is indeed far from obvious ; in disentanglement the aim to encode a fixed generative factor in precisely one latent variable . From a geometric viewpoint this requires the latent representation to be axis-aligned ( one axis corresponding to one generative factor ) . This question becomes yet more intriguing after noticing ( and formally proving ) that both objective functions ( 2 ) and ( 3 ) are invariant under rotations ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ) . In other words , any rotation of a fixed latent representation results in the same value of the objective function and yet β-VAEs consistently produce representations that are axis-aligned and in effect are isolating the generative factor into individual latent variables . 3.3 RESOLUTION VIA NON-LINEAR CONNECTIONS TO PCA . A mechanistic answer to the question raised in the previous subsection was given by Rolinek et al . ( 2019 ) . The formal argument showed that under specific conditions which are typical for β-VAEs ( called polarized regime ) , the model locally performs PCA in the sense of aligning the “ sources of variance ” with the local axes . The resulting global alignment often coincides with finding nonlinear principal components of the dataset ( see Fig . 1 ) . This behavior stems from the convenient but uninformed choice of a diagonal posterior , which breaks the symmetry of ( 2 ) and ( 3 ) . This connection with PCA was also reported by Stuehmer et al . ( 2020 ) , alternatively formalized by Lucas et al . ( 2019 ) and converted into performance improvements in an unsupervised setting by Duan et al . ( 2020 ) . Since our dataset perturbation method is based on this interpretation of the VAE , we offer further context . In more technical terms , Rolinek et al . ( 2019 ) simplify the closed-form KL-term of the objective ( 3 ) under the assumption of polarized regime into the form LKL ( x ( i ) ) ≈ 1 2 ∑ j∈Va µ2j ( x ( i ) ) − log ( σ2j ( x ( i ) ) ) , ( 4 ) where Va is the set of active latent variables , µ2j ( x ( i ) ) is the mean embedding of input x ( i ) and σ2j ( x ( i ) ) the corresponding term in the diagonal posterior which also plays the role of noise applied to the latent variable j . This form of the objective , when studied independently , lends itself to an alternative viewpoint . When the only “ moving part ” in the model is the alignment of the latent representation , i.e . application of a rotation matrix , the induced optimization problem has the following interpretation1 : Distribute a fixed amount of noise among the latent variables such that the L2 reconstruction error increases the least . This extracted problem can be solved in closed form and the solution is based on isolating sources of variance . Intuitively , important scalar factors whose preservation is crucial for reconstruction , need to be captured with high precision ( low noise ) . For that , it is economic to isolate them from other factors . This high-level connection with PCA is then further formalized by Rolinek et al . ( 2019 ) . One less obvious observation is that the “ isolation ” of different sources of variance relies on the accuracy of the linearization of the decoder at around a fixed µ ( x ( i ) ) . Since in many datasets the local and global correlation structure is nearly identical , β-VAE recover sound global principle components . If , however , the local structure obeys a different “ natural ” alignment , the Variational autoencoder prefers it to the global one as captured in a synthetic experiment displayed in Fig . 1 . The sensitivity of β-VAE ’ s global representation to small local changes is precisely our point of attack . 1the precise formal statement can be found in ( Rolinek et al. , 2019 , Equations ( 22 ) and ( 23 ) )
This paper shows a new method to hurt the disentanglement of Variational AutoEncoders (VAEs) by only slightly modifying the images. It conducts experiments and shows that the disentanglement metrics drop significantly by this carefully designed perturbation compared to uniformly noise, and the results are consistent across different variants of VAEs and various datasets. These results show that the success of VAEs are based on the structured nature of the datasets, and the community needs to find new datasets to learn the semantic representations.
SP:02105a375c2a75e53b103af0a9f58dbd2df943e5
Clearing the Path for Truly Semantic Representation Learning
1 INTRODUCTION . The task of unsupervised learning of interpretable data representations has a long history . From classical approaches using linear algebra e.g . via Principle Component Analysis ( PCA ) ( Pearson , 1901 ) or statistical methods such as Independent Component Analysis ( ICA ) ( Comon , 1994 ) all the way to more recent approaches that rely on deep learning architectures . The cornerstone architecture is the Variational Autoencoder ( Kingma & Welling , 2014 ) ( VAE ) which clearly demonstrated both high semantic quality as well as good performance in terms of disentanglement . Until today , derivates of VAEs ( Higgins et al. , 2017 ; Kim & Mnih , 2018a ; Chen et al. , 2018 ; Kumar et al. , 2017 ) excel over other architectures in terms of disentanglement metrics . The extent of VAE ’ s success even prompted recent deeper analyses of its inner workings ( Rolinek et al. , 2019 ; Burgess et al. , 2018 ; Chen et al. , 2018 ; Mathieu et al. , 2018 ) . If we treat the overloaded term disentanglement to the highest of its aspirations , as the ability to recover the true generating factors of data , fundamental problems arise . As explained byLocatello et al . ( 2019 ) , already the concept of generative factors is compromised from a statistical perspective : two ( or in fact infinitely many ) sets of generative factors can generate statistically indistinguishable datasets . Yet , the scores on the disentanglement benchmarks are high and continue to rise . This apparent contradiction needs a resolution . In this work , we claim that all leading disentanglement architectures can be fooled by the same trick . Namely , by introducing a small change of the correlation structure , which , however , perfectly preserves the set of generative factors . To that end , we provide an alternative version of the standard disentanglement datasets in which each image undergoes a modification barely visible to a human eye . We report drastic drops of disentanglement performance on the altered datasets . On a technical level , we build on the findings by Rolinek et al . ( 2019 ) who argued that VAEs recover the nonlinear principle components of the datasets ; in other words nonlinearly computed scalars that are the sources of variance in the sense of classical PCA . The small modifications of the datasets we propose , aim to change the leading principle component by adding modest variance to an alternative Datasets will be released here : https : //sites.google.com/view/sem-rep-learning candidate . The “ to-be ” leading principle component is specific to each dataset but it is determined in a consistent fashion . With the greedy algorithm for discovering the linear PCA components in mind , we can see that any change in the leading principle component is reflected also in the others . As a result , the overall alignment changes and the generating factors get entangled leading to low disentanglement scores . We demonstrate that , even though the viewpoint of ( Rolinek et al. , 2019 ) only has theoretical support for the ( β ) -VAE , it empirically transfers to other architectures . Overall , we want to encourage evaluating new disentanglement approaches on the proposed datasets , in which the generative factors are intact but the correlation structure is less favorable for the principle component discovery ingrained in VAE-style architectures . We hope that providing a more sound experimental setup will clear the path for a new set of disentanglement approaches . 2 RELATED WORK . The related work can be categorized in three research questions : i ) defining disentanglement and metrics capturing the quality of latent representations ; ii ) architecture development for unsupervised learning of disentangled representations ; and iii ) understanding the inner workings of existing architectures , as for example of β-VAEs . This paper is building upon results from all three lines of work . Defining disentanglement . Defining the term disentangled representation is an open question ( Higgins et al. , 2018 ) . The presence of learned representations in machine learning downstream tasks , such as object recognition , natural language processing and others , created the need to “ disentangle the factors of variation ” ( Bengio et al. , 2013 ) very early on . This vague interpretation of disentanglement is inspired by the existence of a low dimensional manifold that captures the variance of higher dimensional data . As such , finding a factorized , statistically independent representation became a core ingredient of disentangled representation learning and dates back to classical ICA models ( Comon , 1994 ; Bell & Sejnowski , 1995 ) . For some tasks , the desired feature of a disentangled representation is that it is semantically meaningful . Prominent examples can be found in computer vision ( Shu et al. , 2017 ; Liao et al. , 2020 ) and in research addressing interpretability of machine learning models ( Adel et al. , 2018 ; Kim , 2019 ) . Based on group theory and symmetry transformations , ( Higgins et al. , 2018 ) provides the “ first principled definition of a disentangled representation ” . Closely related to this concept is also the field of causality in machine learning ( Schölkopf , 2019 ; Suter et al. , 2019 ) , more specifically the search for causal generative models ( Besserve et al. , 2018 ; 2020 ) . Architecture development . The leading architectures for disentangled representation learning are based on VAEs ( Kingma & Welling , 2014 ) . Despite originally developed as a generative modeling architecture , its variants have proven to excel at representation learning tasks . First of all the β-VAE ( Higgins et al. , 2017 ) , which exposes the trade-off between reconstruction and regularization via the additional hyperparameter , performs remarkably well . Other architectures have been proposed that additionally encourage statistical independence in the latent space , e.g . FactorVAE ( Kim & Mnih , 2018b ) and β-TC-VAE ( Chen et al. , 2018 ) . The DIP-VAE ( Kumar et al. , 2017 ) suggests using moment-matching to close the distribution gap introduced in the original VAE paper . As the architectures developed , so did the metrics used for measuring the disentanglement quality of representations ( Chen et al. , 2018 ; Kim & Mnih , 2018b ; Higgins et al. , 2017 ; Kumar et al. , 2017 ) . Understanding inner workings . With the rising success and development of VAE based architectures , the question of understanding their inner working principles became dominant in the community . One line of work searches for an answer to the question why these models disentangle ( Burgess et al. , 2018 ) . Another , closely related line of work shows up and tightens the connection between the vanilla ( β- ) VAE objective and ( probabilistic ) PCA ( Tipping & Bishop , 1999 ) ( Rolinek et al. , 2019 ; Lucas et al. , 2019 ) . Building on such findings , novel approaches for model selection were proposed ( Duan et al. , 2020 ) , emphasizing the value of thoroughly understanding the working principles of these methods . On a less technical side , ( Locatello et al. , 2019 ) conducted a broad set of experiments , questioning the relevance of models given the variance over restarts and the choice of hyperparameter . They also formalized the necessity of inductive bias as a strict requirement for unsupervised learning of disentangled representations . Our experiments are built on their code-base . 3 BACKGROUND . 3.1 QUANTIFYING DISENTANGLEMENT . Among the different viewpoints on disentanglement , we follow recent literature and focus on the connection between the discovered data representation and a set of generative factors . Multiple metrics have been proposed to quantify this connection . Most of them are based on the understanding that , ideally , each generative factor is encoded in precisely one latent variable . This was captured concisely by Chen et al . ( 2018 ) who proposed the Mutual Information Gap ( MIG ) , the mean ( over the Nw generative factors ) normalized difference of the two highest mutual information values between a latent coordinate and the single generating factor : 1 Nw Nw∑ i=0 1 H ( wi ) ( max k I ( wi ; zk ) −max k 6=k′ I ( wi ; zk ) ) , ( 1 ) where k′ = argmaxκ I ( wi , zκ ) . More details about MIG , its implementations , and an extension to discrete variables can be found in ( Chen et al. , 2018 ; Rolinek et al. , 2019 ) . While multiple other metrics were proposed such as SAPScore ( Kumar et al. , 2017 ) , FactorVAEScore ( Kim & Mnih , 2018a ) and DCI Score ( Eastwood & Williams , 2018 ) ( see the supplementary material of Klindt et al . ( 2020 ) ) , in this work , we focus primarily on MIG . 3.2 VARIATIONAL AUTOENCODERS AND THE MYSTERY OF A SPECIFIC ALIGNMENT . Variational autoencoders hide many intricacies and attempting to compress their exposition would not do them justice . For this reason , we limit ourselves to what is crucial for understanding this work : the objective functions . For well-presented full descriptions of VAEs , we refer the readers to ( Doersch , 2016 ) . As it is common in generative models , VAEs aim to maximize the log-likelihood objective N∑ i=1 log p ( x ( i ) ) , ( 2 ) in which { x ( i ) } Ni=1 = X is a dataset consisting of N i.i.d . samples x ( i ) of a multivariate random variable X that follows the true data distribution . The quantity p ( x ( i ) ) captures the probability density of generating the training data point x ( i ) under the current parameters of the model . This objective is , however , intractable in its general form . For this reason , Kingma & Welling ( 2014 ) follow the standard technique of variational inference and introduce a tractable Evidence Lower Bound ( ELBO ) : Eq ( z|x ( i ) ) log p ( x ( i ) | z ) +DKL ( q ( z | x ( i ) ) ‖ p ( z ) ) . ( 3 ) Here , z are the latent variables used to generate samples from X via a parameterized stochastic decoder q ( x ( i ) | z ) . The fundamental question of “ How do these objectives promote disentanglement ? ” was first asked by Burgess et al . ( 2018 ) . This is indeed far from obvious ; in disentanglement the aim to encode a fixed generative factor in precisely one latent variable . From a geometric viewpoint this requires the latent representation to be axis-aligned ( one axis corresponding to one generative factor ) . This question becomes yet more intriguing after noticing ( and formally proving ) that both objective functions ( 2 ) and ( 3 ) are invariant under rotations ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ) . In other words , any rotation of a fixed latent representation results in the same value of the objective function and yet β-VAEs consistently produce representations that are axis-aligned and in effect are isolating the generative factor into individual latent variables . 3.3 RESOLUTION VIA NON-LINEAR CONNECTIONS TO PCA . A mechanistic answer to the question raised in the previous subsection was given by Rolinek et al . ( 2019 ) . The formal argument showed that under specific conditions which are typical for β-VAEs ( called polarized regime ) , the model locally performs PCA in the sense of aligning the “ sources of variance ” with the local axes . The resulting global alignment often coincides with finding nonlinear principal components of the dataset ( see Fig . 1 ) . This behavior stems from the convenient but uninformed choice of a diagonal posterior , which breaks the symmetry of ( 2 ) and ( 3 ) . This connection with PCA was also reported by Stuehmer et al . ( 2020 ) , alternatively formalized by Lucas et al . ( 2019 ) and converted into performance improvements in an unsupervised setting by Duan et al . ( 2020 ) . Since our dataset perturbation method is based on this interpretation of the VAE , we offer further context . In more technical terms , Rolinek et al . ( 2019 ) simplify the closed-form KL-term of the objective ( 3 ) under the assumption of polarized regime into the form LKL ( x ( i ) ) ≈ 1 2 ∑ j∈Va µ2j ( x ( i ) ) − log ( σ2j ( x ( i ) ) ) , ( 4 ) where Va is the set of active latent variables , µ2j ( x ( i ) ) is the mean embedding of input x ( i ) and σ2j ( x ( i ) ) the corresponding term in the diagonal posterior which also plays the role of noise applied to the latent variable j . This form of the objective , when studied independently , lends itself to an alternative viewpoint . When the only “ moving part ” in the model is the alignment of the latent representation , i.e . application of a rotation matrix , the induced optimization problem has the following interpretation1 : Distribute a fixed amount of noise among the latent variables such that the L2 reconstruction error increases the least . This extracted problem can be solved in closed form and the solution is based on isolating sources of variance . Intuitively , important scalar factors whose preservation is crucial for reconstruction , need to be captured with high precision ( low noise ) . For that , it is economic to isolate them from other factors . This high-level connection with PCA is then further formalized by Rolinek et al . ( 2019 ) . One less obvious observation is that the “ isolation ” of different sources of variance relies on the accuracy of the linearization of the decoder at around a fixed µ ( x ( i ) ) . Since in many datasets the local and global correlation structure is nearly identical , β-VAE recover sound global principle components . If , however , the local structure obeys a different “ natural ” alignment , the Variational autoencoder prefers it to the global one as captured in a synthetic experiment displayed in Fig . 1 . The sensitivity of β-VAE ’ s global representation to small local changes is precisely our point of attack . 1the precise formal statement can be found in ( Rolinek et al. , 2019 , Equations ( 22 ) and ( 23 ) )
The authors first describe the shortcomings of existing work for disentanged representation learning and the general problem of unidentifiability. Here however, the presentation could be more precise. For example, they state that the log-likelihood objective (2) and the evidence lower bound (3) would be "invariant under rotations", and give (Burgess et al., 2018; Rolinek et al., 2019) as a reference. However, the log likelihood or the evidence lower bound themselves are not rotationally invariant per-se. Instead these objectives are invariant under rotations for the standard VAE with a rotationally invariant prior p(z) (e.g. the standard normal distribution).
SP:02105a375c2a75e53b103af0a9f58dbd2df943e5
Evaluating Agents Without Rewards
1 INTRODUCTION Metric Reward Correlation Task Reward 1.00 Human Similarity 0.67 Input Entropy 0.54 Information Gain 0.49 Empowerment 0.41 Metric Human Correlation Human Similarity 1.00 Input Entropy 0.89 Information Gain 0.79 Task Reward 0.67 Empowerment 0.66 Deep reinforcement learning ( RL ) has enabled agents to solve complex tasks directly from high-dimensional image inputs , such as locomotion ( Heess et al. , 2017 ) , robotic manipulation ( Akkaya et al. , 2019 ) , and game playing ( Mnih et al. , 2015 ; Silver et al. , 2017 ) . However , many of these successes are built upon rich supervision in the form of manually defined reward functions . Unfortunately , designing informative reward functions is often expensive , time-consuming , and prone to human error ( Krakovna et al. , 2020 ) . Furthermore , these difficulties increase with the complexity of the task of interest . In contrast to many RL agents , natural agents generally learn without externally provided tasks , through intrinsic objectives . For example , children explore the world by crawling around and playing with objects they find . Inspired by this , the field of intrinsic motivation ( Schmidhuber , 1991 ; Oudeyer et al. , 2007 ) seeks mathematical objectives for RL agents that do not depend on a specific task and can be applicable to any unknown environment . We study three common types of intrinsic motivation : Despite the empirical success of intrinsic motivation for facilitating exploration ( Bellemare et al. , 2016b ; Burda et al. , 2018b ) , it remains unclear which family of intrinsic objectives is best for a given scenario , for example when task rewards are sparse or unavailable , or when the goal is to behave similarly to human actors . Moreover , it is not clear whether different intrinsic objectives offer similar benefits in practice or are orthogonal and should be combined . To spur progress toward better understanding of intrinsic objectives , we empirically compare the three objective families in terms of their correlation with human behavior and with the task rewards of three Atari games and Minecraft Treechop . The goal of this paper is to gain understanding rather than to propose a new intrinsic objective or exploration agent . Therefore , there is no need to estimate intrinsic objectives while the agents are learning , which often requires complicated approximations . Instead , we train several well-known RL agents on three Atari games and Minecraft and store their lifetime datasets of experience , resulting in a total of 2.1 billion time steps and about 9 terabytes of agent experience . From the dataset of each agent , we compute the human similarity , input entropy , empowerment , and infogain using simple estimators with clearly stated assumptions . We then analyze the correlations between these metrics to understand how they relate to another and how well they reflect task reward and human similarity . The key findings of this paper are summarized as follows : • Input entropy and information gain both correlate better with human similarity than task reward does . This implies that to measure how similar an agent ’ s behavior is to human behavior , input entropy is a better approximation than task reward . • Simple implementations of input entropy , information gain , and empowerment correlate well with human similarity . This suggests that they can be used as task-agnostic evaluation metrics when human data and task rewards are unavailable . • As a consequence of the these two findings , task-agnostic metrics can be used to measure a different component of agent behavior than is measured by the task rewards of the reinforcement learning environments considered in our study . • Input entropy and information gain correlate strongly with each other , but to a lesser degree with empowerment . This suggests that optimizing input entropy together with either of the two other metrics could be beneficial for designing exploration methods . This paper is structured as follows . Section 2 describes the games and agents used for the study . Section 3 details the experimental setup and estimators used to implement the metrics . Section 4 discusses quantitative and qualitative results . Section 5 summarizes key take-aways and recommendations . 2 BACKGROUND . To validate the effectiveness of our metrics for task-agnostic evaluation across a wide spectrum of agent behavior , we retrospectively computed our metrics on the lifetime experience of well-known RL agents . Thus , we first collected datasets of a variety of agent behavior on which to compute and evaluate our metrics . Environments We evaluated our agents in three different Atari environments provided by Arcade Learning Environment ( Bellemare et al. , 2013 ) : Breakout , Seaquest , and Montezuma ’ s Revenge , and additionally in the Minecraft Treechop environment provided in MineRL ( Guss et al. , 2019 ) . Breakout and Seaquest are relatively simple reactive environments , while Montezuma ’ s Revenge is a challenging platformer requiring long-term planning . Treechop is a 3D environment in which the agent receives reward for breaking and collecting wood blocks , but has considerable freedom to explore the world . We chose these four environments because they span a range of complexity , freedom , and difficulty , as detailed in Appendix E. Agents The seven agent configurations represented in our dataset include three RL algorithms and two trivial agents for comparison . We selected RL agents spanning the range from extrinsic task reward only to intrinsic motivation reward only . Additionally , we included random and no-op agents , two opposite extremes of trivial behavior . Our goal was to represent a wide range of behaviors : playing to achieve a high score , playing to explore the environment , and taking actions without regard to the environment . Specifically , we used the PPO agent ( Schulman et al. , 2017 ) trained to optimize task reward , and the RND ( Burda et al. , 2018b ) and ICM ( Pathak et al. , 2017 ) exploration agents using PPO as an optimizer , which can incorporate both an intrinsic reward signal , and an extrinsic reward signal which can be enabled for task-specific behavior , or disabled for task-agnostic behavior . We evaluate RND and ICM in both of these configurations . Each agent is summarized in Appendix F . 3 METHOD . The goal of this paper is to evaluate agents using metrics other than task reward . For this , we collected 100 million frames on each of the three Atari environments with each of seven agents : random , no-op , PPO , and RND and ICM with and without task reward . Minecraft was evaluated for 12 million frames per agent because the simulation is slower than the Atari games , and five agents rather than seven were used , excluding both configurations of ICM . To evaluate the agents , we first preprocessed the data and then computed our metrics in aggregate over the entire lifetime of each agent/environment configuration ( yielding one number per metric-agentenvironment ) . In this section , we describe our preprocessing method and introduce our estimators for the five considered metrics . 3.1 PREPROCESSING . To efficiently compute the metrics in a robust manner , we discretize the agent ’ s input images so that they can be represented by integer indices . This allows us to summarize each collected datasets as a probability tensor that holds the probability of each transition . Figure 1 visualizes the preprocessing for the three environments . Discretization We first convert the RGB images to grayscale as they were seen by the agents . After that , we bilinearly resize them to 8 × 8 pixels . We discretize these low-resolution images to four possible values per pixel , with thresholds chosen as the brightness percentiles 25 , 50 , and 75 across all unique values of the corresponding pixel in the environment across all agents . Aggregation The unique compactified images are enumerated and summarized into a tensor of counts for each agent and environment combination . For an image index 1 ≤ i ≤ |X| , and action index 1 ≤ j ≤ |A| , and a successor image index 1 ≤ k ≤ |X| , where X is the set of inputs and A the set of actions , the count tensor is defined as , Nijk . = number of transitions from image bucket i and action j to image bucket k. ( 1 ) Normalizing the count tensor N yields a probability tensor P that stores the probability of each transition in the agent ’ s dataset . Under the assumption of a Markovian environment and agent , the probability tensor fully describes the statistics of the preprocessed dataset , P . = 1∑ ijkNijk N , so that ∑ ijk Pijk = 1 . ( 2 ) The probability tensor P describes the joint probability of transitions for each agent and environment and thus allows us to compute any marginals and conditionals needed to compute the metrics . 3.2 METRICS . We compare two task specific metrics , task reward and human similarity , as well as three task-agnostic metrics : input entropy , information gain , and empowerment . The task-agnostic metrics cover the different types of objectives identified by Hafner et al . ( 2020 ) . We compute a single value of each of these metrics on each agent-environment dataset . Task Reward The reward provided by reinforcement learning environments measures success at a specific task . The environments we use have only one predefined task each , despite the wide range of conceivable objectives in Montezuma ’ s Revenge and Minecraft in particular . This is true of many RL environments , and limits one ’ s ability to analyze the behavior of an agent in a general sense within one environment . While there are multi-task benchmarks , they often include a distinct environment for each task rather than multiple tasks in the same environment ( Yu et al. , 2019 ) . This would make it difficult to evaluate the agent ’ s ability to globally explore its environment independent of the task . Human Similarity Task reward captures only the agent ’ s success at the specific task defined via the reward function . This may not match up with a human observer ’ s definition of intelligence . We suggest that a more general measure of intelligence may relate to similarity between the agent ’ s behavior and human behavior in the same environment , i.e . using human behavior as a “ ground truth ” . Hence , we propose a human similarity metric that approximates the overlap between the inputs observed by a human player and an RL agent . To compute this , we used the Atari-HEAD dataset ( Zhang et al. , 2019 ) and preprocessed the data as described in Section 3.1 . We compute human similarity as the Jaccard index , or intersection over union , between input images encountered in the human dataset and those encountered by the artificial agent . It is simpler than but related to inverse reinforcement learning objectives in the vein of Ziebart et al . ( 2008 ) ; Klein et al . ( 2012 ) . For this , we first compute the empirical visitation probabilities of inputs from the probability tensors P agent and P human of the artificial agent and the human player , respectively . The human similarity is then computed as the fraction of non-zero entries , S . = ∣∣ { i : p ( i ) > 0 ∧ q ( i ) > 0 } ∣∣∣∣ { i : p ( i ) > 0 ∨ q ( i ) > 0 } ∣∣ , where p ( i ) .=∑ jk P agentijk , q ( i ) . = ∑ jk P humanijk . ( 3 ) Note that while we use input images from recorded human behavior to compute human similarity , we are not able to compare the human and agent behavior directly , as the RL agents play in an environment with sticky actions , while the humans did not . More generally , human similarity would be challenging to compute in some environments , such as high-dimensional continuous control . Even where it is possible , large human datasets are expensive to collect . Thus , we consider three taskagnostic metrics , which do not require environment-specific engineering or human demonstrators . Input entropy Input entropy measures how improbable the agent ’ s inputs are under a trained density model ( Schmidhuber , 1991 ) . It has been used in RL to model an agent ’ s success at exploring its environment , where a higher input entropy score implies a wider variety of states observed , for instance by Oudeyer et al . ( 2007 ) ; Bellemare et al . ( 2016a ) ; Burda et al . ( 2018b ) . In general , input entropy is the cross entropy of future inputs under a density model trained alongside the agent , but as we retrospectively compute the metric over the agent ’ s lifetime , we only need to compute the probability vector over inputs once . Specifically , we use the marginal entropy over individual inputs , computed by summing the probability tensor over the second and third axes as , C . = − ∑ i p ( i ) log p ( i ) , where p ( i ) .= ∑ jk P agentijk . ( 4 ) Empowerment Empowerment measures the agent ’ s influence over its environment ( Klyubin et al. , 2005 ) , which has been applied to reinforcement learning by Mohamed and Rezende ( 2015 ) ; Karl et al . ( 2017 ) . We use the interpretation of empowerment that measures the agent ’ s realized influence on the world , rather than its potential influence , formalized as the mutual information between actions and sensory inputs ( Salge et al. , 2014 ; Hafner et al. , 2020 ) . We compute empowerment mutual information as the difference between the entropy of actions given the preceding input , before and after observing the following input , E . = ( ∑ ijk p ( i , j , k ) log p ( i , j , k ) ) − ( ∑ ij q ( i , j ) log q ( i , j ) ) , where p ( i , j , k ) .= Pijk∑ j′ Pij′k , q ( i , j ) . = ∑ k Pijk∑ j′k Pij′k . ( 5 ) Information gain Information gain is a measure of how much the agent learns from its observations Lindley et al . ( 1956 ) . It is the mutual information between observations and the agent ’ s representation of the environment . Information gain has led to successful exploration in reinforcement learning ( Sun et al. , 2011 ; Houthooft et al. , 2016 ; Shyam et al. , 2018 ) . To measure the amount of information gained , we need a way to represent the agent ’ s knowledge about its environment . Preprocessing the agent ’ s inputs into discrete classes enables us to represent its knowledge as a belief over the transition matrix M . The total information gain of over agent ’ s lifetime is the entropy difference of its beliefs at the beginning and end of the dataset , I . = H [ M ] −H [ M | dataset ] = E [ log p ( M | dataset ) − log p ( M ) ] . ( 6 ) We choose the belief to be a vector of Dirichlet distributions as in ( Sun et al. , 2011 ; Friston et al. , 2017 ) , each of which has one concentration parameter , initialized at 1 , for each possible subsequent input . For each transition that occurs in the dataset , the corresponding concentration parameter is set to 2 , which we empirically found to be more effective than varying the parameter based on the number of occurrences . This is explained by the limited amount of stochasticity in the environments even after pre-processing ; more than 80 % of all state/action pairs transition to only one unique state in Breakout , Seaquest , and Minecraft , so that seeing a transition once establishes that the transition is possible , and seeing it multiple times should not increase the model ’ s confidence by very much . The entropy of a Dirichlet distribution is given by , H [ D ] = logB ( α ) + ( |X|∑ k=1 α− |X| ) ψ ( |X|∑ k=1 α ) − |X|∑ k=1 ( αk − 1 ) ψ ( αk ) , ( 7 ) where α is the vector of concentration parameters , ψ is the digamma function , and B is the incomplete beta function ( Lin , 2016 ) . The entropy of the distribution over M is then given by adding up the entropy of each of the Dirichlet distributions .
This work studies four task-agnostic metrics for evaluating reinforcement learning agents: human similarity, curiosity, empowerment and information gain. Experiments were conducted with three selected RL algorithms (PPO, ICM and RND) on selected atari games. The results show that a combination of task reward and curiosity better explain human behavior and some non-reward metrics correlate better with human behavior than task reward. The authors propose that such task-agnostic can be used as intrinsic signals for training RL agents when task reward and human data are not available in an environment.
SP:95a11b3ebbaf6f3d4ba0f255d7ebd8ef26e48ced
Evaluating Agents Without Rewards
1 INTRODUCTION Metric Reward Correlation Task Reward 1.00 Human Similarity 0.67 Input Entropy 0.54 Information Gain 0.49 Empowerment 0.41 Metric Human Correlation Human Similarity 1.00 Input Entropy 0.89 Information Gain 0.79 Task Reward 0.67 Empowerment 0.66 Deep reinforcement learning ( RL ) has enabled agents to solve complex tasks directly from high-dimensional image inputs , such as locomotion ( Heess et al. , 2017 ) , robotic manipulation ( Akkaya et al. , 2019 ) , and game playing ( Mnih et al. , 2015 ; Silver et al. , 2017 ) . However , many of these successes are built upon rich supervision in the form of manually defined reward functions . Unfortunately , designing informative reward functions is often expensive , time-consuming , and prone to human error ( Krakovna et al. , 2020 ) . Furthermore , these difficulties increase with the complexity of the task of interest . In contrast to many RL agents , natural agents generally learn without externally provided tasks , through intrinsic objectives . For example , children explore the world by crawling around and playing with objects they find . Inspired by this , the field of intrinsic motivation ( Schmidhuber , 1991 ; Oudeyer et al. , 2007 ) seeks mathematical objectives for RL agents that do not depend on a specific task and can be applicable to any unknown environment . We study three common types of intrinsic motivation : Despite the empirical success of intrinsic motivation for facilitating exploration ( Bellemare et al. , 2016b ; Burda et al. , 2018b ) , it remains unclear which family of intrinsic objectives is best for a given scenario , for example when task rewards are sparse or unavailable , or when the goal is to behave similarly to human actors . Moreover , it is not clear whether different intrinsic objectives offer similar benefits in practice or are orthogonal and should be combined . To spur progress toward better understanding of intrinsic objectives , we empirically compare the three objective families in terms of their correlation with human behavior and with the task rewards of three Atari games and Minecraft Treechop . The goal of this paper is to gain understanding rather than to propose a new intrinsic objective or exploration agent . Therefore , there is no need to estimate intrinsic objectives while the agents are learning , which often requires complicated approximations . Instead , we train several well-known RL agents on three Atari games and Minecraft and store their lifetime datasets of experience , resulting in a total of 2.1 billion time steps and about 9 terabytes of agent experience . From the dataset of each agent , we compute the human similarity , input entropy , empowerment , and infogain using simple estimators with clearly stated assumptions . We then analyze the correlations between these metrics to understand how they relate to another and how well they reflect task reward and human similarity . The key findings of this paper are summarized as follows : • Input entropy and information gain both correlate better with human similarity than task reward does . This implies that to measure how similar an agent ’ s behavior is to human behavior , input entropy is a better approximation than task reward . • Simple implementations of input entropy , information gain , and empowerment correlate well with human similarity . This suggests that they can be used as task-agnostic evaluation metrics when human data and task rewards are unavailable . • As a consequence of the these two findings , task-agnostic metrics can be used to measure a different component of agent behavior than is measured by the task rewards of the reinforcement learning environments considered in our study . • Input entropy and information gain correlate strongly with each other , but to a lesser degree with empowerment . This suggests that optimizing input entropy together with either of the two other metrics could be beneficial for designing exploration methods . This paper is structured as follows . Section 2 describes the games and agents used for the study . Section 3 details the experimental setup and estimators used to implement the metrics . Section 4 discusses quantitative and qualitative results . Section 5 summarizes key take-aways and recommendations . 2 BACKGROUND . To validate the effectiveness of our metrics for task-agnostic evaluation across a wide spectrum of agent behavior , we retrospectively computed our metrics on the lifetime experience of well-known RL agents . Thus , we first collected datasets of a variety of agent behavior on which to compute and evaluate our metrics . Environments We evaluated our agents in three different Atari environments provided by Arcade Learning Environment ( Bellemare et al. , 2013 ) : Breakout , Seaquest , and Montezuma ’ s Revenge , and additionally in the Minecraft Treechop environment provided in MineRL ( Guss et al. , 2019 ) . Breakout and Seaquest are relatively simple reactive environments , while Montezuma ’ s Revenge is a challenging platformer requiring long-term planning . Treechop is a 3D environment in which the agent receives reward for breaking and collecting wood blocks , but has considerable freedom to explore the world . We chose these four environments because they span a range of complexity , freedom , and difficulty , as detailed in Appendix E. Agents The seven agent configurations represented in our dataset include three RL algorithms and two trivial agents for comparison . We selected RL agents spanning the range from extrinsic task reward only to intrinsic motivation reward only . Additionally , we included random and no-op agents , two opposite extremes of trivial behavior . Our goal was to represent a wide range of behaviors : playing to achieve a high score , playing to explore the environment , and taking actions without regard to the environment . Specifically , we used the PPO agent ( Schulman et al. , 2017 ) trained to optimize task reward , and the RND ( Burda et al. , 2018b ) and ICM ( Pathak et al. , 2017 ) exploration agents using PPO as an optimizer , which can incorporate both an intrinsic reward signal , and an extrinsic reward signal which can be enabled for task-specific behavior , or disabled for task-agnostic behavior . We evaluate RND and ICM in both of these configurations . Each agent is summarized in Appendix F . 3 METHOD . The goal of this paper is to evaluate agents using metrics other than task reward . For this , we collected 100 million frames on each of the three Atari environments with each of seven agents : random , no-op , PPO , and RND and ICM with and without task reward . Minecraft was evaluated for 12 million frames per agent because the simulation is slower than the Atari games , and five agents rather than seven were used , excluding both configurations of ICM . To evaluate the agents , we first preprocessed the data and then computed our metrics in aggregate over the entire lifetime of each agent/environment configuration ( yielding one number per metric-agentenvironment ) . In this section , we describe our preprocessing method and introduce our estimators for the five considered metrics . 3.1 PREPROCESSING . To efficiently compute the metrics in a robust manner , we discretize the agent ’ s input images so that they can be represented by integer indices . This allows us to summarize each collected datasets as a probability tensor that holds the probability of each transition . Figure 1 visualizes the preprocessing for the three environments . Discretization We first convert the RGB images to grayscale as they were seen by the agents . After that , we bilinearly resize them to 8 × 8 pixels . We discretize these low-resolution images to four possible values per pixel , with thresholds chosen as the brightness percentiles 25 , 50 , and 75 across all unique values of the corresponding pixel in the environment across all agents . Aggregation The unique compactified images are enumerated and summarized into a tensor of counts for each agent and environment combination . For an image index 1 ≤ i ≤ |X| , and action index 1 ≤ j ≤ |A| , and a successor image index 1 ≤ k ≤ |X| , where X is the set of inputs and A the set of actions , the count tensor is defined as , Nijk . = number of transitions from image bucket i and action j to image bucket k. ( 1 ) Normalizing the count tensor N yields a probability tensor P that stores the probability of each transition in the agent ’ s dataset . Under the assumption of a Markovian environment and agent , the probability tensor fully describes the statistics of the preprocessed dataset , P . = 1∑ ijkNijk N , so that ∑ ijk Pijk = 1 . ( 2 ) The probability tensor P describes the joint probability of transitions for each agent and environment and thus allows us to compute any marginals and conditionals needed to compute the metrics . 3.2 METRICS . We compare two task specific metrics , task reward and human similarity , as well as three task-agnostic metrics : input entropy , information gain , and empowerment . The task-agnostic metrics cover the different types of objectives identified by Hafner et al . ( 2020 ) . We compute a single value of each of these metrics on each agent-environment dataset . Task Reward The reward provided by reinforcement learning environments measures success at a specific task . The environments we use have only one predefined task each , despite the wide range of conceivable objectives in Montezuma ’ s Revenge and Minecraft in particular . This is true of many RL environments , and limits one ’ s ability to analyze the behavior of an agent in a general sense within one environment . While there are multi-task benchmarks , they often include a distinct environment for each task rather than multiple tasks in the same environment ( Yu et al. , 2019 ) . This would make it difficult to evaluate the agent ’ s ability to globally explore its environment independent of the task . Human Similarity Task reward captures only the agent ’ s success at the specific task defined via the reward function . This may not match up with a human observer ’ s definition of intelligence . We suggest that a more general measure of intelligence may relate to similarity between the agent ’ s behavior and human behavior in the same environment , i.e . using human behavior as a “ ground truth ” . Hence , we propose a human similarity metric that approximates the overlap between the inputs observed by a human player and an RL agent . To compute this , we used the Atari-HEAD dataset ( Zhang et al. , 2019 ) and preprocessed the data as described in Section 3.1 . We compute human similarity as the Jaccard index , or intersection over union , between input images encountered in the human dataset and those encountered by the artificial agent . It is simpler than but related to inverse reinforcement learning objectives in the vein of Ziebart et al . ( 2008 ) ; Klein et al . ( 2012 ) . For this , we first compute the empirical visitation probabilities of inputs from the probability tensors P agent and P human of the artificial agent and the human player , respectively . The human similarity is then computed as the fraction of non-zero entries , S . = ∣∣ { i : p ( i ) > 0 ∧ q ( i ) > 0 } ∣∣∣∣ { i : p ( i ) > 0 ∨ q ( i ) > 0 } ∣∣ , where p ( i ) .=∑ jk P agentijk , q ( i ) . = ∑ jk P humanijk . ( 3 ) Note that while we use input images from recorded human behavior to compute human similarity , we are not able to compare the human and agent behavior directly , as the RL agents play in an environment with sticky actions , while the humans did not . More generally , human similarity would be challenging to compute in some environments , such as high-dimensional continuous control . Even where it is possible , large human datasets are expensive to collect . Thus , we consider three taskagnostic metrics , which do not require environment-specific engineering or human demonstrators . Input entropy Input entropy measures how improbable the agent ’ s inputs are under a trained density model ( Schmidhuber , 1991 ) . It has been used in RL to model an agent ’ s success at exploring its environment , where a higher input entropy score implies a wider variety of states observed , for instance by Oudeyer et al . ( 2007 ) ; Bellemare et al . ( 2016a ) ; Burda et al . ( 2018b ) . In general , input entropy is the cross entropy of future inputs under a density model trained alongside the agent , but as we retrospectively compute the metric over the agent ’ s lifetime , we only need to compute the probability vector over inputs once . Specifically , we use the marginal entropy over individual inputs , computed by summing the probability tensor over the second and third axes as , C . = − ∑ i p ( i ) log p ( i ) , where p ( i ) .= ∑ jk P agentijk . ( 4 ) Empowerment Empowerment measures the agent ’ s influence over its environment ( Klyubin et al. , 2005 ) , which has been applied to reinforcement learning by Mohamed and Rezende ( 2015 ) ; Karl et al . ( 2017 ) . We use the interpretation of empowerment that measures the agent ’ s realized influence on the world , rather than its potential influence , formalized as the mutual information between actions and sensory inputs ( Salge et al. , 2014 ; Hafner et al. , 2020 ) . We compute empowerment mutual information as the difference between the entropy of actions given the preceding input , before and after observing the following input , E . = ( ∑ ijk p ( i , j , k ) log p ( i , j , k ) ) − ( ∑ ij q ( i , j ) log q ( i , j ) ) , where p ( i , j , k ) .= Pijk∑ j′ Pij′k , q ( i , j ) . = ∑ k Pijk∑ j′k Pij′k . ( 5 ) Information gain Information gain is a measure of how much the agent learns from its observations Lindley et al . ( 1956 ) . It is the mutual information between observations and the agent ’ s representation of the environment . Information gain has led to successful exploration in reinforcement learning ( Sun et al. , 2011 ; Houthooft et al. , 2016 ; Shyam et al. , 2018 ) . To measure the amount of information gained , we need a way to represent the agent ’ s knowledge about its environment . Preprocessing the agent ’ s inputs into discrete classes enables us to represent its knowledge as a belief over the transition matrix M . The total information gain of over agent ’ s lifetime is the entropy difference of its beliefs at the beginning and end of the dataset , I . = H [ M ] −H [ M | dataset ] = E [ log p ( M | dataset ) − log p ( M ) ] . ( 6 ) We choose the belief to be a vector of Dirichlet distributions as in ( Sun et al. , 2011 ; Friston et al. , 2017 ) , each of which has one concentration parameter , initialized at 1 , for each possible subsequent input . For each transition that occurs in the dataset , the corresponding concentration parameter is set to 2 , which we empirically found to be more effective than varying the parameter based on the number of occurrences . This is explained by the limited amount of stochasticity in the environments even after pre-processing ; more than 80 % of all state/action pairs transition to only one unique state in Breakout , Seaquest , and Minecraft , so that seeing a transition once establishes that the transition is possible , and seeing it multiple times should not increase the model ’ s confidence by very much . The entropy of a Dirichlet distribution is given by , H [ D ] = logB ( α ) + ( |X|∑ k=1 α− |X| ) ψ ( |X|∑ k=1 α ) − |X|∑ k=1 ( αk − 1 ) ψ ( αk ) , ( 7 ) where α is the vector of concentration parameters , ψ is the digamma function , and B is the incomplete beta function ( Lin , 2016 ) . The entropy of the distribution over M is then given by adding up the entropy of each of the Dirichlet distributions .
This paper proposes to study three types of intrinsic motivations: curiosity, empowerment and information gain. They propose to compute these measures on the lifetime experience of RL agents and to use them as behavioral metrics. To evaluate these metrics, they perform a correlation study with respect to two traditional behavioral metrics: the task reward and human similarity.
SP:95a11b3ebbaf6f3d4ba0f255d7ebd8ef26e48ced
Evaluating Agents Without Rewards
1 INTRODUCTION Metric Reward Correlation Task Reward 1.00 Human Similarity 0.67 Input Entropy 0.54 Information Gain 0.49 Empowerment 0.41 Metric Human Correlation Human Similarity 1.00 Input Entropy 0.89 Information Gain 0.79 Task Reward 0.67 Empowerment 0.66 Deep reinforcement learning ( RL ) has enabled agents to solve complex tasks directly from high-dimensional image inputs , such as locomotion ( Heess et al. , 2017 ) , robotic manipulation ( Akkaya et al. , 2019 ) , and game playing ( Mnih et al. , 2015 ; Silver et al. , 2017 ) . However , many of these successes are built upon rich supervision in the form of manually defined reward functions . Unfortunately , designing informative reward functions is often expensive , time-consuming , and prone to human error ( Krakovna et al. , 2020 ) . Furthermore , these difficulties increase with the complexity of the task of interest . In contrast to many RL agents , natural agents generally learn without externally provided tasks , through intrinsic objectives . For example , children explore the world by crawling around and playing with objects they find . Inspired by this , the field of intrinsic motivation ( Schmidhuber , 1991 ; Oudeyer et al. , 2007 ) seeks mathematical objectives for RL agents that do not depend on a specific task and can be applicable to any unknown environment . We study three common types of intrinsic motivation : Despite the empirical success of intrinsic motivation for facilitating exploration ( Bellemare et al. , 2016b ; Burda et al. , 2018b ) , it remains unclear which family of intrinsic objectives is best for a given scenario , for example when task rewards are sparse or unavailable , or when the goal is to behave similarly to human actors . Moreover , it is not clear whether different intrinsic objectives offer similar benefits in practice or are orthogonal and should be combined . To spur progress toward better understanding of intrinsic objectives , we empirically compare the three objective families in terms of their correlation with human behavior and with the task rewards of three Atari games and Minecraft Treechop . The goal of this paper is to gain understanding rather than to propose a new intrinsic objective or exploration agent . Therefore , there is no need to estimate intrinsic objectives while the agents are learning , which often requires complicated approximations . Instead , we train several well-known RL agents on three Atari games and Minecraft and store their lifetime datasets of experience , resulting in a total of 2.1 billion time steps and about 9 terabytes of agent experience . From the dataset of each agent , we compute the human similarity , input entropy , empowerment , and infogain using simple estimators with clearly stated assumptions . We then analyze the correlations between these metrics to understand how they relate to another and how well they reflect task reward and human similarity . The key findings of this paper are summarized as follows : • Input entropy and information gain both correlate better with human similarity than task reward does . This implies that to measure how similar an agent ’ s behavior is to human behavior , input entropy is a better approximation than task reward . • Simple implementations of input entropy , information gain , and empowerment correlate well with human similarity . This suggests that they can be used as task-agnostic evaluation metrics when human data and task rewards are unavailable . • As a consequence of the these two findings , task-agnostic metrics can be used to measure a different component of agent behavior than is measured by the task rewards of the reinforcement learning environments considered in our study . • Input entropy and information gain correlate strongly with each other , but to a lesser degree with empowerment . This suggests that optimizing input entropy together with either of the two other metrics could be beneficial for designing exploration methods . This paper is structured as follows . Section 2 describes the games and agents used for the study . Section 3 details the experimental setup and estimators used to implement the metrics . Section 4 discusses quantitative and qualitative results . Section 5 summarizes key take-aways and recommendations . 2 BACKGROUND . To validate the effectiveness of our metrics for task-agnostic evaluation across a wide spectrum of agent behavior , we retrospectively computed our metrics on the lifetime experience of well-known RL agents . Thus , we first collected datasets of a variety of agent behavior on which to compute and evaluate our metrics . Environments We evaluated our agents in three different Atari environments provided by Arcade Learning Environment ( Bellemare et al. , 2013 ) : Breakout , Seaquest , and Montezuma ’ s Revenge , and additionally in the Minecraft Treechop environment provided in MineRL ( Guss et al. , 2019 ) . Breakout and Seaquest are relatively simple reactive environments , while Montezuma ’ s Revenge is a challenging platformer requiring long-term planning . Treechop is a 3D environment in which the agent receives reward for breaking and collecting wood blocks , but has considerable freedom to explore the world . We chose these four environments because they span a range of complexity , freedom , and difficulty , as detailed in Appendix E. Agents The seven agent configurations represented in our dataset include three RL algorithms and two trivial agents for comparison . We selected RL agents spanning the range from extrinsic task reward only to intrinsic motivation reward only . Additionally , we included random and no-op agents , two opposite extremes of trivial behavior . Our goal was to represent a wide range of behaviors : playing to achieve a high score , playing to explore the environment , and taking actions without regard to the environment . Specifically , we used the PPO agent ( Schulman et al. , 2017 ) trained to optimize task reward , and the RND ( Burda et al. , 2018b ) and ICM ( Pathak et al. , 2017 ) exploration agents using PPO as an optimizer , which can incorporate both an intrinsic reward signal , and an extrinsic reward signal which can be enabled for task-specific behavior , or disabled for task-agnostic behavior . We evaluate RND and ICM in both of these configurations . Each agent is summarized in Appendix F . 3 METHOD . The goal of this paper is to evaluate agents using metrics other than task reward . For this , we collected 100 million frames on each of the three Atari environments with each of seven agents : random , no-op , PPO , and RND and ICM with and without task reward . Minecraft was evaluated for 12 million frames per agent because the simulation is slower than the Atari games , and five agents rather than seven were used , excluding both configurations of ICM . To evaluate the agents , we first preprocessed the data and then computed our metrics in aggregate over the entire lifetime of each agent/environment configuration ( yielding one number per metric-agentenvironment ) . In this section , we describe our preprocessing method and introduce our estimators for the five considered metrics . 3.1 PREPROCESSING . To efficiently compute the metrics in a robust manner , we discretize the agent ’ s input images so that they can be represented by integer indices . This allows us to summarize each collected datasets as a probability tensor that holds the probability of each transition . Figure 1 visualizes the preprocessing for the three environments . Discretization We first convert the RGB images to grayscale as they were seen by the agents . After that , we bilinearly resize them to 8 × 8 pixels . We discretize these low-resolution images to four possible values per pixel , with thresholds chosen as the brightness percentiles 25 , 50 , and 75 across all unique values of the corresponding pixel in the environment across all agents . Aggregation The unique compactified images are enumerated and summarized into a tensor of counts for each agent and environment combination . For an image index 1 ≤ i ≤ |X| , and action index 1 ≤ j ≤ |A| , and a successor image index 1 ≤ k ≤ |X| , where X is the set of inputs and A the set of actions , the count tensor is defined as , Nijk . = number of transitions from image bucket i and action j to image bucket k. ( 1 ) Normalizing the count tensor N yields a probability tensor P that stores the probability of each transition in the agent ’ s dataset . Under the assumption of a Markovian environment and agent , the probability tensor fully describes the statistics of the preprocessed dataset , P . = 1∑ ijkNijk N , so that ∑ ijk Pijk = 1 . ( 2 ) The probability tensor P describes the joint probability of transitions for each agent and environment and thus allows us to compute any marginals and conditionals needed to compute the metrics . 3.2 METRICS . We compare two task specific metrics , task reward and human similarity , as well as three task-agnostic metrics : input entropy , information gain , and empowerment . The task-agnostic metrics cover the different types of objectives identified by Hafner et al . ( 2020 ) . We compute a single value of each of these metrics on each agent-environment dataset . Task Reward The reward provided by reinforcement learning environments measures success at a specific task . The environments we use have only one predefined task each , despite the wide range of conceivable objectives in Montezuma ’ s Revenge and Minecraft in particular . This is true of many RL environments , and limits one ’ s ability to analyze the behavior of an agent in a general sense within one environment . While there are multi-task benchmarks , they often include a distinct environment for each task rather than multiple tasks in the same environment ( Yu et al. , 2019 ) . This would make it difficult to evaluate the agent ’ s ability to globally explore its environment independent of the task . Human Similarity Task reward captures only the agent ’ s success at the specific task defined via the reward function . This may not match up with a human observer ’ s definition of intelligence . We suggest that a more general measure of intelligence may relate to similarity between the agent ’ s behavior and human behavior in the same environment , i.e . using human behavior as a “ ground truth ” . Hence , we propose a human similarity metric that approximates the overlap between the inputs observed by a human player and an RL agent . To compute this , we used the Atari-HEAD dataset ( Zhang et al. , 2019 ) and preprocessed the data as described in Section 3.1 . We compute human similarity as the Jaccard index , or intersection over union , between input images encountered in the human dataset and those encountered by the artificial agent . It is simpler than but related to inverse reinforcement learning objectives in the vein of Ziebart et al . ( 2008 ) ; Klein et al . ( 2012 ) . For this , we first compute the empirical visitation probabilities of inputs from the probability tensors P agent and P human of the artificial agent and the human player , respectively . The human similarity is then computed as the fraction of non-zero entries , S . = ∣∣ { i : p ( i ) > 0 ∧ q ( i ) > 0 } ∣∣∣∣ { i : p ( i ) > 0 ∨ q ( i ) > 0 } ∣∣ , where p ( i ) .=∑ jk P agentijk , q ( i ) . = ∑ jk P humanijk . ( 3 ) Note that while we use input images from recorded human behavior to compute human similarity , we are not able to compare the human and agent behavior directly , as the RL agents play in an environment with sticky actions , while the humans did not . More generally , human similarity would be challenging to compute in some environments , such as high-dimensional continuous control . Even where it is possible , large human datasets are expensive to collect . Thus , we consider three taskagnostic metrics , which do not require environment-specific engineering or human demonstrators . Input entropy Input entropy measures how improbable the agent ’ s inputs are under a trained density model ( Schmidhuber , 1991 ) . It has been used in RL to model an agent ’ s success at exploring its environment , where a higher input entropy score implies a wider variety of states observed , for instance by Oudeyer et al . ( 2007 ) ; Bellemare et al . ( 2016a ) ; Burda et al . ( 2018b ) . In general , input entropy is the cross entropy of future inputs under a density model trained alongside the agent , but as we retrospectively compute the metric over the agent ’ s lifetime , we only need to compute the probability vector over inputs once . Specifically , we use the marginal entropy over individual inputs , computed by summing the probability tensor over the second and third axes as , C . = − ∑ i p ( i ) log p ( i ) , where p ( i ) .= ∑ jk P agentijk . ( 4 ) Empowerment Empowerment measures the agent ’ s influence over its environment ( Klyubin et al. , 2005 ) , which has been applied to reinforcement learning by Mohamed and Rezende ( 2015 ) ; Karl et al . ( 2017 ) . We use the interpretation of empowerment that measures the agent ’ s realized influence on the world , rather than its potential influence , formalized as the mutual information between actions and sensory inputs ( Salge et al. , 2014 ; Hafner et al. , 2020 ) . We compute empowerment mutual information as the difference between the entropy of actions given the preceding input , before and after observing the following input , E . = ( ∑ ijk p ( i , j , k ) log p ( i , j , k ) ) − ( ∑ ij q ( i , j ) log q ( i , j ) ) , where p ( i , j , k ) .= Pijk∑ j′ Pij′k , q ( i , j ) . = ∑ k Pijk∑ j′k Pij′k . ( 5 ) Information gain Information gain is a measure of how much the agent learns from its observations Lindley et al . ( 1956 ) . It is the mutual information between observations and the agent ’ s representation of the environment . Information gain has led to successful exploration in reinforcement learning ( Sun et al. , 2011 ; Houthooft et al. , 2016 ; Shyam et al. , 2018 ) . To measure the amount of information gained , we need a way to represent the agent ’ s knowledge about its environment . Preprocessing the agent ’ s inputs into discrete classes enables us to represent its knowledge as a belief over the transition matrix M . The total information gain of over agent ’ s lifetime is the entropy difference of its beliefs at the beginning and end of the dataset , I . = H [ M ] −H [ M | dataset ] = E [ log p ( M | dataset ) − log p ( M ) ] . ( 6 ) We choose the belief to be a vector of Dirichlet distributions as in ( Sun et al. , 2011 ; Friston et al. , 2017 ) , each of which has one concentration parameter , initialized at 1 , for each possible subsequent input . For each transition that occurs in the dataset , the corresponding concentration parameter is set to 2 , which we empirically found to be more effective than varying the parameter based on the number of occurrences . This is explained by the limited amount of stochasticity in the environments even after pre-processing ; more than 80 % of all state/action pairs transition to only one unique state in Breakout , Seaquest , and Minecraft , so that seeing a transition once establishes that the transition is possible , and seeing it multiple times should not increase the model ’ s confidence by very much . The entropy of a Dirichlet distribution is given by , H [ D ] = logB ( α ) + ( |X|∑ k=1 α− |X| ) ψ ( |X|∑ k=1 α ) − |X|∑ k=1 ( αk − 1 ) ψ ( αk ) , ( 7 ) where α is the vector of concentration parameters , ψ is the digamma function , and B is the incomplete beta function ( Lin , 2016 ) . The entropy of the distribution over M is then given by adding up the entropy of each of the Dirichlet distributions .
The goal of this paper is to improve our understanding of reward-agnostic metrics drawn from the literature through comparison with human behaviour and task reward. This paper compares two intrinsic reward methods against three baselines on three Atari environments on five metrics, including task reward, a simple metric for human similarity, and three information-theoretic assessments of aggregated observation counts drawn from the literature, which they call task-agnostic metrics. The authors report the correlation between the different metrics.
SP:95a11b3ebbaf6f3d4ba0f255d7ebd8ef26e48ced
Dual-mode ASR: Unify and Improve Streaming ASR with Full-context Modeling
1 INTRODUCTION . “ Ok Google . Hey Siri . Hi Alexa. ” have featured a massive boom of smart speakers in recent years , unveiling a trend towards ubiquitous and ambient Artificial Intelligence ( AI ) for better daily lives . As the communication bridge between human and machine , low-latency streaming ASR ( a.k.a. , online ASR ) is of central importance , whose goal is to emit each hypothesized word as quickly and accurately as possible on the fly as they are spoken . On the other hand , there are some scenarios where full-context ASR ( a.k.a. , offline ASR ) is sufficient , for example , offline video captioning on video-sharing platforms . While low-latency streaming ASR is generally preferred in most of the speech recognition scenarios , it often has worse prediction accuracy as measured in Word Error Rate ( WER ) , due to the lack of future context compared with full-context ASR . Improving both WER and emission latency has been shown to be highly challenging ( He et al. , 2019 ; Li et al. , 2020a ; Sainath et al. , 2020 ) in streaming ASR systems . Since the acoustic , pronunciation , and language model ( AM , PM , and LM ) of a conventional ASR system have been evolved into a single end-to-end ( E2E ) all-neural network , modern streaming and full-context ASR models share most of the neural architectures and training recipes in common , such as , Mel-spectrogram inputs , data augmentations , neural network meta-architectures , training objectives , model regularization techniques and decoding methods . The most significant difference is that streaming ASR encoders are auto-regressive models , with the prediction of the current timestep conditioned on previous ones ( no future context is permitted ) . Specifically , let x and y be the input and output sequence , t as frame index , T as total length of frames . Streaming ASR encoders model the output yt as a function of input x1 : t while full-context ASR encoders model the output yt as a function of input x1 : T . Streaming ASR encoders can be built with uni-directional LSTMs , causal convolution and left-context attention layers in streaming ASR encoders ( Chiu & Raffel , 2018 ; Fan et al. , 2018 ; Han et al. , 2020 ; Gulati et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Miao †equal contribution et al. , 2020 ; Tsunoo et al. , 2020 ; Zhang et al. , 2020 ; Yeh et al. , 2019 ) . Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) are commonly used as the decoder in both streaming and fullcontext models , which predicts the token of the current input frame based on all previous tokens using uni-directional recurrent layers . Figure 1 illustrates a simplified example of the similarity and difference between streaming and full-context ASR models with E2E neural networks . Albeit the similarities , streaming and full-context ASR models are usually developed , trained , and deployed separately . In this work , we propose Dual-mode ASR , a framework to unify streaming and full-context speech recognition networks with shared weights . Dual-mode ASR comes with many immediate benefits , including reduced model download and storage on devices and simplified development and deployment workflows . To accomplish this goal , we first introduce Dual-mode Encoders , which can run in both streaming mode and full-context mode . Dual-mode encoders are designed to reuse the same set of model weights for both modes with zero or near-zero parameters overhead . We propose the design principles of a dual-mode encoder and show examples on how to design dual-mode convolution , dual-mode pooling , and dual-mode attention layers . We also investigate into different training algorithms for Dual-mode ASR , specifically , randomly sampled training and joint training . We show that joint training significantly outperforms randomly sampled training in terms of model quality and training stability . Moreover , motivated by Inplace Knowledge Distillation ( Yu & Huang , 2019b ) in which a large model is used to supervise a small model , we propose to distill knowledge from the full-context mode ( teacher ) into the streaming mode ( student ) on the fly during the training within the same Dual-mode ASR model , by encouraging consistency of the predicted token probabilities . We demonstrate that the emission latency and prediction accuracy of streaming ASR significantly benefit from weight sharing and joint training of its full-context mode , especially with inplace knowledge distillation during the training . We present extensive experiments with two state-of-theart ASR networks , convolution-based ContextNet ( Han et al. , 2020 ) and conv-transformer hybrid Conformer ( Gulati et al. , 2020 ) , on two datasets , a widely used public dataset LibriSpeech ( Panay- otov et al. , 2015 ) ( 970 hours of English reading speech ) and a large-scale dataset MultiDomain ( Narayanan et al. , 2018 ) ( 413,000 hours speech of a mixture across multiple domains including Voice Search , Farfield Speech , YouTube and Meetings ) . For each proposed technique , we also present ablation study and analysis to demonstrate and understand the effectiveness . With Dual-mode ASR , we achieve new state-of-the-art streaming ASR results on both LibriSpeech and MultiDomain in terms of accuracy and latency . 2 RELATED WORK . Streaming ASR Networks . There has been a growing interest in building streaming ASR systems based on E2E Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) . Compared with sequence-to-sequence models ( Chorowski et al. , 2014 ; 2015 ; Chorowski & Jaitly , 2016 ; Bahdanau et al. , 2016 ; Chan et al. , 2016 ) , RNN-T models are naturally streamable and have shown great potentials for low-latency streaming ASR ( Chang et al. , 2019 ; He et al. , 2019 ; Tsunoo et al. , 2019 ; Sainath et al. , 2019 ; Shen et al. , 2019 ; Li et al. , 2020a ; b ; Sainath et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Narayanan et al. , 2020 ) . In this work , we mainly focus on RNN-T based models . He et al . specifically studied how to optimize the RNN-T streaming ASR model for mobile devices , and proposed a bag of techniques including using layer normalization and large batch size to stabilize training ; using word-piece targets ( Wu et al. , 2016 ) ; using a time-reduction layer to speed up training and inference ; quantizing network parameters to reduce memory footprint and speed up computation ; applying shallow-fusion to bias towards user-specific context . To support streaming modeling in E2E ASR models , various efforts have also been made by modifying attention-based models such as monotonic attention ( Raffel et al. , 2017 ; Chiu & Raffel , 2017 ; Fan et al. , 2018 ; Arivazhagan et al. , 2019 ) , GMM attention ( Graves , 2013 ; Chiu et al. , 2019 ) , triggered attention ( TA ) ( Moritz et al. , 2019 ) , Scout Network ( Wang et al. , 2020 ) , and approaches that segment encoder output into non-overlapping chunks ( Jaitly et al. , 2016 ; Tsunoo et al. , 2020 ) . Tsunoo et al . also applied knowledge distillation from the non-streaming model to the streaming model , but their streaming and non-streaming models do not share weights and are trained separately . To improve the latency of RNN-T streaming models , Li et al . investigated additional early and late penalties on Endpointer prediction ( Chang et al. , 2019 ) to reduce the emission latency , and employed the minimum word error rate ( MWER ) training ( Prabhavalkar et al. , 2018 ) to remedy accuracy degradation . Sainath et al . further proposed to improve quality by using two-pass models ( Sainath et al. , 2019 ) , i.e. , a second-pass LAS-based rescore model on top of the hypotheses from first-pass RNN-T streaming output . More recently , Li et al . proposed parallel rescoring by replacing LSTMs with Transformers ( Vaswani et al. , 2017 ) in rescoring models . Chang et al . further proposed Prefetching to reduce system latency by submitting partial recognition results for subsequent processing such as obtaining assistant server responses or second-pass rescoring before the recognition result is finalized . Unlike these approaches , our work explores the unification of streaming and fullcontext ASR networks , thus can be generally applied as an add-on technique without requiring extra runtime support during inference . Weight Sharing for Multi-tasking . Sharing model weights of a deep neural network for multiple tasks has been widely explored in the literature to reduce overall model sizes . In the broadest sense , tasks can refer to different objectives or same objective but different settings , ranging from natural language processing and speech recognition to computer vision and reinforcement learning . In speech recognition , Kannan et al . employed a single ASR network for multilingual ASR , and showed accuracy improvements over monolingual ASR systems . Wu et al . proposed dynamic sparsity neural networks ( DSNN ) for speech recognition on mobile devices with resource constraints . A single trained DSNN ( Wu et al. , 2020 ) can transform into multiple networks of different sparsities for adaptive inference in real-time . Chang et al . trained a single RNN-T model with LSTMs ( Hochreiter & Schmidhuber , 1997 ) for Joint Endpointing ( i.e. , predicting both recognition tokens and the end of an utterance transcription ) in streaming ASR systems . Moreover , Watanabe et al . proposed a hybrid CTC and attention architecture for ASR based on multi-objective learning to eliminate the use of linguistic resources . Another related research work in Computer Vision is Slimmable Neural Networks ( Yu et al. , 2018 ; Yu & Huang , 2019a ; b ; Yu et al. , 2020 ) . Yu et al . proposed an approach to train a single neural network running at different widths , permitting instant and adaptive accuracy efficiency trade-offs at runtime . We also adapt the training rules introduced in slimmable networks , that is , using independent normalization layers for different sub-networks ( tasks ) as conditional parameters and using the prediction of teacher network to supervise student network as inplace distillation during the training . Unlike slimmable networks in which a large model is used to supervise a small model , we propose to distill the knowledge from full-context mode ( teacher ) into streaming mode ( student ) on the fly within the same Dual-mode ASR model . Knowledge Distillation . Hinton et al . explored a simple method to “ transfer ” knowledge from a teacher neural network to a student neural network by enforcing their predictions to be close measured by KL-divergence , ` 1 or ` 2 distance . It is shown that such distillation method is effective to compress neural networks ( Yu & Huang , 2019b ) , accelerate training ( Chen et al. , 2015 ) , improve robustness ( Carlini & Wagner , 2017 ; Papernot et al. , 2016 ) , estimate model uncertainty ( Blundell et al. , 2015 ) and transfer learned domain to other domains ( Tzeng et al. , 2015 ) . 3 DUAL-MODE ASR . Most neural sequence transduction networks for ASR have an encoder-decoder structure ( Graves , 2012 ; Sainath et al. , 2020 ; He et al. , 2019 ; Li et al. , 2020a ) , as shown in Figure 1 . Without loss of generality , here we discuss how to design Dual-mode ASR networks under the most commonly used RNN-T model ( Graves , 2012 ) . In RNN-T models , we first extract mel-spectrogram feature from input speech waveform . The Mel-spectrogram feature is then fed into a neural-net encoder , which usually consists of feed-forward layers , RNN/LSTM layers , convolution layers , attention layers , pooling ( time-reduction ) layers , and residual or dense connections . In neural-net encoders , streaming ASR model requires all components to be auto-regressive , whereas full-context ASR model has no such requirement . The ASR decoder then predicts the token of current frame based on the output from the encoder and previous predicted tokens ( inference ) or target tokens ( training with teacher forcing ( Williams & Zipser , 1989 ) ) . The decoder is commonly an auto-regressive model in both streaming and full-context ASR models , thus is fully shared in Dual-mode ASR . The prediction from decoder is finally used either in decoding algorithm during inference ( e.g. , beam search ) or learning algorithm during training ( e.g. , RNN-T loss ) . As discussed above and shown in Figure 1 , it becomes clear that the major difference between streaming and full-context ASR models is in the neural-net encoder . In the following , we will first discuss the design principles of dual-mode encoder to support both streaming and full-context ASR . We provide examples including dual-mode convolution , dual-mode average pooling , and dual-mode attention layers , which are widely used in the state-of-the-art ASR networks ContextNet ( Han et al. , 2020 ) and Conformer ( Gulati et al. , 2020 ) . We will then discuss the training algorithm of Dual-mode ASR networks including joint training and inplace knowledge distillation .
This paper proposes a unified single neural network architecture to realize both streaming and full-context ASR systems. The idea is simple but very efficient. It uses the same model for both streaming and full-context ASR systems, but when we use the streaming mode, some of the network operations that use the future context are ignored (e.g., ignore the future context kernel in CNN, self-attention, or pooling is performed only with the current and history frames). The two modes interact with each other by teacher-student training, where the teacher is the full-context mode while the student is the streaming mode. The paper is well-written overall, but it requires some clarification (see my comments below).
SP:c1096552a3d3382c17df2bb6a2cde86df3d1eb30
Dual-mode ASR: Unify and Improve Streaming ASR with Full-context Modeling
1 INTRODUCTION . “ Ok Google . Hey Siri . Hi Alexa. ” have featured a massive boom of smart speakers in recent years , unveiling a trend towards ubiquitous and ambient Artificial Intelligence ( AI ) for better daily lives . As the communication bridge between human and machine , low-latency streaming ASR ( a.k.a. , online ASR ) is of central importance , whose goal is to emit each hypothesized word as quickly and accurately as possible on the fly as they are spoken . On the other hand , there are some scenarios where full-context ASR ( a.k.a. , offline ASR ) is sufficient , for example , offline video captioning on video-sharing platforms . While low-latency streaming ASR is generally preferred in most of the speech recognition scenarios , it often has worse prediction accuracy as measured in Word Error Rate ( WER ) , due to the lack of future context compared with full-context ASR . Improving both WER and emission latency has been shown to be highly challenging ( He et al. , 2019 ; Li et al. , 2020a ; Sainath et al. , 2020 ) in streaming ASR systems . Since the acoustic , pronunciation , and language model ( AM , PM , and LM ) of a conventional ASR system have been evolved into a single end-to-end ( E2E ) all-neural network , modern streaming and full-context ASR models share most of the neural architectures and training recipes in common , such as , Mel-spectrogram inputs , data augmentations , neural network meta-architectures , training objectives , model regularization techniques and decoding methods . The most significant difference is that streaming ASR encoders are auto-regressive models , with the prediction of the current timestep conditioned on previous ones ( no future context is permitted ) . Specifically , let x and y be the input and output sequence , t as frame index , T as total length of frames . Streaming ASR encoders model the output yt as a function of input x1 : t while full-context ASR encoders model the output yt as a function of input x1 : T . Streaming ASR encoders can be built with uni-directional LSTMs , causal convolution and left-context attention layers in streaming ASR encoders ( Chiu & Raffel , 2018 ; Fan et al. , 2018 ; Han et al. , 2020 ; Gulati et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Miao †equal contribution et al. , 2020 ; Tsunoo et al. , 2020 ; Zhang et al. , 2020 ; Yeh et al. , 2019 ) . Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) are commonly used as the decoder in both streaming and fullcontext models , which predicts the token of the current input frame based on all previous tokens using uni-directional recurrent layers . Figure 1 illustrates a simplified example of the similarity and difference between streaming and full-context ASR models with E2E neural networks . Albeit the similarities , streaming and full-context ASR models are usually developed , trained , and deployed separately . In this work , we propose Dual-mode ASR , a framework to unify streaming and full-context speech recognition networks with shared weights . Dual-mode ASR comes with many immediate benefits , including reduced model download and storage on devices and simplified development and deployment workflows . To accomplish this goal , we first introduce Dual-mode Encoders , which can run in both streaming mode and full-context mode . Dual-mode encoders are designed to reuse the same set of model weights for both modes with zero or near-zero parameters overhead . We propose the design principles of a dual-mode encoder and show examples on how to design dual-mode convolution , dual-mode pooling , and dual-mode attention layers . We also investigate into different training algorithms for Dual-mode ASR , specifically , randomly sampled training and joint training . We show that joint training significantly outperforms randomly sampled training in terms of model quality and training stability . Moreover , motivated by Inplace Knowledge Distillation ( Yu & Huang , 2019b ) in which a large model is used to supervise a small model , we propose to distill knowledge from the full-context mode ( teacher ) into the streaming mode ( student ) on the fly during the training within the same Dual-mode ASR model , by encouraging consistency of the predicted token probabilities . We demonstrate that the emission latency and prediction accuracy of streaming ASR significantly benefit from weight sharing and joint training of its full-context mode , especially with inplace knowledge distillation during the training . We present extensive experiments with two state-of-theart ASR networks , convolution-based ContextNet ( Han et al. , 2020 ) and conv-transformer hybrid Conformer ( Gulati et al. , 2020 ) , on two datasets , a widely used public dataset LibriSpeech ( Panay- otov et al. , 2015 ) ( 970 hours of English reading speech ) and a large-scale dataset MultiDomain ( Narayanan et al. , 2018 ) ( 413,000 hours speech of a mixture across multiple domains including Voice Search , Farfield Speech , YouTube and Meetings ) . For each proposed technique , we also present ablation study and analysis to demonstrate and understand the effectiveness . With Dual-mode ASR , we achieve new state-of-the-art streaming ASR results on both LibriSpeech and MultiDomain in terms of accuracy and latency . 2 RELATED WORK . Streaming ASR Networks . There has been a growing interest in building streaming ASR systems based on E2E Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) . Compared with sequence-to-sequence models ( Chorowski et al. , 2014 ; 2015 ; Chorowski & Jaitly , 2016 ; Bahdanau et al. , 2016 ; Chan et al. , 2016 ) , RNN-T models are naturally streamable and have shown great potentials for low-latency streaming ASR ( Chang et al. , 2019 ; He et al. , 2019 ; Tsunoo et al. , 2019 ; Sainath et al. , 2019 ; Shen et al. , 2019 ; Li et al. , 2020a ; b ; Sainath et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Narayanan et al. , 2020 ) . In this work , we mainly focus on RNN-T based models . He et al . specifically studied how to optimize the RNN-T streaming ASR model for mobile devices , and proposed a bag of techniques including using layer normalization and large batch size to stabilize training ; using word-piece targets ( Wu et al. , 2016 ) ; using a time-reduction layer to speed up training and inference ; quantizing network parameters to reduce memory footprint and speed up computation ; applying shallow-fusion to bias towards user-specific context . To support streaming modeling in E2E ASR models , various efforts have also been made by modifying attention-based models such as monotonic attention ( Raffel et al. , 2017 ; Chiu & Raffel , 2017 ; Fan et al. , 2018 ; Arivazhagan et al. , 2019 ) , GMM attention ( Graves , 2013 ; Chiu et al. , 2019 ) , triggered attention ( TA ) ( Moritz et al. , 2019 ) , Scout Network ( Wang et al. , 2020 ) , and approaches that segment encoder output into non-overlapping chunks ( Jaitly et al. , 2016 ; Tsunoo et al. , 2020 ) . Tsunoo et al . also applied knowledge distillation from the non-streaming model to the streaming model , but their streaming and non-streaming models do not share weights and are trained separately . To improve the latency of RNN-T streaming models , Li et al . investigated additional early and late penalties on Endpointer prediction ( Chang et al. , 2019 ) to reduce the emission latency , and employed the minimum word error rate ( MWER ) training ( Prabhavalkar et al. , 2018 ) to remedy accuracy degradation . Sainath et al . further proposed to improve quality by using two-pass models ( Sainath et al. , 2019 ) , i.e. , a second-pass LAS-based rescore model on top of the hypotheses from first-pass RNN-T streaming output . More recently , Li et al . proposed parallel rescoring by replacing LSTMs with Transformers ( Vaswani et al. , 2017 ) in rescoring models . Chang et al . further proposed Prefetching to reduce system latency by submitting partial recognition results for subsequent processing such as obtaining assistant server responses or second-pass rescoring before the recognition result is finalized . Unlike these approaches , our work explores the unification of streaming and fullcontext ASR networks , thus can be generally applied as an add-on technique without requiring extra runtime support during inference . Weight Sharing for Multi-tasking . Sharing model weights of a deep neural network for multiple tasks has been widely explored in the literature to reduce overall model sizes . In the broadest sense , tasks can refer to different objectives or same objective but different settings , ranging from natural language processing and speech recognition to computer vision and reinforcement learning . In speech recognition , Kannan et al . employed a single ASR network for multilingual ASR , and showed accuracy improvements over monolingual ASR systems . Wu et al . proposed dynamic sparsity neural networks ( DSNN ) for speech recognition on mobile devices with resource constraints . A single trained DSNN ( Wu et al. , 2020 ) can transform into multiple networks of different sparsities for adaptive inference in real-time . Chang et al . trained a single RNN-T model with LSTMs ( Hochreiter & Schmidhuber , 1997 ) for Joint Endpointing ( i.e. , predicting both recognition tokens and the end of an utterance transcription ) in streaming ASR systems . Moreover , Watanabe et al . proposed a hybrid CTC and attention architecture for ASR based on multi-objective learning to eliminate the use of linguistic resources . Another related research work in Computer Vision is Slimmable Neural Networks ( Yu et al. , 2018 ; Yu & Huang , 2019a ; b ; Yu et al. , 2020 ) . Yu et al . proposed an approach to train a single neural network running at different widths , permitting instant and adaptive accuracy efficiency trade-offs at runtime . We also adapt the training rules introduced in slimmable networks , that is , using independent normalization layers for different sub-networks ( tasks ) as conditional parameters and using the prediction of teacher network to supervise student network as inplace distillation during the training . Unlike slimmable networks in which a large model is used to supervise a small model , we propose to distill the knowledge from full-context mode ( teacher ) into streaming mode ( student ) on the fly within the same Dual-mode ASR model . Knowledge Distillation . Hinton et al . explored a simple method to “ transfer ” knowledge from a teacher neural network to a student neural network by enforcing their predictions to be close measured by KL-divergence , ` 1 or ` 2 distance . It is shown that such distillation method is effective to compress neural networks ( Yu & Huang , 2019b ) , accelerate training ( Chen et al. , 2015 ) , improve robustness ( Carlini & Wagner , 2017 ; Papernot et al. , 2016 ) , estimate model uncertainty ( Blundell et al. , 2015 ) and transfer learned domain to other domains ( Tzeng et al. , 2015 ) . 3 DUAL-MODE ASR . Most neural sequence transduction networks for ASR have an encoder-decoder structure ( Graves , 2012 ; Sainath et al. , 2020 ; He et al. , 2019 ; Li et al. , 2020a ) , as shown in Figure 1 . Without loss of generality , here we discuss how to design Dual-mode ASR networks under the most commonly used RNN-T model ( Graves , 2012 ) . In RNN-T models , we first extract mel-spectrogram feature from input speech waveform . The Mel-spectrogram feature is then fed into a neural-net encoder , which usually consists of feed-forward layers , RNN/LSTM layers , convolution layers , attention layers , pooling ( time-reduction ) layers , and residual or dense connections . In neural-net encoders , streaming ASR model requires all components to be auto-regressive , whereas full-context ASR model has no such requirement . The ASR decoder then predicts the token of current frame based on the output from the encoder and previous predicted tokens ( inference ) or target tokens ( training with teacher forcing ( Williams & Zipser , 1989 ) ) . The decoder is commonly an auto-regressive model in both streaming and full-context ASR models , thus is fully shared in Dual-mode ASR . The prediction from decoder is finally used either in decoding algorithm during inference ( e.g. , beam search ) or learning algorithm during training ( e.g. , RNN-T loss ) . As discussed above and shown in Figure 1 , it becomes clear that the major difference between streaming and full-context ASR models is in the neural-net encoder . In the following , we will first discuss the design principles of dual-mode encoder to support both streaming and full-context ASR . We provide examples including dual-mode convolution , dual-mode average pooling , and dual-mode attention layers , which are widely used in the state-of-the-art ASR networks ContextNet ( Han et al. , 2020 ) and Conformer ( Gulati et al. , 2020 ) . We will then discuss the training algorithm of Dual-mode ASR networks including joint training and inplace knowledge distillation .
This paper proposes an unified framework for both streaming and non-streaming ASR and the knowledge transfer between them. The results show that both latency and performance are improved. The benefit of training full-context and streaming together are two folds: 1) Current full-context and streaming ASR are trained separately. Since usually the performance of streaming ASR is inferior to the full-context version, the unified training scheme could enforce the model to fit both tasks well, thus could serve as some kind of regularization. 2) The weight sharing proposed in this paper could make it more efficient for deploying both streaming and non-streaming ASR at the same time.
SP:c1096552a3d3382c17df2bb6a2cde86df3d1eb30
Dual-mode ASR: Unify and Improve Streaming ASR with Full-context Modeling
1 INTRODUCTION . “ Ok Google . Hey Siri . Hi Alexa. ” have featured a massive boom of smart speakers in recent years , unveiling a trend towards ubiquitous and ambient Artificial Intelligence ( AI ) for better daily lives . As the communication bridge between human and machine , low-latency streaming ASR ( a.k.a. , online ASR ) is of central importance , whose goal is to emit each hypothesized word as quickly and accurately as possible on the fly as they are spoken . On the other hand , there are some scenarios where full-context ASR ( a.k.a. , offline ASR ) is sufficient , for example , offline video captioning on video-sharing platforms . While low-latency streaming ASR is generally preferred in most of the speech recognition scenarios , it often has worse prediction accuracy as measured in Word Error Rate ( WER ) , due to the lack of future context compared with full-context ASR . Improving both WER and emission latency has been shown to be highly challenging ( He et al. , 2019 ; Li et al. , 2020a ; Sainath et al. , 2020 ) in streaming ASR systems . Since the acoustic , pronunciation , and language model ( AM , PM , and LM ) of a conventional ASR system have been evolved into a single end-to-end ( E2E ) all-neural network , modern streaming and full-context ASR models share most of the neural architectures and training recipes in common , such as , Mel-spectrogram inputs , data augmentations , neural network meta-architectures , training objectives , model regularization techniques and decoding methods . The most significant difference is that streaming ASR encoders are auto-regressive models , with the prediction of the current timestep conditioned on previous ones ( no future context is permitted ) . Specifically , let x and y be the input and output sequence , t as frame index , T as total length of frames . Streaming ASR encoders model the output yt as a function of input x1 : t while full-context ASR encoders model the output yt as a function of input x1 : T . Streaming ASR encoders can be built with uni-directional LSTMs , causal convolution and left-context attention layers in streaming ASR encoders ( Chiu & Raffel , 2018 ; Fan et al. , 2018 ; Han et al. , 2020 ; Gulati et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Miao †equal contribution et al. , 2020 ; Tsunoo et al. , 2020 ; Zhang et al. , 2020 ; Yeh et al. , 2019 ) . Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) are commonly used as the decoder in both streaming and fullcontext models , which predicts the token of the current input frame based on all previous tokens using uni-directional recurrent layers . Figure 1 illustrates a simplified example of the similarity and difference between streaming and full-context ASR models with E2E neural networks . Albeit the similarities , streaming and full-context ASR models are usually developed , trained , and deployed separately . In this work , we propose Dual-mode ASR , a framework to unify streaming and full-context speech recognition networks with shared weights . Dual-mode ASR comes with many immediate benefits , including reduced model download and storage on devices and simplified development and deployment workflows . To accomplish this goal , we first introduce Dual-mode Encoders , which can run in both streaming mode and full-context mode . Dual-mode encoders are designed to reuse the same set of model weights for both modes with zero or near-zero parameters overhead . We propose the design principles of a dual-mode encoder and show examples on how to design dual-mode convolution , dual-mode pooling , and dual-mode attention layers . We also investigate into different training algorithms for Dual-mode ASR , specifically , randomly sampled training and joint training . We show that joint training significantly outperforms randomly sampled training in terms of model quality and training stability . Moreover , motivated by Inplace Knowledge Distillation ( Yu & Huang , 2019b ) in which a large model is used to supervise a small model , we propose to distill knowledge from the full-context mode ( teacher ) into the streaming mode ( student ) on the fly during the training within the same Dual-mode ASR model , by encouraging consistency of the predicted token probabilities . We demonstrate that the emission latency and prediction accuracy of streaming ASR significantly benefit from weight sharing and joint training of its full-context mode , especially with inplace knowledge distillation during the training . We present extensive experiments with two state-of-theart ASR networks , convolution-based ContextNet ( Han et al. , 2020 ) and conv-transformer hybrid Conformer ( Gulati et al. , 2020 ) , on two datasets , a widely used public dataset LibriSpeech ( Panay- otov et al. , 2015 ) ( 970 hours of English reading speech ) and a large-scale dataset MultiDomain ( Narayanan et al. , 2018 ) ( 413,000 hours speech of a mixture across multiple domains including Voice Search , Farfield Speech , YouTube and Meetings ) . For each proposed technique , we also present ablation study and analysis to demonstrate and understand the effectiveness . With Dual-mode ASR , we achieve new state-of-the-art streaming ASR results on both LibriSpeech and MultiDomain in terms of accuracy and latency . 2 RELATED WORK . Streaming ASR Networks . There has been a growing interest in building streaming ASR systems based on E2E Recurrent Neural Network Transducers ( RNN-T ) ( Graves , 2012 ) . Compared with sequence-to-sequence models ( Chorowski et al. , 2014 ; 2015 ; Chorowski & Jaitly , 2016 ; Bahdanau et al. , 2016 ; Chan et al. , 2016 ) , RNN-T models are naturally streamable and have shown great potentials for low-latency streaming ASR ( Chang et al. , 2019 ; He et al. , 2019 ; Tsunoo et al. , 2019 ; Sainath et al. , 2019 ; Shen et al. , 2019 ; Li et al. , 2020a ; b ; Sainath et al. , 2020 ; Huang et al. , 2020 ; Moritz et al. , 2020 ; Narayanan et al. , 2020 ) . In this work , we mainly focus on RNN-T based models . He et al . specifically studied how to optimize the RNN-T streaming ASR model for mobile devices , and proposed a bag of techniques including using layer normalization and large batch size to stabilize training ; using word-piece targets ( Wu et al. , 2016 ) ; using a time-reduction layer to speed up training and inference ; quantizing network parameters to reduce memory footprint and speed up computation ; applying shallow-fusion to bias towards user-specific context . To support streaming modeling in E2E ASR models , various efforts have also been made by modifying attention-based models such as monotonic attention ( Raffel et al. , 2017 ; Chiu & Raffel , 2017 ; Fan et al. , 2018 ; Arivazhagan et al. , 2019 ) , GMM attention ( Graves , 2013 ; Chiu et al. , 2019 ) , triggered attention ( TA ) ( Moritz et al. , 2019 ) , Scout Network ( Wang et al. , 2020 ) , and approaches that segment encoder output into non-overlapping chunks ( Jaitly et al. , 2016 ; Tsunoo et al. , 2020 ) . Tsunoo et al . also applied knowledge distillation from the non-streaming model to the streaming model , but their streaming and non-streaming models do not share weights and are trained separately . To improve the latency of RNN-T streaming models , Li et al . investigated additional early and late penalties on Endpointer prediction ( Chang et al. , 2019 ) to reduce the emission latency , and employed the minimum word error rate ( MWER ) training ( Prabhavalkar et al. , 2018 ) to remedy accuracy degradation . Sainath et al . further proposed to improve quality by using two-pass models ( Sainath et al. , 2019 ) , i.e. , a second-pass LAS-based rescore model on top of the hypotheses from first-pass RNN-T streaming output . More recently , Li et al . proposed parallel rescoring by replacing LSTMs with Transformers ( Vaswani et al. , 2017 ) in rescoring models . Chang et al . further proposed Prefetching to reduce system latency by submitting partial recognition results for subsequent processing such as obtaining assistant server responses or second-pass rescoring before the recognition result is finalized . Unlike these approaches , our work explores the unification of streaming and fullcontext ASR networks , thus can be generally applied as an add-on technique without requiring extra runtime support during inference . Weight Sharing for Multi-tasking . Sharing model weights of a deep neural network for multiple tasks has been widely explored in the literature to reduce overall model sizes . In the broadest sense , tasks can refer to different objectives or same objective but different settings , ranging from natural language processing and speech recognition to computer vision and reinforcement learning . In speech recognition , Kannan et al . employed a single ASR network for multilingual ASR , and showed accuracy improvements over monolingual ASR systems . Wu et al . proposed dynamic sparsity neural networks ( DSNN ) for speech recognition on mobile devices with resource constraints . A single trained DSNN ( Wu et al. , 2020 ) can transform into multiple networks of different sparsities for adaptive inference in real-time . Chang et al . trained a single RNN-T model with LSTMs ( Hochreiter & Schmidhuber , 1997 ) for Joint Endpointing ( i.e. , predicting both recognition tokens and the end of an utterance transcription ) in streaming ASR systems . Moreover , Watanabe et al . proposed a hybrid CTC and attention architecture for ASR based on multi-objective learning to eliminate the use of linguistic resources . Another related research work in Computer Vision is Slimmable Neural Networks ( Yu et al. , 2018 ; Yu & Huang , 2019a ; b ; Yu et al. , 2020 ) . Yu et al . proposed an approach to train a single neural network running at different widths , permitting instant and adaptive accuracy efficiency trade-offs at runtime . We also adapt the training rules introduced in slimmable networks , that is , using independent normalization layers for different sub-networks ( tasks ) as conditional parameters and using the prediction of teacher network to supervise student network as inplace distillation during the training . Unlike slimmable networks in which a large model is used to supervise a small model , we propose to distill the knowledge from full-context mode ( teacher ) into streaming mode ( student ) on the fly within the same Dual-mode ASR model . Knowledge Distillation . Hinton et al . explored a simple method to “ transfer ” knowledge from a teacher neural network to a student neural network by enforcing their predictions to be close measured by KL-divergence , ` 1 or ` 2 distance . It is shown that such distillation method is effective to compress neural networks ( Yu & Huang , 2019b ) , accelerate training ( Chen et al. , 2015 ) , improve robustness ( Carlini & Wagner , 2017 ; Papernot et al. , 2016 ) , estimate model uncertainty ( Blundell et al. , 2015 ) and transfer learned domain to other domains ( Tzeng et al. , 2015 ) . 3 DUAL-MODE ASR . Most neural sequence transduction networks for ASR have an encoder-decoder structure ( Graves , 2012 ; Sainath et al. , 2020 ; He et al. , 2019 ; Li et al. , 2020a ) , as shown in Figure 1 . Without loss of generality , here we discuss how to design Dual-mode ASR networks under the most commonly used RNN-T model ( Graves , 2012 ) . In RNN-T models , we first extract mel-spectrogram feature from input speech waveform . The Mel-spectrogram feature is then fed into a neural-net encoder , which usually consists of feed-forward layers , RNN/LSTM layers , convolution layers , attention layers , pooling ( time-reduction ) layers , and residual or dense connections . In neural-net encoders , streaming ASR model requires all components to be auto-regressive , whereas full-context ASR model has no such requirement . The ASR decoder then predicts the token of current frame based on the output from the encoder and previous predicted tokens ( inference ) or target tokens ( training with teacher forcing ( Williams & Zipser , 1989 ) ) . The decoder is commonly an auto-regressive model in both streaming and full-context ASR models , thus is fully shared in Dual-mode ASR . The prediction from decoder is finally used either in decoding algorithm during inference ( e.g. , beam search ) or learning algorithm during training ( e.g. , RNN-T loss ) . As discussed above and shown in Figure 1 , it becomes clear that the major difference between streaming and full-context ASR models is in the neural-net encoder . In the following , we will first discuss the design principles of dual-mode encoder to support both streaming and full-context ASR . We provide examples including dual-mode convolution , dual-mode average pooling , and dual-mode attention layers , which are widely used in the state-of-the-art ASR networks ContextNet ( Han et al. , 2020 ) and Conformer ( Gulati et al. , 2020 ) . We will then discuss the training algorithm of Dual-mode ASR networks including joint training and inplace knowledge distillation .
The paper proposes a pragmatic approach to unifying end-to-end speech-recognition models for whole-utterance and streaming models. Streaming models are defined as not using any future audio, while whole-utterance (or "full context") models can look at the entire audio recording. In short, the paper shows that multi-task training is effective, where each minibatch uses each utterance twice: Once as using the whole-utterance model structure, and once using a modified model structure where all model weights referring to future information are forced to be zero.
SP:c1096552a3d3382c17df2bb6a2cde86df3d1eb30
Interpreting Graph Neural Networks for NLP With Differentiable Edge Masking
1 INTRODUCTION . Graph Neural Networks ( GNNs ) have in recent years been shown to provide a scalable and highly performant means of incorporating linguistic information and other structural biases into NLP models . They have been applied to various kinds of representations ( e.g. , syntactic and semantic graphs , co-reference structures , knowledge bases linked to text , database schemas ) and shown effective on a range of tasks , including relation extraction ( Zhang et al. , 2018 ; Zhu et al. , 2019 ; Sun et al. , 2019a ; Guo et al. , 2019 ) , question answering ( Sorokin & Gurevych , 2018 ; Sun et al. , 2018 ; De Cao et al. , 2019 ) , syntactic and semantic parsing tasks ( Marcheggiani & Titov , 2017 ; Bogin et al. , 2019 ; Ji et al. , 2019 ) , summarisation ( Fernandes et al. , 2019 ) , machine translation ( Bastings et al. , 2017 ) and abusive language detection in social networks ( Mishra et al. , 2019 ) . While GNNs often yield strong performance , such models are complex , and it can be difficult to understand the ‘ reasoning ’ behind their predictions . For NLP practitioners , it is highly desirable to know which linguistic information a given model encodes and how that encoding happens ( Jumelet & Hupkes , 2018 ; Giulianelli et al. , 2018 ; Goldberg , 2019 ) . The difficulty in interpreting GNNs represents a barrier to such analysis . Furthermore , this opaqueness decreases user trust , impedes the discovery of harmful biases , and complicates error analysis ( Kim , 2015 ; Ribeiro et al. , 2016b ; Sun et al. , 2019b ; Holstein et al. , 2019 ) . The latter is a particular issue for GNNs , where seemingly small implementation differences can make or break models ( Zaheer et al. , 2017 ; Xu et al. , 2019 ) . In this work , we focus on post-hoc analysis of GNNs . We are interested especially in developing a method for understanding how the GNN uses the input graph . As such , we seek to identify which edges in the graph the GNN relies on , and at which layer they are used . We formulate some desiderata for an interpretation method , seeking a technique that is : 1. able to identify relevant paths in the input graph , as paths are one of the most natural ways of presenting GNN reasoning patterns to users ; 2. sufficiently tractable to be applicable to modern GNN-based NLP models ; 3. as faithful ( Jacovi & Goldberg , 2020 ) as possible , providing insights into how the model truly arrives at the prediction . A simple way to perform interpretation is to use erasure search ( Li et al. , 2016 ; Feng et al. , 2018 ) , an approach wherein attribution happens by searching for a maximal subset of features that can be entirely removed without affecting model predictions . The removal guarantees that all information about the discarded features is ignored by the model . This contrasts with approaches which use heuristics to define feature importance , for example attention-based methods ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) or back-propagation techniques ( Bach et al. , 2015 ; Sundararajan et al. , 2017 ) . They do not guarantee that the model ignores low-scoring features , attracting criticism in recent years ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) . The trust in erasure search is reflected in the literature through other methods motivated as approximations of erasure ( Baehrens et al. , 2010 ; Simonyan et al. , 2014 ) , or through new attribution techniques evaluated using erasure search as ground truth ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) . Applied to GNNs , erasure search would involve searching for the largest subgraph which can be completely discarded . Besides faithfulness considerations and conceptual simplicity , discrete attributions would also simplify the comparison of relevance between paths ; this contrasts with continuous attribution to edges , where it is not straightforward to extract and visualise important paths . Furthermore , in contrast to techniques based on artificial gradients ( Pope et al. , 2019 ; Xie & Lu , 2019 ; Schwarzenberg et al. , 2019 ) , erasure search would provide implementation invariance ( Sundararajan et al. , 2017 ) . This is important in NLP , as models commonly use highly parametrised decoders on top of GNNs ( e.g. , Koncel-Kedziorski et al . ( 2019 ) ) . While arguably satisfying criteria ( 1 ) and ( 3 ) in our desiderata , erasure search unfortunately fails on tractability . In practical scenarios , it is infeasible , and even approximations , which remove one feature at a time ( Zintgraf et al. , 2017 ) and underestimate their contribution due to saturation ( Shrikumar et al. , 2017 ) , remain prohibitively expensive . Our GRAPHMASK aims at meeting the above desiderata by achieving the same benefits as erasure search in a scalable manner . That is , our method makes easily interpretable hard choices on whether to retain or discard edges such that discarded edges have no relevance to model predictions , while remaining tractable and model-agnostic ( Ribeiro et al. , 2016a ) . GRAPHMASK can be understood as a differentiable form of subset erasure , where , instead of finding an optimal subset to erase for every given example , we learn an erasure function which predicts for every edge 〈u , v〉 at every layer k whether that connection should be retained . Given an example graph G , our method returns for each layer k a subgraph G ( k ) S such that we can faithfully claim that no edges outside G ( k ) S influence the predictions of the model . To enable gradient-based optimization for our erasure function , we rely on sparse stochastic gates ( Louizos et al. , 2018 ; Bastings et al. , 2019 ) . In erasure search , optimisation happens individually for each example . This can result in a form of overfitting where even non-superfluous edges are aggressively pruned because a similar prediction could be made using an alternative smaller subgraph ; we refer to this problem as hindsight bias . Because our interpretation method relies on a parametrised erasure function rather than an individual per-edge choice , we can address this issue by amortising parameter learning over a training dataset through a process similar to the readout bottleneck introduced in Schulz et al . ( 2020 ) . In other words , the decision to drop or keep an edge is made based on the information available in the network ( i.e. , representation of the graph nodes ) without having access to the final prediction ( or to the gold standard ) . As we demonstrate in Section 4 , this strategy avoids hindsight bias . Contributions Our contributions are as follows : • We present a novel interpretation method for GNNs , applicable potentially to any end-toend neural model which has a GNN as a component.1 • We demonstrate using artificial data the shortcomings of the closest existing method , and show how our method addresses those shortcomings and improves faithfulness . • We use GRAPHMASK to analyse GNN models for two NLP tasks : semantic role label- ing ( Marcheggiani & Titov , 2017 ) and multi-hop question answering ( De Cao et al. , 2019 ) . 2 RELATED WORK . Several recent papers have focused on developing interpretability techniques for GNNs . The closest to ours is GNNExplainer ( Ying et al. , 2019 ) , wherein a soft erasure function for edges is learned individually for each example . Unlike our method ( and erasure search ) , GNNExplainer can not as such guarantee that gated edges do not affect predictions . Furthermore , as we show in our experiments ( Section 4 ) , separate optimisation for each example results in hindsight bias and compromises faithfulness . Pope et al . ( 2019 ) ; Xie & Lu ( 2019 ) explore gradient-based methods , including gradient heatmaps , Grad-CAM , and Excitation Backpropagation . Similarly , Schwarzenberg et al . ( 2019 ) ; Baldassarre & Azizpour ( 2019 ) ; Schnake et al . ( 2020 ) apply Layerwise Relevance Propagation ( Bach et al. , 2015 ) to the GNN setting . These methods represent an alternative to GRAPHMASK , but as we have noted their faithfulness is questionable ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) , and the lack of implementation invariance ( Sundararajan et al. , 2017 ) is problematic ( see Appendix H ) . Furthermore , significant engineering is still required to develop these techniques for certain GNNs , e.g . networks with attention as the aggregation function ( Veličković et al. , 2018 ) . Another popular approach is to treat attention or gate scores as a measure of importance ( Serrano & Smith , 2019 ) . However , even leaving questionable faithfulness ( Jain & Wallace , 2019 ) aside , many GNNs use neither gates nor attention . For those that do ( Marcheggiani & Titov , 2017 ; Veličković et al. , 2018 ; Neil et al. , 2018 ; Xie & Grossman , 2018 ) , such scores are , as we demonstrate in Section 6 , not necessarily informative , as gates can function to scale rather than filter messages . Outside of graph-specific methods , one line of research involves decomposing the output into a part attributed to a specific subset of features and a part attributed to the remaining features ( Shapley , 1953 ; Murdoch et al. , 2019 ; Singh et al. , 2019 ; Jin et al. , 2020 ) . For GNNs , the computational cost for realistic use cases ( e.g . the thousands of edges per example in De Cao et al . ( 2019 ) ) is prohibitive . LIME ( Ribeiro et al. , 2016b ) like us relies on a trained erasure model , but interprets local models in place of global models . Local models can not trivially identify useful paths or long-distance dependent pairs of edges , and as also pointed out in Ying et al . ( 2019 ) LIME can not be easily applied for large general graphs . Similarly , it is unclear how to apply integrated gradients ( Sundararajan et al. , 2017 ) to retrieve relevant paths , especially for deep GNNs operating in large graphs . Masking messages in GRAPHMASK can be equivalently thought of as adding a certain type of noise to these messages . Therefore , GRAPHMASK can be categorised as belonging to the recently introduced class of perturbation-based methods ( Guan et al. , 2019 ; Taghanaki et al. , 2019 ; Schulz et al. , 2020 ) which equate feature importance with sensitivity of the prediction to the perturbations of that feature . The closest to our model is Schulz et al . ( 2020 ) , wherein the authors like us apply a secondary , trained model to predict the relevancy of a feature in a given layer . Unlike us , this trained model has ‘ look-ahead ’ , i.e . access to layers above the studied layer , making their model vulnerable to hindsight bias . Their approach uses soft gates on individual hidden state dimension to interpolate between hidden states , Gaussian noise in order to detect important features for CNNs on an image processing task , and makes independent Gaussian assumptions on the features to derive their objective . We adapted their method to GNNs and used it as a baseline in our experiments . In our very recent work ( De Cao et al. , 2020 ) we have introduced a similar differentiable masking approach to post-hoc analysis for transformers . We used sparse stochastic gates and L0 regularisation to determine which input tokens can be dropped , conditioning on various hidden layers . Concurrently to this paper , Luo et al . ( 2020 ) have also developed an interpretability technique for GNNs relying on differentiable edge masking . Their approach uses a mutual information objective like GNNExplainer , along with local binary concrete classifiers as in GRAPHMASK . 1Source code available at https : //github.com/MichSchli/GraphMask .
of the paper*: This paper introduces a post-hoc method -- GraphMask, to interpret the prediction of GNNs. For each edge in the GNNs, the authors introduce a learnable hard gate which indicates whether this edge could be erased or not. The gates can be trained together with the model in a fully differentiable way. By analyzing the GNN models' behavior on two tasks -- question answering and semantic role labeling, the authors find that a large proportion of edges could be dropped without deteriorating the performance of the model. At the same time, the remaining edges could be used for interpreting model predictions.
SP:758ab3741de56ebbac4d505a0c15670c55177023
Interpreting Graph Neural Networks for NLP With Differentiable Edge Masking
1 INTRODUCTION . Graph Neural Networks ( GNNs ) have in recent years been shown to provide a scalable and highly performant means of incorporating linguistic information and other structural biases into NLP models . They have been applied to various kinds of representations ( e.g. , syntactic and semantic graphs , co-reference structures , knowledge bases linked to text , database schemas ) and shown effective on a range of tasks , including relation extraction ( Zhang et al. , 2018 ; Zhu et al. , 2019 ; Sun et al. , 2019a ; Guo et al. , 2019 ) , question answering ( Sorokin & Gurevych , 2018 ; Sun et al. , 2018 ; De Cao et al. , 2019 ) , syntactic and semantic parsing tasks ( Marcheggiani & Titov , 2017 ; Bogin et al. , 2019 ; Ji et al. , 2019 ) , summarisation ( Fernandes et al. , 2019 ) , machine translation ( Bastings et al. , 2017 ) and abusive language detection in social networks ( Mishra et al. , 2019 ) . While GNNs often yield strong performance , such models are complex , and it can be difficult to understand the ‘ reasoning ’ behind their predictions . For NLP practitioners , it is highly desirable to know which linguistic information a given model encodes and how that encoding happens ( Jumelet & Hupkes , 2018 ; Giulianelli et al. , 2018 ; Goldberg , 2019 ) . The difficulty in interpreting GNNs represents a barrier to such analysis . Furthermore , this opaqueness decreases user trust , impedes the discovery of harmful biases , and complicates error analysis ( Kim , 2015 ; Ribeiro et al. , 2016b ; Sun et al. , 2019b ; Holstein et al. , 2019 ) . The latter is a particular issue for GNNs , where seemingly small implementation differences can make or break models ( Zaheer et al. , 2017 ; Xu et al. , 2019 ) . In this work , we focus on post-hoc analysis of GNNs . We are interested especially in developing a method for understanding how the GNN uses the input graph . As such , we seek to identify which edges in the graph the GNN relies on , and at which layer they are used . We formulate some desiderata for an interpretation method , seeking a technique that is : 1. able to identify relevant paths in the input graph , as paths are one of the most natural ways of presenting GNN reasoning patterns to users ; 2. sufficiently tractable to be applicable to modern GNN-based NLP models ; 3. as faithful ( Jacovi & Goldberg , 2020 ) as possible , providing insights into how the model truly arrives at the prediction . A simple way to perform interpretation is to use erasure search ( Li et al. , 2016 ; Feng et al. , 2018 ) , an approach wherein attribution happens by searching for a maximal subset of features that can be entirely removed without affecting model predictions . The removal guarantees that all information about the discarded features is ignored by the model . This contrasts with approaches which use heuristics to define feature importance , for example attention-based methods ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) or back-propagation techniques ( Bach et al. , 2015 ; Sundararajan et al. , 2017 ) . They do not guarantee that the model ignores low-scoring features , attracting criticism in recent years ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) . The trust in erasure search is reflected in the literature through other methods motivated as approximations of erasure ( Baehrens et al. , 2010 ; Simonyan et al. , 2014 ) , or through new attribution techniques evaluated using erasure search as ground truth ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) . Applied to GNNs , erasure search would involve searching for the largest subgraph which can be completely discarded . Besides faithfulness considerations and conceptual simplicity , discrete attributions would also simplify the comparison of relevance between paths ; this contrasts with continuous attribution to edges , where it is not straightforward to extract and visualise important paths . Furthermore , in contrast to techniques based on artificial gradients ( Pope et al. , 2019 ; Xie & Lu , 2019 ; Schwarzenberg et al. , 2019 ) , erasure search would provide implementation invariance ( Sundararajan et al. , 2017 ) . This is important in NLP , as models commonly use highly parametrised decoders on top of GNNs ( e.g. , Koncel-Kedziorski et al . ( 2019 ) ) . While arguably satisfying criteria ( 1 ) and ( 3 ) in our desiderata , erasure search unfortunately fails on tractability . In practical scenarios , it is infeasible , and even approximations , which remove one feature at a time ( Zintgraf et al. , 2017 ) and underestimate their contribution due to saturation ( Shrikumar et al. , 2017 ) , remain prohibitively expensive . Our GRAPHMASK aims at meeting the above desiderata by achieving the same benefits as erasure search in a scalable manner . That is , our method makes easily interpretable hard choices on whether to retain or discard edges such that discarded edges have no relevance to model predictions , while remaining tractable and model-agnostic ( Ribeiro et al. , 2016a ) . GRAPHMASK can be understood as a differentiable form of subset erasure , where , instead of finding an optimal subset to erase for every given example , we learn an erasure function which predicts for every edge 〈u , v〉 at every layer k whether that connection should be retained . Given an example graph G , our method returns for each layer k a subgraph G ( k ) S such that we can faithfully claim that no edges outside G ( k ) S influence the predictions of the model . To enable gradient-based optimization for our erasure function , we rely on sparse stochastic gates ( Louizos et al. , 2018 ; Bastings et al. , 2019 ) . In erasure search , optimisation happens individually for each example . This can result in a form of overfitting where even non-superfluous edges are aggressively pruned because a similar prediction could be made using an alternative smaller subgraph ; we refer to this problem as hindsight bias . Because our interpretation method relies on a parametrised erasure function rather than an individual per-edge choice , we can address this issue by amortising parameter learning over a training dataset through a process similar to the readout bottleneck introduced in Schulz et al . ( 2020 ) . In other words , the decision to drop or keep an edge is made based on the information available in the network ( i.e. , representation of the graph nodes ) without having access to the final prediction ( or to the gold standard ) . As we demonstrate in Section 4 , this strategy avoids hindsight bias . Contributions Our contributions are as follows : • We present a novel interpretation method for GNNs , applicable potentially to any end-toend neural model which has a GNN as a component.1 • We demonstrate using artificial data the shortcomings of the closest existing method , and show how our method addresses those shortcomings and improves faithfulness . • We use GRAPHMASK to analyse GNN models for two NLP tasks : semantic role label- ing ( Marcheggiani & Titov , 2017 ) and multi-hop question answering ( De Cao et al. , 2019 ) . 2 RELATED WORK . Several recent papers have focused on developing interpretability techniques for GNNs . The closest to ours is GNNExplainer ( Ying et al. , 2019 ) , wherein a soft erasure function for edges is learned individually for each example . Unlike our method ( and erasure search ) , GNNExplainer can not as such guarantee that gated edges do not affect predictions . Furthermore , as we show in our experiments ( Section 4 ) , separate optimisation for each example results in hindsight bias and compromises faithfulness . Pope et al . ( 2019 ) ; Xie & Lu ( 2019 ) explore gradient-based methods , including gradient heatmaps , Grad-CAM , and Excitation Backpropagation . Similarly , Schwarzenberg et al . ( 2019 ) ; Baldassarre & Azizpour ( 2019 ) ; Schnake et al . ( 2020 ) apply Layerwise Relevance Propagation ( Bach et al. , 2015 ) to the GNN setting . These methods represent an alternative to GRAPHMASK , but as we have noted their faithfulness is questionable ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) , and the lack of implementation invariance ( Sundararajan et al. , 2017 ) is problematic ( see Appendix H ) . Furthermore , significant engineering is still required to develop these techniques for certain GNNs , e.g . networks with attention as the aggregation function ( Veličković et al. , 2018 ) . Another popular approach is to treat attention or gate scores as a measure of importance ( Serrano & Smith , 2019 ) . However , even leaving questionable faithfulness ( Jain & Wallace , 2019 ) aside , many GNNs use neither gates nor attention . For those that do ( Marcheggiani & Titov , 2017 ; Veličković et al. , 2018 ; Neil et al. , 2018 ; Xie & Grossman , 2018 ) , such scores are , as we demonstrate in Section 6 , not necessarily informative , as gates can function to scale rather than filter messages . Outside of graph-specific methods , one line of research involves decomposing the output into a part attributed to a specific subset of features and a part attributed to the remaining features ( Shapley , 1953 ; Murdoch et al. , 2019 ; Singh et al. , 2019 ; Jin et al. , 2020 ) . For GNNs , the computational cost for realistic use cases ( e.g . the thousands of edges per example in De Cao et al . ( 2019 ) ) is prohibitive . LIME ( Ribeiro et al. , 2016b ) like us relies on a trained erasure model , but interprets local models in place of global models . Local models can not trivially identify useful paths or long-distance dependent pairs of edges , and as also pointed out in Ying et al . ( 2019 ) LIME can not be easily applied for large general graphs . Similarly , it is unclear how to apply integrated gradients ( Sundararajan et al. , 2017 ) to retrieve relevant paths , especially for deep GNNs operating in large graphs . Masking messages in GRAPHMASK can be equivalently thought of as adding a certain type of noise to these messages . Therefore , GRAPHMASK can be categorised as belonging to the recently introduced class of perturbation-based methods ( Guan et al. , 2019 ; Taghanaki et al. , 2019 ; Schulz et al. , 2020 ) which equate feature importance with sensitivity of the prediction to the perturbations of that feature . The closest to our model is Schulz et al . ( 2020 ) , wherein the authors like us apply a secondary , trained model to predict the relevancy of a feature in a given layer . Unlike us , this trained model has ‘ look-ahead ’ , i.e . access to layers above the studied layer , making their model vulnerable to hindsight bias . Their approach uses soft gates on individual hidden state dimension to interpolate between hidden states , Gaussian noise in order to detect important features for CNNs on an image processing task , and makes independent Gaussian assumptions on the features to derive their objective . We adapted their method to GNNs and used it as a baseline in our experiments . In our very recent work ( De Cao et al. , 2020 ) we have introduced a similar differentiable masking approach to post-hoc analysis for transformers . We used sparse stochastic gates and L0 regularisation to determine which input tokens can be dropped , conditioning on various hidden layers . Concurrently to this paper , Luo et al . ( 2020 ) have also developed an interpretability technique for GNNs relying on differentiable edge masking . Their approach uses a mutual information objective like GNNExplainer , along with local binary concrete classifiers as in GRAPHMASK . 1Source code available at https : //github.com/MichSchli/GraphMask .
This paper proposes an interpretation method for graph neural networks (GNNs) by learning parameterized, differentiable edge masks. The proposed method uses a single-layer NN classifier to predict whether an edge can be dropped. It further uses L0 norm to encourage sparsity and amortizes parameter learning over a training dataset to avoid the hindsight bias. The method is experimented on a toy dataset (to demonstrate its faithfulness) and two real NLP tasks (multi-hop question answering and semantic role labeling). There are some interesting discussions based on the edge pruning results of these 2 tasks.
SP:758ab3741de56ebbac4d505a0c15670c55177023
Interpreting Graph Neural Networks for NLP With Differentiable Edge Masking
1 INTRODUCTION . Graph Neural Networks ( GNNs ) have in recent years been shown to provide a scalable and highly performant means of incorporating linguistic information and other structural biases into NLP models . They have been applied to various kinds of representations ( e.g. , syntactic and semantic graphs , co-reference structures , knowledge bases linked to text , database schemas ) and shown effective on a range of tasks , including relation extraction ( Zhang et al. , 2018 ; Zhu et al. , 2019 ; Sun et al. , 2019a ; Guo et al. , 2019 ) , question answering ( Sorokin & Gurevych , 2018 ; Sun et al. , 2018 ; De Cao et al. , 2019 ) , syntactic and semantic parsing tasks ( Marcheggiani & Titov , 2017 ; Bogin et al. , 2019 ; Ji et al. , 2019 ) , summarisation ( Fernandes et al. , 2019 ) , machine translation ( Bastings et al. , 2017 ) and abusive language detection in social networks ( Mishra et al. , 2019 ) . While GNNs often yield strong performance , such models are complex , and it can be difficult to understand the ‘ reasoning ’ behind their predictions . For NLP practitioners , it is highly desirable to know which linguistic information a given model encodes and how that encoding happens ( Jumelet & Hupkes , 2018 ; Giulianelli et al. , 2018 ; Goldberg , 2019 ) . The difficulty in interpreting GNNs represents a barrier to such analysis . Furthermore , this opaqueness decreases user trust , impedes the discovery of harmful biases , and complicates error analysis ( Kim , 2015 ; Ribeiro et al. , 2016b ; Sun et al. , 2019b ; Holstein et al. , 2019 ) . The latter is a particular issue for GNNs , where seemingly small implementation differences can make or break models ( Zaheer et al. , 2017 ; Xu et al. , 2019 ) . In this work , we focus on post-hoc analysis of GNNs . We are interested especially in developing a method for understanding how the GNN uses the input graph . As such , we seek to identify which edges in the graph the GNN relies on , and at which layer they are used . We formulate some desiderata for an interpretation method , seeking a technique that is : 1. able to identify relevant paths in the input graph , as paths are one of the most natural ways of presenting GNN reasoning patterns to users ; 2. sufficiently tractable to be applicable to modern GNN-based NLP models ; 3. as faithful ( Jacovi & Goldberg , 2020 ) as possible , providing insights into how the model truly arrives at the prediction . A simple way to perform interpretation is to use erasure search ( Li et al. , 2016 ; Feng et al. , 2018 ) , an approach wherein attribution happens by searching for a maximal subset of features that can be entirely removed without affecting model predictions . The removal guarantees that all information about the discarded features is ignored by the model . This contrasts with approaches which use heuristics to define feature importance , for example attention-based methods ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) or back-propagation techniques ( Bach et al. , 2015 ; Sundararajan et al. , 2017 ) . They do not guarantee that the model ignores low-scoring features , attracting criticism in recent years ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) . The trust in erasure search is reflected in the literature through other methods motivated as approximations of erasure ( Baehrens et al. , 2010 ; Simonyan et al. , 2014 ) , or through new attribution techniques evaluated using erasure search as ground truth ( Serrano & Smith , 2019 ; Jain & Wallace , 2019 ) . Applied to GNNs , erasure search would involve searching for the largest subgraph which can be completely discarded . Besides faithfulness considerations and conceptual simplicity , discrete attributions would also simplify the comparison of relevance between paths ; this contrasts with continuous attribution to edges , where it is not straightforward to extract and visualise important paths . Furthermore , in contrast to techniques based on artificial gradients ( Pope et al. , 2019 ; Xie & Lu , 2019 ; Schwarzenberg et al. , 2019 ) , erasure search would provide implementation invariance ( Sundararajan et al. , 2017 ) . This is important in NLP , as models commonly use highly parametrised decoders on top of GNNs ( e.g. , Koncel-Kedziorski et al . ( 2019 ) ) . While arguably satisfying criteria ( 1 ) and ( 3 ) in our desiderata , erasure search unfortunately fails on tractability . In practical scenarios , it is infeasible , and even approximations , which remove one feature at a time ( Zintgraf et al. , 2017 ) and underestimate their contribution due to saturation ( Shrikumar et al. , 2017 ) , remain prohibitively expensive . Our GRAPHMASK aims at meeting the above desiderata by achieving the same benefits as erasure search in a scalable manner . That is , our method makes easily interpretable hard choices on whether to retain or discard edges such that discarded edges have no relevance to model predictions , while remaining tractable and model-agnostic ( Ribeiro et al. , 2016a ) . GRAPHMASK can be understood as a differentiable form of subset erasure , where , instead of finding an optimal subset to erase for every given example , we learn an erasure function which predicts for every edge 〈u , v〉 at every layer k whether that connection should be retained . Given an example graph G , our method returns for each layer k a subgraph G ( k ) S such that we can faithfully claim that no edges outside G ( k ) S influence the predictions of the model . To enable gradient-based optimization for our erasure function , we rely on sparse stochastic gates ( Louizos et al. , 2018 ; Bastings et al. , 2019 ) . In erasure search , optimisation happens individually for each example . This can result in a form of overfitting where even non-superfluous edges are aggressively pruned because a similar prediction could be made using an alternative smaller subgraph ; we refer to this problem as hindsight bias . Because our interpretation method relies on a parametrised erasure function rather than an individual per-edge choice , we can address this issue by amortising parameter learning over a training dataset through a process similar to the readout bottleneck introduced in Schulz et al . ( 2020 ) . In other words , the decision to drop or keep an edge is made based on the information available in the network ( i.e. , representation of the graph nodes ) without having access to the final prediction ( or to the gold standard ) . As we demonstrate in Section 4 , this strategy avoids hindsight bias . Contributions Our contributions are as follows : • We present a novel interpretation method for GNNs , applicable potentially to any end-toend neural model which has a GNN as a component.1 • We demonstrate using artificial data the shortcomings of the closest existing method , and show how our method addresses those shortcomings and improves faithfulness . • We use GRAPHMASK to analyse GNN models for two NLP tasks : semantic role label- ing ( Marcheggiani & Titov , 2017 ) and multi-hop question answering ( De Cao et al. , 2019 ) . 2 RELATED WORK . Several recent papers have focused on developing interpretability techniques for GNNs . The closest to ours is GNNExplainer ( Ying et al. , 2019 ) , wherein a soft erasure function for edges is learned individually for each example . Unlike our method ( and erasure search ) , GNNExplainer can not as such guarantee that gated edges do not affect predictions . Furthermore , as we show in our experiments ( Section 4 ) , separate optimisation for each example results in hindsight bias and compromises faithfulness . Pope et al . ( 2019 ) ; Xie & Lu ( 2019 ) explore gradient-based methods , including gradient heatmaps , Grad-CAM , and Excitation Backpropagation . Similarly , Schwarzenberg et al . ( 2019 ) ; Baldassarre & Azizpour ( 2019 ) ; Schnake et al . ( 2020 ) apply Layerwise Relevance Propagation ( Bach et al. , 2015 ) to the GNN setting . These methods represent an alternative to GRAPHMASK , but as we have noted their faithfulness is questionable ( Nie et al. , 2018 ; Sixt et al. , 2019 ; Jain & Wallace , 2019 ) , and the lack of implementation invariance ( Sundararajan et al. , 2017 ) is problematic ( see Appendix H ) . Furthermore , significant engineering is still required to develop these techniques for certain GNNs , e.g . networks with attention as the aggregation function ( Veličković et al. , 2018 ) . Another popular approach is to treat attention or gate scores as a measure of importance ( Serrano & Smith , 2019 ) . However , even leaving questionable faithfulness ( Jain & Wallace , 2019 ) aside , many GNNs use neither gates nor attention . For those that do ( Marcheggiani & Titov , 2017 ; Veličković et al. , 2018 ; Neil et al. , 2018 ; Xie & Grossman , 2018 ) , such scores are , as we demonstrate in Section 6 , not necessarily informative , as gates can function to scale rather than filter messages . Outside of graph-specific methods , one line of research involves decomposing the output into a part attributed to a specific subset of features and a part attributed to the remaining features ( Shapley , 1953 ; Murdoch et al. , 2019 ; Singh et al. , 2019 ; Jin et al. , 2020 ) . For GNNs , the computational cost for realistic use cases ( e.g . the thousands of edges per example in De Cao et al . ( 2019 ) ) is prohibitive . LIME ( Ribeiro et al. , 2016b ) like us relies on a trained erasure model , but interprets local models in place of global models . Local models can not trivially identify useful paths or long-distance dependent pairs of edges , and as also pointed out in Ying et al . ( 2019 ) LIME can not be easily applied for large general graphs . Similarly , it is unclear how to apply integrated gradients ( Sundararajan et al. , 2017 ) to retrieve relevant paths , especially for deep GNNs operating in large graphs . Masking messages in GRAPHMASK can be equivalently thought of as adding a certain type of noise to these messages . Therefore , GRAPHMASK can be categorised as belonging to the recently introduced class of perturbation-based methods ( Guan et al. , 2019 ; Taghanaki et al. , 2019 ; Schulz et al. , 2020 ) which equate feature importance with sensitivity of the prediction to the perturbations of that feature . The closest to our model is Schulz et al . ( 2020 ) , wherein the authors like us apply a secondary , trained model to predict the relevancy of a feature in a given layer . Unlike us , this trained model has ‘ look-ahead ’ , i.e . access to layers above the studied layer , making their model vulnerable to hindsight bias . Their approach uses soft gates on individual hidden state dimension to interpolate between hidden states , Gaussian noise in order to detect important features for CNNs on an image processing task , and makes independent Gaussian assumptions on the features to derive their objective . We adapted their method to GNNs and used it as a baseline in our experiments . In our very recent work ( De Cao et al. , 2020 ) we have introduced a similar differentiable masking approach to post-hoc analysis for transformers . We used sparse stochastic gates and L0 regularisation to determine which input tokens can be dropped , conditioning on various hidden layers . Concurrently to this paper , Luo et al . ( 2020 ) have also developed an interpretability technique for GNNs relying on differentiable edge masking . Their approach uses a mutual information objective like GNNExplainer , along with local binary concrete classifiers as in GRAPHMASK . 1Source code available at https : //github.com/MichSchli/GraphMask .
This paper presents a new interpreting algorithm for understanding graph neural network (GNN) models for natural language processing (NLP) tasks. The main idea is to remove redundant edges for each layer of GNN after training the model. To find the redundant edges, the authors suggest minimizing the difference between the output of GNN with the original graph and inputs and the output of GNN with sub-graphs that remove some edges. The loss function forms the L0 norm with the Lagrange multiplier. The algorithm also learns baseline edge information that can replace the values of target edges. Experiment with synthetic datasets shows that suggested algorithms can find the important edges for the task rather than others that find only part of the important edges. Experiments on question answering and semantic role labeling with the real dataset, the suggested algorithm shows the percentage of retained edges and evidence that support the usefulness of the GNN algorithm for the task rather than LSTM.
SP:758ab3741de56ebbac4d505a0c15670c55177023
Improving Hierarchical Adversarial Robustness of Deep Neural Networks
1 INTRODUCTION . Deep neural networks ( DNNs ) are highly vulnerable to attacks based on small modification of the input to the network at test time ( Szegedy et al. , 2013 ) . Those adversarial perturbations are carefully crafted in a way that they are imperceptible to human observers , but when added to clean images , can severely degrade the accuracy of the neural network classifier . Since their discovery , there has been a vast literature proposing various attack and defence techniques for the adversarial settings ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . These methods constitute important first steps in studying adversarial robustness of neural networks . However , there exists a fundamental flaw in the way we assess a defence or an attack mechanism . That is , we overly generalize the mistakes caused by attacks . Particularly , the current approaches focuses on the scenario where different mistakes caused by the attacks are treated equally . We argue that some context do not allow mistakes to be considered equal . In CIFAR-100 ( Krizhevsky et al. , 2009 ) , it is less problematic to misclassify a pine tree as a oak tree than a fish as a truck . As such , we are motivated to propose the concept of hierarchical adversarial robustness to capture this notion . Given a dataset whose classes can be grouped into coarse labels , we define hierarchical adversarial examples as the ones leading to a misclassification at the coarse level ; and we present a variant of the projected gradient descent ( PGD ) adversaries ( Madry et al. , 2017 ) to find hierarchical adversarial examples . Finally , we introduce a simple and principled hierarchical adversarially robust ( HAR ) network which decompose the end-to-end robust learning task into a single classification task into one coarse and multiple fine classification tasks , before being trained by adversarial defence techniques . Our contribution are • We introduce the concept of hierarchical adversarial examples : a special case of the standard adversarial examples which causes mistakes at the coarse level ( Section 2 ) . • We present a worst-case targeted PGD attack to find hierarchical adversarial examples . The attack iterates through all candidate fine labels until a successful misclassification into the desired target ( Section 2.1 ) . • We propose a novel architectural approach , HAR network , for improving the hierarchical ad- versarial robustness of deep neural networks ( Section 3 ) . We empirically show that HAR networks significantly improve the hierarchical adversarial robustness against ` ∞ attacks ( = 8255 ) ( Section 4 ) and ` 2 attacks ( = 0.5 ) ( Appendix A.4 ) on CIFAR-100 . • We benchmark using untargeted PGD20 attacks as well as the proposed iterative targeted PGD attack . In particular , we include an extensive empirical study on the improved hierarchical robustness of HAR by evaluating against attacks with varying PGD iterations and . We find that a vast majority of the misclassifications from the untargeted attack are within the same coarse label , resulting a failed hierarchical attack . The proposed iterative targeted attacks provides a better empirical representation of the hierarchical adversarial robustness of the model ( Section 4.2 ) . • We show that the iterative targeted attack formulated based on the coarse network are weaker hierarchical adversarial examples compared to the ones generated using the entire HAR network ( Section 4.3 ) . 2 HIERARCHICAL ADVERSARIAL EXAMPLES . The advancement in DNN image classifiers is accompanied by the increasing complexity of the network design ( Szegedy et al. , 2016 ; He et al. , 2016 ) , and those intricate networks has provided state-of-the-art results on many benchmark tasks ( Deng et al. , 2009 ; Geiger et al. , 2013 ; Cordts et al. , 2016 ; Everingham et al. , 2015 ) . Unfortunately , the discovery of adversarial examples has revealed that neural networks are extremely vulnerable to maliciously perturbed inputs at test time ( Szegedy et al. , 2013 ) . This makes it difficult to apply DNN-based techniques in mission-critical and safetycritical areas . Another important develeopment along with the advancement of DNN is the growing complexity of the dataset , both in size and in number of classes : i.e . from the 10-class MNIST dataset to the 1000-class ImageNet dataset . As the complexity of the dataset increases exponentially , dataset can often be divided into several coarse classes where each coarse class consists of multiple fine classes . In this paper , we use the term label and class interchangeably . The concept of which an input image is first classified into coarse labels and then into fine labels are referred to as hierarchical classification ( Tousch et al. , 2012 ) . Intuitively , the visual separability between groups of fine labels can be highly uneven within a given dataset , and thus some coarse labels are more difficult to distinguish than others . This motivates the use of more dedicated classifiers for specific groups of classes , allowing the coarse labels to provide information on similarities between the fine labels at an intermediate stage . The class hierarchy can be formed in different ways , and it can be learned strategically for optimal performance of the downstream task ( Deng et al. , 2011 ) . Note that it is also a valid strategy to create a customized class hierarchy and thus be able to deal with sensitive missclassification . To illustrate our work , we use the predefined class hierarchy of the CIFAR-10 and the CIFAR-100 dataset ( Krizhevsky et al. , 2009 ) : fine labels are grouped into coarse labels by semantic similarities . All prior work on adversarial examples for neural networks , regardless of defences or attacks , focuses on the scenario where all misclassifications are considered equally ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . However , in practice , this notion overly generalizes the damage caused by different types of attacks . For example , in an autonomous driving system , confusing a perturbed image of a traffic sign as a pedestrian should not be treated the same way as confusing a bus as a pickup truck . The former raises a major security threat for practical machine learning applications , whereas the latter has very little impact to the underlying task . Moreover , misclassification across different coarse labels poses potential ethical concerns when the dataset involves sensitive features such as different ethnicities , genders , people with disabilities and age groups . Mistakes across coarse classes leads to much more severe consequences compared to mistakes within coarse classes . As such , to capture this different notion of attacks , we propose the term hierarchical adversarial examples . They are a specific case of adversarial examples where the resulting misclassification occurs between fine labels that come from different coarse labels . Here , we provide a clear definition of the hierarchical adversarial examples to differentiate it from the standard adversarial examples . We begin with the notation for the classifier . Consider a neural network F ( x ) : Rd → Rc with a softmax as its last layer ( Hastie et al. , 2009 ) , where d and c denote the input dimension and the number of classes , respectively . The prediction is given by arg maxi F ( x ) i . In the hierarchical classification framework , the classes are categorized ( e.g . by the user ) into fine classes and coarse classes 1 . The dataset consists of image and fine label pairs : { x , y } n. In the later , we use the set theory symbol ∈ to characterize the relationship between a fine and a coarse label : y ∈ z if the fine label y is part of the coarse class z . Note that this relation holds for both disjoint and overlapping coarse classes . Given an input data x , suppose its true coarse and fine labels are z∗ and y∗ respectively . Under the setting defined above , a hierarchical adversarial example must satisfy all the following properties : • the unperturbed input data x is correctly classified by the classifier : arg maxi F ( x ) i = y∗ ; • the perturbed data x′ = x+ δ is perceptually indistinguishable from the original input x ; • the perturbed data x′ is classified incorrectly : arg maxi F ( x′ ) i = y′ where y′ 6= y∗ ; • the misclassified label belongs to a different coarse class : y′ 6∈ z∗ . Notice that satisfying the first three properties is sufficient to define a standard adversarial examples , and that hierarchical adversarial examples are special cases of adversarial examples . It is worth mentioning that measuring perceptual distance can be difficult ( Li et al. , 2003 ) , thus the second property is often replaced by limiting that the adversary can only modify any input x to x + δ with δ ∈ ∆ . Commonly used constraints are -balls w.r.t . ` p-norms , though other constraint sets have been used too ( Wong et al. , 2019 ) . In this work , we focus on ` ∞- and ` 2-norm attacks . 2.1 GENERATING HIERARCHICAL ADVERSARIAL PERTURBATIONS . A common class of attack techniques are gradient-based attacks , such as FGSM ( Goodfellow et al. , 2014 ) , BIM ( Kurakin et al. , 2016 ) and PGD ( Madry et al. , 2017 ) , that utilize gradient ( first-order ) information of the network to compute perturbations . Such methods are motivated by linearizing the loss function and solving for the perturbation that optimizes the loss subject to the ` p-norm constraint . Their popularity is largely due to its simplicity , because the optimization objective can be accomplished in closed form at the cost of one back-propagation . The main idea of gradient-based attacks can be summarized as follows . Given the prediction of F ( x ) and a target label y , the loss function of the model is denoted by ` ( x , y ) , ` ( F ( x ) , y ) , e.g. , a cross-entropy loss . Here , we omit the network parameter w in the loss because it is assumed to be fixed while generating adversarial perturbations . Note that the choice of y and whether to maximize or minimize the loss depend on if the attack is targeted or untargeted . For a targeted ` ∞ attack , gradient-based methods rely on the opposite direction of the loss gradient , − sign∇x ` ( x , y ) , to solve for the perturbation that minimizes the loss with respect to a non-true target label ( y 6= y∗ ) . Despite its simplicity , gradient-based attacks are highly effective at finding ` p-bounded perturbations that lead to misclassifications . In our work , we introduce a simple variant of the projected gradient descent ( PGD ) adversary to find hierarchical adversarial examples . Given an input image with true coarse and fine labels z∗ and y∗ respectively . Let xj denote the perturbed input at iteration j , we define : xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } ( 1 ) where the target label ŷ comes from a different coarse class : ŷ 6∈ z∗ . Algorithm 1 summarize the procedures for generating an ` ∞-constrained hierarchical adversarial examples . The projection operator Π after each iteration ensures that the perturbation is in an -neighbourhood of the original image . We also adopt the random initialization in PGD attacks ( Madry et al. , 2017 ) : x0 = x + η , where η = ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . There are several approaches to choose the target class ( Carlini & Wagner , 2017 ) . The target class can be chosen in an average-case approach where the class is selected uniformly at random among all eligible labels . Alternatively , they can be chosen in a strategic way , a best-case attack , to find the target class which requires the least number of PGD iterations for misclassifications . In our work , we consider a worst-case attack by iterating through all candidate target labels , i.e. , fine labels that 1We could go beyond this 2-level hierarchy . Here we keep the presentation simple for didactic purposes . Algorithm 1 : A worst-case approach for generating ` ∞-bounded hierarchical adversarial example based on a targeted PGD attack . Input : A pair of input data ( x , y∗ ) , where fine label y∗ belongs to the coarse label z∗ ; a neural network F ( · ) ; loss function ` ( · ) ; ` ∞ constraint of ; number of PGD iterations k ; PGD step-size α . 1 Define S = { y | y 6∈ z∗ } , a collection of all fine labels that do not belong in the coarse label z∗ ; 2 for ŷ ∈ S do 3 x0 ← x+ η , where η ← ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . 4 for j = 0 , . . . , k − 1 do 5 xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } where Π is the projection operator . 6 end 7 if arg maxi F ( xk ) i = ŷ then 8 Terminate ( successful attack ) ; 9 else 10 S \ ŷ ; 11 if S is empty then 12 Terminate ( failed attack ) ; 13 end 14 end 15 end do not belong in the same coarse class . This iterative targeted attack process terminates under two conditions : 1. perturbation results in a successful targeted misclassification ; 2. all candidate fine labels have been used as targets .
The authors discuss a new notion of adversarial robustness, specifically, robustness to hierarchical adversarial examples. This is motivated by the idea that some types of misclassifications (e.g. mistaking one type of dog for another) may be less harmful than others (e.g. mistaking a dog for a truck); thus, adversarial examples will be more harmful if they cause coarse-grained errors as opposed to fine-grained ones. The authors further propose a network architecture that is designed to be more robust in the hierarchical sense, and they provide some experimental evidence comparing their methodology to standard adversarially trained networks.
SP:5252a47e41708a6ebf8defd2333928ef761027d4
Improving Hierarchical Adversarial Robustness of Deep Neural Networks
1 INTRODUCTION . Deep neural networks ( DNNs ) are highly vulnerable to attacks based on small modification of the input to the network at test time ( Szegedy et al. , 2013 ) . Those adversarial perturbations are carefully crafted in a way that they are imperceptible to human observers , but when added to clean images , can severely degrade the accuracy of the neural network classifier . Since their discovery , there has been a vast literature proposing various attack and defence techniques for the adversarial settings ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . These methods constitute important first steps in studying adversarial robustness of neural networks . However , there exists a fundamental flaw in the way we assess a defence or an attack mechanism . That is , we overly generalize the mistakes caused by attacks . Particularly , the current approaches focuses on the scenario where different mistakes caused by the attacks are treated equally . We argue that some context do not allow mistakes to be considered equal . In CIFAR-100 ( Krizhevsky et al. , 2009 ) , it is less problematic to misclassify a pine tree as a oak tree than a fish as a truck . As such , we are motivated to propose the concept of hierarchical adversarial robustness to capture this notion . Given a dataset whose classes can be grouped into coarse labels , we define hierarchical adversarial examples as the ones leading to a misclassification at the coarse level ; and we present a variant of the projected gradient descent ( PGD ) adversaries ( Madry et al. , 2017 ) to find hierarchical adversarial examples . Finally , we introduce a simple and principled hierarchical adversarially robust ( HAR ) network which decompose the end-to-end robust learning task into a single classification task into one coarse and multiple fine classification tasks , before being trained by adversarial defence techniques . Our contribution are • We introduce the concept of hierarchical adversarial examples : a special case of the standard adversarial examples which causes mistakes at the coarse level ( Section 2 ) . • We present a worst-case targeted PGD attack to find hierarchical adversarial examples . The attack iterates through all candidate fine labels until a successful misclassification into the desired target ( Section 2.1 ) . • We propose a novel architectural approach , HAR network , for improving the hierarchical ad- versarial robustness of deep neural networks ( Section 3 ) . We empirically show that HAR networks significantly improve the hierarchical adversarial robustness against ` ∞ attacks ( = 8255 ) ( Section 4 ) and ` 2 attacks ( = 0.5 ) ( Appendix A.4 ) on CIFAR-100 . • We benchmark using untargeted PGD20 attacks as well as the proposed iterative targeted PGD attack . In particular , we include an extensive empirical study on the improved hierarchical robustness of HAR by evaluating against attacks with varying PGD iterations and . We find that a vast majority of the misclassifications from the untargeted attack are within the same coarse label , resulting a failed hierarchical attack . The proposed iterative targeted attacks provides a better empirical representation of the hierarchical adversarial robustness of the model ( Section 4.2 ) . • We show that the iterative targeted attack formulated based on the coarse network are weaker hierarchical adversarial examples compared to the ones generated using the entire HAR network ( Section 4.3 ) . 2 HIERARCHICAL ADVERSARIAL EXAMPLES . The advancement in DNN image classifiers is accompanied by the increasing complexity of the network design ( Szegedy et al. , 2016 ; He et al. , 2016 ) , and those intricate networks has provided state-of-the-art results on many benchmark tasks ( Deng et al. , 2009 ; Geiger et al. , 2013 ; Cordts et al. , 2016 ; Everingham et al. , 2015 ) . Unfortunately , the discovery of adversarial examples has revealed that neural networks are extremely vulnerable to maliciously perturbed inputs at test time ( Szegedy et al. , 2013 ) . This makes it difficult to apply DNN-based techniques in mission-critical and safetycritical areas . Another important develeopment along with the advancement of DNN is the growing complexity of the dataset , both in size and in number of classes : i.e . from the 10-class MNIST dataset to the 1000-class ImageNet dataset . As the complexity of the dataset increases exponentially , dataset can often be divided into several coarse classes where each coarse class consists of multiple fine classes . In this paper , we use the term label and class interchangeably . The concept of which an input image is first classified into coarse labels and then into fine labels are referred to as hierarchical classification ( Tousch et al. , 2012 ) . Intuitively , the visual separability between groups of fine labels can be highly uneven within a given dataset , and thus some coarse labels are more difficult to distinguish than others . This motivates the use of more dedicated classifiers for specific groups of classes , allowing the coarse labels to provide information on similarities between the fine labels at an intermediate stage . The class hierarchy can be formed in different ways , and it can be learned strategically for optimal performance of the downstream task ( Deng et al. , 2011 ) . Note that it is also a valid strategy to create a customized class hierarchy and thus be able to deal with sensitive missclassification . To illustrate our work , we use the predefined class hierarchy of the CIFAR-10 and the CIFAR-100 dataset ( Krizhevsky et al. , 2009 ) : fine labels are grouped into coarse labels by semantic similarities . All prior work on adversarial examples for neural networks , regardless of defences or attacks , focuses on the scenario where all misclassifications are considered equally ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . However , in practice , this notion overly generalizes the damage caused by different types of attacks . For example , in an autonomous driving system , confusing a perturbed image of a traffic sign as a pedestrian should not be treated the same way as confusing a bus as a pickup truck . The former raises a major security threat for practical machine learning applications , whereas the latter has very little impact to the underlying task . Moreover , misclassification across different coarse labels poses potential ethical concerns when the dataset involves sensitive features such as different ethnicities , genders , people with disabilities and age groups . Mistakes across coarse classes leads to much more severe consequences compared to mistakes within coarse classes . As such , to capture this different notion of attacks , we propose the term hierarchical adversarial examples . They are a specific case of adversarial examples where the resulting misclassification occurs between fine labels that come from different coarse labels . Here , we provide a clear definition of the hierarchical adversarial examples to differentiate it from the standard adversarial examples . We begin with the notation for the classifier . Consider a neural network F ( x ) : Rd → Rc with a softmax as its last layer ( Hastie et al. , 2009 ) , where d and c denote the input dimension and the number of classes , respectively . The prediction is given by arg maxi F ( x ) i . In the hierarchical classification framework , the classes are categorized ( e.g . by the user ) into fine classes and coarse classes 1 . The dataset consists of image and fine label pairs : { x , y } n. In the later , we use the set theory symbol ∈ to characterize the relationship between a fine and a coarse label : y ∈ z if the fine label y is part of the coarse class z . Note that this relation holds for both disjoint and overlapping coarse classes . Given an input data x , suppose its true coarse and fine labels are z∗ and y∗ respectively . Under the setting defined above , a hierarchical adversarial example must satisfy all the following properties : • the unperturbed input data x is correctly classified by the classifier : arg maxi F ( x ) i = y∗ ; • the perturbed data x′ = x+ δ is perceptually indistinguishable from the original input x ; • the perturbed data x′ is classified incorrectly : arg maxi F ( x′ ) i = y′ where y′ 6= y∗ ; • the misclassified label belongs to a different coarse class : y′ 6∈ z∗ . Notice that satisfying the first three properties is sufficient to define a standard adversarial examples , and that hierarchical adversarial examples are special cases of adversarial examples . It is worth mentioning that measuring perceptual distance can be difficult ( Li et al. , 2003 ) , thus the second property is often replaced by limiting that the adversary can only modify any input x to x + δ with δ ∈ ∆ . Commonly used constraints are -balls w.r.t . ` p-norms , though other constraint sets have been used too ( Wong et al. , 2019 ) . In this work , we focus on ` ∞- and ` 2-norm attacks . 2.1 GENERATING HIERARCHICAL ADVERSARIAL PERTURBATIONS . A common class of attack techniques are gradient-based attacks , such as FGSM ( Goodfellow et al. , 2014 ) , BIM ( Kurakin et al. , 2016 ) and PGD ( Madry et al. , 2017 ) , that utilize gradient ( first-order ) information of the network to compute perturbations . Such methods are motivated by linearizing the loss function and solving for the perturbation that optimizes the loss subject to the ` p-norm constraint . Their popularity is largely due to its simplicity , because the optimization objective can be accomplished in closed form at the cost of one back-propagation . The main idea of gradient-based attacks can be summarized as follows . Given the prediction of F ( x ) and a target label y , the loss function of the model is denoted by ` ( x , y ) , ` ( F ( x ) , y ) , e.g. , a cross-entropy loss . Here , we omit the network parameter w in the loss because it is assumed to be fixed while generating adversarial perturbations . Note that the choice of y and whether to maximize or minimize the loss depend on if the attack is targeted or untargeted . For a targeted ` ∞ attack , gradient-based methods rely on the opposite direction of the loss gradient , − sign∇x ` ( x , y ) , to solve for the perturbation that minimizes the loss with respect to a non-true target label ( y 6= y∗ ) . Despite its simplicity , gradient-based attacks are highly effective at finding ` p-bounded perturbations that lead to misclassifications . In our work , we introduce a simple variant of the projected gradient descent ( PGD ) adversary to find hierarchical adversarial examples . Given an input image with true coarse and fine labels z∗ and y∗ respectively . Let xj denote the perturbed input at iteration j , we define : xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } ( 1 ) where the target label ŷ comes from a different coarse class : ŷ 6∈ z∗ . Algorithm 1 summarize the procedures for generating an ` ∞-constrained hierarchical adversarial examples . The projection operator Π after each iteration ensures that the perturbation is in an -neighbourhood of the original image . We also adopt the random initialization in PGD attacks ( Madry et al. , 2017 ) : x0 = x + η , where η = ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . There are several approaches to choose the target class ( Carlini & Wagner , 2017 ) . The target class can be chosen in an average-case approach where the class is selected uniformly at random among all eligible labels . Alternatively , they can be chosen in a strategic way , a best-case attack , to find the target class which requires the least number of PGD iterations for misclassifications . In our work , we consider a worst-case attack by iterating through all candidate target labels , i.e. , fine labels that 1We could go beyond this 2-level hierarchy . Here we keep the presentation simple for didactic purposes . Algorithm 1 : A worst-case approach for generating ` ∞-bounded hierarchical adversarial example based on a targeted PGD attack . Input : A pair of input data ( x , y∗ ) , where fine label y∗ belongs to the coarse label z∗ ; a neural network F ( · ) ; loss function ` ( · ) ; ` ∞ constraint of ; number of PGD iterations k ; PGD step-size α . 1 Define S = { y | y 6∈ z∗ } , a collection of all fine labels that do not belong in the coarse label z∗ ; 2 for ŷ ∈ S do 3 x0 ← x+ η , where η ← ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . 4 for j = 0 , . . . , k − 1 do 5 xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } where Π is the projection operator . 6 end 7 if arg maxi F ( xk ) i = ŷ then 8 Terminate ( successful attack ) ; 9 else 10 S \ ŷ ; 11 if S is empty then 12 Terminate ( failed attack ) ; 13 end 14 end 15 end do not belong in the same coarse class . This iterative targeted attack process terminates under two conditions : 1. perturbation results in a successful targeted misclassification ; 2. all candidate fine labels have been used as targets .
This paper tackles the problem of building hierarchical adversarially robust (HAR) models---i.e., models that are less prone to coarse-grained misclassifications in the face of adversarial manipulation. Specifically, the authors propose HAR networks, wherein the learning/inference problem is decomposed into coarse-grained classification followed by a number of fine-grained classifications. The proposed approach is evaluated on CIFAR-10 and (a subset of) CIFAR-100 for linf adversarial attacks.
SP:5252a47e41708a6ebf8defd2333928ef761027d4
Improving Hierarchical Adversarial Robustness of Deep Neural Networks
1 INTRODUCTION . Deep neural networks ( DNNs ) are highly vulnerable to attacks based on small modification of the input to the network at test time ( Szegedy et al. , 2013 ) . Those adversarial perturbations are carefully crafted in a way that they are imperceptible to human observers , but when added to clean images , can severely degrade the accuracy of the neural network classifier . Since their discovery , there has been a vast literature proposing various attack and defence techniques for the adversarial settings ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . These methods constitute important first steps in studying adversarial robustness of neural networks . However , there exists a fundamental flaw in the way we assess a defence or an attack mechanism . That is , we overly generalize the mistakes caused by attacks . Particularly , the current approaches focuses on the scenario where different mistakes caused by the attacks are treated equally . We argue that some context do not allow mistakes to be considered equal . In CIFAR-100 ( Krizhevsky et al. , 2009 ) , it is less problematic to misclassify a pine tree as a oak tree than a fish as a truck . As such , we are motivated to propose the concept of hierarchical adversarial robustness to capture this notion . Given a dataset whose classes can be grouped into coarse labels , we define hierarchical adversarial examples as the ones leading to a misclassification at the coarse level ; and we present a variant of the projected gradient descent ( PGD ) adversaries ( Madry et al. , 2017 ) to find hierarchical adversarial examples . Finally , we introduce a simple and principled hierarchical adversarially robust ( HAR ) network which decompose the end-to-end robust learning task into a single classification task into one coarse and multiple fine classification tasks , before being trained by adversarial defence techniques . Our contribution are • We introduce the concept of hierarchical adversarial examples : a special case of the standard adversarial examples which causes mistakes at the coarse level ( Section 2 ) . • We present a worst-case targeted PGD attack to find hierarchical adversarial examples . The attack iterates through all candidate fine labels until a successful misclassification into the desired target ( Section 2.1 ) . • We propose a novel architectural approach , HAR network , for improving the hierarchical ad- versarial robustness of deep neural networks ( Section 3 ) . We empirically show that HAR networks significantly improve the hierarchical adversarial robustness against ` ∞ attacks ( = 8255 ) ( Section 4 ) and ` 2 attacks ( = 0.5 ) ( Appendix A.4 ) on CIFAR-100 . • We benchmark using untargeted PGD20 attacks as well as the proposed iterative targeted PGD attack . In particular , we include an extensive empirical study on the improved hierarchical robustness of HAR by evaluating against attacks with varying PGD iterations and . We find that a vast majority of the misclassifications from the untargeted attack are within the same coarse label , resulting a failed hierarchical attack . The proposed iterative targeted attacks provides a better empirical representation of the hierarchical adversarial robustness of the model ( Section 4.2 ) . • We show that the iterative targeted attack formulated based on the coarse network are weaker hierarchical adversarial examples compared to the ones generated using the entire HAR network ( Section 4.3 ) . 2 HIERARCHICAL ADVERSARIAL EXAMPLES . The advancement in DNN image classifiers is accompanied by the increasing complexity of the network design ( Szegedy et al. , 2016 ; He et al. , 2016 ) , and those intricate networks has provided state-of-the-art results on many benchmark tasks ( Deng et al. , 2009 ; Geiger et al. , 2013 ; Cordts et al. , 2016 ; Everingham et al. , 2015 ) . Unfortunately , the discovery of adversarial examples has revealed that neural networks are extremely vulnerable to maliciously perturbed inputs at test time ( Szegedy et al. , 2013 ) . This makes it difficult to apply DNN-based techniques in mission-critical and safetycritical areas . Another important develeopment along with the advancement of DNN is the growing complexity of the dataset , both in size and in number of classes : i.e . from the 10-class MNIST dataset to the 1000-class ImageNet dataset . As the complexity of the dataset increases exponentially , dataset can often be divided into several coarse classes where each coarse class consists of multiple fine classes . In this paper , we use the term label and class interchangeably . The concept of which an input image is first classified into coarse labels and then into fine labels are referred to as hierarchical classification ( Tousch et al. , 2012 ) . Intuitively , the visual separability between groups of fine labels can be highly uneven within a given dataset , and thus some coarse labels are more difficult to distinguish than others . This motivates the use of more dedicated classifiers for specific groups of classes , allowing the coarse labels to provide information on similarities between the fine labels at an intermediate stage . The class hierarchy can be formed in different ways , and it can be learned strategically for optimal performance of the downstream task ( Deng et al. , 2011 ) . Note that it is also a valid strategy to create a customized class hierarchy and thus be able to deal with sensitive missclassification . To illustrate our work , we use the predefined class hierarchy of the CIFAR-10 and the CIFAR-100 dataset ( Krizhevsky et al. , 2009 ) : fine labels are grouped into coarse labels by semantic similarities . All prior work on adversarial examples for neural networks , regardless of defences or attacks , focuses on the scenario where all misclassifications are considered equally ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ; Wong et al. , 2020 ) . However , in practice , this notion overly generalizes the damage caused by different types of attacks . For example , in an autonomous driving system , confusing a perturbed image of a traffic sign as a pedestrian should not be treated the same way as confusing a bus as a pickup truck . The former raises a major security threat for practical machine learning applications , whereas the latter has very little impact to the underlying task . Moreover , misclassification across different coarse labels poses potential ethical concerns when the dataset involves sensitive features such as different ethnicities , genders , people with disabilities and age groups . Mistakes across coarse classes leads to much more severe consequences compared to mistakes within coarse classes . As such , to capture this different notion of attacks , we propose the term hierarchical adversarial examples . They are a specific case of adversarial examples where the resulting misclassification occurs between fine labels that come from different coarse labels . Here , we provide a clear definition of the hierarchical adversarial examples to differentiate it from the standard adversarial examples . We begin with the notation for the classifier . Consider a neural network F ( x ) : Rd → Rc with a softmax as its last layer ( Hastie et al. , 2009 ) , where d and c denote the input dimension and the number of classes , respectively . The prediction is given by arg maxi F ( x ) i . In the hierarchical classification framework , the classes are categorized ( e.g . by the user ) into fine classes and coarse classes 1 . The dataset consists of image and fine label pairs : { x , y } n. In the later , we use the set theory symbol ∈ to characterize the relationship between a fine and a coarse label : y ∈ z if the fine label y is part of the coarse class z . Note that this relation holds for both disjoint and overlapping coarse classes . Given an input data x , suppose its true coarse and fine labels are z∗ and y∗ respectively . Under the setting defined above , a hierarchical adversarial example must satisfy all the following properties : • the unperturbed input data x is correctly classified by the classifier : arg maxi F ( x ) i = y∗ ; • the perturbed data x′ = x+ δ is perceptually indistinguishable from the original input x ; • the perturbed data x′ is classified incorrectly : arg maxi F ( x′ ) i = y′ where y′ 6= y∗ ; • the misclassified label belongs to a different coarse class : y′ 6∈ z∗ . Notice that satisfying the first three properties is sufficient to define a standard adversarial examples , and that hierarchical adversarial examples are special cases of adversarial examples . It is worth mentioning that measuring perceptual distance can be difficult ( Li et al. , 2003 ) , thus the second property is often replaced by limiting that the adversary can only modify any input x to x + δ with δ ∈ ∆ . Commonly used constraints are -balls w.r.t . ` p-norms , though other constraint sets have been used too ( Wong et al. , 2019 ) . In this work , we focus on ` ∞- and ` 2-norm attacks . 2.1 GENERATING HIERARCHICAL ADVERSARIAL PERTURBATIONS . A common class of attack techniques are gradient-based attacks , such as FGSM ( Goodfellow et al. , 2014 ) , BIM ( Kurakin et al. , 2016 ) and PGD ( Madry et al. , 2017 ) , that utilize gradient ( first-order ) information of the network to compute perturbations . Such methods are motivated by linearizing the loss function and solving for the perturbation that optimizes the loss subject to the ` p-norm constraint . Their popularity is largely due to its simplicity , because the optimization objective can be accomplished in closed form at the cost of one back-propagation . The main idea of gradient-based attacks can be summarized as follows . Given the prediction of F ( x ) and a target label y , the loss function of the model is denoted by ` ( x , y ) , ` ( F ( x ) , y ) , e.g. , a cross-entropy loss . Here , we omit the network parameter w in the loss because it is assumed to be fixed while generating adversarial perturbations . Note that the choice of y and whether to maximize or minimize the loss depend on if the attack is targeted or untargeted . For a targeted ` ∞ attack , gradient-based methods rely on the opposite direction of the loss gradient , − sign∇x ` ( x , y ) , to solve for the perturbation that minimizes the loss with respect to a non-true target label ( y 6= y∗ ) . Despite its simplicity , gradient-based attacks are highly effective at finding ` p-bounded perturbations that lead to misclassifications . In our work , we introduce a simple variant of the projected gradient descent ( PGD ) adversary to find hierarchical adversarial examples . Given an input image with true coarse and fine labels z∗ and y∗ respectively . Let xj denote the perturbed input at iteration j , we define : xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } ( 1 ) where the target label ŷ comes from a different coarse class : ŷ 6∈ z∗ . Algorithm 1 summarize the procedures for generating an ` ∞-constrained hierarchical adversarial examples . The projection operator Π after each iteration ensures that the perturbation is in an -neighbourhood of the original image . We also adopt the random initialization in PGD attacks ( Madry et al. , 2017 ) : x0 = x + η , where η = ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . There are several approaches to choose the target class ( Carlini & Wagner , 2017 ) . The target class can be chosen in an average-case approach where the class is selected uniformly at random among all eligible labels . Alternatively , they can be chosen in a strategic way , a best-case attack , to find the target class which requires the least number of PGD iterations for misclassifications . In our work , we consider a worst-case attack by iterating through all candidate target labels , i.e. , fine labels that 1We could go beyond this 2-level hierarchy . Here we keep the presentation simple for didactic purposes . Algorithm 1 : A worst-case approach for generating ` ∞-bounded hierarchical adversarial example based on a targeted PGD attack . Input : A pair of input data ( x , y∗ ) , where fine label y∗ belongs to the coarse label z∗ ; a neural network F ( · ) ; loss function ` ( · ) ; ` ∞ constraint of ; number of PGD iterations k ; PGD step-size α . 1 Define S = { y | y 6∈ z∗ } , a collection of all fine labels that do not belong in the coarse label z∗ ; 2 for ŷ ∈ S do 3 x0 ← x+ η , where η ← ( η1 , η2 , . . . , ηd ) > and ηi ∼ U ( − , ) . 4 for j = 0 , . . . , k − 1 do 5 xj+1 = ΠB∞ ( x , ) { xj − α sign ( ∇x ` ( xj , ŷ ) ) } where Π is the projection operator . 6 end 7 if arg maxi F ( xk ) i = ŷ then 8 Terminate ( successful attack ) ; 9 else 10 S \ ŷ ; 11 if S is empty then 12 Terminate ( failed attack ) ; 13 end 14 end 15 end do not belong in the same coarse class . This iterative targeted attack process terminates under two conditions : 1. perturbation results in a successful targeted misclassification ; 2. all candidate fine labels have been used as targets .
This paper investigates adversarial attacks in the hierarchy of labels. Misclassifying a person for a car is a “coarse misclassification”, but misclassifying a bus for a car is a “fine misclassification”. The paper introduces both a metric for hierarchical adversarial robustness, and a method to improve this metric (which is a hierarchical formulation of resnet architectures).
SP:5252a47e41708a6ebf8defd2333928ef761027d4
Robustness against Relational Adversary
Test-time adversarial attacks have posed serious challenges to the robustness of machine-learning models , and in many settings the adversarial perturbation need not be bounded by small �p-norms . Motivated by the semantics-preserving attacks in vision and security domain , we investigate relational adversaries , a broad class of attackers who create adversarial examples that are in a reflexive-transitive closure of a logical relation . We analyze the conditions for robustness and propose normalize-and-predict – a learning framework with provable robustness guarantee . We compare our approach with adversarial training and derive an unified framework that provides benefits of both approaches . Guided by our theoretical findings , we apply our framework to image classification and malware detection . Results of both tasks show that attacks using relational adversaries frequently fool existing models , but our unified framework can significantly enhance their robustness . 1 INTRODUCTION . The robustness of machine learning ( ML ) systems has been challenged by test-time attacks using adversarial examples ( Szegedy et al. , 2013 ) . These adversarial examples are intentionally manipulated inputs that preserve the essential characteristics of the original inputs , and thus are expected to have the same test outcome as the originals by human standard ; yet they severely affect the performance of many ML models across different domains ( Moosavi-Dezfooli et al. , 2016 ; Eykholt et al. , 2018 ; Qin et al. , 2019 ) . As models in high-stake domains such as system security are also undermined by attacks ( Grosse et al. , 2017 ; Rosenberg et al. , 2018 ; Hu & Tan , 2018 ) , robust ML in adversarial test environment becomes an imperative task for the ML community . Existing work on test-time attacks predominately considers �p-norm bounded adversarial manipulation ( Goodfellow et al. , 2014 ; Carlini & Wagner , 2017 ) . However , in many security-critical settings , the adversarial examples need not respect the �p-norm constraint as long as they preserve the malicious semantics . In malware detection , for example , a malware author can implement the same function using different APIs , or bind a malware within benign softwares like video games or office tools . The modified malware preserves the malicious functionality despite the drastically different syntactic features . Hence , focusing on adversarial examples of small �p-norm in this setting will fail to address a sizable attack surface that attackers can exploit to evade detectors . In addition to security threats , another rising concern on ML models is the spurious correlations they could have learned in a biased data set . Ribeiro et al . ( 2016 ) show that a highly accurate wolf-vshusky-dog classifier indeed bases its prediction on the presence/absence of snow in the background . A reliable model , in contrast , should be robust to changes of this nature . Although dubbed as semantic perturbation or manipulation ( Mohapatra et al. , 2020 ; Bhattad et al. , 2019 ) , these changes do not alter the core of the semantics of input data , thus , we still consider them to be semantics-preserving pertaining to the classification task . Since such semantics-preserving changes often resulted in large �p-norms , they are likely to render the existing �p-norm based defenses ineffective . In this paper , we consider a general attack framework in which attackers create adversarial examples by transforming the original inputs via a set of rules in a semantics-preserving manner . Unlike the prior works ( Rosenberg et al. , 2018 ; Hu & Tan , 2018 ; Hosseini et al. , 2017 ; Hosseini & Poovendran , 2018 ) which investigate specific adversarial settings , our paper extends the scope of attacks to general logical transformation : we unify the threat models into a powerful relational adversary , which can readily incorporate more complex input transformations . From the defense perspective , recent work has started to look beyond �p-norm constraints , including adversarial training ( Grosse et al. , 2017 ; Rosenberg et al. , 2019 ; Lei et al. , 2019 ) , verificationloss regularization ( Huang et al. , 2019 ) and invariance-induced regularization ( Yang et al. , 2019 ) . Adversarial training in principle can achieve high robust accuracy when the adversarial example in the training loop maximizes the loss . However , finding such adversarial examples is in general NPhard ( Katz et al. , 2017 ) , and we show in Sec 4 that it is even PSPACE-hard for semantics-preserving attacks that are considered in this paper . Huang et al . ( 2019 ) and Yang et al . ( 2019 ) add regularizers that incorporate model robustness as part of the training objective . However , such regularization can not be strictly enforced in training , and neither can the model robustness . These limitations still cause vulnerability to semantics-preserving attacks . Normalize-and-Predict Learning Framework This paper attempts to overcome the limitations of prior work by introducing a learning framework that guarantees robustness by design . In particular , we target a relational adversary , whose admissible manipulation is specified by a logical relation . A logical relation is a set of input pairs , each of which consists of a source and target of an atomic , semantics-preserving transformation . We consider a strong adversary who can apply an arbitrary number of transformations . Our paper makes the following contribution towards the theoretical understanding of robust ML against relational adversaries : 1 . We formally describe admissible adversarial manipulation using logical relations , and characterize the necessary and sufficient conditions for robustness to relational adversaries . 2 . We propose normalize-and-predict ( hereinafter abbreviated as N & P ) , a learning framework that first converts each data input to a well-defined and unique normal form and then trains and classifies over the normalized inputs . We show that our framework has guaranteed robustness , and characterize conditions to different levels of robustness-accuracy trade-off . 3 . We compare N & P to the popular adversarial training framework , which directly optimizes for accuracy under attacks . We show that N & P has the advantage in terms of explicit robustness guarantee and reduced training complexity , and in certain cases yields the same model accuracy as adversarial training . Motivated by the comparison , we propose a unified framework , which selectively normalizes over relations that tend to preserve the model accuracy and adversarially trains over the rest . Our unified approach gets the benefits from both frameworks . We then apply our theoretical findings to malware detection and image classification . For the former , first , we formulate two types of common program transformation — ( 1 ) addition of redundant libraries and API calls , and ( 2 ) substitution of equivalent API calls — as logical relations . Next , we instantiate our learning framework to these relations , and propose two generic relational adversarial attacks to determine the robustness of a model . Finally , we perform experiments over Sleipnir , a real-world WIN32 malware data set . Regarding image classification , we reused an attack method proposed by the prior work ( Hosseini & Poovendran , 2018 ) — shifting of the hue in the HSV color space — that can be deemed as a specific instantiation of our attack framework . We then compare the accuracy and robustness of ResNet-32 ( He et al. , 2016 ) , a common image classification model , trained with the unified framework against the standard adversarial training on CIFAR-10 ( Krizhevsky et al. , 2009 ) . The results we obtained in both tasks show that : 1 . Attacks using addition and substitution suffice to evade existing ML malware detectors . 2 . Our unified approach using input normalization and adversarial training achieves highest robust accuracy among all baselines in malware detection . The drop in accuracy on clean inputs is small and the computation cost is lower than pure adversarial training . 3 . When trained with the unified learning framework , ResNet-32 achieves similar clean accuracy but significantly higher robust accuracy than adversarial training alone . Finally , based on our theoretical and empirical results , we conclude that input normalization is vital to robust learning against relational adversaries . We believe techniques that can improve the quality of normalization are promising directions for future work . 2 RELATED WORK .. Test-time attacks using adversarial examples have been extensively studied in the past several years . Research has shown ML models are vulnerable to such attack in a variety of application domains ( Moosavi-Dezfooli et al. , 2016 ; Chen et al. , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Ebrahimi et al. , 2018 ; Qin et al. , 2019 ; Yang et al. , 2020 ) including system security where reliable defense is absolutely essential . For instance , Grosse et al . ( 2017 ) and Al-Dujaili et al . ( 2018 ) evade API/library usage based malware detectors by adding redundant API calls ; Rosenberg et al . ( 2018 ) , Hu & Tan ( 2018 ) , and Rosenberg et al . ( 2019 ) successfully attack running-time behavior based detectors by adding redundant execution traces ; Pierazzi et al . ( 2020 ) extend the attacks from feature-space to problem-space , propose a framework to describe real-world attacker ’ s constraints and create realistic attack instances using automated software transplantation . On the defense end , the work closest to ours in spirit is Yang et al . ( 2019 ) , which adds invarianceinduced regularizers to the training process . Their work however differs from ours in two major ways . First , their work considers a specific spatial transformation attack in image classification ; our work considers a general adversary based on logic relations . Second , their regularizer may not enforce the model robustness on finite samples as they are primarily interested in enhancing the model accuracy . In contrast , our framework emphasizes robustness which is enforced by design . Grosse et al . ( 2017 ) ; Al-Dujaili et al . ( 2018 ) ; Rosenberg et al . ( 2019 ) improve robustness via adversarial training ; we show such approach is hard to optimize . Incer et al . ( 2018 ) ; Kouzemtchenko ( 2018 ) enforce monotonicity over model outputs so that the addition of feature values always increase the maliciousness score . These approaches are limited to guarding against the addition attacks , thus lacks generality . Last , Xu et al . ( 2017 ) use feature squeezing , which quantizes the feature values in order to reduce the number of adversarial choices . However , their defense is for �p-norm adversaries and thus inapplicable for relational attacks . Normalization is a technique to reduce the number of syntactically distinct instances . First introduced to network security in the early 2000s in the context of intrusion detection systems ( Handley et al. , 2001 ) , it was later applied to malware detection ( Christodorescu et al. , 2007 ; Coogan et al. , 2011 ; Bichsel et al. , 2016 ; Salem & Banescu , 2016 ; Baumann et al. , 2017 ) . Our work addresses the open question whether normalization is useful for ML under relational adversary by investigating its impact on both model robustness and accuracy . 3 BACKGROUND . In this section , we first describe the learning task , then formalize the potential adversarial manipulation as logical relations , and eventually derive the notion of robustness to relational adversaries . Learning Task . We consider a data distribution D over a input space X and categorical label space Y . We use bold face letters , e.g . x , for input vectors and y for the label . Given a hypothesis class H , the learner wants to learn a classifier f : X → Y in H that minimizes the risk over the data distribution . In non-adversarial settings , the learner solves minf∈H E ( x , y ) ∼D � ( f , x , y ) , where � is a loss function . For classification , � ( f , x , y ) = 1 ( f ( x ) �= y ) . Logical Relation . A relation R is a set of input pairs , where each pair ( x , z ) specifies a transformation of input x to output z . We write x →R z iff ( x , z ) ∈ R. We write x →∗R z iff x = z or there exists z0 , z1 , · · · , zk ( k > 0 ) such that x = z0 , zi →R zi+1 ( 0 ≤ i < k ) and zk = z . In other words , →∗R is the reflexive-transitive closure of →R . We describe an example relation as follows : Example 1 ( Hue Shifting ) . Let xh , xs , xv denote the hue , saturation and value components of an image x . In a hue shifting relation R , x →R z iff zh = ( xh+δ ) % 1 where δ is a scalar , zs = xs , zv = xv . Since xh changes in a circle , i.e. , hue of 1 is equal to hue of 0 . Hence , we compute the modulo of the hue component with 1 to map zh within [ 0,1 ] ( Appendix B gives the background of HSV ) . In this paper , we also consider unions of relations . Notice that a finite union R of m relations R1 , · · · , Rm is also a relation , and x →R z iff x →Ri z for any i ∈ { 1 , · · · , m } . Threat Model . A test-time adversary replaces a clean test input x with an adversarially manipulated input A ( x ) , where A ( · ) represents the attack algorithm . We consider an adversary who wants to maximize the classification error rate : E ( x , y ) ∼D 1 ( f ( A ( x ) ) �= y ) . We assume white-box attacks1 , i.e . the adversary has total access to f , including its structures , model parameters and any defense mechanism in place . To maintain the malicious semantics , the adversarial input A ( x ) should belong to a feasible set T ( x ) . In this paper , we focus on T ( x ) that is described by relation . We consider a logical relation R that is known to both the learner and the adversary , and we define a relational adversary as the following . Definition 1 ( relational adversary ) . An adversary is said to be R-relational if T ( x ) = { z |x →∗R z } , i.e . each element in R represents an admissible transformation , and the adversary can apply arbitrary number of transformation specified by R. We can then define the robustness of a classifier f by how often its prediction is consistent under attack , and robust accuracy as the fraction of predictions that are both robust and accurate . Definition 2 ( Robustness and robust accuracy ) . Let Q ( R , f , x ) be the following statement : ∀ z ( ( x →∗R z ) ⇒ f ( x ) = f ( z ) ) . Then , a classifier f is robust at x if Q ( R , f , x ) is true , and the robustness of f to an R-relational adversary is : Ex∼DX 1Q ( R , f , x ) , where 1 ( · ) indicates the truth value of a statement and DX is the marginal distribution over inputs . The robust accuracy of f w.r.t . an R-relational adversary is then : E ( x , y ) ∼D 1Q ( R , f , x ) ∧f ( x ) =y . Notice that the robust accuracy of a classifier is no more than the robustness in value because of the extra requirement of f ( x ) = y . Meanwhile , a classifier with the highest robustness accuracy may not always have the highest robustness and vice versa : an intuitive example is that a constant classifier is always robust but not necessarily robustly accurate . In Sec 4 , we will discuss both objectives and characterize the trade-off between them . 4 N & P – A PROVABLY ROBUST LEARNING FRAMEWORK In this section , we introduce N & P , a learning framework which learns and predicts over normalized training and test inputs . We first identify the necessary and sufficient condition for robustness , and propose a normalization procedure that makes N & P provably robust to R-relational adversaries . Finally , we analyze the performance of N & P : since N & P guarantees robustness , the analysis will focus on robustness-accuracy trade-off and provide an in-depth understanding to causes of such trade-off . 4.1 AN OVERVIEW OF THE N & P FRAMEWORK In N & P , the learner first specifies a normalizer N : X → X . We call N ( x ) the ‘ normal form ’ of input x . The learner then both trains the classifier and predicts the test label over the normal forms instead of the original inputs . Let D denote the training set . In the empirical risk minimization learning scheme , for example , the learner will now solve the following problem min f∈H � ( x , y ) ∈D � ( f , N ( x ) , y ) , ( 1 ) and use the minimizer f∗ as the classifier . During test-time , the model will predict f∗ ( N ( x ) ) . Table 1 compares the N & P learning pipeline to normal risk minimization and adversarial training . 1We consider a strong white-box attacker to avoid interference from security by obscurity , which is shown fragile in various other adversarial settings ( Carlini & Wagner , 2017 ) .
The paper proposes to define robustness against adversarial attacks using a binary relation over inputs. The binary relation R states which input examples should be classified the same way and each connected component defined by R needs to be assigned the same label leading to robust classification. The idea of using a relation to capture what information in the input can be exploited for classification seems simple but was insightful to this reviewer. The authors propose to combine this approach of normalizing the input with existing techniques to handle adversarial classification to propose a new way to derive a robust classifier. Experiments on malware data and image data show that it leads to the best trade-off between classification accuracy and robustness.
SP:ac40b4df07128cb87ba180c80a4c7d70511bb430
Robustness against Relational Adversary
Test-time adversarial attacks have posed serious challenges to the robustness of machine-learning models , and in many settings the adversarial perturbation need not be bounded by small �p-norms . Motivated by the semantics-preserving attacks in vision and security domain , we investigate relational adversaries , a broad class of attackers who create adversarial examples that are in a reflexive-transitive closure of a logical relation . We analyze the conditions for robustness and propose normalize-and-predict – a learning framework with provable robustness guarantee . We compare our approach with adversarial training and derive an unified framework that provides benefits of both approaches . Guided by our theoretical findings , we apply our framework to image classification and malware detection . Results of both tasks show that attacks using relational adversaries frequently fool existing models , but our unified framework can significantly enhance their robustness . 1 INTRODUCTION . The robustness of machine learning ( ML ) systems has been challenged by test-time attacks using adversarial examples ( Szegedy et al. , 2013 ) . These adversarial examples are intentionally manipulated inputs that preserve the essential characteristics of the original inputs , and thus are expected to have the same test outcome as the originals by human standard ; yet they severely affect the performance of many ML models across different domains ( Moosavi-Dezfooli et al. , 2016 ; Eykholt et al. , 2018 ; Qin et al. , 2019 ) . As models in high-stake domains such as system security are also undermined by attacks ( Grosse et al. , 2017 ; Rosenberg et al. , 2018 ; Hu & Tan , 2018 ) , robust ML in adversarial test environment becomes an imperative task for the ML community . Existing work on test-time attacks predominately considers �p-norm bounded adversarial manipulation ( Goodfellow et al. , 2014 ; Carlini & Wagner , 2017 ) . However , in many security-critical settings , the adversarial examples need not respect the �p-norm constraint as long as they preserve the malicious semantics . In malware detection , for example , a malware author can implement the same function using different APIs , or bind a malware within benign softwares like video games or office tools . The modified malware preserves the malicious functionality despite the drastically different syntactic features . Hence , focusing on adversarial examples of small �p-norm in this setting will fail to address a sizable attack surface that attackers can exploit to evade detectors . In addition to security threats , another rising concern on ML models is the spurious correlations they could have learned in a biased data set . Ribeiro et al . ( 2016 ) show that a highly accurate wolf-vshusky-dog classifier indeed bases its prediction on the presence/absence of snow in the background . A reliable model , in contrast , should be robust to changes of this nature . Although dubbed as semantic perturbation or manipulation ( Mohapatra et al. , 2020 ; Bhattad et al. , 2019 ) , these changes do not alter the core of the semantics of input data , thus , we still consider them to be semantics-preserving pertaining to the classification task . Since such semantics-preserving changes often resulted in large �p-norms , they are likely to render the existing �p-norm based defenses ineffective . In this paper , we consider a general attack framework in which attackers create adversarial examples by transforming the original inputs via a set of rules in a semantics-preserving manner . Unlike the prior works ( Rosenberg et al. , 2018 ; Hu & Tan , 2018 ; Hosseini et al. , 2017 ; Hosseini & Poovendran , 2018 ) which investigate specific adversarial settings , our paper extends the scope of attacks to general logical transformation : we unify the threat models into a powerful relational adversary , which can readily incorporate more complex input transformations . From the defense perspective , recent work has started to look beyond �p-norm constraints , including adversarial training ( Grosse et al. , 2017 ; Rosenberg et al. , 2019 ; Lei et al. , 2019 ) , verificationloss regularization ( Huang et al. , 2019 ) and invariance-induced regularization ( Yang et al. , 2019 ) . Adversarial training in principle can achieve high robust accuracy when the adversarial example in the training loop maximizes the loss . However , finding such adversarial examples is in general NPhard ( Katz et al. , 2017 ) , and we show in Sec 4 that it is even PSPACE-hard for semantics-preserving attacks that are considered in this paper . Huang et al . ( 2019 ) and Yang et al . ( 2019 ) add regularizers that incorporate model robustness as part of the training objective . However , such regularization can not be strictly enforced in training , and neither can the model robustness . These limitations still cause vulnerability to semantics-preserving attacks . Normalize-and-Predict Learning Framework This paper attempts to overcome the limitations of prior work by introducing a learning framework that guarantees robustness by design . In particular , we target a relational adversary , whose admissible manipulation is specified by a logical relation . A logical relation is a set of input pairs , each of which consists of a source and target of an atomic , semantics-preserving transformation . We consider a strong adversary who can apply an arbitrary number of transformations . Our paper makes the following contribution towards the theoretical understanding of robust ML against relational adversaries : 1 . We formally describe admissible adversarial manipulation using logical relations , and characterize the necessary and sufficient conditions for robustness to relational adversaries . 2 . We propose normalize-and-predict ( hereinafter abbreviated as N & P ) , a learning framework that first converts each data input to a well-defined and unique normal form and then trains and classifies over the normalized inputs . We show that our framework has guaranteed robustness , and characterize conditions to different levels of robustness-accuracy trade-off . 3 . We compare N & P to the popular adversarial training framework , which directly optimizes for accuracy under attacks . We show that N & P has the advantage in terms of explicit robustness guarantee and reduced training complexity , and in certain cases yields the same model accuracy as adversarial training . Motivated by the comparison , we propose a unified framework , which selectively normalizes over relations that tend to preserve the model accuracy and adversarially trains over the rest . Our unified approach gets the benefits from both frameworks . We then apply our theoretical findings to malware detection and image classification . For the former , first , we formulate two types of common program transformation — ( 1 ) addition of redundant libraries and API calls , and ( 2 ) substitution of equivalent API calls — as logical relations . Next , we instantiate our learning framework to these relations , and propose two generic relational adversarial attacks to determine the robustness of a model . Finally , we perform experiments over Sleipnir , a real-world WIN32 malware data set . Regarding image classification , we reused an attack method proposed by the prior work ( Hosseini & Poovendran , 2018 ) — shifting of the hue in the HSV color space — that can be deemed as a specific instantiation of our attack framework . We then compare the accuracy and robustness of ResNet-32 ( He et al. , 2016 ) , a common image classification model , trained with the unified framework against the standard adversarial training on CIFAR-10 ( Krizhevsky et al. , 2009 ) . The results we obtained in both tasks show that : 1 . Attacks using addition and substitution suffice to evade existing ML malware detectors . 2 . Our unified approach using input normalization and adversarial training achieves highest robust accuracy among all baselines in malware detection . The drop in accuracy on clean inputs is small and the computation cost is lower than pure adversarial training . 3 . When trained with the unified learning framework , ResNet-32 achieves similar clean accuracy but significantly higher robust accuracy than adversarial training alone . Finally , based on our theoretical and empirical results , we conclude that input normalization is vital to robust learning against relational adversaries . We believe techniques that can improve the quality of normalization are promising directions for future work . 2 RELATED WORK .. Test-time attacks using adversarial examples have been extensively studied in the past several years . Research has shown ML models are vulnerable to such attack in a variety of application domains ( Moosavi-Dezfooli et al. , 2016 ; Chen et al. , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Ebrahimi et al. , 2018 ; Qin et al. , 2019 ; Yang et al. , 2020 ) including system security where reliable defense is absolutely essential . For instance , Grosse et al . ( 2017 ) and Al-Dujaili et al . ( 2018 ) evade API/library usage based malware detectors by adding redundant API calls ; Rosenberg et al . ( 2018 ) , Hu & Tan ( 2018 ) , and Rosenberg et al . ( 2019 ) successfully attack running-time behavior based detectors by adding redundant execution traces ; Pierazzi et al . ( 2020 ) extend the attacks from feature-space to problem-space , propose a framework to describe real-world attacker ’ s constraints and create realistic attack instances using automated software transplantation . On the defense end , the work closest to ours in spirit is Yang et al . ( 2019 ) , which adds invarianceinduced regularizers to the training process . Their work however differs from ours in two major ways . First , their work considers a specific spatial transformation attack in image classification ; our work considers a general adversary based on logic relations . Second , their regularizer may not enforce the model robustness on finite samples as they are primarily interested in enhancing the model accuracy . In contrast , our framework emphasizes robustness which is enforced by design . Grosse et al . ( 2017 ) ; Al-Dujaili et al . ( 2018 ) ; Rosenberg et al . ( 2019 ) improve robustness via adversarial training ; we show such approach is hard to optimize . Incer et al . ( 2018 ) ; Kouzemtchenko ( 2018 ) enforce monotonicity over model outputs so that the addition of feature values always increase the maliciousness score . These approaches are limited to guarding against the addition attacks , thus lacks generality . Last , Xu et al . ( 2017 ) use feature squeezing , which quantizes the feature values in order to reduce the number of adversarial choices . However , their defense is for �p-norm adversaries and thus inapplicable for relational attacks . Normalization is a technique to reduce the number of syntactically distinct instances . First introduced to network security in the early 2000s in the context of intrusion detection systems ( Handley et al. , 2001 ) , it was later applied to malware detection ( Christodorescu et al. , 2007 ; Coogan et al. , 2011 ; Bichsel et al. , 2016 ; Salem & Banescu , 2016 ; Baumann et al. , 2017 ) . Our work addresses the open question whether normalization is useful for ML under relational adversary by investigating its impact on both model robustness and accuracy . 3 BACKGROUND . In this section , we first describe the learning task , then formalize the potential adversarial manipulation as logical relations , and eventually derive the notion of robustness to relational adversaries . Learning Task . We consider a data distribution D over a input space X and categorical label space Y . We use bold face letters , e.g . x , for input vectors and y for the label . Given a hypothesis class H , the learner wants to learn a classifier f : X → Y in H that minimizes the risk over the data distribution . In non-adversarial settings , the learner solves minf∈H E ( x , y ) ∼D � ( f , x , y ) , where � is a loss function . For classification , � ( f , x , y ) = 1 ( f ( x ) �= y ) . Logical Relation . A relation R is a set of input pairs , where each pair ( x , z ) specifies a transformation of input x to output z . We write x →R z iff ( x , z ) ∈ R. We write x →∗R z iff x = z or there exists z0 , z1 , · · · , zk ( k > 0 ) such that x = z0 , zi →R zi+1 ( 0 ≤ i < k ) and zk = z . In other words , →∗R is the reflexive-transitive closure of →R . We describe an example relation as follows : Example 1 ( Hue Shifting ) . Let xh , xs , xv denote the hue , saturation and value components of an image x . In a hue shifting relation R , x →R z iff zh = ( xh+δ ) % 1 where δ is a scalar , zs = xs , zv = xv . Since xh changes in a circle , i.e. , hue of 1 is equal to hue of 0 . Hence , we compute the modulo of the hue component with 1 to map zh within [ 0,1 ] ( Appendix B gives the background of HSV ) . In this paper , we also consider unions of relations . Notice that a finite union R of m relations R1 , · · · , Rm is also a relation , and x →R z iff x →Ri z for any i ∈ { 1 , · · · , m } . Threat Model . A test-time adversary replaces a clean test input x with an adversarially manipulated input A ( x ) , where A ( · ) represents the attack algorithm . We consider an adversary who wants to maximize the classification error rate : E ( x , y ) ∼D 1 ( f ( A ( x ) ) �= y ) . We assume white-box attacks1 , i.e . the adversary has total access to f , including its structures , model parameters and any defense mechanism in place . To maintain the malicious semantics , the adversarial input A ( x ) should belong to a feasible set T ( x ) . In this paper , we focus on T ( x ) that is described by relation . We consider a logical relation R that is known to both the learner and the adversary , and we define a relational adversary as the following . Definition 1 ( relational adversary ) . An adversary is said to be R-relational if T ( x ) = { z |x →∗R z } , i.e . each element in R represents an admissible transformation , and the adversary can apply arbitrary number of transformation specified by R. We can then define the robustness of a classifier f by how often its prediction is consistent under attack , and robust accuracy as the fraction of predictions that are both robust and accurate . Definition 2 ( Robustness and robust accuracy ) . Let Q ( R , f , x ) be the following statement : ∀ z ( ( x →∗R z ) ⇒ f ( x ) = f ( z ) ) . Then , a classifier f is robust at x if Q ( R , f , x ) is true , and the robustness of f to an R-relational adversary is : Ex∼DX 1Q ( R , f , x ) , where 1 ( · ) indicates the truth value of a statement and DX is the marginal distribution over inputs . The robust accuracy of f w.r.t . an R-relational adversary is then : E ( x , y ) ∼D 1Q ( R , f , x ) ∧f ( x ) =y . Notice that the robust accuracy of a classifier is no more than the robustness in value because of the extra requirement of f ( x ) = y . Meanwhile , a classifier with the highest robustness accuracy may not always have the highest robustness and vice versa : an intuitive example is that a constant classifier is always robust but not necessarily robustly accurate . In Sec 4 , we will discuss both objectives and characterize the trade-off between them . 4 N & P – A PROVABLY ROBUST LEARNING FRAMEWORK In this section , we introduce N & P , a learning framework which learns and predicts over normalized training and test inputs . We first identify the necessary and sufficient condition for robustness , and propose a normalization procedure that makes N & P provably robust to R-relational adversaries . Finally , we analyze the performance of N & P : since N & P guarantees robustness , the analysis will focus on robustness-accuracy trade-off and provide an in-depth understanding to causes of such trade-off . 4.1 AN OVERVIEW OF THE N & P FRAMEWORK In N & P , the learner first specifies a normalizer N : X → X . We call N ( x ) the ‘ normal form ’ of input x . The learner then both trains the classifier and predicts the test label over the normal forms instead of the original inputs . Let D denote the training set . In the empirical risk minimization learning scheme , for example , the learner will now solve the following problem min f∈H � ( x , y ) ∈D � ( f , N ( x ) , y ) , ( 1 ) and use the minimizer f∗ as the classifier . During test-time , the model will predict f∗ ( N ( x ) ) . Table 1 compares the N & P learning pipeline to normal risk minimization and adversarial training . 1We consider a strong white-box attacker to avoid interference from security by obscurity , which is shown fragile in various other adversarial settings ( Carlini & Wagner , 2017 ) .
This paper proposed a new framework, relational adversary, to study adversarial robustness under multiple (sequential) data transformations. The authors also made robustness guarantees based on the Normalizle-and-Predict scenario. Improved robustness is numerically presented on two tasks: malware detection (under add/substitute attack) and image classification (under joint hue and Linfinity perturbation).
SP:ac40b4df07128cb87ba180c80a4c7d70511bb430
Robustness against Relational Adversary
Test-time adversarial attacks have posed serious challenges to the robustness of machine-learning models , and in many settings the adversarial perturbation need not be bounded by small �p-norms . Motivated by the semantics-preserving attacks in vision and security domain , we investigate relational adversaries , a broad class of attackers who create adversarial examples that are in a reflexive-transitive closure of a logical relation . We analyze the conditions for robustness and propose normalize-and-predict – a learning framework with provable robustness guarantee . We compare our approach with adversarial training and derive an unified framework that provides benefits of both approaches . Guided by our theoretical findings , we apply our framework to image classification and malware detection . Results of both tasks show that attacks using relational adversaries frequently fool existing models , but our unified framework can significantly enhance their robustness . 1 INTRODUCTION . The robustness of machine learning ( ML ) systems has been challenged by test-time attacks using adversarial examples ( Szegedy et al. , 2013 ) . These adversarial examples are intentionally manipulated inputs that preserve the essential characteristics of the original inputs , and thus are expected to have the same test outcome as the originals by human standard ; yet they severely affect the performance of many ML models across different domains ( Moosavi-Dezfooli et al. , 2016 ; Eykholt et al. , 2018 ; Qin et al. , 2019 ) . As models in high-stake domains such as system security are also undermined by attacks ( Grosse et al. , 2017 ; Rosenberg et al. , 2018 ; Hu & Tan , 2018 ) , robust ML in adversarial test environment becomes an imperative task for the ML community . Existing work on test-time attacks predominately considers �p-norm bounded adversarial manipulation ( Goodfellow et al. , 2014 ; Carlini & Wagner , 2017 ) . However , in many security-critical settings , the adversarial examples need not respect the �p-norm constraint as long as they preserve the malicious semantics . In malware detection , for example , a malware author can implement the same function using different APIs , or bind a malware within benign softwares like video games or office tools . The modified malware preserves the malicious functionality despite the drastically different syntactic features . Hence , focusing on adversarial examples of small �p-norm in this setting will fail to address a sizable attack surface that attackers can exploit to evade detectors . In addition to security threats , another rising concern on ML models is the spurious correlations they could have learned in a biased data set . Ribeiro et al . ( 2016 ) show that a highly accurate wolf-vshusky-dog classifier indeed bases its prediction on the presence/absence of snow in the background . A reliable model , in contrast , should be robust to changes of this nature . Although dubbed as semantic perturbation or manipulation ( Mohapatra et al. , 2020 ; Bhattad et al. , 2019 ) , these changes do not alter the core of the semantics of input data , thus , we still consider them to be semantics-preserving pertaining to the classification task . Since such semantics-preserving changes often resulted in large �p-norms , they are likely to render the existing �p-norm based defenses ineffective . In this paper , we consider a general attack framework in which attackers create adversarial examples by transforming the original inputs via a set of rules in a semantics-preserving manner . Unlike the prior works ( Rosenberg et al. , 2018 ; Hu & Tan , 2018 ; Hosseini et al. , 2017 ; Hosseini & Poovendran , 2018 ) which investigate specific adversarial settings , our paper extends the scope of attacks to general logical transformation : we unify the threat models into a powerful relational adversary , which can readily incorporate more complex input transformations . From the defense perspective , recent work has started to look beyond �p-norm constraints , including adversarial training ( Grosse et al. , 2017 ; Rosenberg et al. , 2019 ; Lei et al. , 2019 ) , verificationloss regularization ( Huang et al. , 2019 ) and invariance-induced regularization ( Yang et al. , 2019 ) . Adversarial training in principle can achieve high robust accuracy when the adversarial example in the training loop maximizes the loss . However , finding such adversarial examples is in general NPhard ( Katz et al. , 2017 ) , and we show in Sec 4 that it is even PSPACE-hard for semantics-preserving attacks that are considered in this paper . Huang et al . ( 2019 ) and Yang et al . ( 2019 ) add regularizers that incorporate model robustness as part of the training objective . However , such regularization can not be strictly enforced in training , and neither can the model robustness . These limitations still cause vulnerability to semantics-preserving attacks . Normalize-and-Predict Learning Framework This paper attempts to overcome the limitations of prior work by introducing a learning framework that guarantees robustness by design . In particular , we target a relational adversary , whose admissible manipulation is specified by a logical relation . A logical relation is a set of input pairs , each of which consists of a source and target of an atomic , semantics-preserving transformation . We consider a strong adversary who can apply an arbitrary number of transformations . Our paper makes the following contribution towards the theoretical understanding of robust ML against relational adversaries : 1 . We formally describe admissible adversarial manipulation using logical relations , and characterize the necessary and sufficient conditions for robustness to relational adversaries . 2 . We propose normalize-and-predict ( hereinafter abbreviated as N & P ) , a learning framework that first converts each data input to a well-defined and unique normal form and then trains and classifies over the normalized inputs . We show that our framework has guaranteed robustness , and characterize conditions to different levels of robustness-accuracy trade-off . 3 . We compare N & P to the popular adversarial training framework , which directly optimizes for accuracy under attacks . We show that N & P has the advantage in terms of explicit robustness guarantee and reduced training complexity , and in certain cases yields the same model accuracy as adversarial training . Motivated by the comparison , we propose a unified framework , which selectively normalizes over relations that tend to preserve the model accuracy and adversarially trains over the rest . Our unified approach gets the benefits from both frameworks . We then apply our theoretical findings to malware detection and image classification . For the former , first , we formulate two types of common program transformation — ( 1 ) addition of redundant libraries and API calls , and ( 2 ) substitution of equivalent API calls — as logical relations . Next , we instantiate our learning framework to these relations , and propose two generic relational adversarial attacks to determine the robustness of a model . Finally , we perform experiments over Sleipnir , a real-world WIN32 malware data set . Regarding image classification , we reused an attack method proposed by the prior work ( Hosseini & Poovendran , 2018 ) — shifting of the hue in the HSV color space — that can be deemed as a specific instantiation of our attack framework . We then compare the accuracy and robustness of ResNet-32 ( He et al. , 2016 ) , a common image classification model , trained with the unified framework against the standard adversarial training on CIFAR-10 ( Krizhevsky et al. , 2009 ) . The results we obtained in both tasks show that : 1 . Attacks using addition and substitution suffice to evade existing ML malware detectors . 2 . Our unified approach using input normalization and adversarial training achieves highest robust accuracy among all baselines in malware detection . The drop in accuracy on clean inputs is small and the computation cost is lower than pure adversarial training . 3 . When trained with the unified learning framework , ResNet-32 achieves similar clean accuracy but significantly higher robust accuracy than adversarial training alone . Finally , based on our theoretical and empirical results , we conclude that input normalization is vital to robust learning against relational adversaries . We believe techniques that can improve the quality of normalization are promising directions for future work . 2 RELATED WORK .. Test-time attacks using adversarial examples have been extensively studied in the past several years . Research has shown ML models are vulnerable to such attack in a variety of application domains ( Moosavi-Dezfooli et al. , 2016 ; Chen et al. , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Ebrahimi et al. , 2018 ; Qin et al. , 2019 ; Yang et al. , 2020 ) including system security where reliable defense is absolutely essential . For instance , Grosse et al . ( 2017 ) and Al-Dujaili et al . ( 2018 ) evade API/library usage based malware detectors by adding redundant API calls ; Rosenberg et al . ( 2018 ) , Hu & Tan ( 2018 ) , and Rosenberg et al . ( 2019 ) successfully attack running-time behavior based detectors by adding redundant execution traces ; Pierazzi et al . ( 2020 ) extend the attacks from feature-space to problem-space , propose a framework to describe real-world attacker ’ s constraints and create realistic attack instances using automated software transplantation . On the defense end , the work closest to ours in spirit is Yang et al . ( 2019 ) , which adds invarianceinduced regularizers to the training process . Their work however differs from ours in two major ways . First , their work considers a specific spatial transformation attack in image classification ; our work considers a general adversary based on logic relations . Second , their regularizer may not enforce the model robustness on finite samples as they are primarily interested in enhancing the model accuracy . In contrast , our framework emphasizes robustness which is enforced by design . Grosse et al . ( 2017 ) ; Al-Dujaili et al . ( 2018 ) ; Rosenberg et al . ( 2019 ) improve robustness via adversarial training ; we show such approach is hard to optimize . Incer et al . ( 2018 ) ; Kouzemtchenko ( 2018 ) enforce monotonicity over model outputs so that the addition of feature values always increase the maliciousness score . These approaches are limited to guarding against the addition attacks , thus lacks generality . Last , Xu et al . ( 2017 ) use feature squeezing , which quantizes the feature values in order to reduce the number of adversarial choices . However , their defense is for �p-norm adversaries and thus inapplicable for relational attacks . Normalization is a technique to reduce the number of syntactically distinct instances . First introduced to network security in the early 2000s in the context of intrusion detection systems ( Handley et al. , 2001 ) , it was later applied to malware detection ( Christodorescu et al. , 2007 ; Coogan et al. , 2011 ; Bichsel et al. , 2016 ; Salem & Banescu , 2016 ; Baumann et al. , 2017 ) . Our work addresses the open question whether normalization is useful for ML under relational adversary by investigating its impact on both model robustness and accuracy . 3 BACKGROUND . In this section , we first describe the learning task , then formalize the potential adversarial manipulation as logical relations , and eventually derive the notion of robustness to relational adversaries . Learning Task . We consider a data distribution D over a input space X and categorical label space Y . We use bold face letters , e.g . x , for input vectors and y for the label . Given a hypothesis class H , the learner wants to learn a classifier f : X → Y in H that minimizes the risk over the data distribution . In non-adversarial settings , the learner solves minf∈H E ( x , y ) ∼D � ( f , x , y ) , where � is a loss function . For classification , � ( f , x , y ) = 1 ( f ( x ) �= y ) . Logical Relation . A relation R is a set of input pairs , where each pair ( x , z ) specifies a transformation of input x to output z . We write x →R z iff ( x , z ) ∈ R. We write x →∗R z iff x = z or there exists z0 , z1 , · · · , zk ( k > 0 ) such that x = z0 , zi →R zi+1 ( 0 ≤ i < k ) and zk = z . In other words , →∗R is the reflexive-transitive closure of →R . We describe an example relation as follows : Example 1 ( Hue Shifting ) . Let xh , xs , xv denote the hue , saturation and value components of an image x . In a hue shifting relation R , x →R z iff zh = ( xh+δ ) % 1 where δ is a scalar , zs = xs , zv = xv . Since xh changes in a circle , i.e. , hue of 1 is equal to hue of 0 . Hence , we compute the modulo of the hue component with 1 to map zh within [ 0,1 ] ( Appendix B gives the background of HSV ) . In this paper , we also consider unions of relations . Notice that a finite union R of m relations R1 , · · · , Rm is also a relation , and x →R z iff x →Ri z for any i ∈ { 1 , · · · , m } . Threat Model . A test-time adversary replaces a clean test input x with an adversarially manipulated input A ( x ) , where A ( · ) represents the attack algorithm . We consider an adversary who wants to maximize the classification error rate : E ( x , y ) ∼D 1 ( f ( A ( x ) ) �= y ) . We assume white-box attacks1 , i.e . the adversary has total access to f , including its structures , model parameters and any defense mechanism in place . To maintain the malicious semantics , the adversarial input A ( x ) should belong to a feasible set T ( x ) . In this paper , we focus on T ( x ) that is described by relation . We consider a logical relation R that is known to both the learner and the adversary , and we define a relational adversary as the following . Definition 1 ( relational adversary ) . An adversary is said to be R-relational if T ( x ) = { z |x →∗R z } , i.e . each element in R represents an admissible transformation , and the adversary can apply arbitrary number of transformation specified by R. We can then define the robustness of a classifier f by how often its prediction is consistent under attack , and robust accuracy as the fraction of predictions that are both robust and accurate . Definition 2 ( Robustness and robust accuracy ) . Let Q ( R , f , x ) be the following statement : ∀ z ( ( x →∗R z ) ⇒ f ( x ) = f ( z ) ) . Then , a classifier f is robust at x if Q ( R , f , x ) is true , and the robustness of f to an R-relational adversary is : Ex∼DX 1Q ( R , f , x ) , where 1 ( · ) indicates the truth value of a statement and DX is the marginal distribution over inputs . The robust accuracy of f w.r.t . an R-relational adversary is then : E ( x , y ) ∼D 1Q ( R , f , x ) ∧f ( x ) =y . Notice that the robust accuracy of a classifier is no more than the robustness in value because of the extra requirement of f ( x ) = y . Meanwhile , a classifier with the highest robustness accuracy may not always have the highest robustness and vice versa : an intuitive example is that a constant classifier is always robust but not necessarily robustly accurate . In Sec 4 , we will discuss both objectives and characterize the trade-off between them . 4 N & P – A PROVABLY ROBUST LEARNING FRAMEWORK In this section , we introduce N & P , a learning framework which learns and predicts over normalized training and test inputs . We first identify the necessary and sufficient condition for robustness , and propose a normalization procedure that makes N & P provably robust to R-relational adversaries . Finally , we analyze the performance of N & P : since N & P guarantees robustness , the analysis will focus on robustness-accuracy trade-off and provide an in-depth understanding to causes of such trade-off . 4.1 AN OVERVIEW OF THE N & P FRAMEWORK In N & P , the learner first specifies a normalizer N : X → X . We call N ( x ) the ‘ normal form ’ of input x . The learner then both trains the classifier and predicts the test label over the normal forms instead of the original inputs . Let D denote the training set . In the empirical risk minimization learning scheme , for example , the learner will now solve the following problem min f∈H � ( x , y ) ∈D � ( f , N ( x ) , y ) , ( 1 ) and use the minimizer f∗ as the classifier . During test-time , the model will predict f∗ ( N ( x ) ) . Table 1 compares the N & P learning pipeline to normal risk minimization and adversarial training . 1We consider a strong white-box attacker to avoid interference from security by obscurity , which is shown fragile in various other adversarial settings ( Carlini & Wagner , 2017 ) .
This work investigates relational adversary which creates adversarial examples by transforming the original inputs via a logical relation. The authors analyze the conditions for robustness to relational adversary and propose a learning framework which learns and predicts over normalized training and test inputs. Since their framework may incur excessive loss in accuracy, the authors then propose a unified framework by combining input normalization with adversarial training and claim that their unified framework can preserve the optimal robust accuracy. Empirical results show that their unified framework can enhance model robustness on two real-world tasks.
SP:ac40b4df07128cb87ba180c80a4c7d70511bb430
Using Synthetic Data to Improve the Long-range Forecasting of Time Series Data
1 INTRODUCTION . Short-range forecasting of time series data has been able to provide some useful information , but its scope of application is limited ( Chatfield , 2000 ; Granger & Newbold , 2014 ) . In most applications , long-range forecasting of time series data is preferred as it allows more time for early intervention and planning opportunities ( Alvarez et al. , 2010 ; Azad et al. , 2014 ) . For example , long-range forecasting of patient ’ s vital signs effectively gives clinicians more time to take action and may reduce the occurrence of potential adverse events ( Luo , 2015 ; Choi & et al , 2016 ) . However , a critical issue affecting the long-range forecasting is that the predictive performance ( e.g. , N -step ahead ) becomes worse as N grows . One practical approach to address this problem is to use synthetic data to shorten the prediction horizon N . For example , in iterative forecasting ( Marcellino et al. , 2006 ; Hamzaçebi et al. , 2009 ) , the previous predictions are used together with the original data as new inputs to evaluate the next prediction . However , the synthetic data ( i.e. , previous predictions ) generated in this recursive and supervised manner is more susceptible to error propagation ( Sorjamaa & et al , 2007 ; Weigend & Gershenfeld , 2018 ) . Overall , the quality of synthetic data is the key to improving long-range forecasting . In recent years , the success of Generative Adversarial Network ( GAN ) ( Goodfellow & et al , 2014 ) in replicating real-world content has inspired numerous GAN based architectures ( Frid-Adar et al. , 2018a ; b ; Shin et al. , 2018 ; Bowles et al. , 2018 ) , in order to generate synthetic data for different purposes ( e.g. , improve classification accuracy ) . However , the utilization of synthetic data to improve long-range forecasting remains unexplored . In this paper , we contribute to the area of long-range forecasting as follows . 1 . We augment the existing conditional Wasserstein GAN with Gradient Penalty with a mean squared error term . This new architecture , called cWGAN-GEP , aims to generate accurate synthetic data which preserves the temporal dynamics between the conditioning input and generated data . 2 . We develop a long-range forecasting method called Generative Forecasting ( GenF ) which consists of three key components : ( i ) a cWGAN-GEP based generator , to generate synthetic data for next few time steps . ( ii ) a predictor which makes long-range predictions based on generated and observed data . ( iii ) an information theoretic clustering ( ITC ) algorithm to better train the cWGAN-GEP based generator and the predictor . 3 . We conduct experiments on three public time series datasets and our results demonstrate that GenF significantly outperforms a diverse range of state-of-the-art benchmarks and classical approaches . In most cases , we find improvements of at least 10 % over the benchmark methods . To the best of our knowledge , our work is the first to propose using synthetic data generated by a GAN based architecture to improve long-range forecasting and the proposed cWGAN-GEP is not explored in any of the previous work . 2 BACKGROUND ON TIME SERIES FORECASTING . In time series forecasting , we use an observation window of historical data to predict the future value ( see Fig . 1 ) . Let M denote the observation window length and N denote the prediction horizon . For those methods that contain generative models , let L denote the synthetic data window length . Let Xi ∈ RK be the observation at the ith time step , where K is the number of features . In Fig . 1 , the prediction horizon is N , indicating that we plan to make predictions N time steps ahead , i.e. , at time step t+N ( e.g. , the circled entry in Fig . 1 ) . Next , we discuss related work in Section 2.1 and shortlist several benchmark methods for comparison in Section 2.2 . 2.1 RELATED WORK . Early methods which use neural networks to perform long-range forecasting include ( Nguyen & Chan , 2004 ; Goswami & Srividya , 1996 ; Al-Saba & El-Amin , 1999 ) . For example , Nguyen & Chan ( 2004 ) propose a group of neural networks to make predictions at different time steps . Several recent works ( Yu et al. , 2017 ; Lai et al. , 2018 ; Qiu et al. , 2020 ; Bouktif et al. , 2018 ; Barsoum et al. , 2018 ) attempt to improve the long-range forecasting by proposing new architectures . For example , Yu et al . ( 2017 ) propose a Long Short-Term Memory ( LSTM ) ( Hochreiter & Schmidhuber , 1997 ) based Tensor-Train Recurrent Neural Network as a module for sequence-to-sequence ( Sutskever et al. , 2014 ) framework , called TLSTM . Moreover , Lai et al . ( 2018 ) propose a Long- and Short-term Time-series network ( LSTNet ) which combines LSTM with autoregressive models to minimize a customized loss function inspired by support vector regression ( SVR ) ( Cortes & Vapnik , 1995 ) . Another recent work ( Cheng et al. , 2020 ) proposes Multi-Level Construal Neural Network ( MLCNN ) which attempts to improve the predictive performance by fusing forecasting information of different future time . One more interesting work to mention is ( Ahmed et al. , 2007 ) , which combines Gaussian processes ( Rasmussen , 2003 ) and neural networks to improve the forecasting performance . Overall , all these methods can be classified into two main classes : direct forecasting and iterative forecasting ( Hamzaçebi et al. , 2009 ; Bontempi et al. , 2012 ) . In direct forecasting , a group of models are trained to directly make predictions at different values of N . The advantage is that all models are independent of each other and hence , models do not interfere with each other . However , its performance tends to becomes worse with N due to the lack of long-range dependencies . In iterative forecasting , the model is trained to make predictions for the next time step ( t + 1 ) only . Then , the same model will be used over and over again and previous predictions are used together with the past observations to make predictions for the next time step . This process is recursively repeated N times to make predictions N time steps ahead . The previous predictions can be considered as synthetic data ( with synthetic data window length L = N − 1 ) to shorten the effective prediction horizon . However , the synthetic data generated in this supervised and recursive manner is more susceptible to error propagation , meaning that a small error in the current prediction becomes larger error in subsequent predictions ( Taieb et al. , 2012 ; Sorjamaa & et al , 2007 ) . 2.2 BENCHMARK METHODS . The taxonomy in Section 2.1 suggests that most existing methods can be classified as either direct or iterative forecasting . This motivates us to use both direct and iterative forecasting as benchmark methods . As mentioned in Section 2.1 , some classical models such as LSTM , Autoregressive Integrated Moving Average ( ARIMA ) ( Box & Pierce , 1970 ) , SVR , and Gaussian Process Regression ( GPR ) ( Rasmussen , 2003 ) are used to form the core of many state-of-the-art methods . Hence , we use these four classical models to implement both direct and iterative forecasting . In addition , three strong baselines described in Section 2.1 , i.e. , TLSTM , LSTNet , and MLCNN , are also selected for comparison as they are reported to provide outstanding long-range forecasting performance in the literature ( Yu et al. , 2017 ; Lai et al. , 2018 ; Cheng et al. , 2020 ) . Moreover , the source code released for these works is well organized to ensure correct implementation . 3 GENERATIVE FORECASTING . In this section , we introduce the idea of GenF ( see Fig . 2 ) and describe its three components : cWGAN-GEP based synthetic data generator , LSTM based predictor and the ITC algorithm . 3.1 IDEA OF GENERATIVE FORECASTING . To improve long-range forecasting , we develop an approach called Generative Forecasting ( GenF ) which consists of a cWGAN-GEP based generator , to generate synthetic data for next few time steps , and a predictor , to make long-range predictions based on observed and generated data . Assuming we use past 3 observations { Xt , Xt−1 , Xt−2 } and make predictions at t+ 10 , we can express GenF as Generate synthetic data X ′t+1 = g ( Xt , Xt−1 , Xt−2 , θg ) , ( 1 ) X ′t+2 = g ( X ′ t+1 , Xt , Xt−1 , θg ) , ( 2 ) X ′t+3 = g ( X ′ t+2 , X ′ t+1 , Xt , θg ) , ( 3 ) Make a long-range prediction : X̄t+10 = f10 ( X ′t+3 , X ′t+2 , X ′t+1 , θ10 ) , ( 4 ) where g denotes the cWGAN-GEP based generator with parameter θg and f10 is the predictor with parameter θ10 . Let X ′t+1 , X ′t+2 and X ′t+3 denote the generated synthetic data for next three time steps and X̄10 denote the prediction at t+ 10 . Note that the value of the synthetic data window length L depends on the quality of the synthetic data and ( 1 ) - ( 3 ) is an example of L = 3 . It can be seen that the generator g generates synthetic data via the strategy of iterative forecasting ( see ( 1 ) - ( 3 ) ) and the predictor makes a prediction via the strategy of direct forecasting ( see ( 4 ) ) . We note that GenF does not belong to either direct or iterative forecasting . The key difference is that GenF leverages synthetic data to shorten the effective prediction horizon while direct forecasting does not leverage any synthetic data . Moreover , unlike iterative forecasting where the synthetic data window length is L = N − 1 , the synthetic data window length L of GenF is much smaller than the prediction horizon N ( L = 3 and N = 10 in the example of ( 1 ) - ( 4 ) ) , so that it can prevent the propagation of error at an early stage . In such a manner , we argue that GenF attempts to balance direct forecasting and iterative forecasting . 3.2 GENERATIVE FORECASTING : THE CWGAN-GEP BASED SYNTHETIC DATA GENERATOR . GAN ( Goodfellow & et al , 2014 ) and its related works have demonstrated promising results in many generative tasks ( Yi et al. , 2017 ; Xu et al. , 2017 ; Haidar & Rezagholizadeh , 2019 ; Zhang et al. , 2017 ; Dong et al. , 2018 ) . The first GAN applied to time series data is C-RNN-GAN ( Mogren , 2016 ) which takes random noise as input and uses LSTM as both the generator and discriminator . One follow-up work , RCGAN ( Esteban et al. , 2017 ) , makes use of the conditioning information to generate synthetic medical data . Along the way , many works have explored generating synthetic data in a diverse range of domains ( e.g. , sensor data ( Alzantot et al. , 2017 ) , biosignal ( Haradal et al. , 2018 ) ) . We note that all these synthetic data are generated for some purpose ( Dai & Le , 2015 ; Larsen et al. , 2015 ; Dumoulin et al. , 2016 ; Srivastava et al. , 2015 ; Yoon et al. , 2019 ) . For example , ( Frid-Adar et al. , 2018a ) makes use of synthetic data augmentation to improve the classification results , and ( Bowles et al. , 2018 ) mixes the synthetic data with training data to enhance the model ’ s predictive ability . However , to the best of our knowledge , none of them have considered using the synthetic data generated by the GAN based architecture , to improve long-range forecasting . We fill in this gap and propose a conditional Wasserstein GAN with Gradient and Error Penalty ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Gulrajani & et al , 2017 ) to generator synthetic data which can be used to improve long-range forecasting . The structure of cWGAN-GEP is shown in Fig . 2 ( right ) . As can be seen , the training data G is used as a condition to direct the generation of synthetic data ( Mirza & Osindero , 2014 ) . Then , the synthetic data ( X ′t+1 ) will be concatenated with the training data G at the latest time step , to be evaluated by the discriminator . The network configurations of cWGAN-GEP are given in Table 1 ( left ) . The loss function is summarized as Loss = E X̃∼Pg [ D ( X̃ ) ] − E X∼Pr [ D ( X ) ] + λE X̂∼P X̂ [ ( ||∇X̂D ( X̂ ) ||2 − 1 ) 2 ] + β ( Xt+1 −X ′t+1 ) 2 . ( 5 ) We note that the first two terms in the R.H.S of ( 5 ) correspond to Wasserstein distance which improves learning performance over the Jensen-Shannon divergence used in the original GAN ( Arjovsky et al. , 2017 ; Gulrajani & et al , 2017 ) . The third term is the gradient penalty , corresponding to the 1-Lipschitz constraint . Unique to our work , we introduce the last term which attempts to minimize the mean squared error between the synthetic data and its true value . In such a manner , we argue that the generator can generate accurate synthetic data while preserving the temporal dynamics between conditioning input and generated data by minimizing the difference between the generated data distribution Pg and real data distribution Pr .
This paper proposes cWGAN-GEP for long-range forecasting of time-series data. cWGAN-GEP is a combination of data generation of data prediction, where given some observations, GAN iteratively generates a short synthetic time-series data, and an LSTM subsequently makes a long-range prediction based on the generated synthetic data. In order to train both components, the authors use information theoretic clustering. The proposed model outperforms various baselines on the prediction task using three time-series datasets.
SP:c0695a7e6fe908a51b38f52594678c6d87c8014a
Using Synthetic Data to Improve the Long-range Forecasting of Time Series Data
1 INTRODUCTION . Short-range forecasting of time series data has been able to provide some useful information , but its scope of application is limited ( Chatfield , 2000 ; Granger & Newbold , 2014 ) . In most applications , long-range forecasting of time series data is preferred as it allows more time for early intervention and planning opportunities ( Alvarez et al. , 2010 ; Azad et al. , 2014 ) . For example , long-range forecasting of patient ’ s vital signs effectively gives clinicians more time to take action and may reduce the occurrence of potential adverse events ( Luo , 2015 ; Choi & et al , 2016 ) . However , a critical issue affecting the long-range forecasting is that the predictive performance ( e.g. , N -step ahead ) becomes worse as N grows . One practical approach to address this problem is to use synthetic data to shorten the prediction horizon N . For example , in iterative forecasting ( Marcellino et al. , 2006 ; Hamzaçebi et al. , 2009 ) , the previous predictions are used together with the original data as new inputs to evaluate the next prediction . However , the synthetic data ( i.e. , previous predictions ) generated in this recursive and supervised manner is more susceptible to error propagation ( Sorjamaa & et al , 2007 ; Weigend & Gershenfeld , 2018 ) . Overall , the quality of synthetic data is the key to improving long-range forecasting . In recent years , the success of Generative Adversarial Network ( GAN ) ( Goodfellow & et al , 2014 ) in replicating real-world content has inspired numerous GAN based architectures ( Frid-Adar et al. , 2018a ; b ; Shin et al. , 2018 ; Bowles et al. , 2018 ) , in order to generate synthetic data for different purposes ( e.g. , improve classification accuracy ) . However , the utilization of synthetic data to improve long-range forecasting remains unexplored . In this paper , we contribute to the area of long-range forecasting as follows . 1 . We augment the existing conditional Wasserstein GAN with Gradient Penalty with a mean squared error term . This new architecture , called cWGAN-GEP , aims to generate accurate synthetic data which preserves the temporal dynamics between the conditioning input and generated data . 2 . We develop a long-range forecasting method called Generative Forecasting ( GenF ) which consists of three key components : ( i ) a cWGAN-GEP based generator , to generate synthetic data for next few time steps . ( ii ) a predictor which makes long-range predictions based on generated and observed data . ( iii ) an information theoretic clustering ( ITC ) algorithm to better train the cWGAN-GEP based generator and the predictor . 3 . We conduct experiments on three public time series datasets and our results demonstrate that GenF significantly outperforms a diverse range of state-of-the-art benchmarks and classical approaches . In most cases , we find improvements of at least 10 % over the benchmark methods . To the best of our knowledge , our work is the first to propose using synthetic data generated by a GAN based architecture to improve long-range forecasting and the proposed cWGAN-GEP is not explored in any of the previous work . 2 BACKGROUND ON TIME SERIES FORECASTING . In time series forecasting , we use an observation window of historical data to predict the future value ( see Fig . 1 ) . Let M denote the observation window length and N denote the prediction horizon . For those methods that contain generative models , let L denote the synthetic data window length . Let Xi ∈ RK be the observation at the ith time step , where K is the number of features . In Fig . 1 , the prediction horizon is N , indicating that we plan to make predictions N time steps ahead , i.e. , at time step t+N ( e.g. , the circled entry in Fig . 1 ) . Next , we discuss related work in Section 2.1 and shortlist several benchmark methods for comparison in Section 2.2 . 2.1 RELATED WORK . Early methods which use neural networks to perform long-range forecasting include ( Nguyen & Chan , 2004 ; Goswami & Srividya , 1996 ; Al-Saba & El-Amin , 1999 ) . For example , Nguyen & Chan ( 2004 ) propose a group of neural networks to make predictions at different time steps . Several recent works ( Yu et al. , 2017 ; Lai et al. , 2018 ; Qiu et al. , 2020 ; Bouktif et al. , 2018 ; Barsoum et al. , 2018 ) attempt to improve the long-range forecasting by proposing new architectures . For example , Yu et al . ( 2017 ) propose a Long Short-Term Memory ( LSTM ) ( Hochreiter & Schmidhuber , 1997 ) based Tensor-Train Recurrent Neural Network as a module for sequence-to-sequence ( Sutskever et al. , 2014 ) framework , called TLSTM . Moreover , Lai et al . ( 2018 ) propose a Long- and Short-term Time-series network ( LSTNet ) which combines LSTM with autoregressive models to minimize a customized loss function inspired by support vector regression ( SVR ) ( Cortes & Vapnik , 1995 ) . Another recent work ( Cheng et al. , 2020 ) proposes Multi-Level Construal Neural Network ( MLCNN ) which attempts to improve the predictive performance by fusing forecasting information of different future time . One more interesting work to mention is ( Ahmed et al. , 2007 ) , which combines Gaussian processes ( Rasmussen , 2003 ) and neural networks to improve the forecasting performance . Overall , all these methods can be classified into two main classes : direct forecasting and iterative forecasting ( Hamzaçebi et al. , 2009 ; Bontempi et al. , 2012 ) . In direct forecasting , a group of models are trained to directly make predictions at different values of N . The advantage is that all models are independent of each other and hence , models do not interfere with each other . However , its performance tends to becomes worse with N due to the lack of long-range dependencies . In iterative forecasting , the model is trained to make predictions for the next time step ( t + 1 ) only . Then , the same model will be used over and over again and previous predictions are used together with the past observations to make predictions for the next time step . This process is recursively repeated N times to make predictions N time steps ahead . The previous predictions can be considered as synthetic data ( with synthetic data window length L = N − 1 ) to shorten the effective prediction horizon . However , the synthetic data generated in this supervised and recursive manner is more susceptible to error propagation , meaning that a small error in the current prediction becomes larger error in subsequent predictions ( Taieb et al. , 2012 ; Sorjamaa & et al , 2007 ) . 2.2 BENCHMARK METHODS . The taxonomy in Section 2.1 suggests that most existing methods can be classified as either direct or iterative forecasting . This motivates us to use both direct and iterative forecasting as benchmark methods . As mentioned in Section 2.1 , some classical models such as LSTM , Autoregressive Integrated Moving Average ( ARIMA ) ( Box & Pierce , 1970 ) , SVR , and Gaussian Process Regression ( GPR ) ( Rasmussen , 2003 ) are used to form the core of many state-of-the-art methods . Hence , we use these four classical models to implement both direct and iterative forecasting . In addition , three strong baselines described in Section 2.1 , i.e. , TLSTM , LSTNet , and MLCNN , are also selected for comparison as they are reported to provide outstanding long-range forecasting performance in the literature ( Yu et al. , 2017 ; Lai et al. , 2018 ; Cheng et al. , 2020 ) . Moreover , the source code released for these works is well organized to ensure correct implementation . 3 GENERATIVE FORECASTING . In this section , we introduce the idea of GenF ( see Fig . 2 ) and describe its three components : cWGAN-GEP based synthetic data generator , LSTM based predictor and the ITC algorithm . 3.1 IDEA OF GENERATIVE FORECASTING . To improve long-range forecasting , we develop an approach called Generative Forecasting ( GenF ) which consists of a cWGAN-GEP based generator , to generate synthetic data for next few time steps , and a predictor , to make long-range predictions based on observed and generated data . Assuming we use past 3 observations { Xt , Xt−1 , Xt−2 } and make predictions at t+ 10 , we can express GenF as Generate synthetic data X ′t+1 = g ( Xt , Xt−1 , Xt−2 , θg ) , ( 1 ) X ′t+2 = g ( X ′ t+1 , Xt , Xt−1 , θg ) , ( 2 ) X ′t+3 = g ( X ′ t+2 , X ′ t+1 , Xt , θg ) , ( 3 ) Make a long-range prediction : X̄t+10 = f10 ( X ′t+3 , X ′t+2 , X ′t+1 , θ10 ) , ( 4 ) where g denotes the cWGAN-GEP based generator with parameter θg and f10 is the predictor with parameter θ10 . Let X ′t+1 , X ′t+2 and X ′t+3 denote the generated synthetic data for next three time steps and X̄10 denote the prediction at t+ 10 . Note that the value of the synthetic data window length L depends on the quality of the synthetic data and ( 1 ) - ( 3 ) is an example of L = 3 . It can be seen that the generator g generates synthetic data via the strategy of iterative forecasting ( see ( 1 ) - ( 3 ) ) and the predictor makes a prediction via the strategy of direct forecasting ( see ( 4 ) ) . We note that GenF does not belong to either direct or iterative forecasting . The key difference is that GenF leverages synthetic data to shorten the effective prediction horizon while direct forecasting does not leverage any synthetic data . Moreover , unlike iterative forecasting where the synthetic data window length is L = N − 1 , the synthetic data window length L of GenF is much smaller than the prediction horizon N ( L = 3 and N = 10 in the example of ( 1 ) - ( 4 ) ) , so that it can prevent the propagation of error at an early stage . In such a manner , we argue that GenF attempts to balance direct forecasting and iterative forecasting . 3.2 GENERATIVE FORECASTING : THE CWGAN-GEP BASED SYNTHETIC DATA GENERATOR . GAN ( Goodfellow & et al , 2014 ) and its related works have demonstrated promising results in many generative tasks ( Yi et al. , 2017 ; Xu et al. , 2017 ; Haidar & Rezagholizadeh , 2019 ; Zhang et al. , 2017 ; Dong et al. , 2018 ) . The first GAN applied to time series data is C-RNN-GAN ( Mogren , 2016 ) which takes random noise as input and uses LSTM as both the generator and discriminator . One follow-up work , RCGAN ( Esteban et al. , 2017 ) , makes use of the conditioning information to generate synthetic medical data . Along the way , many works have explored generating synthetic data in a diverse range of domains ( e.g. , sensor data ( Alzantot et al. , 2017 ) , biosignal ( Haradal et al. , 2018 ) ) . We note that all these synthetic data are generated for some purpose ( Dai & Le , 2015 ; Larsen et al. , 2015 ; Dumoulin et al. , 2016 ; Srivastava et al. , 2015 ; Yoon et al. , 2019 ) . For example , ( Frid-Adar et al. , 2018a ) makes use of synthetic data augmentation to improve the classification results , and ( Bowles et al. , 2018 ) mixes the synthetic data with training data to enhance the model ’ s predictive ability . However , to the best of our knowledge , none of them have considered using the synthetic data generated by the GAN based architecture , to improve long-range forecasting . We fill in this gap and propose a conditional Wasserstein GAN with Gradient and Error Penalty ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Gulrajani & et al , 2017 ) to generator synthetic data which can be used to improve long-range forecasting . The structure of cWGAN-GEP is shown in Fig . 2 ( right ) . As can be seen , the training data G is used as a condition to direct the generation of synthetic data ( Mirza & Osindero , 2014 ) . Then , the synthetic data ( X ′t+1 ) will be concatenated with the training data G at the latest time step , to be evaluated by the discriminator . The network configurations of cWGAN-GEP are given in Table 1 ( left ) . The loss function is summarized as Loss = E X̃∼Pg [ D ( X̃ ) ] − E X∼Pr [ D ( X ) ] + λE X̂∼P X̂ [ ( ||∇X̂D ( X̂ ) ||2 − 1 ) 2 ] + β ( Xt+1 −X ′t+1 ) 2 . ( 5 ) We note that the first two terms in the R.H.S of ( 5 ) correspond to Wasserstein distance which improves learning performance over the Jensen-Shannon divergence used in the original GAN ( Arjovsky et al. , 2017 ; Gulrajani & et al , 2017 ) . The third term is the gradient penalty , corresponding to the 1-Lipschitz constraint . Unique to our work , we introduce the last term which attempts to minimize the mean squared error between the synthetic data and its true value . In such a manner , we argue that the generator can generate accurate synthetic data while preserving the temporal dynamics between conditioning input and generated data by minimizing the difference between the generated data distribution Pg and real data distribution Pr .
This paper presents a framework for long-range forecasting of time series data using synthetic data. The whole pipeline contains three main components: cWGAN-GEP to predict/generate the following data based on observed ones; an LSTM predictor to forecast results based on real/generated data; and ITC to cluster data points by mutual information which forms training data for the first two components according to clustering results. The proposed framework is evaluated on three public datasets and results seem promising.
SP:c0695a7e6fe908a51b38f52594678c6d87c8014a
Using Synthetic Data to Improve the Long-range Forecasting of Time Series Data
1 INTRODUCTION . Short-range forecasting of time series data has been able to provide some useful information , but its scope of application is limited ( Chatfield , 2000 ; Granger & Newbold , 2014 ) . In most applications , long-range forecasting of time series data is preferred as it allows more time for early intervention and planning opportunities ( Alvarez et al. , 2010 ; Azad et al. , 2014 ) . For example , long-range forecasting of patient ’ s vital signs effectively gives clinicians more time to take action and may reduce the occurrence of potential adverse events ( Luo , 2015 ; Choi & et al , 2016 ) . However , a critical issue affecting the long-range forecasting is that the predictive performance ( e.g. , N -step ahead ) becomes worse as N grows . One practical approach to address this problem is to use synthetic data to shorten the prediction horizon N . For example , in iterative forecasting ( Marcellino et al. , 2006 ; Hamzaçebi et al. , 2009 ) , the previous predictions are used together with the original data as new inputs to evaluate the next prediction . However , the synthetic data ( i.e. , previous predictions ) generated in this recursive and supervised manner is more susceptible to error propagation ( Sorjamaa & et al , 2007 ; Weigend & Gershenfeld , 2018 ) . Overall , the quality of synthetic data is the key to improving long-range forecasting . In recent years , the success of Generative Adversarial Network ( GAN ) ( Goodfellow & et al , 2014 ) in replicating real-world content has inspired numerous GAN based architectures ( Frid-Adar et al. , 2018a ; b ; Shin et al. , 2018 ; Bowles et al. , 2018 ) , in order to generate synthetic data for different purposes ( e.g. , improve classification accuracy ) . However , the utilization of synthetic data to improve long-range forecasting remains unexplored . In this paper , we contribute to the area of long-range forecasting as follows . 1 . We augment the existing conditional Wasserstein GAN with Gradient Penalty with a mean squared error term . This new architecture , called cWGAN-GEP , aims to generate accurate synthetic data which preserves the temporal dynamics between the conditioning input and generated data . 2 . We develop a long-range forecasting method called Generative Forecasting ( GenF ) which consists of three key components : ( i ) a cWGAN-GEP based generator , to generate synthetic data for next few time steps . ( ii ) a predictor which makes long-range predictions based on generated and observed data . ( iii ) an information theoretic clustering ( ITC ) algorithm to better train the cWGAN-GEP based generator and the predictor . 3 . We conduct experiments on three public time series datasets and our results demonstrate that GenF significantly outperforms a diverse range of state-of-the-art benchmarks and classical approaches . In most cases , we find improvements of at least 10 % over the benchmark methods . To the best of our knowledge , our work is the first to propose using synthetic data generated by a GAN based architecture to improve long-range forecasting and the proposed cWGAN-GEP is not explored in any of the previous work . 2 BACKGROUND ON TIME SERIES FORECASTING . In time series forecasting , we use an observation window of historical data to predict the future value ( see Fig . 1 ) . Let M denote the observation window length and N denote the prediction horizon . For those methods that contain generative models , let L denote the synthetic data window length . Let Xi ∈ RK be the observation at the ith time step , where K is the number of features . In Fig . 1 , the prediction horizon is N , indicating that we plan to make predictions N time steps ahead , i.e. , at time step t+N ( e.g. , the circled entry in Fig . 1 ) . Next , we discuss related work in Section 2.1 and shortlist several benchmark methods for comparison in Section 2.2 . 2.1 RELATED WORK . Early methods which use neural networks to perform long-range forecasting include ( Nguyen & Chan , 2004 ; Goswami & Srividya , 1996 ; Al-Saba & El-Amin , 1999 ) . For example , Nguyen & Chan ( 2004 ) propose a group of neural networks to make predictions at different time steps . Several recent works ( Yu et al. , 2017 ; Lai et al. , 2018 ; Qiu et al. , 2020 ; Bouktif et al. , 2018 ; Barsoum et al. , 2018 ) attempt to improve the long-range forecasting by proposing new architectures . For example , Yu et al . ( 2017 ) propose a Long Short-Term Memory ( LSTM ) ( Hochreiter & Schmidhuber , 1997 ) based Tensor-Train Recurrent Neural Network as a module for sequence-to-sequence ( Sutskever et al. , 2014 ) framework , called TLSTM . Moreover , Lai et al . ( 2018 ) propose a Long- and Short-term Time-series network ( LSTNet ) which combines LSTM with autoregressive models to minimize a customized loss function inspired by support vector regression ( SVR ) ( Cortes & Vapnik , 1995 ) . Another recent work ( Cheng et al. , 2020 ) proposes Multi-Level Construal Neural Network ( MLCNN ) which attempts to improve the predictive performance by fusing forecasting information of different future time . One more interesting work to mention is ( Ahmed et al. , 2007 ) , which combines Gaussian processes ( Rasmussen , 2003 ) and neural networks to improve the forecasting performance . Overall , all these methods can be classified into two main classes : direct forecasting and iterative forecasting ( Hamzaçebi et al. , 2009 ; Bontempi et al. , 2012 ) . In direct forecasting , a group of models are trained to directly make predictions at different values of N . The advantage is that all models are independent of each other and hence , models do not interfere with each other . However , its performance tends to becomes worse with N due to the lack of long-range dependencies . In iterative forecasting , the model is trained to make predictions for the next time step ( t + 1 ) only . Then , the same model will be used over and over again and previous predictions are used together with the past observations to make predictions for the next time step . This process is recursively repeated N times to make predictions N time steps ahead . The previous predictions can be considered as synthetic data ( with synthetic data window length L = N − 1 ) to shorten the effective prediction horizon . However , the synthetic data generated in this supervised and recursive manner is more susceptible to error propagation , meaning that a small error in the current prediction becomes larger error in subsequent predictions ( Taieb et al. , 2012 ; Sorjamaa & et al , 2007 ) . 2.2 BENCHMARK METHODS . The taxonomy in Section 2.1 suggests that most existing methods can be classified as either direct or iterative forecasting . This motivates us to use both direct and iterative forecasting as benchmark methods . As mentioned in Section 2.1 , some classical models such as LSTM , Autoregressive Integrated Moving Average ( ARIMA ) ( Box & Pierce , 1970 ) , SVR , and Gaussian Process Regression ( GPR ) ( Rasmussen , 2003 ) are used to form the core of many state-of-the-art methods . Hence , we use these four classical models to implement both direct and iterative forecasting . In addition , three strong baselines described in Section 2.1 , i.e. , TLSTM , LSTNet , and MLCNN , are also selected for comparison as they are reported to provide outstanding long-range forecasting performance in the literature ( Yu et al. , 2017 ; Lai et al. , 2018 ; Cheng et al. , 2020 ) . Moreover , the source code released for these works is well organized to ensure correct implementation . 3 GENERATIVE FORECASTING . In this section , we introduce the idea of GenF ( see Fig . 2 ) and describe its three components : cWGAN-GEP based synthetic data generator , LSTM based predictor and the ITC algorithm . 3.1 IDEA OF GENERATIVE FORECASTING . To improve long-range forecasting , we develop an approach called Generative Forecasting ( GenF ) which consists of a cWGAN-GEP based generator , to generate synthetic data for next few time steps , and a predictor , to make long-range predictions based on observed and generated data . Assuming we use past 3 observations { Xt , Xt−1 , Xt−2 } and make predictions at t+ 10 , we can express GenF as Generate synthetic data X ′t+1 = g ( Xt , Xt−1 , Xt−2 , θg ) , ( 1 ) X ′t+2 = g ( X ′ t+1 , Xt , Xt−1 , θg ) , ( 2 ) X ′t+3 = g ( X ′ t+2 , X ′ t+1 , Xt , θg ) , ( 3 ) Make a long-range prediction : X̄t+10 = f10 ( X ′t+3 , X ′t+2 , X ′t+1 , θ10 ) , ( 4 ) where g denotes the cWGAN-GEP based generator with parameter θg and f10 is the predictor with parameter θ10 . Let X ′t+1 , X ′t+2 and X ′t+3 denote the generated synthetic data for next three time steps and X̄10 denote the prediction at t+ 10 . Note that the value of the synthetic data window length L depends on the quality of the synthetic data and ( 1 ) - ( 3 ) is an example of L = 3 . It can be seen that the generator g generates synthetic data via the strategy of iterative forecasting ( see ( 1 ) - ( 3 ) ) and the predictor makes a prediction via the strategy of direct forecasting ( see ( 4 ) ) . We note that GenF does not belong to either direct or iterative forecasting . The key difference is that GenF leverages synthetic data to shorten the effective prediction horizon while direct forecasting does not leverage any synthetic data . Moreover , unlike iterative forecasting where the synthetic data window length is L = N − 1 , the synthetic data window length L of GenF is much smaller than the prediction horizon N ( L = 3 and N = 10 in the example of ( 1 ) - ( 4 ) ) , so that it can prevent the propagation of error at an early stage . In such a manner , we argue that GenF attempts to balance direct forecasting and iterative forecasting . 3.2 GENERATIVE FORECASTING : THE CWGAN-GEP BASED SYNTHETIC DATA GENERATOR . GAN ( Goodfellow & et al , 2014 ) and its related works have demonstrated promising results in many generative tasks ( Yi et al. , 2017 ; Xu et al. , 2017 ; Haidar & Rezagholizadeh , 2019 ; Zhang et al. , 2017 ; Dong et al. , 2018 ) . The first GAN applied to time series data is C-RNN-GAN ( Mogren , 2016 ) which takes random noise as input and uses LSTM as both the generator and discriminator . One follow-up work , RCGAN ( Esteban et al. , 2017 ) , makes use of the conditioning information to generate synthetic medical data . Along the way , many works have explored generating synthetic data in a diverse range of domains ( e.g. , sensor data ( Alzantot et al. , 2017 ) , biosignal ( Haradal et al. , 2018 ) ) . We note that all these synthetic data are generated for some purpose ( Dai & Le , 2015 ; Larsen et al. , 2015 ; Dumoulin et al. , 2016 ; Srivastava et al. , 2015 ; Yoon et al. , 2019 ) . For example , ( Frid-Adar et al. , 2018a ) makes use of synthetic data augmentation to improve the classification results , and ( Bowles et al. , 2018 ) mixes the synthetic data with training data to enhance the model ’ s predictive ability . However , to the best of our knowledge , none of them have considered using the synthetic data generated by the GAN based architecture , to improve long-range forecasting . We fill in this gap and propose a conditional Wasserstein GAN with Gradient and Error Penalty ( Arjovsky et al. , 2017 ; Mirza & Osindero , 2014 ; Gulrajani & et al , 2017 ) to generator synthetic data which can be used to improve long-range forecasting . The structure of cWGAN-GEP is shown in Fig . 2 ( right ) . As can be seen , the training data G is used as a condition to direct the generation of synthetic data ( Mirza & Osindero , 2014 ) . Then , the synthetic data ( X ′t+1 ) will be concatenated with the training data G at the latest time step , to be evaluated by the discriminator . The network configurations of cWGAN-GEP are given in Table 1 ( left ) . The loss function is summarized as Loss = E X̃∼Pg [ D ( X̃ ) ] − E X∼Pr [ D ( X ) ] + λE X̂∼P X̂ [ ( ||∇X̂D ( X̂ ) ||2 − 1 ) 2 ] + β ( Xt+1 −X ′t+1 ) 2 . ( 5 ) We note that the first two terms in the R.H.S of ( 5 ) correspond to Wasserstein distance which improves learning performance over the Jensen-Shannon divergence used in the original GAN ( Arjovsky et al. , 2017 ; Gulrajani & et al , 2017 ) . The third term is the gradient penalty , corresponding to the 1-Lipschitz constraint . Unique to our work , we introduce the last term which attempts to minimize the mean squared error between the synthetic data and its true value . In such a manner , we argue that the generator can generate accurate synthetic data while preserving the temporal dynamics between conditioning input and generated data by minimizing the difference between the generated data distribution Pg and real data distribution Pr .
This paper proposes a technique for long range time-series forecasting that leverages a generative model to extend the existing time series to train a time-series model to make the final prediction at horizon N. The authors design a GAN, exploring an enhanced loss function, and provide a methodology by which to train it. They evaluate the combined approach on a number of different time series, while comparing the technique to both traditional forecasting approaches as well as more recent RNN/CNN-based methods. On those datasets, the technique meets or exceeds performance measured by MSE, in some cases improving MSE by 10% or more.
SP:c0695a7e6fe908a51b38f52594678c6d87c8014a
An Efficient Protocol for Distributed Column Subset Selection in the Entrywise $\ell_p$ Norm
1 p− 1 2 poly ( log nd ) -approximation to the best possible column subset . A key ingredient in our proof is the reduction to the ` p,2-norm , which corresponds to the p-norm of the vector of Euclidean norms of each of the columns of A . This enables us to use strong coreset constructions for Euclidean norms , which previously had not been used in this context . This naturally also allows us to implement our algorithm in the popular streaming model of computation . We further propose a greedy algorithm for selecting columns , which can be used by the coordinator , and show the first provable guarantees for a greedy algorithm for the ` 1,2 norm . Finally , we implement our protocol and give significant practical advantages on real-world data analysis tasks . 1 INTRODUCTION . Column Subset Selection ( k-CSS ) is a widely studied approach for rank-k approximation and feature selection . In k-CSS , one seeks a small subset U ∈ Rd×k of k columns of a data matrix A ∈ Rd×n , typically n d , for which there is a right factor V such that |UV −A| is small under some norm | · | . k-CSS is a special case of low rank approximation for which the left factor is an actual subset of columns . The main advantage of k-CSS over general low rank approximation is that the resulting factorization is more interpretable , as columns correspond to actual features while general low rank approximation takes linear combinations of such features . In addition , k-CSS preserves the sparsity of the data matrix A. k-CSS has been extensively studied in the Frobenius norm ( Guruswami & Sinop , 2012 ; Boutsidis et al. , 2014 ; Boutsidis & Woodruff , 2017 ; Boutsidis et al. , 2008 ) and operator norms ( Halko et al. , 2011 ; Woodruff , 2014 ) . A number of recent works ( Song et al. , 2017 ; Chierichetti et al. , 2017 ; Dan et al. , 2019 ; Ban et al. , 2019 ; Mahankali & Woodruff , 2020 ) studied this problem in the ` p norm ( k-CSSp ) for 1 ≤ p < 2 . The ` 1 norm is less sensitive to outliers , and better at handling missing data and non-Gaussian noise , than the Frobenius norm ( Song et al. , 2017 ) . Specifically , the ` 1 norm leads to improved performance in many real-world applications , such as structure-from-motion ( Ke & Kanade , 2005 ) and image denoising ( Yu et al. , 2012 ) . Distributed low-rank approximation arises naturally when a dataset is too large to store on one machine , takes prohibitively long time for a single machine to compute a rank-k approximation , or is collected simultaneously on multiple machines . Despite the flurry of recent work on k-CSSp , this problem remains largely unexplored in the distributed setting . This should be contrasted to Frobenius norm column subset selection and low rank approximation , for which a number of results in the distributed model are known , see , e.g. , Altschuler et al . ( 2016 ) ; Balcan et al . ( 2015 ; 2016 ) ; Boutsidis et al . ( 2016 ) . We consider a widely applicable model in the distributed setting , where s servers communicate to a central coordinator via 2-way channels . This model can simulate arbitrary point-to-point communication by having the coordinator forward a message from one server to another ; this increases the total communication by a factor of 2 and an additive log s bits per message to identify the destination server . We consider the column partition model , in which each column of A ∈ Rd×n is held by exactly one server . The column partition model is widely-studied and arises naturally in many real world scenarios such as federated learning ( Farahat et al. , 2013 ; Altschuler et al. , 2016 ; Liang et al. , 2014 ) . In the column partition model , we typically have n d , i.e. , A has many more columns than rows . Hence , we desire a protocol for distributed k-CSSp that has a communication cost that is only logarithmic in the large dimension n , as well as fast running time . In addition , it is important that our protocol only uses a small constant number of communication rounds ( meaning back-and-forth exchanges between servers and the coordinator ) . Indeed , otherwise , the servers and coordinator would need to interact more , making the protocol sensitive to failures in the machines , e.g. , if they go offline . Further , a 1-round protocol can naturally be adapted to an single pass streaming algorithm when we consider applications with limited memory and access to the data . In fact , our protocol can be easily extended to yield such a streaming algorithm 1 . In the following , we denote Ai∗ and A∗j as the i-th row and j-th column of A respectively , for i ∈ [ d ] , j ∈ [ n ] . We denote AT as the subset of columns of A with indices in T ⊆ [ n ] . The entrywise ` p-norm of A is |A|p = ( ∑d i=1 ∑n j=1 |Aij |p ) 1 p . The ` p,2 norm is defined as |A|p,2 = ( ∑d j=1 |A∗j | p 2 ) 1 p . We consider 1 ≤ p < 2 . We denote the best rank-k approximation error for A in ` p norm by OPT : = minrank-kAk |A−Ak|p . Given an integer k > 0 , we say U ∈ Rd×k , V ∈ Rk×n are the left and right factors of a rank-k factorization for A in the ` p norm with approximation factor α if |UV −A|p ≤ α ·OPT . Since general rank-k approximation in ` 1 norm is NP hard ( Gillis & Vavasis , 2015 ) , we follow previous work and consider bi-criteria k-CSS algorithms which obtain polynomial running time . Instead of outputting exactly k columns , such algorithms return a subset of Õ ( k ) columns of A , suppressing logarithmic factors in k or n. It is known that the best approximation factor to OPT that can be obtained through the span of a column subset of size Õ ( k ) is Ω ( k1/2−γ ) for p = 1 ( Song et al. , 2017 ) and Ω ( k1/p−1/2−γ ) for p ∈ ( 1 , 2 ) ( Mahankali & Woodruff , 2020 ) , where γ is an arbitrarily small constant . 1We provide a detailed analysis of our streaming algorithm in Appendix E. 1.1 PREVIOUS APPROACHES TO k-CSSp IN THE DISTRIBUTED SETTING If one only wants to obtain a good left factor U , and not necessarily a column subset of A , in the column partition model , one could simply sketch the columns of Ai by applying an oblivious sketching matrix S on each server . Each server sends Ai · S to the coordinator . The coordinator obtains U = AS as a column-wise concatenation of AiS ’ s . Song et al . ( 2017 ) showed that AS achieves an Õ ( √ k ) approximation to OPT , and this protocol only requires Õ ( sdk ) communication , O ( 1 ) rounds and polynomial running time . However , while AS is a good left factor , it does not correspond to an actual subset of columns of A . Obtaining a subset of columns that approximates A well with respect to the p-norm in a distributed setting is non-trivial . One approach due to Song et al . ( 2017 ) is to take the matrix AS described above , sample rows according to the Lewis weights ( Cohen & Peng , 2015 ) of AS to get a right factor V , which is in the row span of A , and then use the Lewis weights of V to in turn sample columns of A . Unfortunately , this protocol only achieves a loose Õ ( k3/2 ) approximation to OPT ( Song et al. , 2017 ) . Moreover , it is not known how to do Lewis weight sampling in a distributed setting . Alternatively , one could adapt existing single-machine k-CSSp algorithms to the distributed setting under the column partition model . Existing works on polynomial time k-CSSp ( Chierichetti et al. , 2017 ; Song et al. , 2019b ; Dan et al. , 2019 ; Mahankali & Woodruff , 2020 ) give bi-criteria algorithms , and are based on a recursive framework with multiple rounds , which is as follows : in each round , Õ ( k ) columns are selected uniformly at random , and with high probability , the selected columns can provide a good approximation to a constant fraction of all columns of A . Among the remaining columns that are not well approximated , Õ ( k ) columns are recursively selected until all columns of A are well approximated , resulting in a total of O ( log n ) rounds . A naı̈ve extension of this bi-criteria k-CSSp framework to a distributed protocol requires O ( log n ) rounds , as in each round , the servers and the coordinator need to communicate with each other in order to find the columns that are covered well and select from the remaining unselected columns . To reduce this to a single round , one might consider running the O ( log n ) round selection procedure on the coordinator only . In order to do this , the coordinator needs to first collect all columns of A from the servers , but directly communicating all columns is prohibitive . Alternatively , one could first apply k-CSSp on Ai to obtain factors Ui and Vi on each server , and then send the coordinator all of the Ui and Vi . The coordinator then column-wise stacks the UiVi to obtain U · V and selects Õ ( k ) columns from U · V . Even though this protocol applies to all p ≥ 1 , it achieves a loose O ( k2 ) approximation to OPT and requires a prohibitive O ( n+ d ) communication cost2 . One could instead try to just communicate the matrices Ui to the coordinator , which results in much less communication , but this no longer gives a good approximation . Indeed , while each Ui serves as a good approximation locally , there may be columns that are locally not important , but become globally important when all of the matrices Ai are put together . What is really needed here is a small coreset Ci for each Ai so that if one concatenates all of the Ci to obtain C , any good column subset of the coreset C corresponds to a good column subset for A . Unfortunately , coresets for the entrywise ` p-norm are not known to exist . 1.2 OUR CONTRIBUTIONS . Our Distributed Protocol We overcome these problems and propose the first efficient protocol for distributed k-CSSp ( 1 ≤ p < 2 ) in the column partition model that selects Õ ( k ) columns of A achieving an Õ ( k1/p−1/2 ) -approximation to the best possible subset of columns and requires only Õ ( sdk ) communication cost , 1 round and polynomial time . Figure 1 gives an overview of the protocol . We note that our subset of columns does not necessarily achieve an Õ ( k1/p−1/2 ) -approximation to OPT itself , although it does achieve such an approximation to the best possible subset of columns . Using the fact that there always exists a subset of columns providing an Õ ( k1/p−1/2 ) -approximation to OPT ( Song et al. , 2017 ) , we conclude that our subset of columns achieves an Õ ( k2/p−1 ) -approximation to OPT . Recently , and independently of our work , Mahankali & Woodruff ( 2020 ) show how to obtain a subset of columns achieving an Õ ( k1/p−1/2 ) -approximation to OPT itself ; however , such a subset is found by uniformly sampling columns in O ( log n ) adaptive rounds using the recursive sampling 2We give this protocol and the analysis in Appendix A framework above , and is inherently hard to implement in a distributed setting with fewer rounds . In contrast , our protocol achieves 1 round of communication , which is optimal . We make use of a strong coreset , i.e. , a sampled and reweighted subset of columns of each Ai that approximates the cost of all potential left factors of Ai , by first embedding all subspaces spanned by any subset of Õ ( k ) columns of A from ` p-space to Euclidean space , to bypass the lack of strong coresets for the ` p norm . We denote this new norm as ` p,2 norm , which is the sum of the p-th powers of the ` 2 norms of the columns . To reduce the error incurred by switching to the ` p,2-norm , we reduce the row dimension of A by left-multiplying by an oblivious sketching matrix S shared across servers , resulting in an overall approximation factor of only Õ ( k1/p−1/2 ) . Afterwards , each server sends its strong coreset to the coordinator . The coordinator , upon receiving the coresets from each server , runs an O ( 1 ) -approximate bi-criteria k-CSSp,2 algorithm to select the final column subset , giving an overall Õ ( k1/p−1/2 ) approximation to the best column subset . We introduce several new technical ideas in the analysis of our protocol . Our work is the first to apply a combination of oblivious sketching in the p-norm via p stable random variables and strong coresets in the ` p,2 norm ( Sohler & Woodruff , 2018 ; Huang & Vishnoi , 2020 ) to distributed k-CSS . Furthermore , to show that our oblivious sketching step only increases the final approximation error by a logarithmic factor , we combine a net argument with a union bound over all possible subspaces spanned by column subsets of A of size Õ ( k ) . Previous arguments involving sketching , such as those by Song et al . ( 2017 ) ; Ban et al . ( 2019 ) ; Mahankali & Woodruff ( 2020 ) , only consider a single subspace at a time . Theoretical Guarantees and Empirical Benefits for Greedy k-CSS1,2 We also propose a greedy algorithm to select columns in the k-CSS1,2 step of our protocol , and show the first additive error guarantee compared to the best possible subset AS of columns , i.e. , our cost is at most ( 1 − ) minV |ASV − A|1,2 + |A|1,2 . Similar error guarantees were known for the Frobenius norm ( Altschuler et al. , 2016 ) , though nothing was known for the ` 1,2 norm . We also implement our protocol and experiment with distributed k-CSS1 on various real-world datasets . We compare the O ( 1 ) -approximate bi-criteria k-CSS1,2 and the greedy k-CSS1,2 as different possible subroutines in our protocol , and show that greedy k-CSS1,2 yields an improvement in practice .
The paper considers the column subset selection (CSS) problem, which has received considerable attention in numerical linear algebra. It considers a distributed variant of CSS in the $\ell_p$ norm, where $p \in [1,2)$. Despite the attention this problem has received previously, it seems like this is a new setting that has not been considered before. The paper primarily provides theoretical results, but also does some experiments.
SP:7843f034ba6da2773202b448221de0886c51f545
An Efficient Protocol for Distributed Column Subset Selection in the Entrywise $\ell_p$ Norm
1 p− 1 2 poly ( log nd ) -approximation to the best possible column subset . A key ingredient in our proof is the reduction to the ` p,2-norm , which corresponds to the p-norm of the vector of Euclidean norms of each of the columns of A . This enables us to use strong coreset constructions for Euclidean norms , which previously had not been used in this context . This naturally also allows us to implement our algorithm in the popular streaming model of computation . We further propose a greedy algorithm for selecting columns , which can be used by the coordinator , and show the first provable guarantees for a greedy algorithm for the ` 1,2 norm . Finally , we implement our protocol and give significant practical advantages on real-world data analysis tasks . 1 INTRODUCTION . Column Subset Selection ( k-CSS ) is a widely studied approach for rank-k approximation and feature selection . In k-CSS , one seeks a small subset U ∈ Rd×k of k columns of a data matrix A ∈ Rd×n , typically n d , for which there is a right factor V such that |UV −A| is small under some norm | · | . k-CSS is a special case of low rank approximation for which the left factor is an actual subset of columns . The main advantage of k-CSS over general low rank approximation is that the resulting factorization is more interpretable , as columns correspond to actual features while general low rank approximation takes linear combinations of such features . In addition , k-CSS preserves the sparsity of the data matrix A. k-CSS has been extensively studied in the Frobenius norm ( Guruswami & Sinop , 2012 ; Boutsidis et al. , 2014 ; Boutsidis & Woodruff , 2017 ; Boutsidis et al. , 2008 ) and operator norms ( Halko et al. , 2011 ; Woodruff , 2014 ) . A number of recent works ( Song et al. , 2017 ; Chierichetti et al. , 2017 ; Dan et al. , 2019 ; Ban et al. , 2019 ; Mahankali & Woodruff , 2020 ) studied this problem in the ` p norm ( k-CSSp ) for 1 ≤ p < 2 . The ` 1 norm is less sensitive to outliers , and better at handling missing data and non-Gaussian noise , than the Frobenius norm ( Song et al. , 2017 ) . Specifically , the ` 1 norm leads to improved performance in many real-world applications , such as structure-from-motion ( Ke & Kanade , 2005 ) and image denoising ( Yu et al. , 2012 ) . Distributed low-rank approximation arises naturally when a dataset is too large to store on one machine , takes prohibitively long time for a single machine to compute a rank-k approximation , or is collected simultaneously on multiple machines . Despite the flurry of recent work on k-CSSp , this problem remains largely unexplored in the distributed setting . This should be contrasted to Frobenius norm column subset selection and low rank approximation , for which a number of results in the distributed model are known , see , e.g. , Altschuler et al . ( 2016 ) ; Balcan et al . ( 2015 ; 2016 ) ; Boutsidis et al . ( 2016 ) . We consider a widely applicable model in the distributed setting , where s servers communicate to a central coordinator via 2-way channels . This model can simulate arbitrary point-to-point communication by having the coordinator forward a message from one server to another ; this increases the total communication by a factor of 2 and an additive log s bits per message to identify the destination server . We consider the column partition model , in which each column of A ∈ Rd×n is held by exactly one server . The column partition model is widely-studied and arises naturally in many real world scenarios such as federated learning ( Farahat et al. , 2013 ; Altschuler et al. , 2016 ; Liang et al. , 2014 ) . In the column partition model , we typically have n d , i.e. , A has many more columns than rows . Hence , we desire a protocol for distributed k-CSSp that has a communication cost that is only logarithmic in the large dimension n , as well as fast running time . In addition , it is important that our protocol only uses a small constant number of communication rounds ( meaning back-and-forth exchanges between servers and the coordinator ) . Indeed , otherwise , the servers and coordinator would need to interact more , making the protocol sensitive to failures in the machines , e.g. , if they go offline . Further , a 1-round protocol can naturally be adapted to an single pass streaming algorithm when we consider applications with limited memory and access to the data . In fact , our protocol can be easily extended to yield such a streaming algorithm 1 . In the following , we denote Ai∗ and A∗j as the i-th row and j-th column of A respectively , for i ∈ [ d ] , j ∈ [ n ] . We denote AT as the subset of columns of A with indices in T ⊆ [ n ] . The entrywise ` p-norm of A is |A|p = ( ∑d i=1 ∑n j=1 |Aij |p ) 1 p . The ` p,2 norm is defined as |A|p,2 = ( ∑d j=1 |A∗j | p 2 ) 1 p . We consider 1 ≤ p < 2 . We denote the best rank-k approximation error for A in ` p norm by OPT : = minrank-kAk |A−Ak|p . Given an integer k > 0 , we say U ∈ Rd×k , V ∈ Rk×n are the left and right factors of a rank-k factorization for A in the ` p norm with approximation factor α if |UV −A|p ≤ α ·OPT . Since general rank-k approximation in ` 1 norm is NP hard ( Gillis & Vavasis , 2015 ) , we follow previous work and consider bi-criteria k-CSS algorithms which obtain polynomial running time . Instead of outputting exactly k columns , such algorithms return a subset of Õ ( k ) columns of A , suppressing logarithmic factors in k or n. It is known that the best approximation factor to OPT that can be obtained through the span of a column subset of size Õ ( k ) is Ω ( k1/2−γ ) for p = 1 ( Song et al. , 2017 ) and Ω ( k1/p−1/2−γ ) for p ∈ ( 1 , 2 ) ( Mahankali & Woodruff , 2020 ) , where γ is an arbitrarily small constant . 1We provide a detailed analysis of our streaming algorithm in Appendix E. 1.1 PREVIOUS APPROACHES TO k-CSSp IN THE DISTRIBUTED SETTING If one only wants to obtain a good left factor U , and not necessarily a column subset of A , in the column partition model , one could simply sketch the columns of Ai by applying an oblivious sketching matrix S on each server . Each server sends Ai · S to the coordinator . The coordinator obtains U = AS as a column-wise concatenation of AiS ’ s . Song et al . ( 2017 ) showed that AS achieves an Õ ( √ k ) approximation to OPT , and this protocol only requires Õ ( sdk ) communication , O ( 1 ) rounds and polynomial running time . However , while AS is a good left factor , it does not correspond to an actual subset of columns of A . Obtaining a subset of columns that approximates A well with respect to the p-norm in a distributed setting is non-trivial . One approach due to Song et al . ( 2017 ) is to take the matrix AS described above , sample rows according to the Lewis weights ( Cohen & Peng , 2015 ) of AS to get a right factor V , which is in the row span of A , and then use the Lewis weights of V to in turn sample columns of A . Unfortunately , this protocol only achieves a loose Õ ( k3/2 ) approximation to OPT ( Song et al. , 2017 ) . Moreover , it is not known how to do Lewis weight sampling in a distributed setting . Alternatively , one could adapt existing single-machine k-CSSp algorithms to the distributed setting under the column partition model . Existing works on polynomial time k-CSSp ( Chierichetti et al. , 2017 ; Song et al. , 2019b ; Dan et al. , 2019 ; Mahankali & Woodruff , 2020 ) give bi-criteria algorithms , and are based on a recursive framework with multiple rounds , which is as follows : in each round , Õ ( k ) columns are selected uniformly at random , and with high probability , the selected columns can provide a good approximation to a constant fraction of all columns of A . Among the remaining columns that are not well approximated , Õ ( k ) columns are recursively selected until all columns of A are well approximated , resulting in a total of O ( log n ) rounds . A naı̈ve extension of this bi-criteria k-CSSp framework to a distributed protocol requires O ( log n ) rounds , as in each round , the servers and the coordinator need to communicate with each other in order to find the columns that are covered well and select from the remaining unselected columns . To reduce this to a single round , one might consider running the O ( log n ) round selection procedure on the coordinator only . In order to do this , the coordinator needs to first collect all columns of A from the servers , but directly communicating all columns is prohibitive . Alternatively , one could first apply k-CSSp on Ai to obtain factors Ui and Vi on each server , and then send the coordinator all of the Ui and Vi . The coordinator then column-wise stacks the UiVi to obtain U · V and selects Õ ( k ) columns from U · V . Even though this protocol applies to all p ≥ 1 , it achieves a loose O ( k2 ) approximation to OPT and requires a prohibitive O ( n+ d ) communication cost2 . One could instead try to just communicate the matrices Ui to the coordinator , which results in much less communication , but this no longer gives a good approximation . Indeed , while each Ui serves as a good approximation locally , there may be columns that are locally not important , but become globally important when all of the matrices Ai are put together . What is really needed here is a small coreset Ci for each Ai so that if one concatenates all of the Ci to obtain C , any good column subset of the coreset C corresponds to a good column subset for A . Unfortunately , coresets for the entrywise ` p-norm are not known to exist . 1.2 OUR CONTRIBUTIONS . Our Distributed Protocol We overcome these problems and propose the first efficient protocol for distributed k-CSSp ( 1 ≤ p < 2 ) in the column partition model that selects Õ ( k ) columns of A achieving an Õ ( k1/p−1/2 ) -approximation to the best possible subset of columns and requires only Õ ( sdk ) communication cost , 1 round and polynomial time . Figure 1 gives an overview of the protocol . We note that our subset of columns does not necessarily achieve an Õ ( k1/p−1/2 ) -approximation to OPT itself , although it does achieve such an approximation to the best possible subset of columns . Using the fact that there always exists a subset of columns providing an Õ ( k1/p−1/2 ) -approximation to OPT ( Song et al. , 2017 ) , we conclude that our subset of columns achieves an Õ ( k2/p−1 ) -approximation to OPT . Recently , and independently of our work , Mahankali & Woodruff ( 2020 ) show how to obtain a subset of columns achieving an Õ ( k1/p−1/2 ) -approximation to OPT itself ; however , such a subset is found by uniformly sampling columns in O ( log n ) adaptive rounds using the recursive sampling 2We give this protocol and the analysis in Appendix A framework above , and is inherently hard to implement in a distributed setting with fewer rounds . In contrast , our protocol achieves 1 round of communication , which is optimal . We make use of a strong coreset , i.e. , a sampled and reweighted subset of columns of each Ai that approximates the cost of all potential left factors of Ai , by first embedding all subspaces spanned by any subset of Õ ( k ) columns of A from ` p-space to Euclidean space , to bypass the lack of strong coresets for the ` p norm . We denote this new norm as ` p,2 norm , which is the sum of the p-th powers of the ` 2 norms of the columns . To reduce the error incurred by switching to the ` p,2-norm , we reduce the row dimension of A by left-multiplying by an oblivious sketching matrix S shared across servers , resulting in an overall approximation factor of only Õ ( k1/p−1/2 ) . Afterwards , each server sends its strong coreset to the coordinator . The coordinator , upon receiving the coresets from each server , runs an O ( 1 ) -approximate bi-criteria k-CSSp,2 algorithm to select the final column subset , giving an overall Õ ( k1/p−1/2 ) approximation to the best column subset . We introduce several new technical ideas in the analysis of our protocol . Our work is the first to apply a combination of oblivious sketching in the p-norm via p stable random variables and strong coresets in the ` p,2 norm ( Sohler & Woodruff , 2018 ; Huang & Vishnoi , 2020 ) to distributed k-CSS . Furthermore , to show that our oblivious sketching step only increases the final approximation error by a logarithmic factor , we combine a net argument with a union bound over all possible subspaces spanned by column subsets of A of size Õ ( k ) . Previous arguments involving sketching , such as those by Song et al . ( 2017 ) ; Ban et al . ( 2019 ) ; Mahankali & Woodruff ( 2020 ) , only consider a single subspace at a time . Theoretical Guarantees and Empirical Benefits for Greedy k-CSS1,2 We also propose a greedy algorithm to select columns in the k-CSS1,2 step of our protocol , and show the first additive error guarantee compared to the best possible subset AS of columns , i.e. , our cost is at most ( 1 − ) minV |ASV − A|1,2 + |A|1,2 . Similar error guarantees were known for the Frobenius norm ( Altschuler et al. , 2016 ) , though nothing was known for the ` 1,2 norm . We also implement our protocol and experiment with distributed k-CSS1 on various real-world datasets . We compare the O ( 1 ) -approximate bi-criteria k-CSS1,2 and the greedy k-CSS1,2 as different possible subroutines in our protocol , and show that greedy k-CSS1,2 yields an improvement in practice .
This paper focused $\ell_p$-norm error analysis of distributed column subset selection problems. The proposed distributed algorithm guarantee an $\tilde O(k^{1/p-1/2} )$-approximation to the best subset of columns with $\tilde O(sdk)$ communication cost per round and polynomial time. The lower bound analysis show that such communication complexity is near optimal. The design and analysis of the algorithm is based on f oblivious sketching and strong coresets, which leads to the overall approximation factor is only $\tilde O(k^{1/p-1/2} )$. The authors also extended the main idea to address $\ell_{1,2}$ norm error.
SP:7843f034ba6da2773202b448221de0886c51f545
An Efficient Protocol for Distributed Column Subset Selection in the Entrywise $\ell_p$ Norm
1 p− 1 2 poly ( log nd ) -approximation to the best possible column subset . A key ingredient in our proof is the reduction to the ` p,2-norm , which corresponds to the p-norm of the vector of Euclidean norms of each of the columns of A . This enables us to use strong coreset constructions for Euclidean norms , which previously had not been used in this context . This naturally also allows us to implement our algorithm in the popular streaming model of computation . We further propose a greedy algorithm for selecting columns , which can be used by the coordinator , and show the first provable guarantees for a greedy algorithm for the ` 1,2 norm . Finally , we implement our protocol and give significant practical advantages on real-world data analysis tasks . 1 INTRODUCTION . Column Subset Selection ( k-CSS ) is a widely studied approach for rank-k approximation and feature selection . In k-CSS , one seeks a small subset U ∈ Rd×k of k columns of a data matrix A ∈ Rd×n , typically n d , for which there is a right factor V such that |UV −A| is small under some norm | · | . k-CSS is a special case of low rank approximation for which the left factor is an actual subset of columns . The main advantage of k-CSS over general low rank approximation is that the resulting factorization is more interpretable , as columns correspond to actual features while general low rank approximation takes linear combinations of such features . In addition , k-CSS preserves the sparsity of the data matrix A. k-CSS has been extensively studied in the Frobenius norm ( Guruswami & Sinop , 2012 ; Boutsidis et al. , 2014 ; Boutsidis & Woodruff , 2017 ; Boutsidis et al. , 2008 ) and operator norms ( Halko et al. , 2011 ; Woodruff , 2014 ) . A number of recent works ( Song et al. , 2017 ; Chierichetti et al. , 2017 ; Dan et al. , 2019 ; Ban et al. , 2019 ; Mahankali & Woodruff , 2020 ) studied this problem in the ` p norm ( k-CSSp ) for 1 ≤ p < 2 . The ` 1 norm is less sensitive to outliers , and better at handling missing data and non-Gaussian noise , than the Frobenius norm ( Song et al. , 2017 ) . Specifically , the ` 1 norm leads to improved performance in many real-world applications , such as structure-from-motion ( Ke & Kanade , 2005 ) and image denoising ( Yu et al. , 2012 ) . Distributed low-rank approximation arises naturally when a dataset is too large to store on one machine , takes prohibitively long time for a single machine to compute a rank-k approximation , or is collected simultaneously on multiple machines . Despite the flurry of recent work on k-CSSp , this problem remains largely unexplored in the distributed setting . This should be contrasted to Frobenius norm column subset selection and low rank approximation , for which a number of results in the distributed model are known , see , e.g. , Altschuler et al . ( 2016 ) ; Balcan et al . ( 2015 ; 2016 ) ; Boutsidis et al . ( 2016 ) . We consider a widely applicable model in the distributed setting , where s servers communicate to a central coordinator via 2-way channels . This model can simulate arbitrary point-to-point communication by having the coordinator forward a message from one server to another ; this increases the total communication by a factor of 2 and an additive log s bits per message to identify the destination server . We consider the column partition model , in which each column of A ∈ Rd×n is held by exactly one server . The column partition model is widely-studied and arises naturally in many real world scenarios such as federated learning ( Farahat et al. , 2013 ; Altschuler et al. , 2016 ; Liang et al. , 2014 ) . In the column partition model , we typically have n d , i.e. , A has many more columns than rows . Hence , we desire a protocol for distributed k-CSSp that has a communication cost that is only logarithmic in the large dimension n , as well as fast running time . In addition , it is important that our protocol only uses a small constant number of communication rounds ( meaning back-and-forth exchanges between servers and the coordinator ) . Indeed , otherwise , the servers and coordinator would need to interact more , making the protocol sensitive to failures in the machines , e.g. , if they go offline . Further , a 1-round protocol can naturally be adapted to an single pass streaming algorithm when we consider applications with limited memory and access to the data . In fact , our protocol can be easily extended to yield such a streaming algorithm 1 . In the following , we denote Ai∗ and A∗j as the i-th row and j-th column of A respectively , for i ∈ [ d ] , j ∈ [ n ] . We denote AT as the subset of columns of A with indices in T ⊆ [ n ] . The entrywise ` p-norm of A is |A|p = ( ∑d i=1 ∑n j=1 |Aij |p ) 1 p . The ` p,2 norm is defined as |A|p,2 = ( ∑d j=1 |A∗j | p 2 ) 1 p . We consider 1 ≤ p < 2 . We denote the best rank-k approximation error for A in ` p norm by OPT : = minrank-kAk |A−Ak|p . Given an integer k > 0 , we say U ∈ Rd×k , V ∈ Rk×n are the left and right factors of a rank-k factorization for A in the ` p norm with approximation factor α if |UV −A|p ≤ α ·OPT . Since general rank-k approximation in ` 1 norm is NP hard ( Gillis & Vavasis , 2015 ) , we follow previous work and consider bi-criteria k-CSS algorithms which obtain polynomial running time . Instead of outputting exactly k columns , such algorithms return a subset of Õ ( k ) columns of A , suppressing logarithmic factors in k or n. It is known that the best approximation factor to OPT that can be obtained through the span of a column subset of size Õ ( k ) is Ω ( k1/2−γ ) for p = 1 ( Song et al. , 2017 ) and Ω ( k1/p−1/2−γ ) for p ∈ ( 1 , 2 ) ( Mahankali & Woodruff , 2020 ) , where γ is an arbitrarily small constant . 1We provide a detailed analysis of our streaming algorithm in Appendix E. 1.1 PREVIOUS APPROACHES TO k-CSSp IN THE DISTRIBUTED SETTING If one only wants to obtain a good left factor U , and not necessarily a column subset of A , in the column partition model , one could simply sketch the columns of Ai by applying an oblivious sketching matrix S on each server . Each server sends Ai · S to the coordinator . The coordinator obtains U = AS as a column-wise concatenation of AiS ’ s . Song et al . ( 2017 ) showed that AS achieves an Õ ( √ k ) approximation to OPT , and this protocol only requires Õ ( sdk ) communication , O ( 1 ) rounds and polynomial running time . However , while AS is a good left factor , it does not correspond to an actual subset of columns of A . Obtaining a subset of columns that approximates A well with respect to the p-norm in a distributed setting is non-trivial . One approach due to Song et al . ( 2017 ) is to take the matrix AS described above , sample rows according to the Lewis weights ( Cohen & Peng , 2015 ) of AS to get a right factor V , which is in the row span of A , and then use the Lewis weights of V to in turn sample columns of A . Unfortunately , this protocol only achieves a loose Õ ( k3/2 ) approximation to OPT ( Song et al. , 2017 ) . Moreover , it is not known how to do Lewis weight sampling in a distributed setting . Alternatively , one could adapt existing single-machine k-CSSp algorithms to the distributed setting under the column partition model . Existing works on polynomial time k-CSSp ( Chierichetti et al. , 2017 ; Song et al. , 2019b ; Dan et al. , 2019 ; Mahankali & Woodruff , 2020 ) give bi-criteria algorithms , and are based on a recursive framework with multiple rounds , which is as follows : in each round , Õ ( k ) columns are selected uniformly at random , and with high probability , the selected columns can provide a good approximation to a constant fraction of all columns of A . Among the remaining columns that are not well approximated , Õ ( k ) columns are recursively selected until all columns of A are well approximated , resulting in a total of O ( log n ) rounds . A naı̈ve extension of this bi-criteria k-CSSp framework to a distributed protocol requires O ( log n ) rounds , as in each round , the servers and the coordinator need to communicate with each other in order to find the columns that are covered well and select from the remaining unselected columns . To reduce this to a single round , one might consider running the O ( log n ) round selection procedure on the coordinator only . In order to do this , the coordinator needs to first collect all columns of A from the servers , but directly communicating all columns is prohibitive . Alternatively , one could first apply k-CSSp on Ai to obtain factors Ui and Vi on each server , and then send the coordinator all of the Ui and Vi . The coordinator then column-wise stacks the UiVi to obtain U · V and selects Õ ( k ) columns from U · V . Even though this protocol applies to all p ≥ 1 , it achieves a loose O ( k2 ) approximation to OPT and requires a prohibitive O ( n+ d ) communication cost2 . One could instead try to just communicate the matrices Ui to the coordinator , which results in much less communication , but this no longer gives a good approximation . Indeed , while each Ui serves as a good approximation locally , there may be columns that are locally not important , but become globally important when all of the matrices Ai are put together . What is really needed here is a small coreset Ci for each Ai so that if one concatenates all of the Ci to obtain C , any good column subset of the coreset C corresponds to a good column subset for A . Unfortunately , coresets for the entrywise ` p-norm are not known to exist . 1.2 OUR CONTRIBUTIONS . Our Distributed Protocol We overcome these problems and propose the first efficient protocol for distributed k-CSSp ( 1 ≤ p < 2 ) in the column partition model that selects Õ ( k ) columns of A achieving an Õ ( k1/p−1/2 ) -approximation to the best possible subset of columns and requires only Õ ( sdk ) communication cost , 1 round and polynomial time . Figure 1 gives an overview of the protocol . We note that our subset of columns does not necessarily achieve an Õ ( k1/p−1/2 ) -approximation to OPT itself , although it does achieve such an approximation to the best possible subset of columns . Using the fact that there always exists a subset of columns providing an Õ ( k1/p−1/2 ) -approximation to OPT ( Song et al. , 2017 ) , we conclude that our subset of columns achieves an Õ ( k2/p−1 ) -approximation to OPT . Recently , and independently of our work , Mahankali & Woodruff ( 2020 ) show how to obtain a subset of columns achieving an Õ ( k1/p−1/2 ) -approximation to OPT itself ; however , such a subset is found by uniformly sampling columns in O ( log n ) adaptive rounds using the recursive sampling 2We give this protocol and the analysis in Appendix A framework above , and is inherently hard to implement in a distributed setting with fewer rounds . In contrast , our protocol achieves 1 round of communication , which is optimal . We make use of a strong coreset , i.e. , a sampled and reweighted subset of columns of each Ai that approximates the cost of all potential left factors of Ai , by first embedding all subspaces spanned by any subset of Õ ( k ) columns of A from ` p-space to Euclidean space , to bypass the lack of strong coresets for the ` p norm . We denote this new norm as ` p,2 norm , which is the sum of the p-th powers of the ` 2 norms of the columns . To reduce the error incurred by switching to the ` p,2-norm , we reduce the row dimension of A by left-multiplying by an oblivious sketching matrix S shared across servers , resulting in an overall approximation factor of only Õ ( k1/p−1/2 ) . Afterwards , each server sends its strong coreset to the coordinator . The coordinator , upon receiving the coresets from each server , runs an O ( 1 ) -approximate bi-criteria k-CSSp,2 algorithm to select the final column subset , giving an overall Õ ( k1/p−1/2 ) approximation to the best column subset . We introduce several new technical ideas in the analysis of our protocol . Our work is the first to apply a combination of oblivious sketching in the p-norm via p stable random variables and strong coresets in the ` p,2 norm ( Sohler & Woodruff , 2018 ; Huang & Vishnoi , 2020 ) to distributed k-CSS . Furthermore , to show that our oblivious sketching step only increases the final approximation error by a logarithmic factor , we combine a net argument with a union bound over all possible subspaces spanned by column subsets of A of size Õ ( k ) . Previous arguments involving sketching , such as those by Song et al . ( 2017 ) ; Ban et al . ( 2019 ) ; Mahankali & Woodruff ( 2020 ) , only consider a single subspace at a time . Theoretical Guarantees and Empirical Benefits for Greedy k-CSS1,2 We also propose a greedy algorithm to select columns in the k-CSS1,2 step of our protocol , and show the first additive error guarantee compared to the best possible subset AS of columns , i.e. , our cost is at most ( 1 − ) minV |ASV − A|1,2 + |A|1,2 . Similar error guarantees were known for the Frobenius norm ( Altschuler et al. , 2016 ) , though nothing was known for the ` 1,2 norm . We also implement our protocol and experiment with distributed k-CSS1 on various real-world datasets . We compare the O ( 1 ) -approximate bi-criteria k-CSS1,2 and the greedy k-CSS1,2 as different possible subroutines in our protocol , and show that greedy k-CSS1,2 yields an improvement in practice .
The authors present a distributed protocol for the column subset selection problem under the $\ell_p$ norms for $1\leq p <2$. The model of computation is a standard coordinator model of communication where the input matrix A is column partitioned to $s$ servers. The main contribution consists of a protocol that requires $O(sdk)$ communication, single round and polynomial running time and returns a $k^{1/p - 1/2}$ multiplicative approximation to the best possible column subset.
SP:7843f034ba6da2773202b448221de0886c51f545
Getting a CLUE: A Method for Explaining Uncertainty Estimates
1 INTRODUCTION . There is growing interest in probabilistic machine learning models , which aim to provide reliable estimates of uncertainty about their predictions ( MacKay , 1992 ) . These estimates are helpful in highstakes applications such as predicting loan defaults or recidivism , or in work towards autonomous vehicles . Well-calibrated uncertainty can be as important as making accurate predictions , leading to increased robustness of automated decision-making systems and helping prevent systems from behaving erratically for out-of-distribution ( OOD ) test points . In practice , predictive uncertainty conveys skepticism about a model ’ s output . However , its utility need not stop there : we posit predictive uncertainty could be rendered more useful and actionable if it were expressed in terms of model inputs , answering the question : “ Which input patterns lead my prediction to be uncertain ? ” Understanding which input features are responsible for predictive uncertainty can help practitioners learn in which regions the training data is sparse . For example , when training a loan default predictor , a data scientist ( i.e. , practitioner ) can identify sub-groups ( by age , gender , race , etc . ) under-represented in the training data . Collecting more data from these groups , and thus further constraining their model ’ s parameters , could lead to accurate predictions for a broader range of clients . In a clinical scenario , a doctor ( i.e. , domain expert ) can use an automated decision-making system to assess whether a patient should receive a treatment . In the case of high uncertainty , the system would suggest that the doctor should not rely on its output . If uncertainty were explained in terms of which features the model finds anomalous , the doctor could appropriately direct their attention . While explaining predictions from deep models has become a burgeoning field ( Montavon et al. , 2018 ; Bhatt et al. , 2020b ) , there has been relatively little research on explaining what leads to neural networks ’ predictive uncertainty . In this work , we introduce Counterfactual Latent Uncertainty Explanations ( CLUE ) , to our knowledge , the first approach to shed light on the subset of input space features that are responsible for uncertainty in probabilistic models . Specifically , we focus on explaining Bayesian Neural Networks ( BNNs ) . We refer to the explanations given by our method as CLUEs . CLUEs try to answer the question : “ What is the smallest change that could be made to an input , while keeping it in distribution , so that our model becomes certain in its decision for said input ? ” CLUEs can be generated for tabular and image data on both classification and regression tasks . An application of CLUE is to improve transparency in the real-world deployment of a probabilistic model , such as a BNN , by complementing existing approaches to model interpretability ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Chang et al. , 2019 ) . When the BNN is confident in its prediction , practitioners can generate an explanation via earlier feature importance techniques . When the BNN is uncertain , its prediction may well be wrong . This potentially wrong prediction could be the result of factors not related to the actual patterns present in the input data , e.g . parameter initialization , randomness in mini-batch construction , etc . An explanation of an uncertain prediction will be disproportionately affected by these factors . Indeed , recent work on feature attribution touches on the unreliability of saliency maps when test points are OOD ( Adebayo et al. , 2020 ) . Therefore , when the BNN is uncertain , it makes sense to provide an explanation of why the BNN is uncertain ( i.e. , CLUE ) instead of an explanation of the BNN ’ s prediction . This is illustrated in Figure 1 . Our code is at : github.com/cambridge-mlg/CLUE . We highlight the following contributions : • We introduce CLUE , an approach that finds counterfactual explanations of uncertainty in input space , by searching in the latent space of a deep generative model ( DGM ) . We put forth an algorithm for generating CLUEs and show how CLUEs are best displayed . • We propose a computationally grounded approach for evaluating counterfactual explanations of uncertainty . It leverages a separate conditional DGM as a synthetic data generator , allowing us to quantify how well explanations reflect the true generative process of the data . • We evaluate CLUE quantitatively through comparison to baseline approaches under the above framework and through ablative analysis . We also perform a user study , showing that CLUEs allow practitioners to predict on which new inputs a BNN will be uncertain . 2 PRELIMINARIES . 2.1 UNCERTAINTY IN BNNS . Given a dataset D= { x ( n ) , y ( n ) } Nn=1 , a prior on our model ’ s weights p ( w ) , and a likelihood function p ( D|w ) =∏Nn=1 p ( y ( n ) |x ( n ) , w ) , the posterior distribution over the predictor ’ s parameters p ( w|D ) ∝ p ( D|w ) p ( w ) encodes our uncertainty about what value w should take . Through marginalization , this parameter uncertainty is translated into predictive uncertainty , yielding reliable error bounds and preventing overfitting : p ( y∗|x∗ , D ) = ∫ p ( y∗|x∗ , w ) p ( w|D ) dw . ( 1 ) For BNNs , both the posterior over parameters and predictive distribution ( 1 ) are intractable . Fortunately , there is a rich literature concerning approximations to these objects ( MacKay , 1992 ; Hernández-Lobato & Adams , 2015 ; Gal , 2016 ) . In this work , we use scale-adapted Stochastic Gradient Hamiltonian Monte Carlo ( SG-HMC ) ( Springenberg et al. , 2016 ) . For regression , we use heteroscedastic Gaussian likelihood functions , quantifying uncertainty using their standard deviation , σ ( y|x ) . For classification , we take the entropy H ( y|x ) of categorical distributions as uncertainty . Details are given in Appendix B. Hereafter , we useH to refer to any uncertainty metric , be it σ or H . Predictive uncertainty can be separated into two components , as shown in Figure 2 . Each conveys different information to practitioners ( Depeweg , 2019 ) . Irreducible or aleatoric uncertainty is caused by inherent noise in the generative process of the data , usually manifesting as class overlap . Model or epistemic uncertainty represents our lack of knowledge about w. Stemming from a model being under-specified by the data , epistemic uncertainty arises when we query points off the training manifold . Capturing model uncertainty is the main advantage of BNNs over regular NNs . It enables the former to be used for uncertainty aware tasks , such as OOD detection ( Daxberger & HernándezLobato , 2019 ) , continual learning ( Nguyen et al. , 2018 ) , active learning ( Depeweg et al. , 2018 ) , and Bayesian optimization ( Springenberg et al. , 2016 ) . 2.2 UNCERTAINTY SENSITIVITY ANALYSIS . To the best of our knowledge , the only existing method for interpreting uncertainty estimates is Uncertainty Sensitivity Analysis ( Depeweg et al. , 2017 ) . This method quantifies the global importance of an input dimension to a chosen metric of uncertainty H using a sum of linear approximations centered at each test point : Ii = 1 |Dtest| |Dtest|∑ n=1 ∣∣∣∣∂H ( yn|xn ) ∂xn , i ∣∣∣∣ . ( 2 ) As discussed by Rudin ( 2019 ) , linear explanations of non-linear models , such as BNNs , can be misleading . Even generalized linear models , which are often considered to be “ inherently interpretable , ” like logistic regression , produce non-linear uncertainty estimates in input space . This can be seen in Figure 2 . Furthermore , high-dimensional input spaces limit the actionability of these explanations , as∇xH will likely not point in the direction of the data manifold . In Figure 3 and Appendix D , we show how this can result in sensitivity analysis generating meaningless explanations . Our method , CLUE , leverages the latent space of a DGM to avoid working with high-dimensional input spaces and to ensure explanations are in-distribution . CLUE does not rely on crude linear approximations . The counterfactual nature of CLUE guarantees explanations have tangible meaning . 2.3 COUNTERFACTUAL EXPLANATIONS . The term “ counterfactual ” captures notions of what would have happened if something had been different . Two meanings have been used by ML subcommunities . 1 ) Those in causal inference make causal assumptions about interdependencies among variables and use these assumptions to incorporate consequential adjustments when particular variables are set to new values ( Kusner et al. , 2017 ; Pearl , 2019 ) . 2 ) In contrast , the interpretability community recently used “ counterfactual explanations ” to explore how input variables must be modified to change a model ’ s output without making explicit causal assumptions ( Wachter et al. , 2018 ) . As such , counterfactual explanations can be seen as a case of contrastive explanations ( Dhurandhar et al. , 2018 ; Byrne , 2019 ) . In this work , we use “ counterfactual ” in a sense similar to 2 ) : we seek to make small changes to an input in order to reduce the uncertainty assigned to it by our model , without explicit causal assumptions . Multiple counterfactual explanations can exist for any given input , as the functions we are interested in explaining are often non-injective ( Russell , 2019 ) . We are concerned with counterfactual input configurations that are close to the original input x0 according to some pairwise distance metric d ( · , · ) . Given a desired outcome c different from the original one y0 produced by predictor pI , counterfactual explanations xc are usually generated by solving an optimization problem that resembles : xc = arg maxx ( pI ( y=c|x ) − d ( x , x0 ) ) s.t . y0 6=c . ( 3 ) Naively optimizing ( 3 ) in high-dimensional input spaces may result in the creation of adversarial inputs which are not actionable ( Goodfellow et al. , 2015 ) . Telling a person that they would have been approved for a loan had their age been −10 is of very little use . To right this , recent works define linear constraints on explanations ( Ustun et al. , 2019 ; Sharma et al. , 2020 ) . An alternative more amenable to high dimensional data is to leverage DGMs ( which we dub auxiliary DGMs ) to ensure explanations are in-distribution ( Dhurandhar et al. , 2018 ; Joshi et al. , 2018 ; Chang et al. , 2019 ; Booth et al. , 2020 ; Tripp et al. , 2020 ) . CLUE avoids the above issues by searching for counterfactuals in the lower-dimensional latent space of an auxiliary DGM . This choice is well suited for uncertainty , as the DGM constrains CLUE ’ s search space to the data manifold . When faced with an OOD input , CLUE returns the nearest in-distribution analog , as shown in Figure 3 . 3 PROPOSED METHOD . Without loss of generality , we useH to refer to any differentiable estimate of uncertainty ( σ or H ) . We introduce an auxiliary latent variable DGM : pθ ( x ) = ∫ pθ ( x|z ) p ( z ) dz . In the rest of this paper , we will use the decoder from a variational autoencoder ( VAE ) . Its encoder is denoted as qφ ( z|x ) . We write these models ’ predictive means as Epθ ( x|z ) [ x ] =µθ ( x|z ) and Eqφ ( z|x ) [ z ] =µφ ( z|x ) respectively . CLUE aims to find points in latent space which generate inputs similar to an original observation x0 but are assigned low uncertainty . This is achieved by minimizing ( 4 ) . CLUEs are then decoded as ( 5 ) . L ( z ) = H ( y|µθ ( x|z ) ) + d ( µθ ( x|z ) , x0 ) , ( 4 ) xCLUE = µθ ( x|zCLUE ) where zCLUE = arg minzL ( z ) . ( 5 ) The pairwise distance metric takes the form d ( x , x0 ) =λxdx ( x , x0 ) + λydy ( f ( x ) , f ( x0 ) ) such that we can enforce similarity between uncertain points and CLUEs in both input and prediction space . The hyperparameters ( λx , λy ) control the trade-off between producing low uncertainty CLUEs and CLUEs which are close to the original inputs . In this work , we take dx ( x , x0 ) = ‖x − x0‖1 to encourage sparse explanations . For regression , dy ( f ( x ) , f ( x0 ) ) is mean squared error . For classification , we use cross-entropy . Note that the best choice for d ( · , · ) will be task-specific . The CLUE algorithm and a diagram of our procedure are provided in Algorithm 1 and Figure 4 , respectively . The hyperparameter λx is selected by cross validation for each dataset such that both terms in ( 4 ) are of similar magnitude . We set λy to 0 for our main experiments , but explore different values in Appendix H.1 . We minimize ( 4 ) with Adam by differentiating through both our BNN and VAE decoder . To facilitate optimization , the initial value of z is chosen to be z0=µφ ( z|x0 ) . Optimization runs for a minimum of three iterations and a maximum of 35 iterations , with a learning rate of 0.1 . If the decrease in L ( z ) is smaller than L ( z0 ) /100 for three consecutive iterations , we apply early stopping . CLUE can be applied to batches of inputs simultaneously , allowing us to leverage GPU-accelerated matrix computation . Our implementation is detailed in full in Appendix B. Algorithm 1 : CLUE Inputs : original datapoint x0 , distance function d ( · , · ) , Uncertainty estimatorH , DGM decoder µθ ( · ) , DGM encoder µφ ( · ) 1 Set initial value of z = µφ ( z|x0 ) ; 2 while loss L is not converged do 3 Decode : x = µθ ( x|z ) ; 4 Use predictor to obtainH ( y|x ) ; 5 L = H ( y|x ) + d ( x , x0 ) ; 6 Update z with∇z L ; 7 end 8 Decode explanation : xCLUE = µθ ( x|z ) ; Output : Uncertainty counterfactual xCLUE As noted by Wachter et al . ( 2018 ) , individual counterfactuals may not shed light on all important features . Fortunately , we can exploit the non-convexity of CLUE ’ s objective to address this . We initialize CLUE with z0 =µφ ( z|x0 ) + , where =N ( z ; 0 , σ0I ) , and perform Algorithm 1 multiple times to obtain different CLUEs . We find σ0 = 0.15 to give a good trade-off between optimization speed and CLUE diversity . Appendix C shows examples of different CLUEs obtained for the same inputs . We want to ensure noise from auxiliary DGM reconstruction does not affect CLUE visualization . For tabular data , we use the change in percentile of each input feature with respect to the training distribution as a measure of importance . We only highlight continuous variables for which CLUEs are separated by 15 percentile points or more from their original inputs . All changes to discrete variables are highlighted . For images , we report changes in pixel values by applying a sign-preserving quadratic function to the difference between CLUEs and original samples : ∆CLUE=|∆x|·∆x with ∆x=xCLUE−x0 . This is showcased in Figure 5 and in Appendix G. It is common for approaches to generating saliency maps to employ constraints that encourage the contiguity of highlighted pixels ( Chang et al. , 2019 ; Dabkowski & Gal , 2017 ) . We do not employ such constraints , but we note they might prove useful when applying CLUE to natural images .
The authors consider the problem of post-hoc explainability for decisions rendered by machine learning models. They focus on addressing uncertain model predictions, producing counterfactual data that is both likely under a generative model of the data, as well as more certain in the classification task. They present both experimental evidence, as well as a user study geared towards practitioners, that show the benefits of counterfactual explanations targeting uncertainty.
SP:51d51aaa3e8df733f5aa3ca3c56dcddf5b3259c4
Getting a CLUE: A Method for Explaining Uncertainty Estimates
1 INTRODUCTION . There is growing interest in probabilistic machine learning models , which aim to provide reliable estimates of uncertainty about their predictions ( MacKay , 1992 ) . These estimates are helpful in highstakes applications such as predicting loan defaults or recidivism , or in work towards autonomous vehicles . Well-calibrated uncertainty can be as important as making accurate predictions , leading to increased robustness of automated decision-making systems and helping prevent systems from behaving erratically for out-of-distribution ( OOD ) test points . In practice , predictive uncertainty conveys skepticism about a model ’ s output . However , its utility need not stop there : we posit predictive uncertainty could be rendered more useful and actionable if it were expressed in terms of model inputs , answering the question : “ Which input patterns lead my prediction to be uncertain ? ” Understanding which input features are responsible for predictive uncertainty can help practitioners learn in which regions the training data is sparse . For example , when training a loan default predictor , a data scientist ( i.e. , practitioner ) can identify sub-groups ( by age , gender , race , etc . ) under-represented in the training data . Collecting more data from these groups , and thus further constraining their model ’ s parameters , could lead to accurate predictions for a broader range of clients . In a clinical scenario , a doctor ( i.e. , domain expert ) can use an automated decision-making system to assess whether a patient should receive a treatment . In the case of high uncertainty , the system would suggest that the doctor should not rely on its output . If uncertainty were explained in terms of which features the model finds anomalous , the doctor could appropriately direct their attention . While explaining predictions from deep models has become a burgeoning field ( Montavon et al. , 2018 ; Bhatt et al. , 2020b ) , there has been relatively little research on explaining what leads to neural networks ’ predictive uncertainty . In this work , we introduce Counterfactual Latent Uncertainty Explanations ( CLUE ) , to our knowledge , the first approach to shed light on the subset of input space features that are responsible for uncertainty in probabilistic models . Specifically , we focus on explaining Bayesian Neural Networks ( BNNs ) . We refer to the explanations given by our method as CLUEs . CLUEs try to answer the question : “ What is the smallest change that could be made to an input , while keeping it in distribution , so that our model becomes certain in its decision for said input ? ” CLUEs can be generated for tabular and image data on both classification and regression tasks . An application of CLUE is to improve transparency in the real-world deployment of a probabilistic model , such as a BNN , by complementing existing approaches to model interpretability ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Chang et al. , 2019 ) . When the BNN is confident in its prediction , practitioners can generate an explanation via earlier feature importance techniques . When the BNN is uncertain , its prediction may well be wrong . This potentially wrong prediction could be the result of factors not related to the actual patterns present in the input data , e.g . parameter initialization , randomness in mini-batch construction , etc . An explanation of an uncertain prediction will be disproportionately affected by these factors . Indeed , recent work on feature attribution touches on the unreliability of saliency maps when test points are OOD ( Adebayo et al. , 2020 ) . Therefore , when the BNN is uncertain , it makes sense to provide an explanation of why the BNN is uncertain ( i.e. , CLUE ) instead of an explanation of the BNN ’ s prediction . This is illustrated in Figure 1 . Our code is at : github.com/cambridge-mlg/CLUE . We highlight the following contributions : • We introduce CLUE , an approach that finds counterfactual explanations of uncertainty in input space , by searching in the latent space of a deep generative model ( DGM ) . We put forth an algorithm for generating CLUEs and show how CLUEs are best displayed . • We propose a computationally grounded approach for evaluating counterfactual explanations of uncertainty . It leverages a separate conditional DGM as a synthetic data generator , allowing us to quantify how well explanations reflect the true generative process of the data . • We evaluate CLUE quantitatively through comparison to baseline approaches under the above framework and through ablative analysis . We also perform a user study , showing that CLUEs allow practitioners to predict on which new inputs a BNN will be uncertain . 2 PRELIMINARIES . 2.1 UNCERTAINTY IN BNNS . Given a dataset D= { x ( n ) , y ( n ) } Nn=1 , a prior on our model ’ s weights p ( w ) , and a likelihood function p ( D|w ) =∏Nn=1 p ( y ( n ) |x ( n ) , w ) , the posterior distribution over the predictor ’ s parameters p ( w|D ) ∝ p ( D|w ) p ( w ) encodes our uncertainty about what value w should take . Through marginalization , this parameter uncertainty is translated into predictive uncertainty , yielding reliable error bounds and preventing overfitting : p ( y∗|x∗ , D ) = ∫ p ( y∗|x∗ , w ) p ( w|D ) dw . ( 1 ) For BNNs , both the posterior over parameters and predictive distribution ( 1 ) are intractable . Fortunately , there is a rich literature concerning approximations to these objects ( MacKay , 1992 ; Hernández-Lobato & Adams , 2015 ; Gal , 2016 ) . In this work , we use scale-adapted Stochastic Gradient Hamiltonian Monte Carlo ( SG-HMC ) ( Springenberg et al. , 2016 ) . For regression , we use heteroscedastic Gaussian likelihood functions , quantifying uncertainty using their standard deviation , σ ( y|x ) . For classification , we take the entropy H ( y|x ) of categorical distributions as uncertainty . Details are given in Appendix B. Hereafter , we useH to refer to any uncertainty metric , be it σ or H . Predictive uncertainty can be separated into two components , as shown in Figure 2 . Each conveys different information to practitioners ( Depeweg , 2019 ) . Irreducible or aleatoric uncertainty is caused by inherent noise in the generative process of the data , usually manifesting as class overlap . Model or epistemic uncertainty represents our lack of knowledge about w. Stemming from a model being under-specified by the data , epistemic uncertainty arises when we query points off the training manifold . Capturing model uncertainty is the main advantage of BNNs over regular NNs . It enables the former to be used for uncertainty aware tasks , such as OOD detection ( Daxberger & HernándezLobato , 2019 ) , continual learning ( Nguyen et al. , 2018 ) , active learning ( Depeweg et al. , 2018 ) , and Bayesian optimization ( Springenberg et al. , 2016 ) . 2.2 UNCERTAINTY SENSITIVITY ANALYSIS . To the best of our knowledge , the only existing method for interpreting uncertainty estimates is Uncertainty Sensitivity Analysis ( Depeweg et al. , 2017 ) . This method quantifies the global importance of an input dimension to a chosen metric of uncertainty H using a sum of linear approximations centered at each test point : Ii = 1 |Dtest| |Dtest|∑ n=1 ∣∣∣∣∂H ( yn|xn ) ∂xn , i ∣∣∣∣ . ( 2 ) As discussed by Rudin ( 2019 ) , linear explanations of non-linear models , such as BNNs , can be misleading . Even generalized linear models , which are often considered to be “ inherently interpretable , ” like logistic regression , produce non-linear uncertainty estimates in input space . This can be seen in Figure 2 . Furthermore , high-dimensional input spaces limit the actionability of these explanations , as∇xH will likely not point in the direction of the data manifold . In Figure 3 and Appendix D , we show how this can result in sensitivity analysis generating meaningless explanations . Our method , CLUE , leverages the latent space of a DGM to avoid working with high-dimensional input spaces and to ensure explanations are in-distribution . CLUE does not rely on crude linear approximations . The counterfactual nature of CLUE guarantees explanations have tangible meaning . 2.3 COUNTERFACTUAL EXPLANATIONS . The term “ counterfactual ” captures notions of what would have happened if something had been different . Two meanings have been used by ML subcommunities . 1 ) Those in causal inference make causal assumptions about interdependencies among variables and use these assumptions to incorporate consequential adjustments when particular variables are set to new values ( Kusner et al. , 2017 ; Pearl , 2019 ) . 2 ) In contrast , the interpretability community recently used “ counterfactual explanations ” to explore how input variables must be modified to change a model ’ s output without making explicit causal assumptions ( Wachter et al. , 2018 ) . As such , counterfactual explanations can be seen as a case of contrastive explanations ( Dhurandhar et al. , 2018 ; Byrne , 2019 ) . In this work , we use “ counterfactual ” in a sense similar to 2 ) : we seek to make small changes to an input in order to reduce the uncertainty assigned to it by our model , without explicit causal assumptions . Multiple counterfactual explanations can exist for any given input , as the functions we are interested in explaining are often non-injective ( Russell , 2019 ) . We are concerned with counterfactual input configurations that are close to the original input x0 according to some pairwise distance metric d ( · , · ) . Given a desired outcome c different from the original one y0 produced by predictor pI , counterfactual explanations xc are usually generated by solving an optimization problem that resembles : xc = arg maxx ( pI ( y=c|x ) − d ( x , x0 ) ) s.t . y0 6=c . ( 3 ) Naively optimizing ( 3 ) in high-dimensional input spaces may result in the creation of adversarial inputs which are not actionable ( Goodfellow et al. , 2015 ) . Telling a person that they would have been approved for a loan had their age been −10 is of very little use . To right this , recent works define linear constraints on explanations ( Ustun et al. , 2019 ; Sharma et al. , 2020 ) . An alternative more amenable to high dimensional data is to leverage DGMs ( which we dub auxiliary DGMs ) to ensure explanations are in-distribution ( Dhurandhar et al. , 2018 ; Joshi et al. , 2018 ; Chang et al. , 2019 ; Booth et al. , 2020 ; Tripp et al. , 2020 ) . CLUE avoids the above issues by searching for counterfactuals in the lower-dimensional latent space of an auxiliary DGM . This choice is well suited for uncertainty , as the DGM constrains CLUE ’ s search space to the data manifold . When faced with an OOD input , CLUE returns the nearest in-distribution analog , as shown in Figure 3 . 3 PROPOSED METHOD . Without loss of generality , we useH to refer to any differentiable estimate of uncertainty ( σ or H ) . We introduce an auxiliary latent variable DGM : pθ ( x ) = ∫ pθ ( x|z ) p ( z ) dz . In the rest of this paper , we will use the decoder from a variational autoencoder ( VAE ) . Its encoder is denoted as qφ ( z|x ) . We write these models ’ predictive means as Epθ ( x|z ) [ x ] =µθ ( x|z ) and Eqφ ( z|x ) [ z ] =µφ ( z|x ) respectively . CLUE aims to find points in latent space which generate inputs similar to an original observation x0 but are assigned low uncertainty . This is achieved by minimizing ( 4 ) . CLUEs are then decoded as ( 5 ) . L ( z ) = H ( y|µθ ( x|z ) ) + d ( µθ ( x|z ) , x0 ) , ( 4 ) xCLUE = µθ ( x|zCLUE ) where zCLUE = arg minzL ( z ) . ( 5 ) The pairwise distance metric takes the form d ( x , x0 ) =λxdx ( x , x0 ) + λydy ( f ( x ) , f ( x0 ) ) such that we can enforce similarity between uncertain points and CLUEs in both input and prediction space . The hyperparameters ( λx , λy ) control the trade-off between producing low uncertainty CLUEs and CLUEs which are close to the original inputs . In this work , we take dx ( x , x0 ) = ‖x − x0‖1 to encourage sparse explanations . For regression , dy ( f ( x ) , f ( x0 ) ) is mean squared error . For classification , we use cross-entropy . Note that the best choice for d ( · , · ) will be task-specific . The CLUE algorithm and a diagram of our procedure are provided in Algorithm 1 and Figure 4 , respectively . The hyperparameter λx is selected by cross validation for each dataset such that both terms in ( 4 ) are of similar magnitude . We set λy to 0 for our main experiments , but explore different values in Appendix H.1 . We minimize ( 4 ) with Adam by differentiating through both our BNN and VAE decoder . To facilitate optimization , the initial value of z is chosen to be z0=µφ ( z|x0 ) . Optimization runs for a minimum of three iterations and a maximum of 35 iterations , with a learning rate of 0.1 . If the decrease in L ( z ) is smaller than L ( z0 ) /100 for three consecutive iterations , we apply early stopping . CLUE can be applied to batches of inputs simultaneously , allowing us to leverage GPU-accelerated matrix computation . Our implementation is detailed in full in Appendix B. Algorithm 1 : CLUE Inputs : original datapoint x0 , distance function d ( · , · ) , Uncertainty estimatorH , DGM decoder µθ ( · ) , DGM encoder µφ ( · ) 1 Set initial value of z = µφ ( z|x0 ) ; 2 while loss L is not converged do 3 Decode : x = µθ ( x|z ) ; 4 Use predictor to obtainH ( y|x ) ; 5 L = H ( y|x ) + d ( x , x0 ) ; 6 Update z with∇z L ; 7 end 8 Decode explanation : xCLUE = µθ ( x|z ) ; Output : Uncertainty counterfactual xCLUE As noted by Wachter et al . ( 2018 ) , individual counterfactuals may not shed light on all important features . Fortunately , we can exploit the non-convexity of CLUE ’ s objective to address this . We initialize CLUE with z0 =µφ ( z|x0 ) + , where =N ( z ; 0 , σ0I ) , and perform Algorithm 1 multiple times to obtain different CLUEs . We find σ0 = 0.15 to give a good trade-off between optimization speed and CLUE diversity . Appendix C shows examples of different CLUEs obtained for the same inputs . We want to ensure noise from auxiliary DGM reconstruction does not affect CLUE visualization . For tabular data , we use the change in percentile of each input feature with respect to the training distribution as a measure of importance . We only highlight continuous variables for which CLUEs are separated by 15 percentile points or more from their original inputs . All changes to discrete variables are highlighted . For images , we report changes in pixel values by applying a sign-preserving quadratic function to the difference between CLUEs and original samples : ∆CLUE=|∆x|·∆x with ∆x=xCLUE−x0 . This is showcased in Figure 5 and in Appendix G. It is common for approaches to generating saliency maps to employ constraints that encourage the contiguity of highlighted pixels ( Chang et al. , 2019 ; Dabkowski & Gal , 2017 ) . We do not employ such constraints , but we note they might prove useful when applying CLUE to natural images .
This paper introduces CLUE -- a method to explain uncertainty estimates. The method utilizes a VAE trained on the original data set to search effectively for low confidence instances. The method utilizes a gradient based search through the latent space of the VAE. The authors assess their approach on a variety of tabular data sets and MNIST. They evaluate along change in uncertainty of the counterfactual as well as human evaluation. They generally find improvements using their method over baselines. Additionally, their method works much better in human evaluations.
SP:51d51aaa3e8df733f5aa3ca3c56dcddf5b3259c4
Getting a CLUE: A Method for Explaining Uncertainty Estimates
1 INTRODUCTION . There is growing interest in probabilistic machine learning models , which aim to provide reliable estimates of uncertainty about their predictions ( MacKay , 1992 ) . These estimates are helpful in highstakes applications such as predicting loan defaults or recidivism , or in work towards autonomous vehicles . Well-calibrated uncertainty can be as important as making accurate predictions , leading to increased robustness of automated decision-making systems and helping prevent systems from behaving erratically for out-of-distribution ( OOD ) test points . In practice , predictive uncertainty conveys skepticism about a model ’ s output . However , its utility need not stop there : we posit predictive uncertainty could be rendered more useful and actionable if it were expressed in terms of model inputs , answering the question : “ Which input patterns lead my prediction to be uncertain ? ” Understanding which input features are responsible for predictive uncertainty can help practitioners learn in which regions the training data is sparse . For example , when training a loan default predictor , a data scientist ( i.e. , practitioner ) can identify sub-groups ( by age , gender , race , etc . ) under-represented in the training data . Collecting more data from these groups , and thus further constraining their model ’ s parameters , could lead to accurate predictions for a broader range of clients . In a clinical scenario , a doctor ( i.e. , domain expert ) can use an automated decision-making system to assess whether a patient should receive a treatment . In the case of high uncertainty , the system would suggest that the doctor should not rely on its output . If uncertainty were explained in terms of which features the model finds anomalous , the doctor could appropriately direct their attention . While explaining predictions from deep models has become a burgeoning field ( Montavon et al. , 2018 ; Bhatt et al. , 2020b ) , there has been relatively little research on explaining what leads to neural networks ’ predictive uncertainty . In this work , we introduce Counterfactual Latent Uncertainty Explanations ( CLUE ) , to our knowledge , the first approach to shed light on the subset of input space features that are responsible for uncertainty in probabilistic models . Specifically , we focus on explaining Bayesian Neural Networks ( BNNs ) . We refer to the explanations given by our method as CLUEs . CLUEs try to answer the question : “ What is the smallest change that could be made to an input , while keeping it in distribution , so that our model becomes certain in its decision for said input ? ” CLUEs can be generated for tabular and image data on both classification and regression tasks . An application of CLUE is to improve transparency in the real-world deployment of a probabilistic model , such as a BNN , by complementing existing approaches to model interpretability ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Chang et al. , 2019 ) . When the BNN is confident in its prediction , practitioners can generate an explanation via earlier feature importance techniques . When the BNN is uncertain , its prediction may well be wrong . This potentially wrong prediction could be the result of factors not related to the actual patterns present in the input data , e.g . parameter initialization , randomness in mini-batch construction , etc . An explanation of an uncertain prediction will be disproportionately affected by these factors . Indeed , recent work on feature attribution touches on the unreliability of saliency maps when test points are OOD ( Adebayo et al. , 2020 ) . Therefore , when the BNN is uncertain , it makes sense to provide an explanation of why the BNN is uncertain ( i.e. , CLUE ) instead of an explanation of the BNN ’ s prediction . This is illustrated in Figure 1 . Our code is at : github.com/cambridge-mlg/CLUE . We highlight the following contributions : • We introduce CLUE , an approach that finds counterfactual explanations of uncertainty in input space , by searching in the latent space of a deep generative model ( DGM ) . We put forth an algorithm for generating CLUEs and show how CLUEs are best displayed . • We propose a computationally grounded approach for evaluating counterfactual explanations of uncertainty . It leverages a separate conditional DGM as a synthetic data generator , allowing us to quantify how well explanations reflect the true generative process of the data . • We evaluate CLUE quantitatively through comparison to baseline approaches under the above framework and through ablative analysis . We also perform a user study , showing that CLUEs allow practitioners to predict on which new inputs a BNN will be uncertain . 2 PRELIMINARIES . 2.1 UNCERTAINTY IN BNNS . Given a dataset D= { x ( n ) , y ( n ) } Nn=1 , a prior on our model ’ s weights p ( w ) , and a likelihood function p ( D|w ) =∏Nn=1 p ( y ( n ) |x ( n ) , w ) , the posterior distribution over the predictor ’ s parameters p ( w|D ) ∝ p ( D|w ) p ( w ) encodes our uncertainty about what value w should take . Through marginalization , this parameter uncertainty is translated into predictive uncertainty , yielding reliable error bounds and preventing overfitting : p ( y∗|x∗ , D ) = ∫ p ( y∗|x∗ , w ) p ( w|D ) dw . ( 1 ) For BNNs , both the posterior over parameters and predictive distribution ( 1 ) are intractable . Fortunately , there is a rich literature concerning approximations to these objects ( MacKay , 1992 ; Hernández-Lobato & Adams , 2015 ; Gal , 2016 ) . In this work , we use scale-adapted Stochastic Gradient Hamiltonian Monte Carlo ( SG-HMC ) ( Springenberg et al. , 2016 ) . For regression , we use heteroscedastic Gaussian likelihood functions , quantifying uncertainty using their standard deviation , σ ( y|x ) . For classification , we take the entropy H ( y|x ) of categorical distributions as uncertainty . Details are given in Appendix B. Hereafter , we useH to refer to any uncertainty metric , be it σ or H . Predictive uncertainty can be separated into two components , as shown in Figure 2 . Each conveys different information to practitioners ( Depeweg , 2019 ) . Irreducible or aleatoric uncertainty is caused by inherent noise in the generative process of the data , usually manifesting as class overlap . Model or epistemic uncertainty represents our lack of knowledge about w. Stemming from a model being under-specified by the data , epistemic uncertainty arises when we query points off the training manifold . Capturing model uncertainty is the main advantage of BNNs over regular NNs . It enables the former to be used for uncertainty aware tasks , such as OOD detection ( Daxberger & HernándezLobato , 2019 ) , continual learning ( Nguyen et al. , 2018 ) , active learning ( Depeweg et al. , 2018 ) , and Bayesian optimization ( Springenberg et al. , 2016 ) . 2.2 UNCERTAINTY SENSITIVITY ANALYSIS . To the best of our knowledge , the only existing method for interpreting uncertainty estimates is Uncertainty Sensitivity Analysis ( Depeweg et al. , 2017 ) . This method quantifies the global importance of an input dimension to a chosen metric of uncertainty H using a sum of linear approximations centered at each test point : Ii = 1 |Dtest| |Dtest|∑ n=1 ∣∣∣∣∂H ( yn|xn ) ∂xn , i ∣∣∣∣ . ( 2 ) As discussed by Rudin ( 2019 ) , linear explanations of non-linear models , such as BNNs , can be misleading . Even generalized linear models , which are often considered to be “ inherently interpretable , ” like logistic regression , produce non-linear uncertainty estimates in input space . This can be seen in Figure 2 . Furthermore , high-dimensional input spaces limit the actionability of these explanations , as∇xH will likely not point in the direction of the data manifold . In Figure 3 and Appendix D , we show how this can result in sensitivity analysis generating meaningless explanations . Our method , CLUE , leverages the latent space of a DGM to avoid working with high-dimensional input spaces and to ensure explanations are in-distribution . CLUE does not rely on crude linear approximations . The counterfactual nature of CLUE guarantees explanations have tangible meaning . 2.3 COUNTERFACTUAL EXPLANATIONS . The term “ counterfactual ” captures notions of what would have happened if something had been different . Two meanings have been used by ML subcommunities . 1 ) Those in causal inference make causal assumptions about interdependencies among variables and use these assumptions to incorporate consequential adjustments when particular variables are set to new values ( Kusner et al. , 2017 ; Pearl , 2019 ) . 2 ) In contrast , the interpretability community recently used “ counterfactual explanations ” to explore how input variables must be modified to change a model ’ s output without making explicit causal assumptions ( Wachter et al. , 2018 ) . As such , counterfactual explanations can be seen as a case of contrastive explanations ( Dhurandhar et al. , 2018 ; Byrne , 2019 ) . In this work , we use “ counterfactual ” in a sense similar to 2 ) : we seek to make small changes to an input in order to reduce the uncertainty assigned to it by our model , without explicit causal assumptions . Multiple counterfactual explanations can exist for any given input , as the functions we are interested in explaining are often non-injective ( Russell , 2019 ) . We are concerned with counterfactual input configurations that are close to the original input x0 according to some pairwise distance metric d ( · , · ) . Given a desired outcome c different from the original one y0 produced by predictor pI , counterfactual explanations xc are usually generated by solving an optimization problem that resembles : xc = arg maxx ( pI ( y=c|x ) − d ( x , x0 ) ) s.t . y0 6=c . ( 3 ) Naively optimizing ( 3 ) in high-dimensional input spaces may result in the creation of adversarial inputs which are not actionable ( Goodfellow et al. , 2015 ) . Telling a person that they would have been approved for a loan had their age been −10 is of very little use . To right this , recent works define linear constraints on explanations ( Ustun et al. , 2019 ; Sharma et al. , 2020 ) . An alternative more amenable to high dimensional data is to leverage DGMs ( which we dub auxiliary DGMs ) to ensure explanations are in-distribution ( Dhurandhar et al. , 2018 ; Joshi et al. , 2018 ; Chang et al. , 2019 ; Booth et al. , 2020 ; Tripp et al. , 2020 ) . CLUE avoids the above issues by searching for counterfactuals in the lower-dimensional latent space of an auxiliary DGM . This choice is well suited for uncertainty , as the DGM constrains CLUE ’ s search space to the data manifold . When faced with an OOD input , CLUE returns the nearest in-distribution analog , as shown in Figure 3 . 3 PROPOSED METHOD . Without loss of generality , we useH to refer to any differentiable estimate of uncertainty ( σ or H ) . We introduce an auxiliary latent variable DGM : pθ ( x ) = ∫ pθ ( x|z ) p ( z ) dz . In the rest of this paper , we will use the decoder from a variational autoencoder ( VAE ) . Its encoder is denoted as qφ ( z|x ) . We write these models ’ predictive means as Epθ ( x|z ) [ x ] =µθ ( x|z ) and Eqφ ( z|x ) [ z ] =µφ ( z|x ) respectively . CLUE aims to find points in latent space which generate inputs similar to an original observation x0 but are assigned low uncertainty . This is achieved by minimizing ( 4 ) . CLUEs are then decoded as ( 5 ) . L ( z ) = H ( y|µθ ( x|z ) ) + d ( µθ ( x|z ) , x0 ) , ( 4 ) xCLUE = µθ ( x|zCLUE ) where zCLUE = arg minzL ( z ) . ( 5 ) The pairwise distance metric takes the form d ( x , x0 ) =λxdx ( x , x0 ) + λydy ( f ( x ) , f ( x0 ) ) such that we can enforce similarity between uncertain points and CLUEs in both input and prediction space . The hyperparameters ( λx , λy ) control the trade-off between producing low uncertainty CLUEs and CLUEs which are close to the original inputs . In this work , we take dx ( x , x0 ) = ‖x − x0‖1 to encourage sparse explanations . For regression , dy ( f ( x ) , f ( x0 ) ) is mean squared error . For classification , we use cross-entropy . Note that the best choice for d ( · , · ) will be task-specific . The CLUE algorithm and a diagram of our procedure are provided in Algorithm 1 and Figure 4 , respectively . The hyperparameter λx is selected by cross validation for each dataset such that both terms in ( 4 ) are of similar magnitude . We set λy to 0 for our main experiments , but explore different values in Appendix H.1 . We minimize ( 4 ) with Adam by differentiating through both our BNN and VAE decoder . To facilitate optimization , the initial value of z is chosen to be z0=µφ ( z|x0 ) . Optimization runs for a minimum of three iterations and a maximum of 35 iterations , with a learning rate of 0.1 . If the decrease in L ( z ) is smaller than L ( z0 ) /100 for three consecutive iterations , we apply early stopping . CLUE can be applied to batches of inputs simultaneously , allowing us to leverage GPU-accelerated matrix computation . Our implementation is detailed in full in Appendix B. Algorithm 1 : CLUE Inputs : original datapoint x0 , distance function d ( · , · ) , Uncertainty estimatorH , DGM decoder µθ ( · ) , DGM encoder µφ ( · ) 1 Set initial value of z = µφ ( z|x0 ) ; 2 while loss L is not converged do 3 Decode : x = µθ ( x|z ) ; 4 Use predictor to obtainH ( y|x ) ; 5 L = H ( y|x ) + d ( x , x0 ) ; 6 Update z with∇z L ; 7 end 8 Decode explanation : xCLUE = µθ ( x|z ) ; Output : Uncertainty counterfactual xCLUE As noted by Wachter et al . ( 2018 ) , individual counterfactuals may not shed light on all important features . Fortunately , we can exploit the non-convexity of CLUE ’ s objective to address this . We initialize CLUE with z0 =µφ ( z|x0 ) + , where =N ( z ; 0 , σ0I ) , and perform Algorithm 1 multiple times to obtain different CLUEs . We find σ0 = 0.15 to give a good trade-off between optimization speed and CLUE diversity . Appendix C shows examples of different CLUEs obtained for the same inputs . We want to ensure noise from auxiliary DGM reconstruction does not affect CLUE visualization . For tabular data , we use the change in percentile of each input feature with respect to the training distribution as a measure of importance . We only highlight continuous variables for which CLUEs are separated by 15 percentile points or more from their original inputs . All changes to discrete variables are highlighted . For images , we report changes in pixel values by applying a sign-preserving quadratic function to the difference between CLUEs and original samples : ∆CLUE=|∆x|·∆x with ∆x=xCLUE−x0 . This is showcased in Figure 5 and in Appendix G. It is common for approaches to generating saliency maps to employ constraints that encourage the contiguity of highlighted pixels ( Chang et al. , 2019 ; Dabkowski & Gal , 2017 ) . We do not employ such constraints , but we note they might prove useful when applying CLUE to natural images .
This paper addresses the problem of explaining the uncertainty of a prediction made by a differentiable probabilistic model (as opposed to the prediction itself) through counterfactual explanations. They propose a technique, CLUE, which optimizes their counterfactual metric in the latent space of a deep generative model. To validate their approach, they introduce a quantitative evaluation for uncertainty metrics and conduct a user study, while also analysing CLUE's reliance on the auxiliary DGM.
SP:51d51aaa3e8df733f5aa3ca3c56dcddf5b3259c4
Mixture of Step Returns in Bootstrapped DQN
1 INTRODUCTION . In recent value-based deep reinforcement learning ( DRL ) , a value function is usually utilized to evaluate state values , which stand for estimates of the expected long-term cumulative rewards that might be collected by an agent . In order to perform such an evaluation , a deep neural network ( DNN ) is employed by a number of contemporary value-based DRL methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) as the value function approximator , in which the network parameters are iteratively updated based on the agent ’ s experience of interactions with an environment . For many of these methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) , the update procedure is carried out by one-step temporal-difference ( TD ) learning ( Sutton & Barto , 1998 ) ( or simply “ one-step TD ” ) , which calculates the error between an estimated state value and a target differing by one timestep . One-step TD has been demonstrated effective in backing up immediate reward signals collected by an agent . Nevertheless , the long temporal horizon that the reward signals from farther states have to propagate through might lead to an extended learning period of the value function approximator . Learning from multi-step returns ( Sutton & Barto , 1998 ) is a way of propagating rewards newly observed by the agent faster to earlier visited states , and has been adopted in several previous works . Asynchronous advantage actor-critic ( A3C ) ( Mnih et al. , 2016 ) employs multi-step returns as targets to update the value functions of its asynchronous threads . Rainbow deep Q-network ( Rainbow DQN ) ( Hessel et al. , 2018 ) also utilizes multi-step returns during the backup procedure . The authors in ( Barth-Maron et al. , 2018 ) also modify the target value function of deep deterministic dolicy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) to estimate TD errors using multi-step returns . Updating value functions with different backup lengths provides advantages in different aspects , including bias and variance of value estimates , convergence speed , and exploration behavior of the agent . Backing up reward signals through multi-step returns shifts the bias-variance tradeoff ( Hessel et al. , 2018 ) . Therefore , backing up with different step return lengths ( or simply ‘ backup length ’ hereafter ( Asis et al. , 2018 ) ) might lead to different target values in the Bellman equation , resulting in different exploration behaviors of the agent as well as different achievable performance of it . The authors in ( Amiranashvili et al. , 2018 ) have demonstrated that the performance of the agent varies with different backup lengths , and showed that both very short and very long backup lengths could cause performance drops . These insights suggest that identifying the best backup length for an environment is not straightforward . In addition , although learning based on multi-step returns enhances the immediate sensitivity to future rewards , it is at the expense of greater variance which may cause the value function approximator to require more data samples to converge to the true expectation . Moreover , relying on a single target value with any specific backup length constrains the exploration behaviors of the agent , and might limit the achievable performance of it . Based on the above observations , there have been several research works proposed to unify different target values with different backup lengths to leverages their respective advantages . The traditional TD ( λ ) ( Sutton & Barto , 1998 ) uses a target value equivalent to an exponential average of all n-step returns ( where n is a natural number ) , providing a faster empirical convergence by interpolating between low-variance TD returns and low-bias Monte Carlo returns . DQN ( λ ) ( Daley & Amato , 2019 ) further proposes an efficient implementation of TD ( λ ) for DRL by modifying the replay buffer memory such that λ-returns can be pre-computed . Although these methods benefit from combining multiple distinct backup lengths , they still rely on a single target value during the update procedure . Integrating step returns into a single target value , nevertheless , may sacrifice the diversity of the advantages provided by different step return targets . As a result , in this paper , we propose Mixture Bootstrapped DQN ( abbreviated as “ MB-DQN ” ) to address the above issues . MB-DQN is built on top of bootstrapped DQN ( Osband et al. , 2016 ) , which contains multiple bootstrapped heads with randomly initialized weights to learn a set of value functions . MB-DQN leverages the advantages of different step return targets by assigning a distinct backup length to each bootstrapped head . Each bootstrapped head maintains its own target value derived from the assigned backup length during the update procedure . Since the backup lengths of the bootstrapped heads are distinct from each other , MB-DQN provides heterogeneity in the target values as well as diversified exploration behaviors of the agent that is unavailable in approaches relying only on a single target value . To validate the proposed concept , in our experiments , we first provide motivational insights on the influence of different configurations of backup lengths in a simple maze environment . We then evaluate the proposed MB-DQN on the Atari 2600 ( Bellemare et al. , 2015 ) benchmark environments , and demonstrate its performance improvement over a number of baseline methods . We further provide a set of ablation studies to analyze the impacts of different design configurations of MB-DQN . In summary , the primary contributions of this paper include : ( 1 ) introducing an approach for maintaining the advantages from different backup lengths , ( 2 ) providing heterogeneity in the target values by utilizing multiple bootstrapped heads , and ( 3 ) enabling diversified exploration behaviors of the agent . The remainder of this paper is organized as the following . Section 2 provides the background material related to this work . Section 3 walks through the proposed MB-DQN methodology . Section 4 reports the experimental results , and presents a set of the ablation analyses . Section 5 concludes this paper . 2 BACKGROUND . In this section , we provide the background material related to this work . We first introduce the basic concepts of the Markov Decision Process ( MDP ) and one-step return , followed by an explanation of the concept of multi-step returns . Next , we provide a brief overview of the Deep Q-Network ( DQN ) . 2.1 MARKOV DECISION PROCESS AND ONE-STEP RETURN . In RL , an agent interacting with an environment E with state space S and action space A is often formulated as an MDP . At each timestep t , the agent perceives a state st ∈ S , takes an action at ∈ A according to its policy π ( a|s ) , receives a reward rt ∼ R ( st , at ) , and transits to next state st+1 ∼ p ( st+1|st , at ) , where R ( st , at ) and p ( st+1|st , at ) are the reward function and transition probability function , respectively . The main objective of the agent is to learn an optimal policy π∗ ( a|s ) that maximizes discounted cumulative return Gt = ∑T i=t γ i−trt , where γ ∈ ( 0 , 1 ] is the discount factor and T is the horizon . For a given policy π ( a|s ) , the state value function V π and state-action value function Qπ are defined as the expected discounted cumulative return Gt starting from a state s and a state-action pair ( s , a ) respectively , and can be represented as the following : V π ( s ) = E [ Gt|st = s , π ] , Qπ ( s , a ) = E [ Gt|st = s , at = a , π ] . ( 1 ) In order to maximize E [ Gt ] , conventional value-based RL methods often use one-step TD learning to iteratively update V π and Qπ . Take Qπ for example , the update rule is expressed as the following : Q ( st , at ) ← Q ( st , at ) + α [ rt + γQ ( st+1 , at+1 ) −Q ( st , at ) ] , ( 2 ) where α ∈ ( 0 , 1 ] is a step size parameter which controls the update speed . This update procedure only considers the immediate return rt and γQ ( st+1 , at+1 ) , which is together called one-step return . 2.2 MULTI-STEP RETURN . Multi-step return is a variant of one-step return presented in the previous section . Multi-step return modifies the target of one-step return through bootstrapping over longer time intervals . It replaces the single reward rt in Eq . ( 2 ) with the truncated multi-step return Rnt , which is represented as follows : Rnt = n∑ j=0 γjrt+j , ( 3 ) where n is the selected backup length . The update rule of Eq . ( 2 ) is then re-written as the following : Q ( st , at ) ← Q ( st , at ) + α [ Rnt + γn+1Q ( st+n+1 , at+n+1 ) −Q ( st , at ) ] . ( 4 ) A longer backup length n has been shown to increase the variance of the estimated Q ( st , at ) as well as decrease its bias ( Jaakkola et al. , 1994 ) . Despite of the high-variance and the increased computational cost , multi-step return enhances the immediate sensitivity of the value approximator to future rewards , and allows them to backup faster . As a result , in certain cases , it is possible to achieve a faster learning speed for the value approximator by using an appropriate backup length n larger than one ( Sutton & Barto , 1998 ; Hessel et al. , 2018 ; Amiranashvili et al. , 2018 ) . 2.3 DEEP Q-NETWORK . DQN is a DNN parameterized by θ for approximating the optimal Q-function . DQN is trained using samples drawn from an experience replay buffer Z , and is updated based on one-step TD learning with an objective to minimize a loss function LDQN , which is typically expressed as the following : LDQN = Es , a , r , s′∼U ( Z ) [ ( ys , a −Q ( s , a , θ ) ) 2 ] , ( 5 ) where ys , a = rt+γmaxaQ ( st+1 , a , θ− ) is the one-step target value , U ( Z ) is a uniform distribution over Z , and θ− is the parameters of the target network . θ− is updated by θ at predefined intervals . 3 METHODOLOGY . In this section , we first demonstrate the impacts of different backup lengths on the behaviors of an agent in a simple maze environment . Then , we walk through the details of the MB-DQN framework . 3.1 AGENT BEHAVIOR WITH DIFFERENT BACKUP LENGTHS IN DQN . To illustrate the impacts of different backup lengths on an agent ’ s behavior , we first consider a toy model in a two-dimensional maze environment containing a starting point and a goal , as depicted in Fig . 1 ( a ) . We use DQN as our default agent and perform our experiments on this maze environment ( denoted as Dense Maze ) with dense rewards . In this setting , the reward of a grid gradually decreases as its distance to the goal increases . We depict the states visited by the agents for 100k timesteps in the training phase in Figs . 1 ( b ) and ( c ) . It is observed that the agent trained with 5-step return reaches the goal through a shorter path than that of the 1-step return case . This is because the longer backup length allows the agent to adjust its value function estimation faster . On the other hand , although the agent trained with 1-step return might converge slower than that of the 5-step return case , it is observed that 1-step return enables the agent to visit and explore more states in the early stage . This is because the reward signal from a farther state has to propagate through a longer temporal horizon . Therefore , the agent explores more extensively before learning an effective policy to reach the goal .
This paper combines the idea of multi-step returns for value-based reinforcement learning with Bootstrapped DQN. Updating value functions with different step returns has potential benefits, and was elegantly integrated with the Bootstrapped DQN structure, where different heads have different backup lengths. This work provides empirical results on Atari game domains, and further provides ablation analysis.
SP:3e683325ee2cea5340d58e08b3fecb67c6e09e7f
Mixture of Step Returns in Bootstrapped DQN
1 INTRODUCTION . In recent value-based deep reinforcement learning ( DRL ) , a value function is usually utilized to evaluate state values , which stand for estimates of the expected long-term cumulative rewards that might be collected by an agent . In order to perform such an evaluation , a deep neural network ( DNN ) is employed by a number of contemporary value-based DRL methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) as the value function approximator , in which the network parameters are iteratively updated based on the agent ’ s experience of interactions with an environment . For many of these methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) , the update procedure is carried out by one-step temporal-difference ( TD ) learning ( Sutton & Barto , 1998 ) ( or simply “ one-step TD ” ) , which calculates the error between an estimated state value and a target differing by one timestep . One-step TD has been demonstrated effective in backing up immediate reward signals collected by an agent . Nevertheless , the long temporal horizon that the reward signals from farther states have to propagate through might lead to an extended learning period of the value function approximator . Learning from multi-step returns ( Sutton & Barto , 1998 ) is a way of propagating rewards newly observed by the agent faster to earlier visited states , and has been adopted in several previous works . Asynchronous advantage actor-critic ( A3C ) ( Mnih et al. , 2016 ) employs multi-step returns as targets to update the value functions of its asynchronous threads . Rainbow deep Q-network ( Rainbow DQN ) ( Hessel et al. , 2018 ) also utilizes multi-step returns during the backup procedure . The authors in ( Barth-Maron et al. , 2018 ) also modify the target value function of deep deterministic dolicy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) to estimate TD errors using multi-step returns . Updating value functions with different backup lengths provides advantages in different aspects , including bias and variance of value estimates , convergence speed , and exploration behavior of the agent . Backing up reward signals through multi-step returns shifts the bias-variance tradeoff ( Hessel et al. , 2018 ) . Therefore , backing up with different step return lengths ( or simply ‘ backup length ’ hereafter ( Asis et al. , 2018 ) ) might lead to different target values in the Bellman equation , resulting in different exploration behaviors of the agent as well as different achievable performance of it . The authors in ( Amiranashvili et al. , 2018 ) have demonstrated that the performance of the agent varies with different backup lengths , and showed that both very short and very long backup lengths could cause performance drops . These insights suggest that identifying the best backup length for an environment is not straightforward . In addition , although learning based on multi-step returns enhances the immediate sensitivity to future rewards , it is at the expense of greater variance which may cause the value function approximator to require more data samples to converge to the true expectation . Moreover , relying on a single target value with any specific backup length constrains the exploration behaviors of the agent , and might limit the achievable performance of it . Based on the above observations , there have been several research works proposed to unify different target values with different backup lengths to leverages their respective advantages . The traditional TD ( λ ) ( Sutton & Barto , 1998 ) uses a target value equivalent to an exponential average of all n-step returns ( where n is a natural number ) , providing a faster empirical convergence by interpolating between low-variance TD returns and low-bias Monte Carlo returns . DQN ( λ ) ( Daley & Amato , 2019 ) further proposes an efficient implementation of TD ( λ ) for DRL by modifying the replay buffer memory such that λ-returns can be pre-computed . Although these methods benefit from combining multiple distinct backup lengths , they still rely on a single target value during the update procedure . Integrating step returns into a single target value , nevertheless , may sacrifice the diversity of the advantages provided by different step return targets . As a result , in this paper , we propose Mixture Bootstrapped DQN ( abbreviated as “ MB-DQN ” ) to address the above issues . MB-DQN is built on top of bootstrapped DQN ( Osband et al. , 2016 ) , which contains multiple bootstrapped heads with randomly initialized weights to learn a set of value functions . MB-DQN leverages the advantages of different step return targets by assigning a distinct backup length to each bootstrapped head . Each bootstrapped head maintains its own target value derived from the assigned backup length during the update procedure . Since the backup lengths of the bootstrapped heads are distinct from each other , MB-DQN provides heterogeneity in the target values as well as diversified exploration behaviors of the agent that is unavailable in approaches relying only on a single target value . To validate the proposed concept , in our experiments , we first provide motivational insights on the influence of different configurations of backup lengths in a simple maze environment . We then evaluate the proposed MB-DQN on the Atari 2600 ( Bellemare et al. , 2015 ) benchmark environments , and demonstrate its performance improvement over a number of baseline methods . We further provide a set of ablation studies to analyze the impacts of different design configurations of MB-DQN . In summary , the primary contributions of this paper include : ( 1 ) introducing an approach for maintaining the advantages from different backup lengths , ( 2 ) providing heterogeneity in the target values by utilizing multiple bootstrapped heads , and ( 3 ) enabling diversified exploration behaviors of the agent . The remainder of this paper is organized as the following . Section 2 provides the background material related to this work . Section 3 walks through the proposed MB-DQN methodology . Section 4 reports the experimental results , and presents a set of the ablation analyses . Section 5 concludes this paper . 2 BACKGROUND . In this section , we provide the background material related to this work . We first introduce the basic concepts of the Markov Decision Process ( MDP ) and one-step return , followed by an explanation of the concept of multi-step returns . Next , we provide a brief overview of the Deep Q-Network ( DQN ) . 2.1 MARKOV DECISION PROCESS AND ONE-STEP RETURN . In RL , an agent interacting with an environment E with state space S and action space A is often formulated as an MDP . At each timestep t , the agent perceives a state st ∈ S , takes an action at ∈ A according to its policy π ( a|s ) , receives a reward rt ∼ R ( st , at ) , and transits to next state st+1 ∼ p ( st+1|st , at ) , where R ( st , at ) and p ( st+1|st , at ) are the reward function and transition probability function , respectively . The main objective of the agent is to learn an optimal policy π∗ ( a|s ) that maximizes discounted cumulative return Gt = ∑T i=t γ i−trt , where γ ∈ ( 0 , 1 ] is the discount factor and T is the horizon . For a given policy π ( a|s ) , the state value function V π and state-action value function Qπ are defined as the expected discounted cumulative return Gt starting from a state s and a state-action pair ( s , a ) respectively , and can be represented as the following : V π ( s ) = E [ Gt|st = s , π ] , Qπ ( s , a ) = E [ Gt|st = s , at = a , π ] . ( 1 ) In order to maximize E [ Gt ] , conventional value-based RL methods often use one-step TD learning to iteratively update V π and Qπ . Take Qπ for example , the update rule is expressed as the following : Q ( st , at ) ← Q ( st , at ) + α [ rt + γQ ( st+1 , at+1 ) −Q ( st , at ) ] , ( 2 ) where α ∈ ( 0 , 1 ] is a step size parameter which controls the update speed . This update procedure only considers the immediate return rt and γQ ( st+1 , at+1 ) , which is together called one-step return . 2.2 MULTI-STEP RETURN . Multi-step return is a variant of one-step return presented in the previous section . Multi-step return modifies the target of one-step return through bootstrapping over longer time intervals . It replaces the single reward rt in Eq . ( 2 ) with the truncated multi-step return Rnt , which is represented as follows : Rnt = n∑ j=0 γjrt+j , ( 3 ) where n is the selected backup length . The update rule of Eq . ( 2 ) is then re-written as the following : Q ( st , at ) ← Q ( st , at ) + α [ Rnt + γn+1Q ( st+n+1 , at+n+1 ) −Q ( st , at ) ] . ( 4 ) A longer backup length n has been shown to increase the variance of the estimated Q ( st , at ) as well as decrease its bias ( Jaakkola et al. , 1994 ) . Despite of the high-variance and the increased computational cost , multi-step return enhances the immediate sensitivity of the value approximator to future rewards , and allows them to backup faster . As a result , in certain cases , it is possible to achieve a faster learning speed for the value approximator by using an appropriate backup length n larger than one ( Sutton & Barto , 1998 ; Hessel et al. , 2018 ; Amiranashvili et al. , 2018 ) . 2.3 DEEP Q-NETWORK . DQN is a DNN parameterized by θ for approximating the optimal Q-function . DQN is trained using samples drawn from an experience replay buffer Z , and is updated based on one-step TD learning with an objective to minimize a loss function LDQN , which is typically expressed as the following : LDQN = Es , a , r , s′∼U ( Z ) [ ( ys , a −Q ( s , a , θ ) ) 2 ] , ( 5 ) where ys , a = rt+γmaxaQ ( st+1 , a , θ− ) is the one-step target value , U ( Z ) is a uniform distribution over Z , and θ− is the parameters of the target network . θ− is updated by θ at predefined intervals . 3 METHODOLOGY . In this section , we first demonstrate the impacts of different backup lengths on the behaviors of an agent in a simple maze environment . Then , we walk through the details of the MB-DQN framework . 3.1 AGENT BEHAVIOR WITH DIFFERENT BACKUP LENGTHS IN DQN . To illustrate the impacts of different backup lengths on an agent ’ s behavior , we first consider a toy model in a two-dimensional maze environment containing a starting point and a goal , as depicted in Fig . 1 ( a ) . We use DQN as our default agent and perform our experiments on this maze environment ( denoted as Dense Maze ) with dense rewards . In this setting , the reward of a grid gradually decreases as its distance to the goal increases . We depict the states visited by the agents for 100k timesteps in the training phase in Figs . 1 ( b ) and ( c ) . It is observed that the agent trained with 5-step return reaches the goal through a shorter path than that of the 1-step return case . This is because the longer backup length allows the agent to adjust its value function estimation faster . On the other hand , although the agent trained with 1-step return might converge slower than that of the 5-step return case , it is observed that 1-step return enables the agent to visit and explore more states in the early stage . This is because the reward signal from a farther state has to propagate through a longer temporal horizon . Therefore , the agent explores more extensively before learning an effective policy to reach the goal .
This paper utilizes different step return targets for different heads in bootstrapped DQN, such that a more heterogeneous posterior estimation of policy value may be obtained. However, my main concern is the novelty. The step size can be viewed as a tunable hyperparameter, and the posterior computation is mainly credited to the usage of different randomized DQNs. Similarly, other tunable hyperparameters may also be diversified to introduce more heterogeneity such as learning rates, etc.
SP:3e683325ee2cea5340d58e08b3fecb67c6e09e7f
Mixture of Step Returns in Bootstrapped DQN
1 INTRODUCTION . In recent value-based deep reinforcement learning ( DRL ) , a value function is usually utilized to evaluate state values , which stand for estimates of the expected long-term cumulative rewards that might be collected by an agent . In order to perform such an evaluation , a deep neural network ( DNN ) is employed by a number of contemporary value-based DRL methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) as the value function approximator , in which the network parameters are iteratively updated based on the agent ’ s experience of interactions with an environment . For many of these methods ( Mnih et al. , 2015 ; Wang et al. , 2016 ; Hasselt et al. , 2016 ; Osband et al. , 2016 ; Hessel et al. , 2018 ) , the update procedure is carried out by one-step temporal-difference ( TD ) learning ( Sutton & Barto , 1998 ) ( or simply “ one-step TD ” ) , which calculates the error between an estimated state value and a target differing by one timestep . One-step TD has been demonstrated effective in backing up immediate reward signals collected by an agent . Nevertheless , the long temporal horizon that the reward signals from farther states have to propagate through might lead to an extended learning period of the value function approximator . Learning from multi-step returns ( Sutton & Barto , 1998 ) is a way of propagating rewards newly observed by the agent faster to earlier visited states , and has been adopted in several previous works . Asynchronous advantage actor-critic ( A3C ) ( Mnih et al. , 2016 ) employs multi-step returns as targets to update the value functions of its asynchronous threads . Rainbow deep Q-network ( Rainbow DQN ) ( Hessel et al. , 2018 ) also utilizes multi-step returns during the backup procedure . The authors in ( Barth-Maron et al. , 2018 ) also modify the target value function of deep deterministic dolicy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) to estimate TD errors using multi-step returns . Updating value functions with different backup lengths provides advantages in different aspects , including bias and variance of value estimates , convergence speed , and exploration behavior of the agent . Backing up reward signals through multi-step returns shifts the bias-variance tradeoff ( Hessel et al. , 2018 ) . Therefore , backing up with different step return lengths ( or simply ‘ backup length ’ hereafter ( Asis et al. , 2018 ) ) might lead to different target values in the Bellman equation , resulting in different exploration behaviors of the agent as well as different achievable performance of it . The authors in ( Amiranashvili et al. , 2018 ) have demonstrated that the performance of the agent varies with different backup lengths , and showed that both very short and very long backup lengths could cause performance drops . These insights suggest that identifying the best backup length for an environment is not straightforward . In addition , although learning based on multi-step returns enhances the immediate sensitivity to future rewards , it is at the expense of greater variance which may cause the value function approximator to require more data samples to converge to the true expectation . Moreover , relying on a single target value with any specific backup length constrains the exploration behaviors of the agent , and might limit the achievable performance of it . Based on the above observations , there have been several research works proposed to unify different target values with different backup lengths to leverages their respective advantages . The traditional TD ( λ ) ( Sutton & Barto , 1998 ) uses a target value equivalent to an exponential average of all n-step returns ( where n is a natural number ) , providing a faster empirical convergence by interpolating between low-variance TD returns and low-bias Monte Carlo returns . DQN ( λ ) ( Daley & Amato , 2019 ) further proposes an efficient implementation of TD ( λ ) for DRL by modifying the replay buffer memory such that λ-returns can be pre-computed . Although these methods benefit from combining multiple distinct backup lengths , they still rely on a single target value during the update procedure . Integrating step returns into a single target value , nevertheless , may sacrifice the diversity of the advantages provided by different step return targets . As a result , in this paper , we propose Mixture Bootstrapped DQN ( abbreviated as “ MB-DQN ” ) to address the above issues . MB-DQN is built on top of bootstrapped DQN ( Osband et al. , 2016 ) , which contains multiple bootstrapped heads with randomly initialized weights to learn a set of value functions . MB-DQN leverages the advantages of different step return targets by assigning a distinct backup length to each bootstrapped head . Each bootstrapped head maintains its own target value derived from the assigned backup length during the update procedure . Since the backup lengths of the bootstrapped heads are distinct from each other , MB-DQN provides heterogeneity in the target values as well as diversified exploration behaviors of the agent that is unavailable in approaches relying only on a single target value . To validate the proposed concept , in our experiments , we first provide motivational insights on the influence of different configurations of backup lengths in a simple maze environment . We then evaluate the proposed MB-DQN on the Atari 2600 ( Bellemare et al. , 2015 ) benchmark environments , and demonstrate its performance improvement over a number of baseline methods . We further provide a set of ablation studies to analyze the impacts of different design configurations of MB-DQN . In summary , the primary contributions of this paper include : ( 1 ) introducing an approach for maintaining the advantages from different backup lengths , ( 2 ) providing heterogeneity in the target values by utilizing multiple bootstrapped heads , and ( 3 ) enabling diversified exploration behaviors of the agent . The remainder of this paper is organized as the following . Section 2 provides the background material related to this work . Section 3 walks through the proposed MB-DQN methodology . Section 4 reports the experimental results , and presents a set of the ablation analyses . Section 5 concludes this paper . 2 BACKGROUND . In this section , we provide the background material related to this work . We first introduce the basic concepts of the Markov Decision Process ( MDP ) and one-step return , followed by an explanation of the concept of multi-step returns . Next , we provide a brief overview of the Deep Q-Network ( DQN ) . 2.1 MARKOV DECISION PROCESS AND ONE-STEP RETURN . In RL , an agent interacting with an environment E with state space S and action space A is often formulated as an MDP . At each timestep t , the agent perceives a state st ∈ S , takes an action at ∈ A according to its policy π ( a|s ) , receives a reward rt ∼ R ( st , at ) , and transits to next state st+1 ∼ p ( st+1|st , at ) , where R ( st , at ) and p ( st+1|st , at ) are the reward function and transition probability function , respectively . The main objective of the agent is to learn an optimal policy π∗ ( a|s ) that maximizes discounted cumulative return Gt = ∑T i=t γ i−trt , where γ ∈ ( 0 , 1 ] is the discount factor and T is the horizon . For a given policy π ( a|s ) , the state value function V π and state-action value function Qπ are defined as the expected discounted cumulative return Gt starting from a state s and a state-action pair ( s , a ) respectively , and can be represented as the following : V π ( s ) = E [ Gt|st = s , π ] , Qπ ( s , a ) = E [ Gt|st = s , at = a , π ] . ( 1 ) In order to maximize E [ Gt ] , conventional value-based RL methods often use one-step TD learning to iteratively update V π and Qπ . Take Qπ for example , the update rule is expressed as the following : Q ( st , at ) ← Q ( st , at ) + α [ rt + γQ ( st+1 , at+1 ) −Q ( st , at ) ] , ( 2 ) where α ∈ ( 0 , 1 ] is a step size parameter which controls the update speed . This update procedure only considers the immediate return rt and γQ ( st+1 , at+1 ) , which is together called one-step return . 2.2 MULTI-STEP RETURN . Multi-step return is a variant of one-step return presented in the previous section . Multi-step return modifies the target of one-step return through bootstrapping over longer time intervals . It replaces the single reward rt in Eq . ( 2 ) with the truncated multi-step return Rnt , which is represented as follows : Rnt = n∑ j=0 γjrt+j , ( 3 ) where n is the selected backup length . The update rule of Eq . ( 2 ) is then re-written as the following : Q ( st , at ) ← Q ( st , at ) + α [ Rnt + γn+1Q ( st+n+1 , at+n+1 ) −Q ( st , at ) ] . ( 4 ) A longer backup length n has been shown to increase the variance of the estimated Q ( st , at ) as well as decrease its bias ( Jaakkola et al. , 1994 ) . Despite of the high-variance and the increased computational cost , multi-step return enhances the immediate sensitivity of the value approximator to future rewards , and allows them to backup faster . As a result , in certain cases , it is possible to achieve a faster learning speed for the value approximator by using an appropriate backup length n larger than one ( Sutton & Barto , 1998 ; Hessel et al. , 2018 ; Amiranashvili et al. , 2018 ) . 2.3 DEEP Q-NETWORK . DQN is a DNN parameterized by θ for approximating the optimal Q-function . DQN is trained using samples drawn from an experience replay buffer Z , and is updated based on one-step TD learning with an objective to minimize a loss function LDQN , which is typically expressed as the following : LDQN = Es , a , r , s′∼U ( Z ) [ ( ys , a −Q ( s , a , θ ) ) 2 ] , ( 5 ) where ys , a = rt+γmaxaQ ( st+1 , a , θ− ) is the one-step target value , U ( Z ) is a uniform distribution over Z , and θ− is the parameters of the target network . θ− is updated by θ at predefined intervals . 3 METHODOLOGY . In this section , we first demonstrate the impacts of different backup lengths on the behaviors of an agent in a simple maze environment . Then , we walk through the details of the MB-DQN framework . 3.1 AGENT BEHAVIOR WITH DIFFERENT BACKUP LENGTHS IN DQN . To illustrate the impacts of different backup lengths on an agent ’ s behavior , we first consider a toy model in a two-dimensional maze environment containing a starting point and a goal , as depicted in Fig . 1 ( a ) . We use DQN as our default agent and perform our experiments on this maze environment ( denoted as Dense Maze ) with dense rewards . In this setting , the reward of a grid gradually decreases as its distance to the goal increases . We depict the states visited by the agents for 100k timesteps in the training phase in Figs . 1 ( b ) and ( c ) . It is observed that the agent trained with 5-step return reaches the goal through a shorter path than that of the 1-step return case . This is because the longer backup length allows the agent to adjust its value function estimation faster . On the other hand , although the agent trained with 1-step return might converge slower than that of the 5-step return case , it is observed that 1-step return enables the agent to visit and explore more states in the early stage . This is because the reward signal from a farther state has to propagate through a longer temporal horizon . Therefore , the agent explores more extensively before learning an effective policy to reach the goal .
This paper proposes Mixture Bootstrapped DQN (MB-DQN). The new algorithm modifies bootstrapped DQN by giving different backup lengths to each head. It shows better performance in several Atari environments, compared to bootstrapped DQN. This work also attempts to analyze the source of empirical benefits in terms of attention areas of the agents, the quality of data sampling, and the way of utilizing different backup lengths. There is also an ablation analysis showing that the MB-DQN is not limited to a single configuration.
SP:3e683325ee2cea5340d58e08b3fecb67c6e09e7f
On the Critical Role of Conventions in Adaptive Human-AI Collaboration
1 INTRODUCTION . Humans collaborate well together in complex tasks by adapting to each other through repeated interactions . What emerges from these repeated interactions is shared knowledge about the interaction history . We intuitively refer to this shared knowledge as conventions . Convention formation helps explain why teammates collaborate better than groups of strangers , and why friends develop lingo incomprehensible to outsiders . The notion of conventions has been studied in language ( Clark & Wilkes-Gibbs , 1986 ; Clark , 1996 ; Hawkins et al. , 2017 ; Khani et al. , 2018 ) and also alluded to in more general multiagent collaborative tasks ( Boutilier , 1996 ; Stone et al. , 2010 ; Foerster et al. , 2019 ; Carroll et al. , 2019 ; Lerer & Peysakhovich , 2019 ; Hu et al. , 2020 ) . For example , Foerster et al . ( 2019 ) trained agents to play the card game Hanabi , and noted the emergent convention that “ hinting for red or yellow indicates that the newest card of the other player is playable ” . One established characterization of a convention that is commonly used ( Boutilier , 1996 ; Hawkins et al. , 2017 ; Lerer & Peysakhovich , 2019 ) is an arbitrary solution to a recurring coordination problem ( Lewis , 1969 ) . A convention is thus one of many possible solutions that a group of partners happens to converge to . This is in contrast to problem solutions that are enforced by the rule constraints , and would have arisen no matter how the partners collaborated and what behavior they converged to . Success in a collaborative task typically involves learning both types of knowledge , which we will refer to as convention-dependent and rule-dependent behavior . The distinction between these two types of behavior has been studied extensively in the linguistic literature ( Franke et al . ; Brochhagen , 2020 ) . In this work , we focus on the less-explored setting of implicit communication , and provide a concrete approach to learn representations for these two different types of behavior . In the context of multi-agent or human-AI collaboration , we would like our AI agents to adapt quickly to new partners . AI agents should be able to flexibly adjust their partner-specific convention- dependent behavior while reusing the same rule-dependent behavior to simplify the learning problem – just like how humans quickly adapt when playing basketball with a new friend , without the need to re-learn the rules of the game . We would also like our AI agents to coordinate well on similar tasks when paired with the same partners – just like how humans can coordinate better when playing a new sport but with an old friend . Although many existing works similarly recognize conventions as an important factor of successful collaboration , they do not focus on separating conventions from rules of the task . This means that adapting to a new partner can be as difficult as learning a new task altogether . For example , existing techniques that emphasize modeling the partner ’ s policy , such as theory of mind ( Simon , 1995 ; Baker et al. , 2017 ; Brooks & Szafir , 2019 ) or multi-agent reinforcement learning ( Foerster et al. , 2018 ) , attempt to model everything about the agent ’ s belief of the partner ’ s state and policies . Such belief modeling approaches very quickly become computationally intractable , as opposed to solely focusing on the relevant conventions developed with a partner . To address the challenges above , we propose a framework that explicitly separates conventiondependent representations and rule-dependent representations through repeated interactions with multiple partners . After many rounds of solving a task ( e.g . playing basketball ) with different partners , an AI agent can learn to distinguish between conventions formed with a specific partner ( e.g . pointing down signals bounce pass ) and intrinsic complexities of the task ( e.g . dribbling ) . This enables us to leverage the representations separately for fast adaptation to new interactive settings . In the rest of this paper , we formalize the problem setting , and describe the underlying model of partners and tasks . Next , we present our framework for learning separations between rule and convention representations . We show that , under some conditions , our rule representation learns a sufficient statistic of the distribution over best-response strategies . We then run a study on humanhuman interactions to test if our hypothesis – that partners can carry over the same conventions across tasks – indeed holds for human subjects . Finally , we show the merits of our method on 3 collaborative tasks : contextual bandit , block placing , and a small scale version of Hanabi ( Bard et al. , 2020 ) . 2 RELATED WORK . Convention formation has been studied under the form of iterated reference games ( Hawkins et al. , 2017 ; 2019 ) , and language emergence ( Mordatch & Abbeel , 2018 ; Lazaridou et al. , 2017 ) . In these works , partners learn to reference objects more efficiently by forming conventions through repeated interactions . But in these tasks , there is little intrinsic task difficulty beyond breaking symmetries . In multi-agent reinforcement learning , techniques such as self-play , cross-training , or opponent learning ( Foerster et al. , 2018 ) have been used to observe emergent behavior in complex , physical settings ( Nikolaidis & Shah , 2013 ; Liu et al. , 2019 ; Baker et al. , 2020 ) . In addition , convention formation has been shown in tasks like Hanabi ( Foerster et al. , 2019 ; Hu & Foerster , 2019 ) , Overcooked ( Carroll et al. , 2019 ; Wang et al. , 2020 ) , and negotiation tasks ( Cao et al. , 2018 ) , where agents learn both how to solve a task and how to coordinate with a partner . But , these works qualitatively analyze emergent conventions through post-hoc inspection of the learned policies , and do not learn representations that separate conventions from rule-dependent behavior . This makes it difficult to leverage learned conventions when adapting to new partners . More recently , an approach was proposed to design agents that avoid relying on conventions altogether ; instead , the agents aim for unambiguous but potentially sub-optimal strategies ( Hu et al. , 2020 ) . Other approaches for studying conventions include game theory ( Lerer & Peysakhovich , 2019 ) and theory of mind ( Simon , 1995 ; Rabinowitz et al. , 2018 ) . Pragmatic reasoning ( Goodman & Frank , 2016 ) is another framework that aims to estimate beliefs over the partner ’ s states and policies , but all these frameworks that rely on modelling beliefs quickly become intractable . Instead of approximating these belief modelling frameworks ( Monroe & Potts , 2015 ) , we instead focus on learning representations for rules and conventions . Our work shares similarities with the paradigms of meta-learning ( Schmidhuber , 1987 ; Finn et al. , 2017 ) or multi-task learning ( Caruana , 1997 ) , if we view collaboration with different partners as new but related tasks . However , we are also interested in how conventions persist across tasks with similar symmetries . More related to our work is perhaps modular policy networks ( Devin et al. , 2017 ) , which learns policy modules and composes them together to transfer across robot arms with different degrees of freedom and across different tasks . However , their approach relies on input cleanly split between background observations of the task , and robot ’ s internal observations . We do not assume such a split in the input ; our approach tries to learn the separation between rules and partners with one input channel . 3 PRELIMINARIES . We begin by formally defining our problem setting as a two-player Markov Decision Process ( MDP ) . Two-Player MDP We consider a two-agent MDP with identical payoffs , which is a tuple { S , { Ae , Ap } , P , R } . S is a set of states , Ae is a set of actions for agent e , Ap is a set of actions for agent p. In general , e represents the ego agent ( that we control ) , and p represents agents who partner with e. P : S × Ae × Ap × S → [ 0 , 1 ] is the probability of reaching a state given the current state and actions of all agents , and R : S × S → R is the real-valued reward function . Since we are interested in repeated interactions , we consider finite-horizon MDPs . A policy π is a stochastic mapping from a state to an action . For our setting , our policy π = ( πe , πp ) has two parts : πe : S → Ae and πp : S → Ap , mapping the state into actions for agent e and p respectively . We also consider collaborative tasks that are partially observable in our experiments . In addition , some tasks are turn-based , which can be handled by including the turn information as part of the state , and ignoring the other player ’ s actions . Here , we focus on tasks with discrete state and action spaces . Running Example : Collaborative Contextual Bandit We describe a collaborative task to ground our discussion around adapting to new partners , and adapting to new tasks with old partners . Consider a contextual bandit setting with 2 contexts , 4 actions , and a prize for each action . The two players each independently pick an arm to pull , and they score prize ( a ) points if they both picked the same arm a ; otherwise , they score 0 points . An example is depicted in Figure 2 , where green boxes represent arms with prize 1 , the rest have prize 0 , and red and blue circles show the player ’ s actions . In Task 1 of Figure 2 , context A only has one good arm a1 while the context B has two good arms a2 and a4 . After repeated rounds of playing , two agents can eventually converge to coordinating on a convention that chooses one of the two good arms in context B ( e.g . selecting the leftmost good arm a2 ) . When the task shifts slightly as shown in Task 2 but context B remains the same across the two tasks , we can reasonably expect the partners to adhere to the same convention they developed for context B of Task 1 when playing context B of Task 2 . There are two axes of generalization at play . First , for a fixed task we would like to learn the underlying structure of the task ( e.g . green arm locations ) to quickly adapt to a new partner when playing the same task . Second , for a fixed partner we would like to keep track of developed conventions to quickly coordinate with this partner on a new task . In the next sections , we define the notion of a new task and a new partner , and propose a framework to effectively generalize across both dimensions . 4 MODEL OF PARTNERS AND TASKS We consider a family of tasks that share the same state space , action space , and transition dynamics ( all of which we refer to as the domain ) , but can differ in the reward function of the underlying MDP . We also consider a family of partners that our ego agent would like to coordinate with . The underlying model governing the actions taken by a partner at a state of a given task can be seen in Figure 3 . For a new task , a new reward function is sampled from θR , while the domain of the MDP is fixed . For a new partner , we sample from θρ a new function ρ , which maps the Q-function at a state of the task to an action . We refer to ρ as the convention of a partner . In other words , the action aits of a partner i at state s of task t depends on the partner ’ s conventions and ( indirectly through the Q-function at state s ) the reward of the task . θρ is the distribution over conventions and can correspond to , for example , the distribution over emergent conventions from AI-agents trained from selfplay , or can be derived from human partners . More formally , for a fixed domain let QRs ( ap ) = maxae Q R ( s , ae , ap ) , where QR is the optimal Q-function for the two player MDP with reward R ( Boutilier , 1996 ; Oliehoek et al. , 2008 ) . In other words , QRs is the Q-function from the partner ’ s perspective at state s in the task with reward R assum- ing best response by the ego agent . Then , the convention of a partner ρ : S×R|Ap| → Ap determines the partner ’ s action at state s , given by ρi ( s , QRs ) . For example , we might expect the distribution of actions across different partners at a state s to follow Boltzmann rationality ( Ziebart et al. , 2008 ) : Eρ∼θρ [ 1 [ ρ ( s , QRs ) = ap ] ] ∝ exp ( QRs ( ap ) ) . Lastly , we assume that behavior at different states are uncorrelated : a choice of action at one state tells us nothing about actions at other states . Given this formulation , we can hope to learn the underlying structure of a task by playing with a number of partners on the same task . For example , if many sampled partners all make the same action ap at a state s , it is likely that QRs ( ap ) is much higher than the second best action , i.e. , the optimal action is dependent on the rules of the task as opposed to the arbitrariness of partner strategies . Therefore a new partner will likely take action ap as well . Additionally , when coordinating with the same partner across different tasks , we can expect to see developed conventions persist across states with similar Q-functions . In particular , if QR1s = Q R2 s for two different tasks with reward functions R1 and R2 , then ρi ( s , QR1s ) = ρ i ( s , QR2s ) , so a partner will take the same action at state s across the two tasks ( e.g . context B in Figure 2 across Task 1 and 2 ) . We note that the roles of partners and tasks in our model are asymmetrical , assuming rational partners . A task can completely determine the actions of all partners at states with one good action ( e.g . context A in Figure 2 ) , whereas a partner can not blindly pick the same action across all tasks . This asymmetry is reflected in our learning framework and our setup of adapting to new partners and new tasks .
This paper makes the observation that when performing cooperative tasks with partners, there are two components to learn: how to perform the task, and how to coordinate with the partner according to conventions. Therefore, it proposes to separate these two components via a modular architecture, which learns a task-specific action distribution that attempts to marginalize out all possible partner conventions, and a series of partner-specific action distributions. The agent's own policy is the product of these two distributions. When coordinating with a new partner, the partner-specific component is learned from scratch using a pre-trained task-specific component, and vice versa.
SP:49760213d0f27d6934490916f8300851fd91561e
On the Critical Role of Conventions in Adaptive Human-AI Collaboration
1 INTRODUCTION . Humans collaborate well together in complex tasks by adapting to each other through repeated interactions . What emerges from these repeated interactions is shared knowledge about the interaction history . We intuitively refer to this shared knowledge as conventions . Convention formation helps explain why teammates collaborate better than groups of strangers , and why friends develop lingo incomprehensible to outsiders . The notion of conventions has been studied in language ( Clark & Wilkes-Gibbs , 1986 ; Clark , 1996 ; Hawkins et al. , 2017 ; Khani et al. , 2018 ) and also alluded to in more general multiagent collaborative tasks ( Boutilier , 1996 ; Stone et al. , 2010 ; Foerster et al. , 2019 ; Carroll et al. , 2019 ; Lerer & Peysakhovich , 2019 ; Hu et al. , 2020 ) . For example , Foerster et al . ( 2019 ) trained agents to play the card game Hanabi , and noted the emergent convention that “ hinting for red or yellow indicates that the newest card of the other player is playable ” . One established characterization of a convention that is commonly used ( Boutilier , 1996 ; Hawkins et al. , 2017 ; Lerer & Peysakhovich , 2019 ) is an arbitrary solution to a recurring coordination problem ( Lewis , 1969 ) . A convention is thus one of many possible solutions that a group of partners happens to converge to . This is in contrast to problem solutions that are enforced by the rule constraints , and would have arisen no matter how the partners collaborated and what behavior they converged to . Success in a collaborative task typically involves learning both types of knowledge , which we will refer to as convention-dependent and rule-dependent behavior . The distinction between these two types of behavior has been studied extensively in the linguistic literature ( Franke et al . ; Brochhagen , 2020 ) . In this work , we focus on the less-explored setting of implicit communication , and provide a concrete approach to learn representations for these two different types of behavior . In the context of multi-agent or human-AI collaboration , we would like our AI agents to adapt quickly to new partners . AI agents should be able to flexibly adjust their partner-specific convention- dependent behavior while reusing the same rule-dependent behavior to simplify the learning problem – just like how humans quickly adapt when playing basketball with a new friend , without the need to re-learn the rules of the game . We would also like our AI agents to coordinate well on similar tasks when paired with the same partners – just like how humans can coordinate better when playing a new sport but with an old friend . Although many existing works similarly recognize conventions as an important factor of successful collaboration , they do not focus on separating conventions from rules of the task . This means that adapting to a new partner can be as difficult as learning a new task altogether . For example , existing techniques that emphasize modeling the partner ’ s policy , such as theory of mind ( Simon , 1995 ; Baker et al. , 2017 ; Brooks & Szafir , 2019 ) or multi-agent reinforcement learning ( Foerster et al. , 2018 ) , attempt to model everything about the agent ’ s belief of the partner ’ s state and policies . Such belief modeling approaches very quickly become computationally intractable , as opposed to solely focusing on the relevant conventions developed with a partner . To address the challenges above , we propose a framework that explicitly separates conventiondependent representations and rule-dependent representations through repeated interactions with multiple partners . After many rounds of solving a task ( e.g . playing basketball ) with different partners , an AI agent can learn to distinguish between conventions formed with a specific partner ( e.g . pointing down signals bounce pass ) and intrinsic complexities of the task ( e.g . dribbling ) . This enables us to leverage the representations separately for fast adaptation to new interactive settings . In the rest of this paper , we formalize the problem setting , and describe the underlying model of partners and tasks . Next , we present our framework for learning separations between rule and convention representations . We show that , under some conditions , our rule representation learns a sufficient statistic of the distribution over best-response strategies . We then run a study on humanhuman interactions to test if our hypothesis – that partners can carry over the same conventions across tasks – indeed holds for human subjects . Finally , we show the merits of our method on 3 collaborative tasks : contextual bandit , block placing , and a small scale version of Hanabi ( Bard et al. , 2020 ) . 2 RELATED WORK . Convention formation has been studied under the form of iterated reference games ( Hawkins et al. , 2017 ; 2019 ) , and language emergence ( Mordatch & Abbeel , 2018 ; Lazaridou et al. , 2017 ) . In these works , partners learn to reference objects more efficiently by forming conventions through repeated interactions . But in these tasks , there is little intrinsic task difficulty beyond breaking symmetries . In multi-agent reinforcement learning , techniques such as self-play , cross-training , or opponent learning ( Foerster et al. , 2018 ) have been used to observe emergent behavior in complex , physical settings ( Nikolaidis & Shah , 2013 ; Liu et al. , 2019 ; Baker et al. , 2020 ) . In addition , convention formation has been shown in tasks like Hanabi ( Foerster et al. , 2019 ; Hu & Foerster , 2019 ) , Overcooked ( Carroll et al. , 2019 ; Wang et al. , 2020 ) , and negotiation tasks ( Cao et al. , 2018 ) , where agents learn both how to solve a task and how to coordinate with a partner . But , these works qualitatively analyze emergent conventions through post-hoc inspection of the learned policies , and do not learn representations that separate conventions from rule-dependent behavior . This makes it difficult to leverage learned conventions when adapting to new partners . More recently , an approach was proposed to design agents that avoid relying on conventions altogether ; instead , the agents aim for unambiguous but potentially sub-optimal strategies ( Hu et al. , 2020 ) . Other approaches for studying conventions include game theory ( Lerer & Peysakhovich , 2019 ) and theory of mind ( Simon , 1995 ; Rabinowitz et al. , 2018 ) . Pragmatic reasoning ( Goodman & Frank , 2016 ) is another framework that aims to estimate beliefs over the partner ’ s states and policies , but all these frameworks that rely on modelling beliefs quickly become intractable . Instead of approximating these belief modelling frameworks ( Monroe & Potts , 2015 ) , we instead focus on learning representations for rules and conventions . Our work shares similarities with the paradigms of meta-learning ( Schmidhuber , 1987 ; Finn et al. , 2017 ) or multi-task learning ( Caruana , 1997 ) , if we view collaboration with different partners as new but related tasks . However , we are also interested in how conventions persist across tasks with similar symmetries . More related to our work is perhaps modular policy networks ( Devin et al. , 2017 ) , which learns policy modules and composes them together to transfer across robot arms with different degrees of freedom and across different tasks . However , their approach relies on input cleanly split between background observations of the task , and robot ’ s internal observations . We do not assume such a split in the input ; our approach tries to learn the separation between rules and partners with one input channel . 3 PRELIMINARIES . We begin by formally defining our problem setting as a two-player Markov Decision Process ( MDP ) . Two-Player MDP We consider a two-agent MDP with identical payoffs , which is a tuple { S , { Ae , Ap } , P , R } . S is a set of states , Ae is a set of actions for agent e , Ap is a set of actions for agent p. In general , e represents the ego agent ( that we control ) , and p represents agents who partner with e. P : S × Ae × Ap × S → [ 0 , 1 ] is the probability of reaching a state given the current state and actions of all agents , and R : S × S → R is the real-valued reward function . Since we are interested in repeated interactions , we consider finite-horizon MDPs . A policy π is a stochastic mapping from a state to an action . For our setting , our policy π = ( πe , πp ) has two parts : πe : S → Ae and πp : S → Ap , mapping the state into actions for agent e and p respectively . We also consider collaborative tasks that are partially observable in our experiments . In addition , some tasks are turn-based , which can be handled by including the turn information as part of the state , and ignoring the other player ’ s actions . Here , we focus on tasks with discrete state and action spaces . Running Example : Collaborative Contextual Bandit We describe a collaborative task to ground our discussion around adapting to new partners , and adapting to new tasks with old partners . Consider a contextual bandit setting with 2 contexts , 4 actions , and a prize for each action . The two players each independently pick an arm to pull , and they score prize ( a ) points if they both picked the same arm a ; otherwise , they score 0 points . An example is depicted in Figure 2 , where green boxes represent arms with prize 1 , the rest have prize 0 , and red and blue circles show the player ’ s actions . In Task 1 of Figure 2 , context A only has one good arm a1 while the context B has two good arms a2 and a4 . After repeated rounds of playing , two agents can eventually converge to coordinating on a convention that chooses one of the two good arms in context B ( e.g . selecting the leftmost good arm a2 ) . When the task shifts slightly as shown in Task 2 but context B remains the same across the two tasks , we can reasonably expect the partners to adhere to the same convention they developed for context B of Task 1 when playing context B of Task 2 . There are two axes of generalization at play . First , for a fixed task we would like to learn the underlying structure of the task ( e.g . green arm locations ) to quickly adapt to a new partner when playing the same task . Second , for a fixed partner we would like to keep track of developed conventions to quickly coordinate with this partner on a new task . In the next sections , we define the notion of a new task and a new partner , and propose a framework to effectively generalize across both dimensions . 4 MODEL OF PARTNERS AND TASKS We consider a family of tasks that share the same state space , action space , and transition dynamics ( all of which we refer to as the domain ) , but can differ in the reward function of the underlying MDP . We also consider a family of partners that our ego agent would like to coordinate with . The underlying model governing the actions taken by a partner at a state of a given task can be seen in Figure 3 . For a new task , a new reward function is sampled from θR , while the domain of the MDP is fixed . For a new partner , we sample from θρ a new function ρ , which maps the Q-function at a state of the task to an action . We refer to ρ as the convention of a partner . In other words , the action aits of a partner i at state s of task t depends on the partner ’ s conventions and ( indirectly through the Q-function at state s ) the reward of the task . θρ is the distribution over conventions and can correspond to , for example , the distribution over emergent conventions from AI-agents trained from selfplay , or can be derived from human partners . More formally , for a fixed domain let QRs ( ap ) = maxae Q R ( s , ae , ap ) , where QR is the optimal Q-function for the two player MDP with reward R ( Boutilier , 1996 ; Oliehoek et al. , 2008 ) . In other words , QRs is the Q-function from the partner ’ s perspective at state s in the task with reward R assum- ing best response by the ego agent . Then , the convention of a partner ρ : S×R|Ap| → Ap determines the partner ’ s action at state s , given by ρi ( s , QRs ) . For example , we might expect the distribution of actions across different partners at a state s to follow Boltzmann rationality ( Ziebart et al. , 2008 ) : Eρ∼θρ [ 1 [ ρ ( s , QRs ) = ap ] ] ∝ exp ( QRs ( ap ) ) . Lastly , we assume that behavior at different states are uncorrelated : a choice of action at one state tells us nothing about actions at other states . Given this formulation , we can hope to learn the underlying structure of a task by playing with a number of partners on the same task . For example , if many sampled partners all make the same action ap at a state s , it is likely that QRs ( ap ) is much higher than the second best action , i.e. , the optimal action is dependent on the rules of the task as opposed to the arbitrariness of partner strategies . Therefore a new partner will likely take action ap as well . Additionally , when coordinating with the same partner across different tasks , we can expect to see developed conventions persist across states with similar Q-functions . In particular , if QR1s = Q R2 s for two different tasks with reward functions R1 and R2 , then ρi ( s , QR1s ) = ρ i ( s , QR2s ) , so a partner will take the same action at state s across the two tasks ( e.g . context B in Figure 2 across Task 1 and 2 ) . We note that the roles of partners and tasks in our model are asymmetrical , assuming rational partners . A task can completely determine the actions of all partners at states with one good action ( e.g . context A in Figure 2 ) , whereas a partner can not blindly pick the same action across all tasks . This asymmetry is reflected in our learning framework and our setup of adapting to new partners and new tasks .
This paper proposes that in human-AI collaboration using deep neural nets, the AI agents we train should separate learning the _rules_ of the environment from the _conventions_ used to coordinate with humans in that environment. It proposes a simple method to do so: learn a single task-specific module that is always used, as well as many partner-specific modules that are used with specific partners. Intuitively, when trained with multiple partners, the task-specific module should learn heuristics that work across partners (the environment-specific rules) while the partner-specific model should learn personalized heuristics for each partner (the conventions). They further incentivize this by regularizing the task-specific module towards the average of the partner policies.
SP:49760213d0f27d6934490916f8300851fd91561e
On the Critical Role of Conventions in Adaptive Human-AI Collaboration
1 INTRODUCTION . Humans collaborate well together in complex tasks by adapting to each other through repeated interactions . What emerges from these repeated interactions is shared knowledge about the interaction history . We intuitively refer to this shared knowledge as conventions . Convention formation helps explain why teammates collaborate better than groups of strangers , and why friends develop lingo incomprehensible to outsiders . The notion of conventions has been studied in language ( Clark & Wilkes-Gibbs , 1986 ; Clark , 1996 ; Hawkins et al. , 2017 ; Khani et al. , 2018 ) and also alluded to in more general multiagent collaborative tasks ( Boutilier , 1996 ; Stone et al. , 2010 ; Foerster et al. , 2019 ; Carroll et al. , 2019 ; Lerer & Peysakhovich , 2019 ; Hu et al. , 2020 ) . For example , Foerster et al . ( 2019 ) trained agents to play the card game Hanabi , and noted the emergent convention that “ hinting for red or yellow indicates that the newest card of the other player is playable ” . One established characterization of a convention that is commonly used ( Boutilier , 1996 ; Hawkins et al. , 2017 ; Lerer & Peysakhovich , 2019 ) is an arbitrary solution to a recurring coordination problem ( Lewis , 1969 ) . A convention is thus one of many possible solutions that a group of partners happens to converge to . This is in contrast to problem solutions that are enforced by the rule constraints , and would have arisen no matter how the partners collaborated and what behavior they converged to . Success in a collaborative task typically involves learning both types of knowledge , which we will refer to as convention-dependent and rule-dependent behavior . The distinction between these two types of behavior has been studied extensively in the linguistic literature ( Franke et al . ; Brochhagen , 2020 ) . In this work , we focus on the less-explored setting of implicit communication , and provide a concrete approach to learn representations for these two different types of behavior . In the context of multi-agent or human-AI collaboration , we would like our AI agents to adapt quickly to new partners . AI agents should be able to flexibly adjust their partner-specific convention- dependent behavior while reusing the same rule-dependent behavior to simplify the learning problem – just like how humans quickly adapt when playing basketball with a new friend , without the need to re-learn the rules of the game . We would also like our AI agents to coordinate well on similar tasks when paired with the same partners – just like how humans can coordinate better when playing a new sport but with an old friend . Although many existing works similarly recognize conventions as an important factor of successful collaboration , they do not focus on separating conventions from rules of the task . This means that adapting to a new partner can be as difficult as learning a new task altogether . For example , existing techniques that emphasize modeling the partner ’ s policy , such as theory of mind ( Simon , 1995 ; Baker et al. , 2017 ; Brooks & Szafir , 2019 ) or multi-agent reinforcement learning ( Foerster et al. , 2018 ) , attempt to model everything about the agent ’ s belief of the partner ’ s state and policies . Such belief modeling approaches very quickly become computationally intractable , as opposed to solely focusing on the relevant conventions developed with a partner . To address the challenges above , we propose a framework that explicitly separates conventiondependent representations and rule-dependent representations through repeated interactions with multiple partners . After many rounds of solving a task ( e.g . playing basketball ) with different partners , an AI agent can learn to distinguish between conventions formed with a specific partner ( e.g . pointing down signals bounce pass ) and intrinsic complexities of the task ( e.g . dribbling ) . This enables us to leverage the representations separately for fast adaptation to new interactive settings . In the rest of this paper , we formalize the problem setting , and describe the underlying model of partners and tasks . Next , we present our framework for learning separations between rule and convention representations . We show that , under some conditions , our rule representation learns a sufficient statistic of the distribution over best-response strategies . We then run a study on humanhuman interactions to test if our hypothesis – that partners can carry over the same conventions across tasks – indeed holds for human subjects . Finally , we show the merits of our method on 3 collaborative tasks : contextual bandit , block placing , and a small scale version of Hanabi ( Bard et al. , 2020 ) . 2 RELATED WORK . Convention formation has been studied under the form of iterated reference games ( Hawkins et al. , 2017 ; 2019 ) , and language emergence ( Mordatch & Abbeel , 2018 ; Lazaridou et al. , 2017 ) . In these works , partners learn to reference objects more efficiently by forming conventions through repeated interactions . But in these tasks , there is little intrinsic task difficulty beyond breaking symmetries . In multi-agent reinforcement learning , techniques such as self-play , cross-training , or opponent learning ( Foerster et al. , 2018 ) have been used to observe emergent behavior in complex , physical settings ( Nikolaidis & Shah , 2013 ; Liu et al. , 2019 ; Baker et al. , 2020 ) . In addition , convention formation has been shown in tasks like Hanabi ( Foerster et al. , 2019 ; Hu & Foerster , 2019 ) , Overcooked ( Carroll et al. , 2019 ; Wang et al. , 2020 ) , and negotiation tasks ( Cao et al. , 2018 ) , where agents learn both how to solve a task and how to coordinate with a partner . But , these works qualitatively analyze emergent conventions through post-hoc inspection of the learned policies , and do not learn representations that separate conventions from rule-dependent behavior . This makes it difficult to leverage learned conventions when adapting to new partners . More recently , an approach was proposed to design agents that avoid relying on conventions altogether ; instead , the agents aim for unambiguous but potentially sub-optimal strategies ( Hu et al. , 2020 ) . Other approaches for studying conventions include game theory ( Lerer & Peysakhovich , 2019 ) and theory of mind ( Simon , 1995 ; Rabinowitz et al. , 2018 ) . Pragmatic reasoning ( Goodman & Frank , 2016 ) is another framework that aims to estimate beliefs over the partner ’ s states and policies , but all these frameworks that rely on modelling beliefs quickly become intractable . Instead of approximating these belief modelling frameworks ( Monroe & Potts , 2015 ) , we instead focus on learning representations for rules and conventions . Our work shares similarities with the paradigms of meta-learning ( Schmidhuber , 1987 ; Finn et al. , 2017 ) or multi-task learning ( Caruana , 1997 ) , if we view collaboration with different partners as new but related tasks . However , we are also interested in how conventions persist across tasks with similar symmetries . More related to our work is perhaps modular policy networks ( Devin et al. , 2017 ) , which learns policy modules and composes them together to transfer across robot arms with different degrees of freedom and across different tasks . However , their approach relies on input cleanly split between background observations of the task , and robot ’ s internal observations . We do not assume such a split in the input ; our approach tries to learn the separation between rules and partners with one input channel . 3 PRELIMINARIES . We begin by formally defining our problem setting as a two-player Markov Decision Process ( MDP ) . Two-Player MDP We consider a two-agent MDP with identical payoffs , which is a tuple { S , { Ae , Ap } , P , R } . S is a set of states , Ae is a set of actions for agent e , Ap is a set of actions for agent p. In general , e represents the ego agent ( that we control ) , and p represents agents who partner with e. P : S × Ae × Ap × S → [ 0 , 1 ] is the probability of reaching a state given the current state and actions of all agents , and R : S × S → R is the real-valued reward function . Since we are interested in repeated interactions , we consider finite-horizon MDPs . A policy π is a stochastic mapping from a state to an action . For our setting , our policy π = ( πe , πp ) has two parts : πe : S → Ae and πp : S → Ap , mapping the state into actions for agent e and p respectively . We also consider collaborative tasks that are partially observable in our experiments . In addition , some tasks are turn-based , which can be handled by including the turn information as part of the state , and ignoring the other player ’ s actions . Here , we focus on tasks with discrete state and action spaces . Running Example : Collaborative Contextual Bandit We describe a collaborative task to ground our discussion around adapting to new partners , and adapting to new tasks with old partners . Consider a contextual bandit setting with 2 contexts , 4 actions , and a prize for each action . The two players each independently pick an arm to pull , and they score prize ( a ) points if they both picked the same arm a ; otherwise , they score 0 points . An example is depicted in Figure 2 , where green boxes represent arms with prize 1 , the rest have prize 0 , and red and blue circles show the player ’ s actions . In Task 1 of Figure 2 , context A only has one good arm a1 while the context B has two good arms a2 and a4 . After repeated rounds of playing , two agents can eventually converge to coordinating on a convention that chooses one of the two good arms in context B ( e.g . selecting the leftmost good arm a2 ) . When the task shifts slightly as shown in Task 2 but context B remains the same across the two tasks , we can reasonably expect the partners to adhere to the same convention they developed for context B of Task 1 when playing context B of Task 2 . There are two axes of generalization at play . First , for a fixed task we would like to learn the underlying structure of the task ( e.g . green arm locations ) to quickly adapt to a new partner when playing the same task . Second , for a fixed partner we would like to keep track of developed conventions to quickly coordinate with this partner on a new task . In the next sections , we define the notion of a new task and a new partner , and propose a framework to effectively generalize across both dimensions . 4 MODEL OF PARTNERS AND TASKS We consider a family of tasks that share the same state space , action space , and transition dynamics ( all of which we refer to as the domain ) , but can differ in the reward function of the underlying MDP . We also consider a family of partners that our ego agent would like to coordinate with . The underlying model governing the actions taken by a partner at a state of a given task can be seen in Figure 3 . For a new task , a new reward function is sampled from θR , while the domain of the MDP is fixed . For a new partner , we sample from θρ a new function ρ , which maps the Q-function at a state of the task to an action . We refer to ρ as the convention of a partner . In other words , the action aits of a partner i at state s of task t depends on the partner ’ s conventions and ( indirectly through the Q-function at state s ) the reward of the task . θρ is the distribution over conventions and can correspond to , for example , the distribution over emergent conventions from AI-agents trained from selfplay , or can be derived from human partners . More formally , for a fixed domain let QRs ( ap ) = maxae Q R ( s , ae , ap ) , where QR is the optimal Q-function for the two player MDP with reward R ( Boutilier , 1996 ; Oliehoek et al. , 2008 ) . In other words , QRs is the Q-function from the partner ’ s perspective at state s in the task with reward R assum- ing best response by the ego agent . Then , the convention of a partner ρ : S×R|Ap| → Ap determines the partner ’ s action at state s , given by ρi ( s , QRs ) . For example , we might expect the distribution of actions across different partners at a state s to follow Boltzmann rationality ( Ziebart et al. , 2008 ) : Eρ∼θρ [ 1 [ ρ ( s , QRs ) = ap ] ] ∝ exp ( QRs ( ap ) ) . Lastly , we assume that behavior at different states are uncorrelated : a choice of action at one state tells us nothing about actions at other states . Given this formulation , we can hope to learn the underlying structure of a task by playing with a number of partners on the same task . For example , if many sampled partners all make the same action ap at a state s , it is likely that QRs ( ap ) is much higher than the second best action , i.e. , the optimal action is dependent on the rules of the task as opposed to the arbitrariness of partner strategies . Therefore a new partner will likely take action ap as well . Additionally , when coordinating with the same partner across different tasks , we can expect to see developed conventions persist across states with similar Q-functions . In particular , if QR1s = Q R2 s for two different tasks with reward functions R1 and R2 , then ρi ( s , QR1s ) = ρ i ( s , QR2s ) , so a partner will take the same action at state s across the two tasks ( e.g . context B in Figure 2 across Task 1 and 2 ) . We note that the roles of partners and tasks in our model are asymmetrical , assuming rational partners . A task can completely determine the actions of all partners at states with one good action ( e.g . context A in Figure 2 ) , whereas a partner can not blindly pick the same action across all tasks . This asymmetry is reflected in our learning framework and our setup of adapting to new partners and new tasks .
The paper proposes an interesting model to study multi-agent interactions, in uncertain environments. In s nutshell, the model proposed consists of a MDP (Finite state, action, horizon) and two players playing simultaneously (the turn-by-turn model can be subsumed by the simultaneous move model as stated in the paper). In the absence of learning, the finite MDP has an optimal solution. The key contribution of the paper is to focus on instances when the optimal solution is not unique. In a two-player model, this requires symmetry breaking in order for a sample path of the MDP to track the optimal trajectory.
SP:49760213d0f27d6934490916f8300851fd91561e
Practical Massively Parallel Monte-Carlo Tree Search Applied to Molecular Design
1 INTRODUCTION . A survey paper on MCTS , published in 2012 , has cited 240 papers , including many game and non-game applications ( Browne et al. , 2012 ) . Since the invention of Upper Confidence bound applied to Trees ( UCT ) ( Kocsis & Szepesvári , 2006 ) ( the most representative MCTS algorithm ) in 2006 , MCTS has shown remarkable performance in various problems . Recently , the successful combination with Deep Neural Networks ( DNN ) in computer Go by AlphaGo ( Silver et al. , 2016 ) has brought MCTS into the spotlight . Combining MCTS and DNN is becoming one of the standard tools for solving decision making or combinatorial optimization problems . Therefore , there is a significant demand for parallel MCTS . However , in contrast to the enormous computing resources invested in training DNN models in many recent studies , MCTS is rarely parallelized at large scale . Parallelizing MCTS/UCT is notoriously challenging . For example , in UCT , the algorithm follows four steps , selection-expansion-rollout-backpropagation . Non-parallel vanilla UCT updates ( backpropagates ) the values in the tree nodes after each rollout . The behavior of the subsequent selection steps depends on the results of the previous rollouts-backpropagation . Therefore , there is no apparent parallelism in the algorithm . ∗This work was done while all the authors were at RIKEN . 1Code is available at https : //github.com/yoshizoe/mp-chemts Using virtual-loss technique ( explained in section 2.3 ) , MCTS has been efficiently parallelized on shared-memory single machine environment , where the number of CPU cores are limited ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ; Segal , 2010 ) . However , there is limited research on large-scale parallel MCTS using distributed memory environments . Only two approaches scale efficiently on distributed memory environment , but these were only validated in terms of the number of rollouts and the actual improvement is not validated ( Yoshizoe et al. , 2011 ; Graf et al. , 2011 ) . Recently , the combination of ( non-parallel ) MCTS and DNN has been applied to molecular design problems , which aims to find new chemical compounds with desired properties ( Yang et al. , 2017 ; Sumita et al. , 2018 ) , utilizing the ability of MCTS to solve single-agent problems . In general , designing novel molecules can be formulated as a combinatorial optimization or planning problem to find the optimal solutions in vast chemical space ( of 1023 to 1060 , Polishchuk et al . ( 2013 ) ) and can be tackled with the combinations of deep generative models and search ( Kusner et al. , 2017 ; GómezBombarelli et al. , 2018 ; Jin et al. , 2018 ; Popova et al. , 2018 ; 2019 ; Yang et al. , 2017 ) . However , there are no previous studies about massively parallel MCTS for molecular design . In this paper , we propose a novel distributed parallel MCTS and apply it to the molecule design problem . This is the first work to explore viability of distributed parallel MCTS in molecular design . Our experimental results show that a simple RNN model combined with massively parallel MCTS outperforms existing work using more complex models combined with Bayesian Optimization or Reinforcement Learning ( other than UCT ) . 2 BACKGROUND . 2.1 ( NON-PARALLEL ) MCTS . In 2006 , Kocsis and Szepesvári proposed UCT based on a Multi-Armed Bandit algorithm UCB1 ( Auer et al. , 2002 ) , which is the first MCTS algorithm having a proof of convergence to the optimal solution . It has shown good performance for many problems , including the game of Go ( Gelly et al. , 2006 ) . One round of UCT consists of four steps , as shown in Fig . 1 . It repeats the rounds for a given number of times or until a specified time has elapsed . Selection : The algorithm starts from the root node and selects the child with the highest UCB1 value ( Fig . 2 left ) until it reaches a leaf node . For each child i , vi is the number of visits , wi is the cumulative reward , and V is the number of visits at the parent node . Exploration constant C controls the behavior of UCT : the smaller , the more selective ; the greater , the more explorative . Expansion : If the number of visits exceeds a given threshold , expand the leaf node ( add the children of the leaf to the tree ) and select one of the new children for simulation . Do nothing otherwise . Simulation : UCT then evaluates the node by a simulation . This step is often called playout or rollout . A simple example of rollout is to go down the tree by selecting a random child at each node until it reaches a terminal node and returns the value at the terminal node as the reward r ( win or loss for games ) . Replacing rollout with a DNN based evaluation is becoming more popular following the success of AlphaGo . Backpropagation : UCT finally traverses the path all the way back to the root , and updates the values of the nodes in the path ( wi = wi + r , vi = vi + 1 ) . 2.2 SOLVING MOLECULAR DESIGN USING MCTS . The Simplified Molecular-Input Line-Entry System ( SMILES ) ( Weininger , 1988 ) is a standard notation in chemistry for describing molecules using ASCII strings , defined by a grammar . SMILES uses ASCII symbols to denote atoms , bonds , or structural information such as rings . For example , SMILES for Carbon dioxide is `` O=C=O '' where `` = '' means a double bond , and for Benzene , it is `` C1=CC=CC=C1 '' or `` c1ccccc1 '' which forms a ring by connecting the two `` C1 '' s. The search space for molecular design can be defined as a tree based on the SMILES , where the root node is the starting symbol ( denoted as `` & '' , usually not shown ) and each path from the root to a depth d node represents a left-to-right enumeration of the first d symbols in the ( partial ) SMILES string ( see Fig . 1 . The subscripts shows the depth. ) . Yang et al . ( 2017 ) were the first to apply non-parallel MCTS to this problem using the AlphaGo-like approach , which combines MCTS with DNN and a computational chemistry simulator . They trained an RNN model with a chemical compound database , and the RNN predicts the next symbol of a partial SMILES string which is given as the input . The model is used for expansion and rollout . Expansion for Molecular Design : The node ( =2 ) in Fig . 1 denotes SMILES strings starting with `` O= '' . The RNN receives `` O= '' as input and outputs the probability of the next SMILES symbols . Instead of simply adding all symbols as child nodes , the low probability branches are pruned based on the output of the model . Simulation for Molecular Design : Fig . 1 illustrates the simulation step for molecular design . Node ( C3 ) denotes SMILES strings starting with `` O=C '' . Firstly , a rollout generates a complete SMILES string , a new candidate molecule , by repeatedly sampling the next symbol using the model , until the model outputs the terminal symbol . Then , a computational chemistry simulator receives the SMILES string and calculates the target chemical property for the molecule , to determine the reward . 2.3 PARALLEL MCTS . Non-parallel MCTS finds the most promising leaf one at a time in the selection step . In parallel MCTS , multiple workers must find the promising leaves ( to launch simulations from ) in parallel , hence , should find leaves speculatively without knowing the latest results . Fig . 2 shows the example of a three workers case ( a worker means a thread or a process , which runs on either a CPU or GPU ) . If the workers ( shown in green , red , blue ) follow the UCB1 formula , all end up at the same leaf node ( Fig . 2- ( a ) ) , and the parallelization fails . The Virtual loss ( Chaslot et al. , 2008 ) let the workers find the promising but different leaves . The original UCB1 is modified to UCBvl shown in Fig . 2- ( b ) , where ti is the number of workers currently searching in the subtree of the child node i , and T is the sum of ti of the children . It is called virtual loss because it assumes that the current ongoing simulations will obtain 0 reward . With this modification , UCBvl value is penalized based on the number of workers , which makes the subsequent workers avoid the subtrees already being explored ( see Fig . 2- ( b ) ) . Parallel UCT with virtual loss was proved to improve the strength of shared-memory ( using up to 16 cores ) Go programs ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ) . Segal ’ s experiment on an emulated multithreaded machine that assumes no communication overhead shows speedup on up to 512 threads . However , his experiments on real distributed machines did not provide significant speedup beyond 32 cores ( Segal , 2010 ) . 2.4 HASH-DRIVEN PARALLEL SEARCH AND UNIFORM LOAD BALANCING . When many workers perform a search in parallel , it is essential to distribute the search space as evenly as possible . If there is an imbalance in the workload , overall performance will be less efficient because only some workers will continue the computation while the rest remain idle . If all the search space is explicitly given in advance , this is a trivial matter . However , in case of problems such as games and combinatorial optimization , where the search space is generated while the search is performed , it is difficult to distribute the search space evenly . Hash-driven ( HD ) parallel search is one of the methods for resolving this difficulty ; Evett et al . ( 1995 ) ( PRA * ) and Romein et al . ( 1999 ) ( TDS : Transposition-table Driven Scheduling ) developed this method independently and applied to parallel Iterative Deepening A * search . Kishimoto et al . ( 2013 ) later applied it to parallel A * search . HD parallel search requires a hash function that defines the hash key of each node . Each time the algorithm creates a node during the search , it assigns the node to a specific worker , the home worker ( or the home processor ) , based on the hash function , and achieves a near-equal load balancing if the hash function is sufficiently random ( such as Zobrist Hashing ( Zobrist , 1970 ) ) . Figure 3 illustrates this method . The hash function randomly divides the tree into four partitions ( shown in four colors ) , and each worker holds the nodes in the assigned partition in its hash table . A distinct drawback of this method is that it requires communication between workers almost every time the algorithm traverses a branch ( unless the two nodes are on the same worker ) . The key to efficient parallel speedup is the trade-off between uniform load balancing and frequent communication . The experimental results for IDA * and A * ( Evett et al. , 1995 ; Romein et al. , 1999 ; Kishimoto et al. , 2013 ) prove its efficiency for these search algorithms . However , a straightforward application of HD parallel search to UCT is not efficient enough as described below .
The paper proposes a new algorithm to scale up parallel MCTS. The proposed method, MP-MCTS is a modified version of previous efforts to parallelize MCTS (TDS-UCT, TDS-df-UCT), all using virtual loss and modern MCTS enhancements (NN-guided selection learned offline). In exchange for small additional memory requirement, MP-MCTS is able to grow significantly deeper trees at much higher levels of parallelism. Overall, the approach is shown to be quite effective at constructing deeper trees efficiently on large MPI clusters and aligns nicely with results in the single-worker MCTS literature (shallow vs deep trees). The experimental section is nicely detailed and shows strong performance gains over the state of the art in molecular design. Overall, this seems to be a very successful scale-up of MCTS, resulting in a new state-of-the-art result in molecular design. The algorithmic description is a bit thin right now. Please consider including a detailed discussion of the pseudo-code.
SP:c6d8de42cce0118baf2a59b69da17305bf89fb44
Practical Massively Parallel Monte-Carlo Tree Search Applied to Molecular Design
1 INTRODUCTION . A survey paper on MCTS , published in 2012 , has cited 240 papers , including many game and non-game applications ( Browne et al. , 2012 ) . Since the invention of Upper Confidence bound applied to Trees ( UCT ) ( Kocsis & Szepesvári , 2006 ) ( the most representative MCTS algorithm ) in 2006 , MCTS has shown remarkable performance in various problems . Recently , the successful combination with Deep Neural Networks ( DNN ) in computer Go by AlphaGo ( Silver et al. , 2016 ) has brought MCTS into the spotlight . Combining MCTS and DNN is becoming one of the standard tools for solving decision making or combinatorial optimization problems . Therefore , there is a significant demand for parallel MCTS . However , in contrast to the enormous computing resources invested in training DNN models in many recent studies , MCTS is rarely parallelized at large scale . Parallelizing MCTS/UCT is notoriously challenging . For example , in UCT , the algorithm follows four steps , selection-expansion-rollout-backpropagation . Non-parallel vanilla UCT updates ( backpropagates ) the values in the tree nodes after each rollout . The behavior of the subsequent selection steps depends on the results of the previous rollouts-backpropagation . Therefore , there is no apparent parallelism in the algorithm . ∗This work was done while all the authors were at RIKEN . 1Code is available at https : //github.com/yoshizoe/mp-chemts Using virtual-loss technique ( explained in section 2.3 ) , MCTS has been efficiently parallelized on shared-memory single machine environment , where the number of CPU cores are limited ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ; Segal , 2010 ) . However , there is limited research on large-scale parallel MCTS using distributed memory environments . Only two approaches scale efficiently on distributed memory environment , but these were only validated in terms of the number of rollouts and the actual improvement is not validated ( Yoshizoe et al. , 2011 ; Graf et al. , 2011 ) . Recently , the combination of ( non-parallel ) MCTS and DNN has been applied to molecular design problems , which aims to find new chemical compounds with desired properties ( Yang et al. , 2017 ; Sumita et al. , 2018 ) , utilizing the ability of MCTS to solve single-agent problems . In general , designing novel molecules can be formulated as a combinatorial optimization or planning problem to find the optimal solutions in vast chemical space ( of 1023 to 1060 , Polishchuk et al . ( 2013 ) ) and can be tackled with the combinations of deep generative models and search ( Kusner et al. , 2017 ; GómezBombarelli et al. , 2018 ; Jin et al. , 2018 ; Popova et al. , 2018 ; 2019 ; Yang et al. , 2017 ) . However , there are no previous studies about massively parallel MCTS for molecular design . In this paper , we propose a novel distributed parallel MCTS and apply it to the molecule design problem . This is the first work to explore viability of distributed parallel MCTS in molecular design . Our experimental results show that a simple RNN model combined with massively parallel MCTS outperforms existing work using more complex models combined with Bayesian Optimization or Reinforcement Learning ( other than UCT ) . 2 BACKGROUND . 2.1 ( NON-PARALLEL ) MCTS . In 2006 , Kocsis and Szepesvári proposed UCT based on a Multi-Armed Bandit algorithm UCB1 ( Auer et al. , 2002 ) , which is the first MCTS algorithm having a proof of convergence to the optimal solution . It has shown good performance for many problems , including the game of Go ( Gelly et al. , 2006 ) . One round of UCT consists of four steps , as shown in Fig . 1 . It repeats the rounds for a given number of times or until a specified time has elapsed . Selection : The algorithm starts from the root node and selects the child with the highest UCB1 value ( Fig . 2 left ) until it reaches a leaf node . For each child i , vi is the number of visits , wi is the cumulative reward , and V is the number of visits at the parent node . Exploration constant C controls the behavior of UCT : the smaller , the more selective ; the greater , the more explorative . Expansion : If the number of visits exceeds a given threshold , expand the leaf node ( add the children of the leaf to the tree ) and select one of the new children for simulation . Do nothing otherwise . Simulation : UCT then evaluates the node by a simulation . This step is often called playout or rollout . A simple example of rollout is to go down the tree by selecting a random child at each node until it reaches a terminal node and returns the value at the terminal node as the reward r ( win or loss for games ) . Replacing rollout with a DNN based evaluation is becoming more popular following the success of AlphaGo . Backpropagation : UCT finally traverses the path all the way back to the root , and updates the values of the nodes in the path ( wi = wi + r , vi = vi + 1 ) . 2.2 SOLVING MOLECULAR DESIGN USING MCTS . The Simplified Molecular-Input Line-Entry System ( SMILES ) ( Weininger , 1988 ) is a standard notation in chemistry for describing molecules using ASCII strings , defined by a grammar . SMILES uses ASCII symbols to denote atoms , bonds , or structural information such as rings . For example , SMILES for Carbon dioxide is `` O=C=O '' where `` = '' means a double bond , and for Benzene , it is `` C1=CC=CC=C1 '' or `` c1ccccc1 '' which forms a ring by connecting the two `` C1 '' s. The search space for molecular design can be defined as a tree based on the SMILES , where the root node is the starting symbol ( denoted as `` & '' , usually not shown ) and each path from the root to a depth d node represents a left-to-right enumeration of the first d symbols in the ( partial ) SMILES string ( see Fig . 1 . The subscripts shows the depth. ) . Yang et al . ( 2017 ) were the first to apply non-parallel MCTS to this problem using the AlphaGo-like approach , which combines MCTS with DNN and a computational chemistry simulator . They trained an RNN model with a chemical compound database , and the RNN predicts the next symbol of a partial SMILES string which is given as the input . The model is used for expansion and rollout . Expansion for Molecular Design : The node ( =2 ) in Fig . 1 denotes SMILES strings starting with `` O= '' . The RNN receives `` O= '' as input and outputs the probability of the next SMILES symbols . Instead of simply adding all symbols as child nodes , the low probability branches are pruned based on the output of the model . Simulation for Molecular Design : Fig . 1 illustrates the simulation step for molecular design . Node ( C3 ) denotes SMILES strings starting with `` O=C '' . Firstly , a rollout generates a complete SMILES string , a new candidate molecule , by repeatedly sampling the next symbol using the model , until the model outputs the terminal symbol . Then , a computational chemistry simulator receives the SMILES string and calculates the target chemical property for the molecule , to determine the reward . 2.3 PARALLEL MCTS . Non-parallel MCTS finds the most promising leaf one at a time in the selection step . In parallel MCTS , multiple workers must find the promising leaves ( to launch simulations from ) in parallel , hence , should find leaves speculatively without knowing the latest results . Fig . 2 shows the example of a three workers case ( a worker means a thread or a process , which runs on either a CPU or GPU ) . If the workers ( shown in green , red , blue ) follow the UCB1 formula , all end up at the same leaf node ( Fig . 2- ( a ) ) , and the parallelization fails . The Virtual loss ( Chaslot et al. , 2008 ) let the workers find the promising but different leaves . The original UCB1 is modified to UCBvl shown in Fig . 2- ( b ) , where ti is the number of workers currently searching in the subtree of the child node i , and T is the sum of ti of the children . It is called virtual loss because it assumes that the current ongoing simulations will obtain 0 reward . With this modification , UCBvl value is penalized based on the number of workers , which makes the subsequent workers avoid the subtrees already being explored ( see Fig . 2- ( b ) ) . Parallel UCT with virtual loss was proved to improve the strength of shared-memory ( using up to 16 cores ) Go programs ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ) . Segal ’ s experiment on an emulated multithreaded machine that assumes no communication overhead shows speedup on up to 512 threads . However , his experiments on real distributed machines did not provide significant speedup beyond 32 cores ( Segal , 2010 ) . 2.4 HASH-DRIVEN PARALLEL SEARCH AND UNIFORM LOAD BALANCING . When many workers perform a search in parallel , it is essential to distribute the search space as evenly as possible . If there is an imbalance in the workload , overall performance will be less efficient because only some workers will continue the computation while the rest remain idle . If all the search space is explicitly given in advance , this is a trivial matter . However , in case of problems such as games and combinatorial optimization , where the search space is generated while the search is performed , it is difficult to distribute the search space evenly . Hash-driven ( HD ) parallel search is one of the methods for resolving this difficulty ; Evett et al . ( 1995 ) ( PRA * ) and Romein et al . ( 1999 ) ( TDS : Transposition-table Driven Scheduling ) developed this method independently and applied to parallel Iterative Deepening A * search . Kishimoto et al . ( 2013 ) later applied it to parallel A * search . HD parallel search requires a hash function that defines the hash key of each node . Each time the algorithm creates a node during the search , it assigns the node to a specific worker , the home worker ( or the home processor ) , based on the hash function , and achieves a near-equal load balancing if the hash function is sufficiently random ( such as Zobrist Hashing ( Zobrist , 1970 ) ) . Figure 3 illustrates this method . The hash function randomly divides the tree into four partitions ( shown in four colors ) , and each worker holds the nodes in the assigned partition in its hash table . A distinct drawback of this method is that it requires communication between workers almost every time the algorithm traverses a branch ( unless the two nodes are on the same worker ) . The key to efficient parallel speedup is the trade-off between uniform load balancing and frequent communication . The experimental results for IDA * and A * ( Evett et al. , 1995 ; Romein et al. , 1999 ; Kishimoto et al. , 2013 ) prove its efficiency for these search algorithms . However , a straightforward application of HD parallel search to UCT is not efficient enough as described below .
This paper aims to provide a scalable and competitive molecular design technique based on MCTS. Machine learning guided molecular design is a popular field and many solutions have been developed in the recent years. There is appeal, due to the high dimensionality of search space, to resort to MCTS based approaches that leverage stochastic pruning of the search space as an effective way of making the problem tractable.
SP:c6d8de42cce0118baf2a59b69da17305bf89fb44
Practical Massively Parallel Monte-Carlo Tree Search Applied to Molecular Design
1 INTRODUCTION . A survey paper on MCTS , published in 2012 , has cited 240 papers , including many game and non-game applications ( Browne et al. , 2012 ) . Since the invention of Upper Confidence bound applied to Trees ( UCT ) ( Kocsis & Szepesvári , 2006 ) ( the most representative MCTS algorithm ) in 2006 , MCTS has shown remarkable performance in various problems . Recently , the successful combination with Deep Neural Networks ( DNN ) in computer Go by AlphaGo ( Silver et al. , 2016 ) has brought MCTS into the spotlight . Combining MCTS and DNN is becoming one of the standard tools for solving decision making or combinatorial optimization problems . Therefore , there is a significant demand for parallel MCTS . However , in contrast to the enormous computing resources invested in training DNN models in many recent studies , MCTS is rarely parallelized at large scale . Parallelizing MCTS/UCT is notoriously challenging . For example , in UCT , the algorithm follows four steps , selection-expansion-rollout-backpropagation . Non-parallel vanilla UCT updates ( backpropagates ) the values in the tree nodes after each rollout . The behavior of the subsequent selection steps depends on the results of the previous rollouts-backpropagation . Therefore , there is no apparent parallelism in the algorithm . ∗This work was done while all the authors were at RIKEN . 1Code is available at https : //github.com/yoshizoe/mp-chemts Using virtual-loss technique ( explained in section 2.3 ) , MCTS has been efficiently parallelized on shared-memory single machine environment , where the number of CPU cores are limited ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ; Segal , 2010 ) . However , there is limited research on large-scale parallel MCTS using distributed memory environments . Only two approaches scale efficiently on distributed memory environment , but these were only validated in terms of the number of rollouts and the actual improvement is not validated ( Yoshizoe et al. , 2011 ; Graf et al. , 2011 ) . Recently , the combination of ( non-parallel ) MCTS and DNN has been applied to molecular design problems , which aims to find new chemical compounds with desired properties ( Yang et al. , 2017 ; Sumita et al. , 2018 ) , utilizing the ability of MCTS to solve single-agent problems . In general , designing novel molecules can be formulated as a combinatorial optimization or planning problem to find the optimal solutions in vast chemical space ( of 1023 to 1060 , Polishchuk et al . ( 2013 ) ) and can be tackled with the combinations of deep generative models and search ( Kusner et al. , 2017 ; GómezBombarelli et al. , 2018 ; Jin et al. , 2018 ; Popova et al. , 2018 ; 2019 ; Yang et al. , 2017 ) . However , there are no previous studies about massively parallel MCTS for molecular design . In this paper , we propose a novel distributed parallel MCTS and apply it to the molecule design problem . This is the first work to explore viability of distributed parallel MCTS in molecular design . Our experimental results show that a simple RNN model combined with massively parallel MCTS outperforms existing work using more complex models combined with Bayesian Optimization or Reinforcement Learning ( other than UCT ) . 2 BACKGROUND . 2.1 ( NON-PARALLEL ) MCTS . In 2006 , Kocsis and Szepesvári proposed UCT based on a Multi-Armed Bandit algorithm UCB1 ( Auer et al. , 2002 ) , which is the first MCTS algorithm having a proof of convergence to the optimal solution . It has shown good performance for many problems , including the game of Go ( Gelly et al. , 2006 ) . One round of UCT consists of four steps , as shown in Fig . 1 . It repeats the rounds for a given number of times or until a specified time has elapsed . Selection : The algorithm starts from the root node and selects the child with the highest UCB1 value ( Fig . 2 left ) until it reaches a leaf node . For each child i , vi is the number of visits , wi is the cumulative reward , and V is the number of visits at the parent node . Exploration constant C controls the behavior of UCT : the smaller , the more selective ; the greater , the more explorative . Expansion : If the number of visits exceeds a given threshold , expand the leaf node ( add the children of the leaf to the tree ) and select one of the new children for simulation . Do nothing otherwise . Simulation : UCT then evaluates the node by a simulation . This step is often called playout or rollout . A simple example of rollout is to go down the tree by selecting a random child at each node until it reaches a terminal node and returns the value at the terminal node as the reward r ( win or loss for games ) . Replacing rollout with a DNN based evaluation is becoming more popular following the success of AlphaGo . Backpropagation : UCT finally traverses the path all the way back to the root , and updates the values of the nodes in the path ( wi = wi + r , vi = vi + 1 ) . 2.2 SOLVING MOLECULAR DESIGN USING MCTS . The Simplified Molecular-Input Line-Entry System ( SMILES ) ( Weininger , 1988 ) is a standard notation in chemistry for describing molecules using ASCII strings , defined by a grammar . SMILES uses ASCII symbols to denote atoms , bonds , or structural information such as rings . For example , SMILES for Carbon dioxide is `` O=C=O '' where `` = '' means a double bond , and for Benzene , it is `` C1=CC=CC=C1 '' or `` c1ccccc1 '' which forms a ring by connecting the two `` C1 '' s. The search space for molecular design can be defined as a tree based on the SMILES , where the root node is the starting symbol ( denoted as `` & '' , usually not shown ) and each path from the root to a depth d node represents a left-to-right enumeration of the first d symbols in the ( partial ) SMILES string ( see Fig . 1 . The subscripts shows the depth. ) . Yang et al . ( 2017 ) were the first to apply non-parallel MCTS to this problem using the AlphaGo-like approach , which combines MCTS with DNN and a computational chemistry simulator . They trained an RNN model with a chemical compound database , and the RNN predicts the next symbol of a partial SMILES string which is given as the input . The model is used for expansion and rollout . Expansion for Molecular Design : The node ( =2 ) in Fig . 1 denotes SMILES strings starting with `` O= '' . The RNN receives `` O= '' as input and outputs the probability of the next SMILES symbols . Instead of simply adding all symbols as child nodes , the low probability branches are pruned based on the output of the model . Simulation for Molecular Design : Fig . 1 illustrates the simulation step for molecular design . Node ( C3 ) denotes SMILES strings starting with `` O=C '' . Firstly , a rollout generates a complete SMILES string , a new candidate molecule , by repeatedly sampling the next symbol using the model , until the model outputs the terminal symbol . Then , a computational chemistry simulator receives the SMILES string and calculates the target chemical property for the molecule , to determine the reward . 2.3 PARALLEL MCTS . Non-parallel MCTS finds the most promising leaf one at a time in the selection step . In parallel MCTS , multiple workers must find the promising leaves ( to launch simulations from ) in parallel , hence , should find leaves speculatively without knowing the latest results . Fig . 2 shows the example of a three workers case ( a worker means a thread or a process , which runs on either a CPU or GPU ) . If the workers ( shown in green , red , blue ) follow the UCB1 formula , all end up at the same leaf node ( Fig . 2- ( a ) ) , and the parallelization fails . The Virtual loss ( Chaslot et al. , 2008 ) let the workers find the promising but different leaves . The original UCB1 is modified to UCBvl shown in Fig . 2- ( b ) , where ti is the number of workers currently searching in the subtree of the child node i , and T is the sum of ti of the children . It is called virtual loss because it assumes that the current ongoing simulations will obtain 0 reward . With this modification , UCBvl value is penalized based on the number of workers , which makes the subsequent workers avoid the subtrees already being explored ( see Fig . 2- ( b ) ) . Parallel UCT with virtual loss was proved to improve the strength of shared-memory ( using up to 16 cores ) Go programs ( Chaslot et al. , 2008 ; Enzenberger & Müller , 2010 ) . Segal ’ s experiment on an emulated multithreaded machine that assumes no communication overhead shows speedup on up to 512 threads . However , his experiments on real distributed machines did not provide significant speedup beyond 32 cores ( Segal , 2010 ) . 2.4 HASH-DRIVEN PARALLEL SEARCH AND UNIFORM LOAD BALANCING . When many workers perform a search in parallel , it is essential to distribute the search space as evenly as possible . If there is an imbalance in the workload , overall performance will be less efficient because only some workers will continue the computation while the rest remain idle . If all the search space is explicitly given in advance , this is a trivial matter . However , in case of problems such as games and combinatorial optimization , where the search space is generated while the search is performed , it is difficult to distribute the search space evenly . Hash-driven ( HD ) parallel search is one of the methods for resolving this difficulty ; Evett et al . ( 1995 ) ( PRA * ) and Romein et al . ( 1999 ) ( TDS : Transposition-table Driven Scheduling ) developed this method independently and applied to parallel Iterative Deepening A * search . Kishimoto et al . ( 2013 ) later applied it to parallel A * search . HD parallel search requires a hash function that defines the hash key of each node . Each time the algorithm creates a node during the search , it assigns the node to a specific worker , the home worker ( or the home processor ) , based on the hash function , and achieves a near-equal load balancing if the hash function is sufficiently random ( such as Zobrist Hashing ( Zobrist , 1970 ) ) . Figure 3 illustrates this method . The hash function randomly divides the tree into four partitions ( shown in four colors ) , and each worker holds the nodes in the assigned partition in its hash table . A distinct drawback of this method is that it requires communication between workers almost every time the algorithm traverses a branch ( unless the two nodes are on the same worker ) . The key to efficient parallel speedup is the trade-off between uniform load balancing and frequent communication . The experimental results for IDA * and A * ( Evett et al. , 1995 ; Romein et al. , 1999 ; Kishimoto et al. , 2013 ) prove its efficiency for these search algorithms . However , a straightforward application of HD parallel search to UCT is not efficient enough as described below .
In this work the authors apply a distributed parallel Monte-Carlo Tree Search (MCTS) algorithm to the Molecular Design problem. The goal of this paper is to speed-up the computation needed by an MCTS algorithm using parallelization over multiple machines. The authors show how to modify a previously successful parallel MCTS algorithm (namely, TDS-DF-UCT) to address its shortcoming that leads to shallow and wide trees. The modification that is performed changes the way that the history on the nodes are stored and propagated, which leads the algorithm to construct trees with more similar characteristics with those constructed by a sequential algorithm that is allowed to use time equal to the number of processors times the time required by the parallel implementation.
SP:c6d8de42cce0118baf2a59b69da17305bf89fb44
Learning Stochastic Behaviour from Aggregate Data
1 Introduction In the context of a dynamic system , Aggregate data refers to the data sets that full trajectory of each individual is not available , meaning that there is no known individual level correspondence . Typical examples include data sets collected for DNA evolution , social gathering , density in control problems , bird migration during which it is impossible to identify individual bird , and many more . In those applications , some observed individuals at one time point may be unobserved at the next time spot , or when the individual identities are blocked or unavailable due to various technical and ethical reasons . Rather than inferring the exact information for each individual , the main objective of learning dynamics in aggregate data is to recover and predict the evolution of distribution of all individuals together . Trajectory data , in contrast , is a kind of data that we are able to acquire the information of each individual all the time , although some studies considered the case that some individual trajectories are partially missing . However , the identities of those individuals , whenever they are observable , is always assumed available . For example , stock price , weather , customer behaviors and most training data sets for computer vision and natural language processing . There are many popular models to learn dynamics of full-trajectory data . Typical ones include Hidden Markov Model ( HMM ) ( Alshamaa et al. , 2019 ; Eddy , 1996 ) , Kalman Filter ( KF ) ( Farahi & Yazdi , 2020 ; Harvey , 1990 ; Kalman , 1960 ) and Particle Filter ( PF ) ( Santos et al. , 2019 ; Djuric et al. , 2003 ) , as well as the models built upon HMM , KF and PF ( Deriche et al. , 2020 ; Fang et al. , 2019 ; Hefny et al. , 2015 ; Langford et al. , 2009 ) , they all require full trajectories of each individual , which may not be applicable in the aggregate data situations . On the other side , only a few methods are focused on aggregated data in the recent learning literature . In the work of Hashimoto et al . ( 2016 ) , authors assumed that the hidden dynamic of particles follows a stochastic differential equation ( SDE ) , in particular , they use a recurrent neural network to parameterize the drift term . Furthermore , Wang et al . ( 2018 ) improved traditional HMM model by using an SDE to describe the evolving process of hidden states . To the best of our knowledge , there is no method directly learning the evolution of the density of objects from aggregate data yet . We propose to learn the dynamics of density through the weak form of Fokker Planck Equation ( FPE ) , which is a parabolic partial differential equation ( PDE ) governing many dynamical systems subject to random noise perturbations , including the typical SDE models in existing studies . Our learning is accomplished by minimizing the Wasserstein distance between predicted distribution given by FPE and the empirical distribution from data samples . Meanwhile we utilize neural networks to handle higher dimensional cases . More importantly , by leveraging the framework of Wasserstein Generative Adversarial Network ( WGAN ) ( Arjovsky et al. , 2017 ) , our model is capable of approximating the distribution of samples at different time points without solving the SDE or FPE . More specifically , we treat the drift coefficient , the goal of learning , in the FPE as a generator , and the test function in the weak form of FPE as a discriminator . In other words , our method can also be regarded as a data-driven method to estimate transport coefficient in FPE , which corresponds to the drift terms in SDEs . Additionally , though we treat diffusion term as a constant in our model , it is straightforward to generalize it to be a neural network as well , which can be an extension of this work . We would like to mention that several methods of solving SDE and FPE ( Weinan et al. , 2017 ; Beck et al. , 2018 ; Li et al. , 2019 ) adopt opposite ways to our method , they utilize neural networks to estimate the distribution P ( x , t ) with given drift and diffusion terms . In conclusion , our contributions are : • We design an algorithm that is able to recover the density evolution of nonlinear dynamics via minimizing the Wasserstein discrepancy between real aggregate data and our generated data . • By leveraging the weak form of FPE , we are able to compute the Wasserstein distance directly without solving the FPE . • Finally , we demonstrate the accuracy and the effectiveness of our algorithm by several synthetic and real-world examples . 2 ProposedMethod 2.1 Fokker Planck Equation for the density evolution We assume the individuals evolve in a pattern in the space RD as shown in Figure 1 . One example satisfying such process is the stochastic differential equation ( SDE ) , which is also known as the Itô process ( Øksendal , 2003 ) : dXt = g ( Xt , t ) dt + σdWt . Here dXt represents an infinitesimal change of { Xt } along with time increment dt , g ( · , t ) = ( g1 ( · , t ) , ... , gD ( · , t ) ) T is the drift term ( drifting vector field ) that drives the dynamics of the SDE , σ is the diffusion constant , { Wt } is the standard Brownian Motion . Then the probability density of { Xt } is governed by the Fokker Planck Equation ( FPE ) ( Risken & Caugheyz , 1991 ) , as stated below in Lemma 1 . Lemma 1 . Suppose { Xt } solves the SDE dXt = g ( Xt , t ) dt + σdWt , denote p ( · , t ) as the probability density of the random variableXt . Then p ( x , t ) solves the following equation : ∂p ( x , t ) ∂t = D∑ i=1 − ∂ ∂xi [ gi ( x , t ) p ( x , t ) ] + 1 2 σ2 D∑ i=1 ∂2 ∂xi2 p ( x , t ) ( 1 ) As a linear evolution PDE , FPE describes the evolution of density function of the stochastic process driven by a SDE . Due to this reason , FPE plays a crucial role in stochastic calculus , statistical physics and modeling ( Nelson , 1985 ; Qi & Majda , 2016 ; Risken , 1989 ) . Its importance is also drawing more attention among statistic and machine learning communities ( Liu & Wang , 2016 ; Pavon et al. , 2018 ; Rezende & Mohamed , 2015 ) . In this paper , we utilize the weak form of FPE as a basis to study hidden dynamics of the time evolving aggregated data without solving FPE . Our task can be described as : assume that the individuals evolve with the process indicated by Figure 1 , which can be simulated by Itô process . Then given observations xt along time axis , we aim to recover the drift coefficient g ( x , t ) in FPE , and thus we are able to recover and predict the density evolution of such dynamic . For simplicity we treat g ( x , t ) as a function uncorrelated to time t , namely , g ( x , t ) = g ( x ) . Notice that though evolving process of individuals can be simulated by Itô process , in reality since we lose identity information of individuals , the observed data become aggregate data , thus we need a new way other than traditional methods to study the swarm ’ s distribution . 2.2 Weak Form of Fokker Planck Equation Given FPE stated in Lemma 1 , if we multiply a test function f ∈ H10 ( RD ) on both sides of the FPE , then the integration on both sides leads to : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 − ∂ ∂xi [ gi ( x ) p ( x , t ) ] f ( x ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 p ( x , t ) f ( x ) dx . Then integrating by parts on the right hand side leads to the weak form of FPE : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 gi ( x ) ∂ ∂xi f ( x ) p ( x , t ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 f ( x ) p ( x , t ) dx . where H10 ( R D ) denote the Sobolev space . The first advantage of weak solution is that the solution of a PDE usually requires strong regularity and thus may not exist in the classical sense for a certain group of equations , however , the weak solution has fewer regularity requirements and thus their existence are guaranteed for a much larger classes of equations . The second advantage is that the weak formulation may provide new perspectives for numerically solving PDEs ( Zienkiewicz & Cheung , 1971 ) , ( Sirignano & Spiliopoulos , 2018 ) and ( Zang et al. , 2019 ) etc . Suppose the observed samples at time points tm−1 and tm are following true densities p̂ ( · , tm−1 ) and p̂ ( · , tm ) . Consider the following SDE dX̃t = gω ( X̃t ) dt + σdWt , tm−1 ≤ t ≤ tm X̃ tm−1 ∼ p̂ ( · , tm−1 ) ( 2 ) Here gω is an approximation to the real drift term g , in our research , we treat gω as a neural network with parameters ω . Let us now denote p̃ ( · , t ) as the density of X̃t . Then it is natural to compute and minimize the discrepancy between our approximated density p̃ ( · , tm ) and true density p̂ ( · , tm ) , within this process , we are optimizing gω and thus will recover the true drift term g. In our research , we choose the Wasserstein-1 distance as our discrepancy function ( Villani , 2008 ) ( Arjovsky et al. , 2017 ) . Now we apply Kantorovich-Rubinstein duality ( Villani , 2008 ) , this leads to : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) = sup ‖∇ f ‖≤1 { Exr∼ p̂ ( x , tm ) [ f ( xr ) ] − Exg∼ p̃ ( x , tm ) [ f ( xg ) ] } ( 3 ) The first term Exr∼p̂ ( x , tm ) [ f ( xr ) ] in Equation ( 3 ) can be conveniently computed by Monte-Carlo method since we are already provided with the real data points xr ∼ p̂ ( · , tm ) . To evaluate the second term , we first approximate p̃ ( · , tm ) by trapezoidal rule ( Atkinson , 2008 ) : p̃ ( x , tm ) ≈ p̂ ( x , tm−1 ) + ∆t 2 ( ∂p̃ ( x , tm−1 ) ∂t + ∂p̃ ( x , tm ) ∂t ) here ∆t = tm − tm−1 . ( 4 ) And thus we can compute : Exg∼p̃ ( · , tm ) [ f ( xg ) ] ≈ ∫ f ( x ) p̂ ( x , tm−1 ) dx+ ∆t 2 ( ∫ ∂p̂ ( x , tm−1 ) ∂t f ( x ) dx + ∫ ∂p̃ ( x , tm ) ∂t f ( x ) dx ) ( 5 ) In the above Equation ( 5 ) , the second and the third term on the right-hand side can be reformulated via the weak form of FPE and we are able to derive a computable formulation for W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) . Furthermore , we can use Monte-Carlo method to approximate the expectations in ( 5 ) . the first and the second terms can be directly computed via data points from p̂ ( · , tm−1 ) . For the third term , we need to generate samples from p̃ ( · , tm ) , to achieve this , we apply Euler-Maruyama scheme ( Kloeden & Platen , 2013 ) to SDE ( 2 ) in order to acquire our desired samples x̃tm : x̃tm = x̂tm−1 + gω ( x̂tm−1 ) ∆t + σ √ ∆tz , here z ∼ N ( 0 , I ) , x̂tm−1 ∼ p̂ ( · , tm−1 ) . ( 6 ) Here N ( 0 , I ) is the standard Gaussian distribution on RD . Now we summarize these results in Proposition 1 : Proposition 1 . For a set of points X = { x ( 1 ) , ... , x ( N ) } in RD . We denote : F f ( X ) = 1 N N∑ k=1 ( D∑ i=1 giω ( x ( k ) ) ∂ ∂xi f ( x ( k ) ) + 1 2 σ2 D∑ i=1 ∂2 ∂x2i f ( x ( k ) ) ) then at time point tm , the Wasserstein distance between p̂ ( · , tm ) and p̃ ( · , tm ) can be approximated by : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tm ) − 1 N N∑ k=1 f ( x̂ ( k ) tm−1 ) − ∆t 2 ( F f ( X̂m−1 ) + F f ( X̃m ) ) Here { x̂ ( k ) tm−1 } ∼ p̂ ( · , tm−1 ) , { x̂ ( k ) tm } ∼ p̂ ( · , tm ) and we denote X̂m−1 = { x̂ ( 1 ) tm−1 , ... , x̂ ( N ) tm−1 } , X̃m = { x̃ ( 1 ) tm , ... , x̃ ( N ) tm } , where each x̃ ( k ) tm is computed by Euler-Maruyama scheme ( 6 ) . 2.3 Wasserstein Distance on Time Series In real cases , it is not realistic to observe the data at arbitrary two consecutive time nodes , especially when ∆t is small . To make our model more flexible , we should extend our formulation so that we are able to plug in observed data at arbitrary time points . To be more precise , suppose we observe data set X̂tn = { x̂ ( 1 ) tn , ... , x̂ ( N ) tn } at J + 1 different time points t0 , t1 , ... , tJ . And we denote the generated data set as X̃tn = { x̃ ( 1 ) tn , ... , x̃ ( N ) tn } , here each x̃ ( · ) tn is derived from the n-step Euler-Maruyama scheme : x̃t j = x̃t j−1 + gω ( x̃t j−1 ) ∆t + σ √ ∆tz , with z ∼ N ( 0 , I ) 0 ≤ j ≤ n , x̃t0 ∼ p̂ ( · , t0 ) ( 7 ) Let us denote p̃ ( · , t ) as the solution to FPE ( 1 ) with g replaced by gω and with initial condition p̃ ( · , t0 ) = p̂ ( · , t0 ) , then the approximation formula for evaluating the Wasserstein distance W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) is provided in the following proposition : Proposition 2 . Suppose we keep all the notations defined as above , then we have the approximation : W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tn ) − 1 N N∑ k=1 f ( x̂ ( k ) t0 ) − ∆t 2 ( F f ( X̂0 ) + F f ( X̃n ) + 2 n−1∑ s=1 F f ( X̃s ) ) Minimizing the Objective Function : Based on Proposition 2 , we obtain objective function by summing up the accumulated Wasserstein distances among J observations along the time axis . Thus , our ultimate goal is to minimize the following objection function : min gω J∑ n=1 sup ‖∇ fn‖≤1 1N N∑ k=1 fn ( x̂ ( k ) tn ) − 1 N N∑ k=1 fn ( x̂ ( k ) t0 ) − ∆t 2 ( F fn ( X̂0 ) + F fn ( X̃n ) + 2 n−1∑ s=1 F fn ( X̃s ) ) Notice that since we have observations on J distinct time points ( despite the initial point ) , for each time point we compute Wasserstein distance with the help of the dual function fn , thus we will involve J test functions in total . In our actual implementation , we will choose these dual functions as neural networks . We call our algorithm Fokker Planck Process ( FPP ) , the entire procedure is shown in Algorithm 1 . We also provide an error analysis in Appendix . 3 Experiments In this section , we evaluate our model on various synthetic and realistic data sets by employing Algorithm 1 . We generate samples x̃t and make all predictions base on Equation ( 6 ) starting with x̂0 . Baselines : We compare our model with two recently proposed methods . One model ( NN ) adopts recurrent neural network ( RNN ) to learn dynamics directly from observations of aggregate data ( Hashimoto et al. , 2016 ) . The other one model ( LEGEND ) learns dynamics in a HMM framework ( Wang et al. , 2018 ) . The baselines in our experiments are two typical representatives that have stateof-the-art performance on learning aggregate data . Furthermore , though we simulate the evolving process of the data as a SDE , which is on the same track with NN , as mentioned before , NN trains its RNN via optimizing Sinkhorn distance ( Cuturi , 2013 ) , our model starts with a view of weak form of PDE , focuses more on WGAN framework and easier computation . Algorithm 1 Fokker Planck Process Algorithm Require : Initialize fθn ( 1 ≤ n ≤ J ) , gω Require : Set fn as the inner loop learning rate for fθn and g as the outer loop learning rate for gω 1 : for # training iterations do 2 : for k steps do 3 : for observed time ts in { t1 , ... , tJ } do 4 : Compute the generated data set X̃ts from Euler-Maruyama scheme ( 7 ) for 1 ≤ s ≤ J 5 : Acquire data sets X̂ts = { x̂ ( 1 ) ts , ... , x̂ ( N ) ts } from real distribution p̂ ( · , ts ) for 1 ≤ s ≤ J 6 : end for 7 : For each dual function fθn , compute : 8 : Fn = F fθn ( X̂t0 ) + F fθn ( X̃tn ) + 2 ∑n−1 s=1 F fθn ( X̃ts ) 9 : Update each fθn by θn ← θn + fn∇θ ( 1 N ∑N k=1 fθn ( x̂ ( k ) tn ) − 1 N ∑N k=1 fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) 10 : end for 11 : Update gω by ω← ω − g∇ω ( ∑J n=1 ( 1 N fθn ( x̂ ( k ) tn ) − 1 N fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) ) 12 : end for 3.1 Synthetic Data We first evaluate our model on three synthetic data sets which are generated by three artificial dynamics : Synthetic-1 , Synthetic-2 and Synthetic-3 . Experiment Setup : In all synthetic data experiments , we set the drift term g and the discriminator f as two simple fully-connected networks . The g network has one hidden layer and the f network has three hidden layers . Each layer has 32 nodes for both g and f . The only one activation function we choose is Tanh . Notice that since we need to calculate ∂ 2 f ∂x2 , the activation function of f must be twice differentiable to avoid loss of weight gradient . In terms of training process , we use the Adam optimizer ( Kingma & Ba , 2014 ) with learning rate 10−4 . Furthermore , we use spectral normalization to realize ‖∇ f ‖ ≤ 1 ( Miyato et al. , 2018 ) . We initialize the weights with Xavier initialization ( Glorot & Bengio , 2010 ) and train our model by Algorithm 1 .
The paper addresses an interesting problem: learning stochastic dynamics from aggregate data. The aggregate data refers to the setting when the data is anonymized. For example, one has data about the location of the birds at different instants in time, but the birds are not labeled and can not be distinguished from each other. For the purpose of learning, the paper proposes to use a generator, in the setting of WGAN, to learn the drift term in the dynamics. The novelty of the proposed approach is to consider the weak form of the Fokker-Planck equation to express the loss function.
SP:181689080f5bce74c54b4c18f759ba61211ee583
Learning Stochastic Behaviour from Aggregate Data
1 Introduction In the context of a dynamic system , Aggregate data refers to the data sets that full trajectory of each individual is not available , meaning that there is no known individual level correspondence . Typical examples include data sets collected for DNA evolution , social gathering , density in control problems , bird migration during which it is impossible to identify individual bird , and many more . In those applications , some observed individuals at one time point may be unobserved at the next time spot , or when the individual identities are blocked or unavailable due to various technical and ethical reasons . Rather than inferring the exact information for each individual , the main objective of learning dynamics in aggregate data is to recover and predict the evolution of distribution of all individuals together . Trajectory data , in contrast , is a kind of data that we are able to acquire the information of each individual all the time , although some studies considered the case that some individual trajectories are partially missing . However , the identities of those individuals , whenever they are observable , is always assumed available . For example , stock price , weather , customer behaviors and most training data sets for computer vision and natural language processing . There are many popular models to learn dynamics of full-trajectory data . Typical ones include Hidden Markov Model ( HMM ) ( Alshamaa et al. , 2019 ; Eddy , 1996 ) , Kalman Filter ( KF ) ( Farahi & Yazdi , 2020 ; Harvey , 1990 ; Kalman , 1960 ) and Particle Filter ( PF ) ( Santos et al. , 2019 ; Djuric et al. , 2003 ) , as well as the models built upon HMM , KF and PF ( Deriche et al. , 2020 ; Fang et al. , 2019 ; Hefny et al. , 2015 ; Langford et al. , 2009 ) , they all require full trajectories of each individual , which may not be applicable in the aggregate data situations . On the other side , only a few methods are focused on aggregated data in the recent learning literature . In the work of Hashimoto et al . ( 2016 ) , authors assumed that the hidden dynamic of particles follows a stochastic differential equation ( SDE ) , in particular , they use a recurrent neural network to parameterize the drift term . Furthermore , Wang et al . ( 2018 ) improved traditional HMM model by using an SDE to describe the evolving process of hidden states . To the best of our knowledge , there is no method directly learning the evolution of the density of objects from aggregate data yet . We propose to learn the dynamics of density through the weak form of Fokker Planck Equation ( FPE ) , which is a parabolic partial differential equation ( PDE ) governing many dynamical systems subject to random noise perturbations , including the typical SDE models in existing studies . Our learning is accomplished by minimizing the Wasserstein distance between predicted distribution given by FPE and the empirical distribution from data samples . Meanwhile we utilize neural networks to handle higher dimensional cases . More importantly , by leveraging the framework of Wasserstein Generative Adversarial Network ( WGAN ) ( Arjovsky et al. , 2017 ) , our model is capable of approximating the distribution of samples at different time points without solving the SDE or FPE . More specifically , we treat the drift coefficient , the goal of learning , in the FPE as a generator , and the test function in the weak form of FPE as a discriminator . In other words , our method can also be regarded as a data-driven method to estimate transport coefficient in FPE , which corresponds to the drift terms in SDEs . Additionally , though we treat diffusion term as a constant in our model , it is straightforward to generalize it to be a neural network as well , which can be an extension of this work . We would like to mention that several methods of solving SDE and FPE ( Weinan et al. , 2017 ; Beck et al. , 2018 ; Li et al. , 2019 ) adopt opposite ways to our method , they utilize neural networks to estimate the distribution P ( x , t ) with given drift and diffusion terms . In conclusion , our contributions are : • We design an algorithm that is able to recover the density evolution of nonlinear dynamics via minimizing the Wasserstein discrepancy between real aggregate data and our generated data . • By leveraging the weak form of FPE , we are able to compute the Wasserstein distance directly without solving the FPE . • Finally , we demonstrate the accuracy and the effectiveness of our algorithm by several synthetic and real-world examples . 2 ProposedMethod 2.1 Fokker Planck Equation for the density evolution We assume the individuals evolve in a pattern in the space RD as shown in Figure 1 . One example satisfying such process is the stochastic differential equation ( SDE ) , which is also known as the Itô process ( Øksendal , 2003 ) : dXt = g ( Xt , t ) dt + σdWt . Here dXt represents an infinitesimal change of { Xt } along with time increment dt , g ( · , t ) = ( g1 ( · , t ) , ... , gD ( · , t ) ) T is the drift term ( drifting vector field ) that drives the dynamics of the SDE , σ is the diffusion constant , { Wt } is the standard Brownian Motion . Then the probability density of { Xt } is governed by the Fokker Planck Equation ( FPE ) ( Risken & Caugheyz , 1991 ) , as stated below in Lemma 1 . Lemma 1 . Suppose { Xt } solves the SDE dXt = g ( Xt , t ) dt + σdWt , denote p ( · , t ) as the probability density of the random variableXt . Then p ( x , t ) solves the following equation : ∂p ( x , t ) ∂t = D∑ i=1 − ∂ ∂xi [ gi ( x , t ) p ( x , t ) ] + 1 2 σ2 D∑ i=1 ∂2 ∂xi2 p ( x , t ) ( 1 ) As a linear evolution PDE , FPE describes the evolution of density function of the stochastic process driven by a SDE . Due to this reason , FPE plays a crucial role in stochastic calculus , statistical physics and modeling ( Nelson , 1985 ; Qi & Majda , 2016 ; Risken , 1989 ) . Its importance is also drawing more attention among statistic and machine learning communities ( Liu & Wang , 2016 ; Pavon et al. , 2018 ; Rezende & Mohamed , 2015 ) . In this paper , we utilize the weak form of FPE as a basis to study hidden dynamics of the time evolving aggregated data without solving FPE . Our task can be described as : assume that the individuals evolve with the process indicated by Figure 1 , which can be simulated by Itô process . Then given observations xt along time axis , we aim to recover the drift coefficient g ( x , t ) in FPE , and thus we are able to recover and predict the density evolution of such dynamic . For simplicity we treat g ( x , t ) as a function uncorrelated to time t , namely , g ( x , t ) = g ( x ) . Notice that though evolving process of individuals can be simulated by Itô process , in reality since we lose identity information of individuals , the observed data become aggregate data , thus we need a new way other than traditional methods to study the swarm ’ s distribution . 2.2 Weak Form of Fokker Planck Equation Given FPE stated in Lemma 1 , if we multiply a test function f ∈ H10 ( RD ) on both sides of the FPE , then the integration on both sides leads to : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 − ∂ ∂xi [ gi ( x ) p ( x , t ) ] f ( x ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 p ( x , t ) f ( x ) dx . Then integrating by parts on the right hand side leads to the weak form of FPE : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 gi ( x ) ∂ ∂xi f ( x ) p ( x , t ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 f ( x ) p ( x , t ) dx . where H10 ( R D ) denote the Sobolev space . The first advantage of weak solution is that the solution of a PDE usually requires strong regularity and thus may not exist in the classical sense for a certain group of equations , however , the weak solution has fewer regularity requirements and thus their existence are guaranteed for a much larger classes of equations . The second advantage is that the weak formulation may provide new perspectives for numerically solving PDEs ( Zienkiewicz & Cheung , 1971 ) , ( Sirignano & Spiliopoulos , 2018 ) and ( Zang et al. , 2019 ) etc . Suppose the observed samples at time points tm−1 and tm are following true densities p̂ ( · , tm−1 ) and p̂ ( · , tm ) . Consider the following SDE dX̃t = gω ( X̃t ) dt + σdWt , tm−1 ≤ t ≤ tm X̃ tm−1 ∼ p̂ ( · , tm−1 ) ( 2 ) Here gω is an approximation to the real drift term g , in our research , we treat gω as a neural network with parameters ω . Let us now denote p̃ ( · , t ) as the density of X̃t . Then it is natural to compute and minimize the discrepancy between our approximated density p̃ ( · , tm ) and true density p̂ ( · , tm ) , within this process , we are optimizing gω and thus will recover the true drift term g. In our research , we choose the Wasserstein-1 distance as our discrepancy function ( Villani , 2008 ) ( Arjovsky et al. , 2017 ) . Now we apply Kantorovich-Rubinstein duality ( Villani , 2008 ) , this leads to : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) = sup ‖∇ f ‖≤1 { Exr∼ p̂ ( x , tm ) [ f ( xr ) ] − Exg∼ p̃ ( x , tm ) [ f ( xg ) ] } ( 3 ) The first term Exr∼p̂ ( x , tm ) [ f ( xr ) ] in Equation ( 3 ) can be conveniently computed by Monte-Carlo method since we are already provided with the real data points xr ∼ p̂ ( · , tm ) . To evaluate the second term , we first approximate p̃ ( · , tm ) by trapezoidal rule ( Atkinson , 2008 ) : p̃ ( x , tm ) ≈ p̂ ( x , tm−1 ) + ∆t 2 ( ∂p̃ ( x , tm−1 ) ∂t + ∂p̃ ( x , tm ) ∂t ) here ∆t = tm − tm−1 . ( 4 ) And thus we can compute : Exg∼p̃ ( · , tm ) [ f ( xg ) ] ≈ ∫ f ( x ) p̂ ( x , tm−1 ) dx+ ∆t 2 ( ∫ ∂p̂ ( x , tm−1 ) ∂t f ( x ) dx + ∫ ∂p̃ ( x , tm ) ∂t f ( x ) dx ) ( 5 ) In the above Equation ( 5 ) , the second and the third term on the right-hand side can be reformulated via the weak form of FPE and we are able to derive a computable formulation for W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) . Furthermore , we can use Monte-Carlo method to approximate the expectations in ( 5 ) . the first and the second terms can be directly computed via data points from p̂ ( · , tm−1 ) . For the third term , we need to generate samples from p̃ ( · , tm ) , to achieve this , we apply Euler-Maruyama scheme ( Kloeden & Platen , 2013 ) to SDE ( 2 ) in order to acquire our desired samples x̃tm : x̃tm = x̂tm−1 + gω ( x̂tm−1 ) ∆t + σ √ ∆tz , here z ∼ N ( 0 , I ) , x̂tm−1 ∼ p̂ ( · , tm−1 ) . ( 6 ) Here N ( 0 , I ) is the standard Gaussian distribution on RD . Now we summarize these results in Proposition 1 : Proposition 1 . For a set of points X = { x ( 1 ) , ... , x ( N ) } in RD . We denote : F f ( X ) = 1 N N∑ k=1 ( D∑ i=1 giω ( x ( k ) ) ∂ ∂xi f ( x ( k ) ) + 1 2 σ2 D∑ i=1 ∂2 ∂x2i f ( x ( k ) ) ) then at time point tm , the Wasserstein distance between p̂ ( · , tm ) and p̃ ( · , tm ) can be approximated by : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tm ) − 1 N N∑ k=1 f ( x̂ ( k ) tm−1 ) − ∆t 2 ( F f ( X̂m−1 ) + F f ( X̃m ) ) Here { x̂ ( k ) tm−1 } ∼ p̂ ( · , tm−1 ) , { x̂ ( k ) tm } ∼ p̂ ( · , tm ) and we denote X̂m−1 = { x̂ ( 1 ) tm−1 , ... , x̂ ( N ) tm−1 } , X̃m = { x̃ ( 1 ) tm , ... , x̃ ( N ) tm } , where each x̃ ( k ) tm is computed by Euler-Maruyama scheme ( 6 ) . 2.3 Wasserstein Distance on Time Series In real cases , it is not realistic to observe the data at arbitrary two consecutive time nodes , especially when ∆t is small . To make our model more flexible , we should extend our formulation so that we are able to plug in observed data at arbitrary time points . To be more precise , suppose we observe data set X̂tn = { x̂ ( 1 ) tn , ... , x̂ ( N ) tn } at J + 1 different time points t0 , t1 , ... , tJ . And we denote the generated data set as X̃tn = { x̃ ( 1 ) tn , ... , x̃ ( N ) tn } , here each x̃ ( · ) tn is derived from the n-step Euler-Maruyama scheme : x̃t j = x̃t j−1 + gω ( x̃t j−1 ) ∆t + σ √ ∆tz , with z ∼ N ( 0 , I ) 0 ≤ j ≤ n , x̃t0 ∼ p̂ ( · , t0 ) ( 7 ) Let us denote p̃ ( · , t ) as the solution to FPE ( 1 ) with g replaced by gω and with initial condition p̃ ( · , t0 ) = p̂ ( · , t0 ) , then the approximation formula for evaluating the Wasserstein distance W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) is provided in the following proposition : Proposition 2 . Suppose we keep all the notations defined as above , then we have the approximation : W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tn ) − 1 N N∑ k=1 f ( x̂ ( k ) t0 ) − ∆t 2 ( F f ( X̂0 ) + F f ( X̃n ) + 2 n−1∑ s=1 F f ( X̃s ) ) Minimizing the Objective Function : Based on Proposition 2 , we obtain objective function by summing up the accumulated Wasserstein distances among J observations along the time axis . Thus , our ultimate goal is to minimize the following objection function : min gω J∑ n=1 sup ‖∇ fn‖≤1 1N N∑ k=1 fn ( x̂ ( k ) tn ) − 1 N N∑ k=1 fn ( x̂ ( k ) t0 ) − ∆t 2 ( F fn ( X̂0 ) + F fn ( X̃n ) + 2 n−1∑ s=1 F fn ( X̃s ) ) Notice that since we have observations on J distinct time points ( despite the initial point ) , for each time point we compute Wasserstein distance with the help of the dual function fn , thus we will involve J test functions in total . In our actual implementation , we will choose these dual functions as neural networks . We call our algorithm Fokker Planck Process ( FPP ) , the entire procedure is shown in Algorithm 1 . We also provide an error analysis in Appendix . 3 Experiments In this section , we evaluate our model on various synthetic and realistic data sets by employing Algorithm 1 . We generate samples x̃t and make all predictions base on Equation ( 6 ) starting with x̂0 . Baselines : We compare our model with two recently proposed methods . One model ( NN ) adopts recurrent neural network ( RNN ) to learn dynamics directly from observations of aggregate data ( Hashimoto et al. , 2016 ) . The other one model ( LEGEND ) learns dynamics in a HMM framework ( Wang et al. , 2018 ) . The baselines in our experiments are two typical representatives that have stateof-the-art performance on learning aggregate data . Furthermore , though we simulate the evolving process of the data as a SDE , which is on the same track with NN , as mentioned before , NN trains its RNN via optimizing Sinkhorn distance ( Cuturi , 2013 ) , our model starts with a view of weak form of PDE , focuses more on WGAN framework and easier computation . Algorithm 1 Fokker Planck Process Algorithm Require : Initialize fθn ( 1 ≤ n ≤ J ) , gω Require : Set fn as the inner loop learning rate for fθn and g as the outer loop learning rate for gω 1 : for # training iterations do 2 : for k steps do 3 : for observed time ts in { t1 , ... , tJ } do 4 : Compute the generated data set X̃ts from Euler-Maruyama scheme ( 7 ) for 1 ≤ s ≤ J 5 : Acquire data sets X̂ts = { x̂ ( 1 ) ts , ... , x̂ ( N ) ts } from real distribution p̂ ( · , ts ) for 1 ≤ s ≤ J 6 : end for 7 : For each dual function fθn , compute : 8 : Fn = F fθn ( X̂t0 ) + F fθn ( X̃tn ) + 2 ∑n−1 s=1 F fθn ( X̃ts ) 9 : Update each fθn by θn ← θn + fn∇θ ( 1 N ∑N k=1 fθn ( x̂ ( k ) tn ) − 1 N ∑N k=1 fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) 10 : end for 11 : Update gω by ω← ω − g∇ω ( ∑J n=1 ( 1 N fθn ( x̂ ( k ) tn ) − 1 N fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) ) 12 : end for 3.1 Synthetic Data We first evaluate our model on three synthetic data sets which are generated by three artificial dynamics : Synthetic-1 , Synthetic-2 and Synthetic-3 . Experiment Setup : In all synthetic data experiments , we set the drift term g and the discriminator f as two simple fully-connected networks . The g network has one hidden layer and the f network has three hidden layers . Each layer has 32 nodes for both g and f . The only one activation function we choose is Tanh . Notice that since we need to calculate ∂ 2 f ∂x2 , the activation function of f must be twice differentiable to avoid loss of weight gradient . In terms of training process , we use the Adam optimizer ( Kingma & Ba , 2014 ) with learning rate 10−4 . Furthermore , we use spectral normalization to realize ‖∇ f ‖ ≤ 1 ( Miyato et al. , 2018 ) . We initialize the weights with Xavier initialization ( Glorot & Bengio , 2010 ) and train our model by Algorithm 1 .
The paper is about an interesting setting, where observations correspond to lots of individuals evolving over time. The twist is that individual identifiers are not available. Thus from one time point to the next, the observer does not know which individual is which. The problem is to learn a time series model from this, and models considered here are in the form of an SDE.
SP:181689080f5bce74c54b4c18f759ba61211ee583
Learning Stochastic Behaviour from Aggregate Data
1 Introduction In the context of a dynamic system , Aggregate data refers to the data sets that full trajectory of each individual is not available , meaning that there is no known individual level correspondence . Typical examples include data sets collected for DNA evolution , social gathering , density in control problems , bird migration during which it is impossible to identify individual bird , and many more . In those applications , some observed individuals at one time point may be unobserved at the next time spot , or when the individual identities are blocked or unavailable due to various technical and ethical reasons . Rather than inferring the exact information for each individual , the main objective of learning dynamics in aggregate data is to recover and predict the evolution of distribution of all individuals together . Trajectory data , in contrast , is a kind of data that we are able to acquire the information of each individual all the time , although some studies considered the case that some individual trajectories are partially missing . However , the identities of those individuals , whenever they are observable , is always assumed available . For example , stock price , weather , customer behaviors and most training data sets for computer vision and natural language processing . There are many popular models to learn dynamics of full-trajectory data . Typical ones include Hidden Markov Model ( HMM ) ( Alshamaa et al. , 2019 ; Eddy , 1996 ) , Kalman Filter ( KF ) ( Farahi & Yazdi , 2020 ; Harvey , 1990 ; Kalman , 1960 ) and Particle Filter ( PF ) ( Santos et al. , 2019 ; Djuric et al. , 2003 ) , as well as the models built upon HMM , KF and PF ( Deriche et al. , 2020 ; Fang et al. , 2019 ; Hefny et al. , 2015 ; Langford et al. , 2009 ) , they all require full trajectories of each individual , which may not be applicable in the aggregate data situations . On the other side , only a few methods are focused on aggregated data in the recent learning literature . In the work of Hashimoto et al . ( 2016 ) , authors assumed that the hidden dynamic of particles follows a stochastic differential equation ( SDE ) , in particular , they use a recurrent neural network to parameterize the drift term . Furthermore , Wang et al . ( 2018 ) improved traditional HMM model by using an SDE to describe the evolving process of hidden states . To the best of our knowledge , there is no method directly learning the evolution of the density of objects from aggregate data yet . We propose to learn the dynamics of density through the weak form of Fokker Planck Equation ( FPE ) , which is a parabolic partial differential equation ( PDE ) governing many dynamical systems subject to random noise perturbations , including the typical SDE models in existing studies . Our learning is accomplished by minimizing the Wasserstein distance between predicted distribution given by FPE and the empirical distribution from data samples . Meanwhile we utilize neural networks to handle higher dimensional cases . More importantly , by leveraging the framework of Wasserstein Generative Adversarial Network ( WGAN ) ( Arjovsky et al. , 2017 ) , our model is capable of approximating the distribution of samples at different time points without solving the SDE or FPE . More specifically , we treat the drift coefficient , the goal of learning , in the FPE as a generator , and the test function in the weak form of FPE as a discriminator . In other words , our method can also be regarded as a data-driven method to estimate transport coefficient in FPE , which corresponds to the drift terms in SDEs . Additionally , though we treat diffusion term as a constant in our model , it is straightforward to generalize it to be a neural network as well , which can be an extension of this work . We would like to mention that several methods of solving SDE and FPE ( Weinan et al. , 2017 ; Beck et al. , 2018 ; Li et al. , 2019 ) adopt opposite ways to our method , they utilize neural networks to estimate the distribution P ( x , t ) with given drift and diffusion terms . In conclusion , our contributions are : • We design an algorithm that is able to recover the density evolution of nonlinear dynamics via minimizing the Wasserstein discrepancy between real aggregate data and our generated data . • By leveraging the weak form of FPE , we are able to compute the Wasserstein distance directly without solving the FPE . • Finally , we demonstrate the accuracy and the effectiveness of our algorithm by several synthetic and real-world examples . 2 ProposedMethod 2.1 Fokker Planck Equation for the density evolution We assume the individuals evolve in a pattern in the space RD as shown in Figure 1 . One example satisfying such process is the stochastic differential equation ( SDE ) , which is also known as the Itô process ( Øksendal , 2003 ) : dXt = g ( Xt , t ) dt + σdWt . Here dXt represents an infinitesimal change of { Xt } along with time increment dt , g ( · , t ) = ( g1 ( · , t ) , ... , gD ( · , t ) ) T is the drift term ( drifting vector field ) that drives the dynamics of the SDE , σ is the diffusion constant , { Wt } is the standard Brownian Motion . Then the probability density of { Xt } is governed by the Fokker Planck Equation ( FPE ) ( Risken & Caugheyz , 1991 ) , as stated below in Lemma 1 . Lemma 1 . Suppose { Xt } solves the SDE dXt = g ( Xt , t ) dt + σdWt , denote p ( · , t ) as the probability density of the random variableXt . Then p ( x , t ) solves the following equation : ∂p ( x , t ) ∂t = D∑ i=1 − ∂ ∂xi [ gi ( x , t ) p ( x , t ) ] + 1 2 σ2 D∑ i=1 ∂2 ∂xi2 p ( x , t ) ( 1 ) As a linear evolution PDE , FPE describes the evolution of density function of the stochastic process driven by a SDE . Due to this reason , FPE plays a crucial role in stochastic calculus , statistical physics and modeling ( Nelson , 1985 ; Qi & Majda , 2016 ; Risken , 1989 ) . Its importance is also drawing more attention among statistic and machine learning communities ( Liu & Wang , 2016 ; Pavon et al. , 2018 ; Rezende & Mohamed , 2015 ) . In this paper , we utilize the weak form of FPE as a basis to study hidden dynamics of the time evolving aggregated data without solving FPE . Our task can be described as : assume that the individuals evolve with the process indicated by Figure 1 , which can be simulated by Itô process . Then given observations xt along time axis , we aim to recover the drift coefficient g ( x , t ) in FPE , and thus we are able to recover and predict the density evolution of such dynamic . For simplicity we treat g ( x , t ) as a function uncorrelated to time t , namely , g ( x , t ) = g ( x ) . Notice that though evolving process of individuals can be simulated by Itô process , in reality since we lose identity information of individuals , the observed data become aggregate data , thus we need a new way other than traditional methods to study the swarm ’ s distribution . 2.2 Weak Form of Fokker Planck Equation Given FPE stated in Lemma 1 , if we multiply a test function f ∈ H10 ( RD ) on both sides of the FPE , then the integration on both sides leads to : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 − ∂ ∂xi [ gi ( x ) p ( x , t ) ] f ( x ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 p ( x , t ) f ( x ) dx . Then integrating by parts on the right hand side leads to the weak form of FPE : ∫ ∂p ∂t f ( x ) dx = ∫ D∑ i=1 gi ( x ) ∂ ∂xi f ( x ) p ( x , t ) dx + 1 2 σ2 ∫ D∑ i=1 ∂2 ∂xi2 f ( x ) p ( x , t ) dx . where H10 ( R D ) denote the Sobolev space . The first advantage of weak solution is that the solution of a PDE usually requires strong regularity and thus may not exist in the classical sense for a certain group of equations , however , the weak solution has fewer regularity requirements and thus their existence are guaranteed for a much larger classes of equations . The second advantage is that the weak formulation may provide new perspectives for numerically solving PDEs ( Zienkiewicz & Cheung , 1971 ) , ( Sirignano & Spiliopoulos , 2018 ) and ( Zang et al. , 2019 ) etc . Suppose the observed samples at time points tm−1 and tm are following true densities p̂ ( · , tm−1 ) and p̂ ( · , tm ) . Consider the following SDE dX̃t = gω ( X̃t ) dt + σdWt , tm−1 ≤ t ≤ tm X̃ tm−1 ∼ p̂ ( · , tm−1 ) ( 2 ) Here gω is an approximation to the real drift term g , in our research , we treat gω as a neural network with parameters ω . Let us now denote p̃ ( · , t ) as the density of X̃t . Then it is natural to compute and minimize the discrepancy between our approximated density p̃ ( · , tm ) and true density p̂ ( · , tm ) , within this process , we are optimizing gω and thus will recover the true drift term g. In our research , we choose the Wasserstein-1 distance as our discrepancy function ( Villani , 2008 ) ( Arjovsky et al. , 2017 ) . Now we apply Kantorovich-Rubinstein duality ( Villani , 2008 ) , this leads to : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) = sup ‖∇ f ‖≤1 { Exr∼ p̂ ( x , tm ) [ f ( xr ) ] − Exg∼ p̃ ( x , tm ) [ f ( xg ) ] } ( 3 ) The first term Exr∼p̂ ( x , tm ) [ f ( xr ) ] in Equation ( 3 ) can be conveniently computed by Monte-Carlo method since we are already provided with the real data points xr ∼ p̂ ( · , tm ) . To evaluate the second term , we first approximate p̃ ( · , tm ) by trapezoidal rule ( Atkinson , 2008 ) : p̃ ( x , tm ) ≈ p̂ ( x , tm−1 ) + ∆t 2 ( ∂p̃ ( x , tm−1 ) ∂t + ∂p̃ ( x , tm ) ∂t ) here ∆t = tm − tm−1 . ( 4 ) And thus we can compute : Exg∼p̃ ( · , tm ) [ f ( xg ) ] ≈ ∫ f ( x ) p̂ ( x , tm−1 ) dx+ ∆t 2 ( ∫ ∂p̂ ( x , tm−1 ) ∂t f ( x ) dx + ∫ ∂p̃ ( x , tm ) ∂t f ( x ) dx ) ( 5 ) In the above Equation ( 5 ) , the second and the third term on the right-hand side can be reformulated via the weak form of FPE and we are able to derive a computable formulation for W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) . Furthermore , we can use Monte-Carlo method to approximate the expectations in ( 5 ) . the first and the second terms can be directly computed via data points from p̂ ( · , tm−1 ) . For the third term , we need to generate samples from p̃ ( · , tm ) , to achieve this , we apply Euler-Maruyama scheme ( Kloeden & Platen , 2013 ) to SDE ( 2 ) in order to acquire our desired samples x̃tm : x̃tm = x̂tm−1 + gω ( x̂tm−1 ) ∆t + σ √ ∆tz , here z ∼ N ( 0 , I ) , x̂tm−1 ∼ p̂ ( · , tm−1 ) . ( 6 ) Here N ( 0 , I ) is the standard Gaussian distribution on RD . Now we summarize these results in Proposition 1 : Proposition 1 . For a set of points X = { x ( 1 ) , ... , x ( N ) } in RD . We denote : F f ( X ) = 1 N N∑ k=1 ( D∑ i=1 giω ( x ( k ) ) ∂ ∂xi f ( x ( k ) ) + 1 2 σ2 D∑ i=1 ∂2 ∂x2i f ( x ( k ) ) ) then at time point tm , the Wasserstein distance between p̂ ( · , tm ) and p̃ ( · , tm ) can be approximated by : W1 ( p̂ ( · , tm ) , p̃ ( · , tm ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tm ) − 1 N N∑ k=1 f ( x̂ ( k ) tm−1 ) − ∆t 2 ( F f ( X̂m−1 ) + F f ( X̃m ) ) Here { x̂ ( k ) tm−1 } ∼ p̂ ( · , tm−1 ) , { x̂ ( k ) tm } ∼ p̂ ( · , tm ) and we denote X̂m−1 = { x̂ ( 1 ) tm−1 , ... , x̂ ( N ) tm−1 } , X̃m = { x̃ ( 1 ) tm , ... , x̃ ( N ) tm } , where each x̃ ( k ) tm is computed by Euler-Maruyama scheme ( 6 ) . 2.3 Wasserstein Distance on Time Series In real cases , it is not realistic to observe the data at arbitrary two consecutive time nodes , especially when ∆t is small . To make our model more flexible , we should extend our formulation so that we are able to plug in observed data at arbitrary time points . To be more precise , suppose we observe data set X̂tn = { x̂ ( 1 ) tn , ... , x̂ ( N ) tn } at J + 1 different time points t0 , t1 , ... , tJ . And we denote the generated data set as X̃tn = { x̃ ( 1 ) tn , ... , x̃ ( N ) tn } , here each x̃ ( · ) tn is derived from the n-step Euler-Maruyama scheme : x̃t j = x̃t j−1 + gω ( x̃t j−1 ) ∆t + σ √ ∆tz , with z ∼ N ( 0 , I ) 0 ≤ j ≤ n , x̃t0 ∼ p̂ ( · , t0 ) ( 7 ) Let us denote p̃ ( · , t ) as the solution to FPE ( 1 ) with g replaced by gω and with initial condition p̃ ( · , t0 ) = p̂ ( · , t0 ) , then the approximation formula for evaluating the Wasserstein distance W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) is provided in the following proposition : Proposition 2 . Suppose we keep all the notations defined as above , then we have the approximation : W1 ( p̂ ( · , tn ) , p̃ ( · , tn ) ) ≈ sup ‖∇ f ‖≤1 1N N∑ k=1 f ( x̂ ( k ) tn ) − 1 N N∑ k=1 f ( x̂ ( k ) t0 ) − ∆t 2 ( F f ( X̂0 ) + F f ( X̃n ) + 2 n−1∑ s=1 F f ( X̃s ) ) Minimizing the Objective Function : Based on Proposition 2 , we obtain objective function by summing up the accumulated Wasserstein distances among J observations along the time axis . Thus , our ultimate goal is to minimize the following objection function : min gω J∑ n=1 sup ‖∇ fn‖≤1 1N N∑ k=1 fn ( x̂ ( k ) tn ) − 1 N N∑ k=1 fn ( x̂ ( k ) t0 ) − ∆t 2 ( F fn ( X̂0 ) + F fn ( X̃n ) + 2 n−1∑ s=1 F fn ( X̃s ) ) Notice that since we have observations on J distinct time points ( despite the initial point ) , for each time point we compute Wasserstein distance with the help of the dual function fn , thus we will involve J test functions in total . In our actual implementation , we will choose these dual functions as neural networks . We call our algorithm Fokker Planck Process ( FPP ) , the entire procedure is shown in Algorithm 1 . We also provide an error analysis in Appendix . 3 Experiments In this section , we evaluate our model on various synthetic and realistic data sets by employing Algorithm 1 . We generate samples x̃t and make all predictions base on Equation ( 6 ) starting with x̂0 . Baselines : We compare our model with two recently proposed methods . One model ( NN ) adopts recurrent neural network ( RNN ) to learn dynamics directly from observations of aggregate data ( Hashimoto et al. , 2016 ) . The other one model ( LEGEND ) learns dynamics in a HMM framework ( Wang et al. , 2018 ) . The baselines in our experiments are two typical representatives that have stateof-the-art performance on learning aggregate data . Furthermore , though we simulate the evolving process of the data as a SDE , which is on the same track with NN , as mentioned before , NN trains its RNN via optimizing Sinkhorn distance ( Cuturi , 2013 ) , our model starts with a view of weak form of PDE , focuses more on WGAN framework and easier computation . Algorithm 1 Fokker Planck Process Algorithm Require : Initialize fθn ( 1 ≤ n ≤ J ) , gω Require : Set fn as the inner loop learning rate for fθn and g as the outer loop learning rate for gω 1 : for # training iterations do 2 : for k steps do 3 : for observed time ts in { t1 , ... , tJ } do 4 : Compute the generated data set X̃ts from Euler-Maruyama scheme ( 7 ) for 1 ≤ s ≤ J 5 : Acquire data sets X̂ts = { x̂ ( 1 ) ts , ... , x̂ ( N ) ts } from real distribution p̂ ( · , ts ) for 1 ≤ s ≤ J 6 : end for 7 : For each dual function fθn , compute : 8 : Fn = F fθn ( X̂t0 ) + F fθn ( X̃tn ) + 2 ∑n−1 s=1 F fθn ( X̃ts ) 9 : Update each fθn by θn ← θn + fn∇θ ( 1 N ∑N k=1 fθn ( x̂ ( k ) tn ) − 1 N ∑N k=1 fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) 10 : end for 11 : Update gω by ω← ω − g∇ω ( ∑J n=1 ( 1 N fθn ( x̂ ( k ) tn ) − 1 N fθn ( x̂ ( k ) t0 ) − ∆t 2 Fn ) ) 12 : end for 3.1 Synthetic Data We first evaluate our model on three synthetic data sets which are generated by three artificial dynamics : Synthetic-1 , Synthetic-2 and Synthetic-3 . Experiment Setup : In all synthetic data experiments , we set the drift term g and the discriminator f as two simple fully-connected networks . The g network has one hidden layer and the f network has three hidden layers . Each layer has 32 nodes for both g and f . The only one activation function we choose is Tanh . Notice that since we need to calculate ∂ 2 f ∂x2 , the activation function of f must be twice differentiable to avoid loss of weight gradient . In terms of training process , we use the Adam optimizer ( Kingma & Ba , 2014 ) with learning rate 10−4 . Furthermore , we use spectral normalization to realize ‖∇ f ‖ ≤ 1 ( Miyato et al. , 2018 ) . We initialize the weights with Xavier initialization ( Glorot & Bengio , 2010 ) and train our model by Algorithm 1 .
This paper proposes a new approach to learn the dynamics of density evolution of objects from aggregated data. The basic idea is to derive a closed-form Wasserstein distance between the empirical data distribution and the predicted distribution generated from the weak form of Fokker Planck Equation (FPE). Based on this measure, an objective function is developed to learn the underlying drift coefficients and the discriminator simultaneously using neural networks. Some theoretical results are provided and numerical experiments are carried out to illustrate the effectiveness of the proposed method.
SP:181689080f5bce74c54b4c18f759ba61211ee583
Rapid Task-Solving in Novel Environments
1 INTRODUCTION . An ideal AI system would be useful immediately upon deployment in a new environment , and would become more useful as it gained experience there . Consider for example a household robot deployed in a new home . Ideally , the new owner could turn the robot on and ask it to get started , say , by cleaning the bathroom . The robot would use general knowledge about household layouts to find the bathroom and cleaning supplies . As it carried out this task , it would gather information for use in later tasks , noting for example where the clothes hampers are in the rooms it passes . When faced with its next task , say , doing the laundry , it would use its newfound knowledge of the hamper locations to efficiently collect the laundry . Humans make this kind of rapid task-solving in novel environments ( RTS ) look easy ( Lake et al. , 2017 ) , but as yet it remains an aspiration for AI . Prominent deep RL systems display some of the key abilities required , namely , exploration and planning . But , they need many episodes over which to explore ( Ecoffet et al. , 2019 ; Badia et al. , 2020 ) and to learn models for planning ( Schrittwieser et al. , 2019 ) . This is in part because they treat each new environment in isolation , relying on generic exploration and planning algorithms . We propose to overcome this limitation by treating RTS as a meta-reinforcement learning ( RL ) problem , where agents learn exploration policies and planning algorithms from a distribution over RTS challenges . Our contributions are to : 1 . Develop two domains for studying meta-learned RTS : the minimal and interpretable Memory & Planning Game and the scaled-up One-Shot StreetLearn . 2 . Show that previous meta-RL agents fail at RTS because of limitations in their ability to plan using recently gathered information . ∗Equal contribution . 3 . Design a new architecture – the Episodic Planning Network ( EPN ) – that overcomes this limitation , widely outperforming prior agents across both domains . 4 . Show that EPNs learn exploration and planning algorithms that generalize to larger problems than those seen in training . 5 . Demonstrate that EPNs learn a value iteration-like planning algorithm that iteratively propagates information about state-state connectivity outward from the goal state . 2 PROBLEM FORMULATION . Our objective is to build agents that can maximize reward over a sequence of tasks in a novel environment . Our basic approach is to have agents learn to do this through exposure to distributions over multi-task environments . To define such a distribution , we first formalize the notion of an environment e as a 4-tuple ( S , A , Pa , R ) consisting of states , actions , a state-action transition function , and a distribution over reward functions . We then define the notion of a task t in environment e as a Markov decision process ( MDP ) ( S , A , Pa , r ) that results from sampling a reward function r from R. We can now define a framework for learning to solve tasks in novel environments as a simple generalization of the popular meta-RL framework ( Wang et al. , 2017 ; Duan et al. , 2016 ) . In meta-RL , the agent is trained on MDPs ( S , A , Pa , r ) sampled from a task distributionD . In the rapid task-solving in novel environments ( RTS ) paradigm , we instead sample problems by first sampling an environment e from an environment distribution E , then sequentially sampling tasks , i.e . MDPs , from that environment ’ s reward function distribution ( see Figure 1 ) . An agent can be trained for RTS by maximizing the following objective : Ee∼E [ Er∼Re [ Je , r ( θ ) ] ] , where Je , r is the expected reward in environment e with reward function r. When there is only one reward function per environment , the inner expectation disappears and we recover the usual metaRL objective Ee∼E [ Je ( θ ) ] . RTS can be viewed as meta-RL with the added complication that the reward function changes within the inner learning loop . While meta-RL formalizes the problem of learning to learn , RTS formalizes both the problems of learning to learn and learning to plan . To maximize reward while the reward function is constantly changing in non-trivial novel environments , agents must learn to ( 1 ) efficiently explore and effectively encode the information discovered during exploration ( i.e. , learn ) and ( 2 ) use that encoded knowledge to select actions by predicting trajectories it has never experienced ( i.e. , plan1 ) . 3 THE LIMITATIONS OF PRIOR AGENTS . To test whether past deep-RL agents can explore and plan in novel environments , we introduce a minimal problem that isolates the challenges of ( 1 ) exploring and remembering the dynamics of novel environments and ( 2 ) planning over those memories . The problem we propose is a simple variation of the well-known Memory Game2 , wherein players must remember the locations of cards in a grid . The variation we propose , which we call the Memory & Planning Game , extends the challenge to require planning as well as remembering ( see Figure 2 ) . In the Memory & Planning Game , the agent occupies an environment consisting of a grid of symbols ( 4×4 ) . The observation consists of two symbols – one which corresponds to the agent ’ s current location , and another that corresponds to the ” goal ” the agent is tasked with navigating to . The agent can not see its relative location with respect to other symbols in the grid . At each step the agent selects one of 5 possible actions : move left , move right , move up , move down , and collect . If the agent chooses the ” collect ” action when its current location symbol matches the goal symbol , a reward of 1 is received . Otherwise , the agent receives a reward of 0 . At the beginning of each episode , a new set of symbols is sampled , effectively inducing a new transition function . The agent is allowed a fixed number of steps ( 100 ) per episode to ” collect ” as many goals as possible . Each time the agent collects a goal – which corresponds to completing a task – , a new goal is sampled in and the transition function stays fixed . 1Following Sutton & Barto ( 1998 ) , we refer to the ability to choose actions based on predictions of not-yetexperienced events as “ planning ” . A successful agent will ( 1 ) efficiently explore the grid to discover the current set of symbols and their connectivity and ( 2 ) plan shortest paths to goal symbol if it has seen ( or can infer ) all of the transitions it needs to connect its current location and the current goal location . This setup supplies a minimal case of the RTS problem : at the beginning of each episode the agent faces a new transition structure ( S , A , Pa ) and must solve the current task while finding information that will be useful for solving future tasks on that same transition structure . In subsequent tasks , the agent must use its stored knowledge of the current grid ’ s connectivity to plan shortest paths . In this symbolic domain , we find evidence that previous agents learn to explore but not to plan . Specifically , they match the within-trial planning optimum ; that is , a strategy that explores optimally within each task , but forgets everything about the current environment when the task ends ( Figure 2 ) . We hypothesize that this failure is the result of the limited expressiveness of past architectures ’ mechanisms for processing retrieved memories . We designed Episodic Planning Networks to overcome this limitation . 4 EPISODIC PLANNING NETWORKS . Past episodic memory agents used their memory stores by querying the memories , summing the retrieved slots , then projecting the result through a multi-layered perceptron ( MLP ) ( Fortunato et al. , 2019 ; Wayne et al. , 2018 ) . We hypothesize that these agents fail to plan because the weighted sum of retrieved slots is not sufficiently representationally expressive , and the MLP is not , on its own , sufficiently computationally expressive to support planning in non-trivial environments . To test this hypothesis , we replace the weighted sum and MLP with an an iterative self-attention-based architecture designed to support implicit planning . The architecture , which we call the Episodic Planning Network ( EPN , see Figure 1b ) consists of three main components : ( 1 ) an episodic memory which reflects the agent ’ s experience in the episode so far ; ( 2 ) an iterative self-attention module that operates over memories , followed by a pooling operation ( we will refer to this component as the planner ) ; and ( 3 ) a policy network . Episodic memory – At each timestep , we start by appending the embedding of the current goal to each slot in the episodic memory . The result is passed as input to the planner . We then add a new 2In a striking parallel , the Memory Game played a key role in the development of memory abilities in early episodic memory deep-RL agents ( Wayne et al. , 2018 ) . memory to the episodic memory , which represents that timestep ’ s transition : it is the concatenation of embeddings of the current observation , the previous action , and the previous observation . Planner – A self-attention-based update function is applied over the memories to produce a processed representation of the agent ’ s past experience in the episode and reflecting the agent ’ s belief about the environment . This self-attention operation is iterated some number of times , sharing parameters across iterations . The current state is appended to each element resulting from the selfattention , each of which is then passed through a shared MLP . The resulting vectors are aggregated by a feature-wise max operation . Note that the self-attention ( SA ) does not have access to the current state until the very end – it does all of its updates with access only to the goal state and episodic memories . This design reflects the intuition that the SA function might learn to compute something like a value map , which represents the distance to goal from all states in memory . If the final SA state does in fact come to represent such a value map , then a simple MLP should be sufficient to compute the action that , from the current state , leads to the nearest/highest value state with respect to the goal . We find in Section 5 , Figure 4 evidence that the final SA state comes in fact to resemble an iteratively improved value map . The specific self-attention update function we used was : Bi+1 = f ( Bi + φ ( Bi ) ) φ ( x ) = MHA ( LayerNorm ( x ) ) where MHA is the multi-head dot-product attention described by Vaswani et al . ( 2017 ) . Layer normalization was applied to the inputs of each iteration , and residual connections were added around the multi-head attention operation.3 In our experiments , f was a ReLU followed by a 2-layer MLP shared across rows . Policy network – A 2-layer multi-layer perceptron ( MLP ) was applied to the output of the planner to produce policy logits and a baseline . When using pixel inputs , embeddings of the observations were produced by a 3-layer convolutional neural network . We trained all agents to optimize an actor-critic objective function using IMPALA , a framework for distributed RL training ( Espeholt et al. , 2018 ) . For further details , please refer to the Supplemental Material . Our results show that the EPN succeeds in both exploration and planning in the Memory & Planning Game . It matches the shortest-path optimum after only a few tasks in a novel environment ( Figure 2c ) , and its exploration and planning performance closely matches the performance of a hand-coded agent which combines a strong exploration strategy – avoiding visiting the same state twice – with an optimal planning policy ( Figure 2d , e ) . For these results and the ones we will present in the following section , all of the episodic memories attend to all of the others . This update function scales quadratically with the number of memories ( and the number of steps per episode ) . In the Supplemental Material we present results showing that we recover 92 % of the performance using a variant of the update function that scales linearly with the size of the memory ( see Figure 5 in the Suppl . Material ) .
The authors present the challenge of rapid task-solving (RTS), where the goal is to solve a series of tasks as quickly as possible in a new, shared environment. This challenge requires both memory and planning capabilities from an agent, and the authors demonstrate that current SOTA modern deep RL agents with memory components still fail at this challenge. The authors instead propose “episodic planning networks” (EPNs), which contain architectural changes that allow for better long-term planning, and demonstrate their success on two challenges: a memory & planning game, and a navigation task from Street View images. Finally, the authors demonstrate that their proposed EPNs intuitively learn a planning algorithm similar to BFS, hinting at their generalization ability.
SP:97da780fb0c3a770d3a37d9a183dc8b1b4ba1bd0
Rapid Task-Solving in Novel Environments
1 INTRODUCTION . An ideal AI system would be useful immediately upon deployment in a new environment , and would become more useful as it gained experience there . Consider for example a household robot deployed in a new home . Ideally , the new owner could turn the robot on and ask it to get started , say , by cleaning the bathroom . The robot would use general knowledge about household layouts to find the bathroom and cleaning supplies . As it carried out this task , it would gather information for use in later tasks , noting for example where the clothes hampers are in the rooms it passes . When faced with its next task , say , doing the laundry , it would use its newfound knowledge of the hamper locations to efficiently collect the laundry . Humans make this kind of rapid task-solving in novel environments ( RTS ) look easy ( Lake et al. , 2017 ) , but as yet it remains an aspiration for AI . Prominent deep RL systems display some of the key abilities required , namely , exploration and planning . But , they need many episodes over which to explore ( Ecoffet et al. , 2019 ; Badia et al. , 2020 ) and to learn models for planning ( Schrittwieser et al. , 2019 ) . This is in part because they treat each new environment in isolation , relying on generic exploration and planning algorithms . We propose to overcome this limitation by treating RTS as a meta-reinforcement learning ( RL ) problem , where agents learn exploration policies and planning algorithms from a distribution over RTS challenges . Our contributions are to : 1 . Develop two domains for studying meta-learned RTS : the minimal and interpretable Memory & Planning Game and the scaled-up One-Shot StreetLearn . 2 . Show that previous meta-RL agents fail at RTS because of limitations in their ability to plan using recently gathered information . ∗Equal contribution . 3 . Design a new architecture – the Episodic Planning Network ( EPN ) – that overcomes this limitation , widely outperforming prior agents across both domains . 4 . Show that EPNs learn exploration and planning algorithms that generalize to larger problems than those seen in training . 5 . Demonstrate that EPNs learn a value iteration-like planning algorithm that iteratively propagates information about state-state connectivity outward from the goal state . 2 PROBLEM FORMULATION . Our objective is to build agents that can maximize reward over a sequence of tasks in a novel environment . Our basic approach is to have agents learn to do this through exposure to distributions over multi-task environments . To define such a distribution , we first formalize the notion of an environment e as a 4-tuple ( S , A , Pa , R ) consisting of states , actions , a state-action transition function , and a distribution over reward functions . We then define the notion of a task t in environment e as a Markov decision process ( MDP ) ( S , A , Pa , r ) that results from sampling a reward function r from R. We can now define a framework for learning to solve tasks in novel environments as a simple generalization of the popular meta-RL framework ( Wang et al. , 2017 ; Duan et al. , 2016 ) . In meta-RL , the agent is trained on MDPs ( S , A , Pa , r ) sampled from a task distributionD . In the rapid task-solving in novel environments ( RTS ) paradigm , we instead sample problems by first sampling an environment e from an environment distribution E , then sequentially sampling tasks , i.e . MDPs , from that environment ’ s reward function distribution ( see Figure 1 ) . An agent can be trained for RTS by maximizing the following objective : Ee∼E [ Er∼Re [ Je , r ( θ ) ] ] , where Je , r is the expected reward in environment e with reward function r. When there is only one reward function per environment , the inner expectation disappears and we recover the usual metaRL objective Ee∼E [ Je ( θ ) ] . RTS can be viewed as meta-RL with the added complication that the reward function changes within the inner learning loop . While meta-RL formalizes the problem of learning to learn , RTS formalizes both the problems of learning to learn and learning to plan . To maximize reward while the reward function is constantly changing in non-trivial novel environments , agents must learn to ( 1 ) efficiently explore and effectively encode the information discovered during exploration ( i.e. , learn ) and ( 2 ) use that encoded knowledge to select actions by predicting trajectories it has never experienced ( i.e. , plan1 ) . 3 THE LIMITATIONS OF PRIOR AGENTS . To test whether past deep-RL agents can explore and plan in novel environments , we introduce a minimal problem that isolates the challenges of ( 1 ) exploring and remembering the dynamics of novel environments and ( 2 ) planning over those memories . The problem we propose is a simple variation of the well-known Memory Game2 , wherein players must remember the locations of cards in a grid . The variation we propose , which we call the Memory & Planning Game , extends the challenge to require planning as well as remembering ( see Figure 2 ) . In the Memory & Planning Game , the agent occupies an environment consisting of a grid of symbols ( 4×4 ) . The observation consists of two symbols – one which corresponds to the agent ’ s current location , and another that corresponds to the ” goal ” the agent is tasked with navigating to . The agent can not see its relative location with respect to other symbols in the grid . At each step the agent selects one of 5 possible actions : move left , move right , move up , move down , and collect . If the agent chooses the ” collect ” action when its current location symbol matches the goal symbol , a reward of 1 is received . Otherwise , the agent receives a reward of 0 . At the beginning of each episode , a new set of symbols is sampled , effectively inducing a new transition function . The agent is allowed a fixed number of steps ( 100 ) per episode to ” collect ” as many goals as possible . Each time the agent collects a goal – which corresponds to completing a task – , a new goal is sampled in and the transition function stays fixed . 1Following Sutton & Barto ( 1998 ) , we refer to the ability to choose actions based on predictions of not-yetexperienced events as “ planning ” . A successful agent will ( 1 ) efficiently explore the grid to discover the current set of symbols and their connectivity and ( 2 ) plan shortest paths to goal symbol if it has seen ( or can infer ) all of the transitions it needs to connect its current location and the current goal location . This setup supplies a minimal case of the RTS problem : at the beginning of each episode the agent faces a new transition structure ( S , A , Pa ) and must solve the current task while finding information that will be useful for solving future tasks on that same transition structure . In subsequent tasks , the agent must use its stored knowledge of the current grid ’ s connectivity to plan shortest paths . In this symbolic domain , we find evidence that previous agents learn to explore but not to plan . Specifically , they match the within-trial planning optimum ; that is , a strategy that explores optimally within each task , but forgets everything about the current environment when the task ends ( Figure 2 ) . We hypothesize that this failure is the result of the limited expressiveness of past architectures ’ mechanisms for processing retrieved memories . We designed Episodic Planning Networks to overcome this limitation . 4 EPISODIC PLANNING NETWORKS . Past episodic memory agents used their memory stores by querying the memories , summing the retrieved slots , then projecting the result through a multi-layered perceptron ( MLP ) ( Fortunato et al. , 2019 ; Wayne et al. , 2018 ) . We hypothesize that these agents fail to plan because the weighted sum of retrieved slots is not sufficiently representationally expressive , and the MLP is not , on its own , sufficiently computationally expressive to support planning in non-trivial environments . To test this hypothesis , we replace the weighted sum and MLP with an an iterative self-attention-based architecture designed to support implicit planning . The architecture , which we call the Episodic Planning Network ( EPN , see Figure 1b ) consists of three main components : ( 1 ) an episodic memory which reflects the agent ’ s experience in the episode so far ; ( 2 ) an iterative self-attention module that operates over memories , followed by a pooling operation ( we will refer to this component as the planner ) ; and ( 3 ) a policy network . Episodic memory – At each timestep , we start by appending the embedding of the current goal to each slot in the episodic memory . The result is passed as input to the planner . We then add a new 2In a striking parallel , the Memory Game played a key role in the development of memory abilities in early episodic memory deep-RL agents ( Wayne et al. , 2018 ) . memory to the episodic memory , which represents that timestep ’ s transition : it is the concatenation of embeddings of the current observation , the previous action , and the previous observation . Planner – A self-attention-based update function is applied over the memories to produce a processed representation of the agent ’ s past experience in the episode and reflecting the agent ’ s belief about the environment . This self-attention operation is iterated some number of times , sharing parameters across iterations . The current state is appended to each element resulting from the selfattention , each of which is then passed through a shared MLP . The resulting vectors are aggregated by a feature-wise max operation . Note that the self-attention ( SA ) does not have access to the current state until the very end – it does all of its updates with access only to the goal state and episodic memories . This design reflects the intuition that the SA function might learn to compute something like a value map , which represents the distance to goal from all states in memory . If the final SA state does in fact come to represent such a value map , then a simple MLP should be sufficient to compute the action that , from the current state , leads to the nearest/highest value state with respect to the goal . We find in Section 5 , Figure 4 evidence that the final SA state comes in fact to resemble an iteratively improved value map . The specific self-attention update function we used was : Bi+1 = f ( Bi + φ ( Bi ) ) φ ( x ) = MHA ( LayerNorm ( x ) ) where MHA is the multi-head dot-product attention described by Vaswani et al . ( 2017 ) . Layer normalization was applied to the inputs of each iteration , and residual connections were added around the multi-head attention operation.3 In our experiments , f was a ReLU followed by a 2-layer MLP shared across rows . Policy network – A 2-layer multi-layer perceptron ( MLP ) was applied to the output of the planner to produce policy logits and a baseline . When using pixel inputs , embeddings of the observations were produced by a 3-layer convolutional neural network . We trained all agents to optimize an actor-critic objective function using IMPALA , a framework for distributed RL training ( Espeholt et al. , 2018 ) . For further details , please refer to the Supplemental Material . Our results show that the EPN succeeds in both exploration and planning in the Memory & Planning Game . It matches the shortest-path optimum after only a few tasks in a novel environment ( Figure 2c ) , and its exploration and planning performance closely matches the performance of a hand-coded agent which combines a strong exploration strategy – avoiding visiting the same state twice – with an optimal planning policy ( Figure 2d , e ) . For these results and the ones we will present in the following section , all of the episodic memories attend to all of the others . This update function scales quadratically with the number of memories ( and the number of steps per episode ) . In the Supplemental Material we present results showing that we recover 92 % of the performance using a variant of the update function that scales linearly with the size of the memory ( see Figure 5 in the Suppl . Material ) .
The authors propose a non-parametric memory based on the transformer/self-attention architecture to learn over tasks that require planning from previously experienced tasks. They describe this style of learning as a form of meta reinforcement learning where individual episodes are a collection of tasks in the same environment and individual environments are sampled from a 'meta' environment. This is very similar in spirit to the RL-squared framework of Duan et al. 2017.
SP:97da780fb0c3a770d3a37d9a183dc8b1b4ba1bd0
Rapid Task-Solving in Novel Environments
1 INTRODUCTION . An ideal AI system would be useful immediately upon deployment in a new environment , and would become more useful as it gained experience there . Consider for example a household robot deployed in a new home . Ideally , the new owner could turn the robot on and ask it to get started , say , by cleaning the bathroom . The robot would use general knowledge about household layouts to find the bathroom and cleaning supplies . As it carried out this task , it would gather information for use in later tasks , noting for example where the clothes hampers are in the rooms it passes . When faced with its next task , say , doing the laundry , it would use its newfound knowledge of the hamper locations to efficiently collect the laundry . Humans make this kind of rapid task-solving in novel environments ( RTS ) look easy ( Lake et al. , 2017 ) , but as yet it remains an aspiration for AI . Prominent deep RL systems display some of the key abilities required , namely , exploration and planning . But , they need many episodes over which to explore ( Ecoffet et al. , 2019 ; Badia et al. , 2020 ) and to learn models for planning ( Schrittwieser et al. , 2019 ) . This is in part because they treat each new environment in isolation , relying on generic exploration and planning algorithms . We propose to overcome this limitation by treating RTS as a meta-reinforcement learning ( RL ) problem , where agents learn exploration policies and planning algorithms from a distribution over RTS challenges . Our contributions are to : 1 . Develop two domains for studying meta-learned RTS : the minimal and interpretable Memory & Planning Game and the scaled-up One-Shot StreetLearn . 2 . Show that previous meta-RL agents fail at RTS because of limitations in their ability to plan using recently gathered information . ∗Equal contribution . 3 . Design a new architecture – the Episodic Planning Network ( EPN ) – that overcomes this limitation , widely outperforming prior agents across both domains . 4 . Show that EPNs learn exploration and planning algorithms that generalize to larger problems than those seen in training . 5 . Demonstrate that EPNs learn a value iteration-like planning algorithm that iteratively propagates information about state-state connectivity outward from the goal state . 2 PROBLEM FORMULATION . Our objective is to build agents that can maximize reward over a sequence of tasks in a novel environment . Our basic approach is to have agents learn to do this through exposure to distributions over multi-task environments . To define such a distribution , we first formalize the notion of an environment e as a 4-tuple ( S , A , Pa , R ) consisting of states , actions , a state-action transition function , and a distribution over reward functions . We then define the notion of a task t in environment e as a Markov decision process ( MDP ) ( S , A , Pa , r ) that results from sampling a reward function r from R. We can now define a framework for learning to solve tasks in novel environments as a simple generalization of the popular meta-RL framework ( Wang et al. , 2017 ; Duan et al. , 2016 ) . In meta-RL , the agent is trained on MDPs ( S , A , Pa , r ) sampled from a task distributionD . In the rapid task-solving in novel environments ( RTS ) paradigm , we instead sample problems by first sampling an environment e from an environment distribution E , then sequentially sampling tasks , i.e . MDPs , from that environment ’ s reward function distribution ( see Figure 1 ) . An agent can be trained for RTS by maximizing the following objective : Ee∼E [ Er∼Re [ Je , r ( θ ) ] ] , where Je , r is the expected reward in environment e with reward function r. When there is only one reward function per environment , the inner expectation disappears and we recover the usual metaRL objective Ee∼E [ Je ( θ ) ] . RTS can be viewed as meta-RL with the added complication that the reward function changes within the inner learning loop . While meta-RL formalizes the problem of learning to learn , RTS formalizes both the problems of learning to learn and learning to plan . To maximize reward while the reward function is constantly changing in non-trivial novel environments , agents must learn to ( 1 ) efficiently explore and effectively encode the information discovered during exploration ( i.e. , learn ) and ( 2 ) use that encoded knowledge to select actions by predicting trajectories it has never experienced ( i.e. , plan1 ) . 3 THE LIMITATIONS OF PRIOR AGENTS . To test whether past deep-RL agents can explore and plan in novel environments , we introduce a minimal problem that isolates the challenges of ( 1 ) exploring and remembering the dynamics of novel environments and ( 2 ) planning over those memories . The problem we propose is a simple variation of the well-known Memory Game2 , wherein players must remember the locations of cards in a grid . The variation we propose , which we call the Memory & Planning Game , extends the challenge to require planning as well as remembering ( see Figure 2 ) . In the Memory & Planning Game , the agent occupies an environment consisting of a grid of symbols ( 4×4 ) . The observation consists of two symbols – one which corresponds to the agent ’ s current location , and another that corresponds to the ” goal ” the agent is tasked with navigating to . The agent can not see its relative location with respect to other symbols in the grid . At each step the agent selects one of 5 possible actions : move left , move right , move up , move down , and collect . If the agent chooses the ” collect ” action when its current location symbol matches the goal symbol , a reward of 1 is received . Otherwise , the agent receives a reward of 0 . At the beginning of each episode , a new set of symbols is sampled , effectively inducing a new transition function . The agent is allowed a fixed number of steps ( 100 ) per episode to ” collect ” as many goals as possible . Each time the agent collects a goal – which corresponds to completing a task – , a new goal is sampled in and the transition function stays fixed . 1Following Sutton & Barto ( 1998 ) , we refer to the ability to choose actions based on predictions of not-yetexperienced events as “ planning ” . A successful agent will ( 1 ) efficiently explore the grid to discover the current set of symbols and their connectivity and ( 2 ) plan shortest paths to goal symbol if it has seen ( or can infer ) all of the transitions it needs to connect its current location and the current goal location . This setup supplies a minimal case of the RTS problem : at the beginning of each episode the agent faces a new transition structure ( S , A , Pa ) and must solve the current task while finding information that will be useful for solving future tasks on that same transition structure . In subsequent tasks , the agent must use its stored knowledge of the current grid ’ s connectivity to plan shortest paths . In this symbolic domain , we find evidence that previous agents learn to explore but not to plan . Specifically , they match the within-trial planning optimum ; that is , a strategy that explores optimally within each task , but forgets everything about the current environment when the task ends ( Figure 2 ) . We hypothesize that this failure is the result of the limited expressiveness of past architectures ’ mechanisms for processing retrieved memories . We designed Episodic Planning Networks to overcome this limitation . 4 EPISODIC PLANNING NETWORKS . Past episodic memory agents used their memory stores by querying the memories , summing the retrieved slots , then projecting the result through a multi-layered perceptron ( MLP ) ( Fortunato et al. , 2019 ; Wayne et al. , 2018 ) . We hypothesize that these agents fail to plan because the weighted sum of retrieved slots is not sufficiently representationally expressive , and the MLP is not , on its own , sufficiently computationally expressive to support planning in non-trivial environments . To test this hypothesis , we replace the weighted sum and MLP with an an iterative self-attention-based architecture designed to support implicit planning . The architecture , which we call the Episodic Planning Network ( EPN , see Figure 1b ) consists of three main components : ( 1 ) an episodic memory which reflects the agent ’ s experience in the episode so far ; ( 2 ) an iterative self-attention module that operates over memories , followed by a pooling operation ( we will refer to this component as the planner ) ; and ( 3 ) a policy network . Episodic memory – At each timestep , we start by appending the embedding of the current goal to each slot in the episodic memory . The result is passed as input to the planner . We then add a new 2In a striking parallel , the Memory Game played a key role in the development of memory abilities in early episodic memory deep-RL agents ( Wayne et al. , 2018 ) . memory to the episodic memory , which represents that timestep ’ s transition : it is the concatenation of embeddings of the current observation , the previous action , and the previous observation . Planner – A self-attention-based update function is applied over the memories to produce a processed representation of the agent ’ s past experience in the episode and reflecting the agent ’ s belief about the environment . This self-attention operation is iterated some number of times , sharing parameters across iterations . The current state is appended to each element resulting from the selfattention , each of which is then passed through a shared MLP . The resulting vectors are aggregated by a feature-wise max operation . Note that the self-attention ( SA ) does not have access to the current state until the very end – it does all of its updates with access only to the goal state and episodic memories . This design reflects the intuition that the SA function might learn to compute something like a value map , which represents the distance to goal from all states in memory . If the final SA state does in fact come to represent such a value map , then a simple MLP should be sufficient to compute the action that , from the current state , leads to the nearest/highest value state with respect to the goal . We find in Section 5 , Figure 4 evidence that the final SA state comes in fact to resemble an iteratively improved value map . The specific self-attention update function we used was : Bi+1 = f ( Bi + φ ( Bi ) ) φ ( x ) = MHA ( LayerNorm ( x ) ) where MHA is the multi-head dot-product attention described by Vaswani et al . ( 2017 ) . Layer normalization was applied to the inputs of each iteration , and residual connections were added around the multi-head attention operation.3 In our experiments , f was a ReLU followed by a 2-layer MLP shared across rows . Policy network – A 2-layer multi-layer perceptron ( MLP ) was applied to the output of the planner to produce policy logits and a baseline . When using pixel inputs , embeddings of the observations were produced by a 3-layer convolutional neural network . We trained all agents to optimize an actor-critic objective function using IMPALA , a framework for distributed RL training ( Espeholt et al. , 2018 ) . For further details , please refer to the Supplemental Material . Our results show that the EPN succeeds in both exploration and planning in the Memory & Planning Game . It matches the shortest-path optimum after only a few tasks in a novel environment ( Figure 2c ) , and its exploration and planning performance closely matches the performance of a hand-coded agent which combines a strong exploration strategy – avoiding visiting the same state twice – with an optimal planning policy ( Figure 2d , e ) . For these results and the ones we will present in the following section , all of the episodic memories attend to all of the others . This update function scales quadratically with the number of memories ( and the number of steps per episode ) . In the Supplemental Material we present results showing that we recover 92 % of the performance using a variant of the update function that scales linearly with the size of the memory ( see Figure 5 in the Suppl . Material ) .
The paper proposes 2 new benchmarks for Rapid Task Solving (RTS), that evaluate RL agents on the ability to memorize past experiences and learn to plan to solve new tasks in different environments rapidly. The paper also proposes Episodic Planning Networks (EPN), an RL method that replaces a weighted sum and multi-layer peceptrons in memory networks with self-attention. The proposed EPNs proved to significantly outperform baseline methods with memory and an LSTM method without memory. The paper formulates RTS as an extension of meta-reinforcement learning framework, where in addition to optimizing over a distribution of tasks, the objective is to also optimize over a distribution over environments.
SP:97da780fb0c3a770d3a37d9a183dc8b1b4ba1bd0
Nearest Neighbor Machine Translation
1 INTRODUCTION . Non-parametric methods have recently been successfully applied to tasks such as language modeling ( Khandelwal et al. , 2020 ) and question answering ( Guu et al. , 2020 ; Lewis et al. , 2020 ) . They allow models that are ( 1 ) expressive , because they can use an arbitrary amount of data at test time ; ( 2 ) adaptable , because predictions can be controlled by changing the datastore , and ( 3 ) interpretable , because the data used to make the prediction can be directly inspected . We introduce kNN-MT , a simple non-parametric method for machine translation ( MT ) using nearest neighbor retrieval . kNNMT can be added to any pre-trained neural translation model without further training , and significantly improves performance for in-domain , out-of-domain , and multi-lingual evaluations . More specifically , kNN-MT interpolates the target-token softmax distribution from a neural MT model with a multinomial generated using nearest neighbor search over examples cached in a data store . The cache is over translation contexts ( i.e . the complete source and prefix of the target ) , and is indexed by hidden states computed from the base MT model . We hypothesize that contexts which are close in representation space are more likely to be followed by the same target word . We show this is not only true for the original training data , thereby improving base model performance , but across a range of different bi-text corpora , allowing for simple and effective model adaptation . Our work builds upon recent results showing the effectiveness of nearest neighbor methods in unconditional language models ( Khandelwal et al. , 2020 ) . We generalize to conditional language models , by using both source and target context , and show nearest neighbour models can be effective for generation in addition to density estimation . Compared to prior work on non-parametric methods for MT , our approach is arguably simpler ( in that it requires no training , as compared to Gu et al . ( 2018 ) ) and more expressive ( in that it provides access to billions of key-value pairs during inference , as compared to Zhang et al . ( 2018 ) ; Gu et al . ( 2018 ) ) . Extensive experiments show that kNN-MT scales to datastores containing billions of tokens , improving results across a range of settings . For example , it improves a state-of-the-art GermanEnglish translation model by 1.5 BLEU . kNN-MT can also be used to adapt a single model to ∗Work done while the first author was interning at Facebook AI Research . diverse domains by simply adding a domain-specific datastore—improving results by an average of 9.2 BLEU over the base model out-of-domain , and even outperforming existing models that train on these domains . Finally , language-pair-specific datastores are used to adapt a multilingual model to particular language pairs , with improvements of 3 BLEU for translating English into German and Chinese . We find that retrievals from kNN-MT are typically highly contextually relevant . 2 NEAREST NEIGHBOR MACHINE TRANSLATION . kNN-MT involves augmenting the decoder of a pre-trained machine translation model with a nearest neighbor retrieval mechanism , allowing the model direct access to a datastore of cached examples . The translation is generated word-by-word ; at each time step , we find the most similar contexts in the datastore , and compute a distribution over the corresponding target tokens , as shown in Figure 1 . This distribution is then interpolated with the output distribution from the pre-trained MT model . More specifically , given an input sequence of tokens in a source language s = ( s1 , . . . , sM1 ) , a neural MT model outputs a sequence of tokens t = ( t1 , . . . , tM2 ) in the target language . When using autoregressive decoders , the output distribution for each token ti in the target sequence is conditioned on the entire source sequence as well as the previous target tokens , p ( ti|s , t1 : i−1 ) . Let ( s , t1 : i−1 ) be the translation context and ti be the target token . Datastore creation Our datastore is constructed offline and consists of a set of key-value pairs . The key is a high-dimensional representation of the entire translation context computed by the MT decoder , f ( s , t1 : i−1 ) , where f represents a mapping from input to an intermediate representation of the decoder . The value is the corresponding ground truth target token ti . For a parallel text collection ( S , T ) , the representations are generated by a single forward pass over each example and the complete datastore is defined as follows : ( K , V ) = { ( f ( s , t1 : i−1 ) , ti ) , ∀ti ∈ t | ( s , t ) ∈ ( S , T ) } ( 1 ) Tokens from the source language are not stored directly as values in the datastore . Conditioning on the source is implicit via the keys , and the values are only target language tokens . Generation At test time , given a source x , the model outputs a distribution over the vocabulary pMT ( yi|x , ŷ1 : i−1 ) for the target yi at every step of generation , where ŷ represents the generated tokens . The model also outputs the representation f ( x , ŷ1 : i−1 ) , which is used to query the datastore for the k nearest neighbors N according to squared-L2 distance , d. In practice , the search over billions of key-value pairs is carried out using FAISS ( Johnson et al. , 2017 ) , a library for fast nearest neighbor search in high-dimensional spaces . The retrieved set is converted into a distribution over the vocabulary by applying a softmax with temperature T to the negative distances and aggregating over multiple occurrences of the same vo- cabulary item . Using a temperature greater than one flattens the distribution , and prevents overfitting to the most similar retrievals . pkNN ( yi|x , ŷ1 : i−1 ) ∝ ∑ ( kj , vj ) ∈N 1yi=vj exp ( −d ( kj , f ( x , ŷ1 : i−1 ) ) T ) ( 2 ) While a pure kNN approach is effective , we improve results by interpolating with the base model distribution , which is more robust in cases without relevant cached examples . The model and kNN distributions are interpolated with a tuned parameter λ , resulting in the final kNN-MT distribution : p ( yi|x , ŷ1 : i−1 ) = λ pkNN ( yi|x , ŷ1 : i−1 ) + ( 1− λ ) pMT ( yi|x , ŷ1 : i−1 ) ( 3 ) The complete translation is generated using beam search . kNN-MT vs. kNN-LM kNN-MT is a generalization of kNN-LM applied to conditional sequence generation , with a few important differences . First , the keys are not only conditioned on prior context , but also on the source sequence ( here , in a different language ) . This means that the representations must encode both source and target context ; we show examples in Section 6 . Second , there is an additional tuned parameter , the softmax temperature . Higher temperatures flatten the distribution and allow for greater diversity without overfitting to the retrieved contexts , as shown in Section 6 . 3 EXPERIMENTAL SETUP . We experiment with kNN-MT in three settings : ( 1 ) single language-pair translation , ( 2 ) multilingual MT and ( 3 ) domain adaptation . Data We use the following datasets for training and evaluation . WMT ’ 19 : For the single language-pair experiments , we use WMT ’ 19 data for German-English . CCMATRIX : We train our multilingual model on CCMatrix ( Schwenk et al. , 2019 ) , containing parallel data for 79 languages and 1,546 language pairs . The parallel sentences are mined from cleaned monolingual commoncrawl data created using the ccNet pipeline ( Wenzek et al. , 2019 ) . Semantically similar sentences in different languages are aligned using a learned distance measure ; we use examples where the distance measure is at least 1.06 , resulting in 4 billion sentence-pairs . NEWSTEST : The newstest2018 and newstest2019 test sets from WMT ( Bojar et al. , 2018 ; Barrault et al. , 2019 ) are used as validation and test sets for the multilingual experiments . The same GermanEnglish validation and test sets are also used for evaluation in the single language-pair and domain adaptation experiments . TED TALKS : We use the Ted Talks data prepared by Qi et al . ( 2018 ) for evaluation in the multilingual setting , particularly to explore performance for language pairs that do no include English . MULTI-DOMAINS : We use the multi-domains dataset ( Koehn & Knowles , 2017 ) , re-split by Aharoni & Goldberg ( 2020 ) for the domain adaptation experiments . It includes German-English parallel data for train/validation/test sets in five domains : Medical , Law , IT , Koran and Subtitles . Models For the single language-pair and domain adaptation experiments , we use the WMT ’ 19 German-English news translation task winner ( Ng et al. , 2019 ) , available via the FAIRSEQ library ( Ott et al. , 2019 ) .1 It is a Transformer encoder-decoder model ( Vaswani et al. , 2017 ) with 6 layers , 1,024 dimensional representations , 8,192 dimensional feedforward layers and 8 attention heads . Apart from WMT ’ 19 training data , this model is trained on over 10 billion tokens of backtranslation data and fine-tuned on newstest test sets from years prior to 2018 . In this work , we do not use ensembles or n-best reranking . For multilingual MT , we trained a 418M parameter Transformer-based encoder-decoder model on the CCMatrix data for 100K updates . The model has embedding dimension 1,024 , hidden dimension 4,096 , 12 layers in both the encoder and decoder , with 16 attention heads . To balance the 1https : //github.com/pytorch/fairseq/tree/master/examples/translation training of different language pairs , which have various resource levels , we apply temperature upsampling with T = 5 ( Arivazhagan et al. , 2019 ) . The vocabulary is shared across all languages and consists of 128K subwords extracted using sentencepiece ( Kudo & Richardson , 2018 ) .2 All results use case-sensitive detokenized BLEU , measured using SACREBLEU ( Post , 2018 ) .We provide the SACREBLEU signatures , along with details on the statistical power of our experiments , in Appendix C. kNN-MT In this work , we use a FAISS index to represent the datastore and search for nearest neighbors . The keys are stored in clusters to speed up search and quantized to 64-bytes for space efficiency ( the full-precision keys are discarded ) . The index is constructed offline via a single forward pass over every example in the given parallel text collection . We use the 1024-dimensional representation input to the final layer feedforward network as the key . Building the index involves a training phase to learn the cluster centroids . We use 5M keys for learning 131K cluster centroids for the multilingual experiments , and 1M keys for 4K clusters for in-domain data in the domain adaptation experiments . During inference , we query the datastore for 64 neighbors while searching 32 clusters . The interpolation and softmax temperature parameters are tuned on the validation sets.3 Computational Cost While kNN-MT does not add trainable model parameters , it does add some computational overhead . The primary cost of building the datastore is a single forward pass over all examples in the datastore , which is a fraction of the cost for training on the same examples for one epoch . During inference , retrieving 64 keys from a datastore containing billions of items results in a generation speed that is two orders of magnitude slower than the base MT system . Generation speed can be improved by searching fewer clusters , using smaller beams , or querying smaller datastores , with relatively minor trade-offs in performance , as we will see in Section 5 . Developing faster nearest neighbor search tools remains an active area of research ( Guo et al. , 2020 ) .
The paper is an extension of [1]. The task in [1] is Language Modeling, while this paper is doing machine translation with the similar idea. The authors propose a non-parametric method for machine translation via a k-nearest-neighbor (KNN) classifier. Specifically, it predicts tokens with a KNN classifier over examples cached in a so-called datastore and this method can be applied to any pre-trained neural machine translation model without further training. The experiments show that it improves results across a range of settings (in-domain, out-of-domain, and multi-lingual evaluations).
SP:97f770b52e8757978d650cd8c82c9cff2ea97d78
Nearest Neighbor Machine Translation
1 INTRODUCTION . Non-parametric methods have recently been successfully applied to tasks such as language modeling ( Khandelwal et al. , 2020 ) and question answering ( Guu et al. , 2020 ; Lewis et al. , 2020 ) . They allow models that are ( 1 ) expressive , because they can use an arbitrary amount of data at test time ; ( 2 ) adaptable , because predictions can be controlled by changing the datastore , and ( 3 ) interpretable , because the data used to make the prediction can be directly inspected . We introduce kNN-MT , a simple non-parametric method for machine translation ( MT ) using nearest neighbor retrieval . kNNMT can be added to any pre-trained neural translation model without further training , and significantly improves performance for in-domain , out-of-domain , and multi-lingual evaluations . More specifically , kNN-MT interpolates the target-token softmax distribution from a neural MT model with a multinomial generated using nearest neighbor search over examples cached in a data store . The cache is over translation contexts ( i.e . the complete source and prefix of the target ) , and is indexed by hidden states computed from the base MT model . We hypothesize that contexts which are close in representation space are more likely to be followed by the same target word . We show this is not only true for the original training data , thereby improving base model performance , but across a range of different bi-text corpora , allowing for simple and effective model adaptation . Our work builds upon recent results showing the effectiveness of nearest neighbor methods in unconditional language models ( Khandelwal et al. , 2020 ) . We generalize to conditional language models , by using both source and target context , and show nearest neighbour models can be effective for generation in addition to density estimation . Compared to prior work on non-parametric methods for MT , our approach is arguably simpler ( in that it requires no training , as compared to Gu et al . ( 2018 ) ) and more expressive ( in that it provides access to billions of key-value pairs during inference , as compared to Zhang et al . ( 2018 ) ; Gu et al . ( 2018 ) ) . Extensive experiments show that kNN-MT scales to datastores containing billions of tokens , improving results across a range of settings . For example , it improves a state-of-the-art GermanEnglish translation model by 1.5 BLEU . kNN-MT can also be used to adapt a single model to ∗Work done while the first author was interning at Facebook AI Research . diverse domains by simply adding a domain-specific datastore—improving results by an average of 9.2 BLEU over the base model out-of-domain , and even outperforming existing models that train on these domains . Finally , language-pair-specific datastores are used to adapt a multilingual model to particular language pairs , with improvements of 3 BLEU for translating English into German and Chinese . We find that retrievals from kNN-MT are typically highly contextually relevant . 2 NEAREST NEIGHBOR MACHINE TRANSLATION . kNN-MT involves augmenting the decoder of a pre-trained machine translation model with a nearest neighbor retrieval mechanism , allowing the model direct access to a datastore of cached examples . The translation is generated word-by-word ; at each time step , we find the most similar contexts in the datastore , and compute a distribution over the corresponding target tokens , as shown in Figure 1 . This distribution is then interpolated with the output distribution from the pre-trained MT model . More specifically , given an input sequence of tokens in a source language s = ( s1 , . . . , sM1 ) , a neural MT model outputs a sequence of tokens t = ( t1 , . . . , tM2 ) in the target language . When using autoregressive decoders , the output distribution for each token ti in the target sequence is conditioned on the entire source sequence as well as the previous target tokens , p ( ti|s , t1 : i−1 ) . Let ( s , t1 : i−1 ) be the translation context and ti be the target token . Datastore creation Our datastore is constructed offline and consists of a set of key-value pairs . The key is a high-dimensional representation of the entire translation context computed by the MT decoder , f ( s , t1 : i−1 ) , where f represents a mapping from input to an intermediate representation of the decoder . The value is the corresponding ground truth target token ti . For a parallel text collection ( S , T ) , the representations are generated by a single forward pass over each example and the complete datastore is defined as follows : ( K , V ) = { ( f ( s , t1 : i−1 ) , ti ) , ∀ti ∈ t | ( s , t ) ∈ ( S , T ) } ( 1 ) Tokens from the source language are not stored directly as values in the datastore . Conditioning on the source is implicit via the keys , and the values are only target language tokens . Generation At test time , given a source x , the model outputs a distribution over the vocabulary pMT ( yi|x , ŷ1 : i−1 ) for the target yi at every step of generation , where ŷ represents the generated tokens . The model also outputs the representation f ( x , ŷ1 : i−1 ) , which is used to query the datastore for the k nearest neighbors N according to squared-L2 distance , d. In practice , the search over billions of key-value pairs is carried out using FAISS ( Johnson et al. , 2017 ) , a library for fast nearest neighbor search in high-dimensional spaces . The retrieved set is converted into a distribution over the vocabulary by applying a softmax with temperature T to the negative distances and aggregating over multiple occurrences of the same vo- cabulary item . Using a temperature greater than one flattens the distribution , and prevents overfitting to the most similar retrievals . pkNN ( yi|x , ŷ1 : i−1 ) ∝ ∑ ( kj , vj ) ∈N 1yi=vj exp ( −d ( kj , f ( x , ŷ1 : i−1 ) ) T ) ( 2 ) While a pure kNN approach is effective , we improve results by interpolating with the base model distribution , which is more robust in cases without relevant cached examples . The model and kNN distributions are interpolated with a tuned parameter λ , resulting in the final kNN-MT distribution : p ( yi|x , ŷ1 : i−1 ) = λ pkNN ( yi|x , ŷ1 : i−1 ) + ( 1− λ ) pMT ( yi|x , ŷ1 : i−1 ) ( 3 ) The complete translation is generated using beam search . kNN-MT vs. kNN-LM kNN-MT is a generalization of kNN-LM applied to conditional sequence generation , with a few important differences . First , the keys are not only conditioned on prior context , but also on the source sequence ( here , in a different language ) . This means that the representations must encode both source and target context ; we show examples in Section 6 . Second , there is an additional tuned parameter , the softmax temperature . Higher temperatures flatten the distribution and allow for greater diversity without overfitting to the retrieved contexts , as shown in Section 6 . 3 EXPERIMENTAL SETUP . We experiment with kNN-MT in three settings : ( 1 ) single language-pair translation , ( 2 ) multilingual MT and ( 3 ) domain adaptation . Data We use the following datasets for training and evaluation . WMT ’ 19 : For the single language-pair experiments , we use WMT ’ 19 data for German-English . CCMATRIX : We train our multilingual model on CCMatrix ( Schwenk et al. , 2019 ) , containing parallel data for 79 languages and 1,546 language pairs . The parallel sentences are mined from cleaned monolingual commoncrawl data created using the ccNet pipeline ( Wenzek et al. , 2019 ) . Semantically similar sentences in different languages are aligned using a learned distance measure ; we use examples where the distance measure is at least 1.06 , resulting in 4 billion sentence-pairs . NEWSTEST : The newstest2018 and newstest2019 test sets from WMT ( Bojar et al. , 2018 ; Barrault et al. , 2019 ) are used as validation and test sets for the multilingual experiments . The same GermanEnglish validation and test sets are also used for evaluation in the single language-pair and domain adaptation experiments . TED TALKS : We use the Ted Talks data prepared by Qi et al . ( 2018 ) for evaluation in the multilingual setting , particularly to explore performance for language pairs that do no include English . MULTI-DOMAINS : We use the multi-domains dataset ( Koehn & Knowles , 2017 ) , re-split by Aharoni & Goldberg ( 2020 ) for the domain adaptation experiments . It includes German-English parallel data for train/validation/test sets in five domains : Medical , Law , IT , Koran and Subtitles . Models For the single language-pair and domain adaptation experiments , we use the WMT ’ 19 German-English news translation task winner ( Ng et al. , 2019 ) , available via the FAIRSEQ library ( Ott et al. , 2019 ) .1 It is a Transformer encoder-decoder model ( Vaswani et al. , 2017 ) with 6 layers , 1,024 dimensional representations , 8,192 dimensional feedforward layers and 8 attention heads . Apart from WMT ’ 19 training data , this model is trained on over 10 billion tokens of backtranslation data and fine-tuned on newstest test sets from years prior to 2018 . In this work , we do not use ensembles or n-best reranking . For multilingual MT , we trained a 418M parameter Transformer-based encoder-decoder model on the CCMatrix data for 100K updates . The model has embedding dimension 1,024 , hidden dimension 4,096 , 12 layers in both the encoder and decoder , with 16 attention heads . To balance the 1https : //github.com/pytorch/fairseq/tree/master/examples/translation training of different language pairs , which have various resource levels , we apply temperature upsampling with T = 5 ( Arivazhagan et al. , 2019 ) . The vocabulary is shared across all languages and consists of 128K subwords extracted using sentencepiece ( Kudo & Richardson , 2018 ) .2 All results use case-sensitive detokenized BLEU , measured using SACREBLEU ( Post , 2018 ) .We provide the SACREBLEU signatures , along with details on the statistical power of our experiments , in Appendix C. kNN-MT In this work , we use a FAISS index to represent the datastore and search for nearest neighbors . The keys are stored in clusters to speed up search and quantized to 64-bytes for space efficiency ( the full-precision keys are discarded ) . The index is constructed offline via a single forward pass over every example in the given parallel text collection . We use the 1024-dimensional representation input to the final layer feedforward network as the key . Building the index involves a training phase to learn the cluster centroids . We use 5M keys for learning 131K cluster centroids for the multilingual experiments , and 1M keys for 4K clusters for in-domain data in the domain adaptation experiments . During inference , we query the datastore for 64 neighbors while searching 32 clusters . The interpolation and softmax temperature parameters are tuned on the validation sets.3 Computational Cost While kNN-MT does not add trainable model parameters , it does add some computational overhead . The primary cost of building the datastore is a single forward pass over all examples in the datastore , which is a fraction of the cost for training on the same examples for one epoch . During inference , retrieving 64 keys from a datastore containing billions of items results in a generation speed that is two orders of magnitude slower than the base MT system . Generation speed can be improved by searching fewer clusters , using smaller beams , or querying smaller datastores , with relatively minor trade-offs in performance , as we will see in Section 5 . Developing faster nearest neighbor search tools remains an active area of research ( Guo et al. , 2020 ) .
This submission introduces the kNN-MT approach for neural machine translation, which incorporates the memorize-catching spirit with the nearest neighbor classifier on a large datastore when generating the decoding sentences, together with the neural machine translation model for similarity search. No additional parameters are needed, but the inference cost increases. The authors conduct experiments are different settings, the single language pair translation, the multi-lingual machine translation, and the domain adaption translation. Results show that kNN-MT can easily improve translation performances by searching out related test sentences with non-trivial scores.
SP:97f770b52e8757978d650cd8c82c9cff2ea97d78
Nearest Neighbor Machine Translation
1 INTRODUCTION . Non-parametric methods have recently been successfully applied to tasks such as language modeling ( Khandelwal et al. , 2020 ) and question answering ( Guu et al. , 2020 ; Lewis et al. , 2020 ) . They allow models that are ( 1 ) expressive , because they can use an arbitrary amount of data at test time ; ( 2 ) adaptable , because predictions can be controlled by changing the datastore , and ( 3 ) interpretable , because the data used to make the prediction can be directly inspected . We introduce kNN-MT , a simple non-parametric method for machine translation ( MT ) using nearest neighbor retrieval . kNNMT can be added to any pre-trained neural translation model without further training , and significantly improves performance for in-domain , out-of-domain , and multi-lingual evaluations . More specifically , kNN-MT interpolates the target-token softmax distribution from a neural MT model with a multinomial generated using nearest neighbor search over examples cached in a data store . The cache is over translation contexts ( i.e . the complete source and prefix of the target ) , and is indexed by hidden states computed from the base MT model . We hypothesize that contexts which are close in representation space are more likely to be followed by the same target word . We show this is not only true for the original training data , thereby improving base model performance , but across a range of different bi-text corpora , allowing for simple and effective model adaptation . Our work builds upon recent results showing the effectiveness of nearest neighbor methods in unconditional language models ( Khandelwal et al. , 2020 ) . We generalize to conditional language models , by using both source and target context , and show nearest neighbour models can be effective for generation in addition to density estimation . Compared to prior work on non-parametric methods for MT , our approach is arguably simpler ( in that it requires no training , as compared to Gu et al . ( 2018 ) ) and more expressive ( in that it provides access to billions of key-value pairs during inference , as compared to Zhang et al . ( 2018 ) ; Gu et al . ( 2018 ) ) . Extensive experiments show that kNN-MT scales to datastores containing billions of tokens , improving results across a range of settings . For example , it improves a state-of-the-art GermanEnglish translation model by 1.5 BLEU . kNN-MT can also be used to adapt a single model to ∗Work done while the first author was interning at Facebook AI Research . diverse domains by simply adding a domain-specific datastore—improving results by an average of 9.2 BLEU over the base model out-of-domain , and even outperforming existing models that train on these domains . Finally , language-pair-specific datastores are used to adapt a multilingual model to particular language pairs , with improvements of 3 BLEU for translating English into German and Chinese . We find that retrievals from kNN-MT are typically highly contextually relevant . 2 NEAREST NEIGHBOR MACHINE TRANSLATION . kNN-MT involves augmenting the decoder of a pre-trained machine translation model with a nearest neighbor retrieval mechanism , allowing the model direct access to a datastore of cached examples . The translation is generated word-by-word ; at each time step , we find the most similar contexts in the datastore , and compute a distribution over the corresponding target tokens , as shown in Figure 1 . This distribution is then interpolated with the output distribution from the pre-trained MT model . More specifically , given an input sequence of tokens in a source language s = ( s1 , . . . , sM1 ) , a neural MT model outputs a sequence of tokens t = ( t1 , . . . , tM2 ) in the target language . When using autoregressive decoders , the output distribution for each token ti in the target sequence is conditioned on the entire source sequence as well as the previous target tokens , p ( ti|s , t1 : i−1 ) . Let ( s , t1 : i−1 ) be the translation context and ti be the target token . Datastore creation Our datastore is constructed offline and consists of a set of key-value pairs . The key is a high-dimensional representation of the entire translation context computed by the MT decoder , f ( s , t1 : i−1 ) , where f represents a mapping from input to an intermediate representation of the decoder . The value is the corresponding ground truth target token ti . For a parallel text collection ( S , T ) , the representations are generated by a single forward pass over each example and the complete datastore is defined as follows : ( K , V ) = { ( f ( s , t1 : i−1 ) , ti ) , ∀ti ∈ t | ( s , t ) ∈ ( S , T ) } ( 1 ) Tokens from the source language are not stored directly as values in the datastore . Conditioning on the source is implicit via the keys , and the values are only target language tokens . Generation At test time , given a source x , the model outputs a distribution over the vocabulary pMT ( yi|x , ŷ1 : i−1 ) for the target yi at every step of generation , where ŷ represents the generated tokens . The model also outputs the representation f ( x , ŷ1 : i−1 ) , which is used to query the datastore for the k nearest neighbors N according to squared-L2 distance , d. In practice , the search over billions of key-value pairs is carried out using FAISS ( Johnson et al. , 2017 ) , a library for fast nearest neighbor search in high-dimensional spaces . The retrieved set is converted into a distribution over the vocabulary by applying a softmax with temperature T to the negative distances and aggregating over multiple occurrences of the same vo- cabulary item . Using a temperature greater than one flattens the distribution , and prevents overfitting to the most similar retrievals . pkNN ( yi|x , ŷ1 : i−1 ) ∝ ∑ ( kj , vj ) ∈N 1yi=vj exp ( −d ( kj , f ( x , ŷ1 : i−1 ) ) T ) ( 2 ) While a pure kNN approach is effective , we improve results by interpolating with the base model distribution , which is more robust in cases without relevant cached examples . The model and kNN distributions are interpolated with a tuned parameter λ , resulting in the final kNN-MT distribution : p ( yi|x , ŷ1 : i−1 ) = λ pkNN ( yi|x , ŷ1 : i−1 ) + ( 1− λ ) pMT ( yi|x , ŷ1 : i−1 ) ( 3 ) The complete translation is generated using beam search . kNN-MT vs. kNN-LM kNN-MT is a generalization of kNN-LM applied to conditional sequence generation , with a few important differences . First , the keys are not only conditioned on prior context , but also on the source sequence ( here , in a different language ) . This means that the representations must encode both source and target context ; we show examples in Section 6 . Second , there is an additional tuned parameter , the softmax temperature . Higher temperatures flatten the distribution and allow for greater diversity without overfitting to the retrieved contexts , as shown in Section 6 . 3 EXPERIMENTAL SETUP . We experiment with kNN-MT in three settings : ( 1 ) single language-pair translation , ( 2 ) multilingual MT and ( 3 ) domain adaptation . Data We use the following datasets for training and evaluation . WMT ’ 19 : For the single language-pair experiments , we use WMT ’ 19 data for German-English . CCMATRIX : We train our multilingual model on CCMatrix ( Schwenk et al. , 2019 ) , containing parallel data for 79 languages and 1,546 language pairs . The parallel sentences are mined from cleaned monolingual commoncrawl data created using the ccNet pipeline ( Wenzek et al. , 2019 ) . Semantically similar sentences in different languages are aligned using a learned distance measure ; we use examples where the distance measure is at least 1.06 , resulting in 4 billion sentence-pairs . NEWSTEST : The newstest2018 and newstest2019 test sets from WMT ( Bojar et al. , 2018 ; Barrault et al. , 2019 ) are used as validation and test sets for the multilingual experiments . The same GermanEnglish validation and test sets are also used for evaluation in the single language-pair and domain adaptation experiments . TED TALKS : We use the Ted Talks data prepared by Qi et al . ( 2018 ) for evaluation in the multilingual setting , particularly to explore performance for language pairs that do no include English . MULTI-DOMAINS : We use the multi-domains dataset ( Koehn & Knowles , 2017 ) , re-split by Aharoni & Goldberg ( 2020 ) for the domain adaptation experiments . It includes German-English parallel data for train/validation/test sets in five domains : Medical , Law , IT , Koran and Subtitles . Models For the single language-pair and domain adaptation experiments , we use the WMT ’ 19 German-English news translation task winner ( Ng et al. , 2019 ) , available via the FAIRSEQ library ( Ott et al. , 2019 ) .1 It is a Transformer encoder-decoder model ( Vaswani et al. , 2017 ) with 6 layers , 1,024 dimensional representations , 8,192 dimensional feedforward layers and 8 attention heads . Apart from WMT ’ 19 training data , this model is trained on over 10 billion tokens of backtranslation data and fine-tuned on newstest test sets from years prior to 2018 . In this work , we do not use ensembles or n-best reranking . For multilingual MT , we trained a 418M parameter Transformer-based encoder-decoder model on the CCMatrix data for 100K updates . The model has embedding dimension 1,024 , hidden dimension 4,096 , 12 layers in both the encoder and decoder , with 16 attention heads . To balance the 1https : //github.com/pytorch/fairseq/tree/master/examples/translation training of different language pairs , which have various resource levels , we apply temperature upsampling with T = 5 ( Arivazhagan et al. , 2019 ) . The vocabulary is shared across all languages and consists of 128K subwords extracted using sentencepiece ( Kudo & Richardson , 2018 ) .2 All results use case-sensitive detokenized BLEU , measured using SACREBLEU ( Post , 2018 ) .We provide the SACREBLEU signatures , along with details on the statistical power of our experiments , in Appendix C. kNN-MT In this work , we use a FAISS index to represent the datastore and search for nearest neighbors . The keys are stored in clusters to speed up search and quantized to 64-bytes for space efficiency ( the full-precision keys are discarded ) . The index is constructed offline via a single forward pass over every example in the given parallel text collection . We use the 1024-dimensional representation input to the final layer feedforward network as the key . Building the index involves a training phase to learn the cluster centroids . We use 5M keys for learning 131K cluster centroids for the multilingual experiments , and 1M keys for 4K clusters for in-domain data in the domain adaptation experiments . During inference , we query the datastore for 64 neighbors while searching 32 clusters . The interpolation and softmax temperature parameters are tuned on the validation sets.3 Computational Cost While kNN-MT does not add trainable model parameters , it does add some computational overhead . The primary cost of building the datastore is a single forward pass over all examples in the datastore , which is a fraction of the cost for training on the same examples for one epoch . During inference , retrieving 64 keys from a datastore containing billions of items results in a generation speed that is two orders of magnitude slower than the base MT system . Generation speed can be improved by searching fewer clusters , using smaller beams , or querying smaller datastores , with relatively minor trade-offs in performance , as we will see in Section 5 . Developing faster nearest neighbor search tools remains an active area of research ( Guo et al. , 2020 ) .
This paper describes a nearest-neighbor enhancement to NMT, where internal token-level context representations are used to index into a large data store to find relevant (source, target prefix) pairs. Since the index representation is taken from a pre-softmax representation in the decoder network, no additional training of the NMT model is required. The authors show a diverse range of strong results, from improvements using a data store over the model’s own training data, to improvement from using a collection of domain-specific corpora not present during training used for domain adaptation, to language specific collections to improve capacity of multilingual models. They are also able to show by example how the model makes MT more interpretable.
SP:97f770b52e8757978d650cd8c82c9cff2ea97d78
On the Origin of Implicit Regularization in Stochastic Gradient Descent
1 INTRODUCTION . In the limit of vanishing learning rates , stochastic gradient descent with minibatch gradients ( SGD ) follows the path of gradient flow on the full batch loss function ( Yaida , 2019 ) . However in deep networks , SGD often achieves higher test accuracies when the learning rate is moderately large ( LeCun et al. , 2012 ; Keskar et al. , 2017 ) . This generalization benefit is not explained by convergence rate bounds ( Ma et al. , 2018 ; Zhang et al. , 2019 ) , because it arises even for large compute budgets for which smaller learning rates often achieve lower training losses ( Smith et al. , 2020 ) . Although many authors have studied this phenomenon ( Jastrzębski et al. , 2018 ; Smith & Le , 2018 ; Chaudhari & Soatto , 2018 ; Shallue et al. , 2018 ; Park et al. , 2019 ; Li et al. , 2019 ; Lewkowycz et al. , 2020 ) , it remains poorly understood , and is an important open question in the theory of deep learning . In a recent work , Barrett & Dherin ( 2021 ) analyzed the influence of finite learning rates on the iterates of gradient descent ( GD ) . Their approach is inspired by backward error analysis , a method for the numerical analysis of ordinary differential equation ( ODE ) solvers ( Hairer et al. , 2006 ) . The key insight of backward error analysis is that we can describe the bias introduced when integrating an ODE with finite step sizes by introducing an ancillary modified flow . This modified flow is derived to ensure that discrete iterates of the original ODE lie on the path of the continuous solution to the modified flow . Using this technique , the authors show that if the learning rate is not too large , the discrete iterates of GD lie close to the path of gradient flow on a modified loss C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 . This modified loss is composed of the original loss C ( ω ) and an implicit regularizer proportional to the learning rate which penalizes the euclidean norm of the gradient . However these results only hold for full batch GD , while in practice SGD with small or moderately large batch sizes usually achieves higher test accuracies ( Keskar et al. , 2017 ; Smith et al. , 2020 ) . In this work , we devise an alternative approach to backward error analysis , which accounts for the correlations between minibatches during one epoch of training . Using this novel approach , we prove that for small finite learning rates , the mean SGD iterate after one epoch , averaged over all possible sequences of minibatches , lies close to the path of gradient flow on a second modified loss C̃SGD ( ω ) , which we define in equation 1 . This new modified loss is also composed of the full batch loss function and an implicit regularizer , however the structure of the implicit regularizers for GD and SGD differ , and their modified losses can have different local and global minima . Our analysis therefore helps explain both why finite learning rates can aid generalization , and why SGD can achieve higher test accuracies than GD . We assume that each training example is sampled once per epoch , in line with best practice ( Bottou , 2012 ) , and we confirm empirically that explicitly including the implicit regularization term of SGD in the training loss can enhance the test accuracy when the learning rate is small . Furthermore , we prove that if the batch size is small and the gradients are sufficiently diverse , then the expected magnitude of the implicit regularization term of SGD is proportional to the ratio of the learning rate to the batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ) . We note that many previous authors have sought to explain the generalization benefit of SGD using an analogy between SGD and stochastic differential equations ( SDEs ) ( Mandt et al. , 2017 ; Smith & Le , 2018 ; Jastrzębski et al. , 2018 ; Chaudhari & Soatto , 2018 ) . However this SDE analogy assumes that each minibatch is randomly sampled from the full dataset , which implies that some examples will be sampled multiple times in one epoch . Furthermore , the most common SDE analogy holds only for vanishing learning rates ( Yaida , 2019 ) and therefore misses the generalization benefits of finite learning rates which we identify in this work . An important exception is Li et al . ( 2017 ) , who applied backward error analysis to identify a modified SDE which holds when the learning rate is finite . However this work still relies on the assumption that minibatches are sampled randomly . It also focused on the convergence rate , and did not discuss the performance of SGD on the test set . Main Result . We now introduce our main result . We define the cost function over parameters ω as C ( ω ) = ( 1/N ) ∑N j=1 Cj ( ω ) , which is the mean of the per-example costs Cj ( ω ) , where N denotes the training set size . Gradient flow follows the ODE ω̇ = −∇C ( ω ) , while gradient descent computes discrete updates ωi+1 = ωi − ∇C ( ωi ) , where is the learning rate . For simplicity , we assume that the batch size B perfectly splits the training set such that N % B = 0 , where % denotes the modulo operation , and for convenience we define the number of batches per epoch m = N/B . We can therefore re-write the cost function as a sum over minibatches C ( ω ) = ( 1/m ) ∑m−1 k=0 Ĉk ( ω ) , where the minibatch cost Ĉk ( ω ) = ( 1/B ) ∑kB+B j=kB+1 Cj ( ω ) . In order to guarantee that we sample each example precisely once per epoch , we define SGD by the discrete update ωi+1 = ωi− ∇Ĉi % m ( ωi ) . Informally , our main result is as follows . After one epoch , the mean iterate of SGD with a small but finite learning rate , averaged over all possible shuffles of the batch indices , stays close to the path of gradient flow on a modified loss ω̇ = −∇C̃SGD ( ω ) , where the modified loss C̃SGD is given by : C̃SGD ( ω ) = C ( ω ) + 4m ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . ( 1 ) We emphasize that our analysis studies the mean evolution of SGD , not the path of individual trajectories . The modified loss C̃SGD ( ω ) is composed of the original loss C ( ω ) and an implicit regularizer Creg ( ω ) = ( 1/4m ) ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . The scale of this implicit regularization term is proportional to the learning rate , and it penalizes the mean squared norm of the gradient evaluated on a batch of B examples . To help us compare the modified losses of GD and SGD , we can expand , C̃SGD ( ω ) = C ( ω ) + 4 ||∇C ( ω ) ||2 + 4m ∑m−1 i=0 ||∇Ĉi ( ω ) −∇C ( ω ) ||2 . ( 2 ) We arrive at Equation 2 from Equation 1 by noting that ∑m−1 i=0 ( ∇Ĉi ( ω ) − ∇C ( ω ) ) = 0 . In the limit B → N , we identify the modified loss of gradient descent , C̃GD = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 , which penalizes “ sharp ” regions where the norm of the full-batch gradient ( ||∇C ( ω ) ||2 ) is large . However , as shown by Equation 2 , the modified loss of SGD penalizes both sharp regions where the full-batch gradient is large , and also “ non-uniform ” regions where the norms of the errors in the minibatch gradients ( ||∇Ĉ ( ω ) − ∇C ( ω ) ||2 ) are large ( Wu et al. , 2018 ) . Although global minima of C ( ω ) are global minima of C̃GD ( ω ) , global minima of C ( ω ) may not be global ( or even local ) minima of C̃SGD ( ω ) . Note however that C ( ω ) and C̃SGD ( ω ) do share the same global minima on over-parameterized models which can interpolate the training set ( Ma et al. , 2018 ) . We verify in our experiments that the implicit regularizer can enhance the test accuracy of models trained with SGD . Paper structure . In Section 2 , we derive our main result ( Equation 1 ) , and we confirm empirically that we can close the generalization gap between small and large learning rates by including the implicit regularizer explicitly in the loss function . In Section 3 , we confirm Equation 1 satisfies the linear scaling rule between learning rate and batch size ( Goyal et al. , 2017 ) . In Section 4 , we provide additional experiments which challenge the prevailing view that the generalization benefit of small batch SGD arises from the temperature of an associated SDE ( Mandt et al. , 2017 ; Park et al. , 2019 ) . 2 A BACKWARD ERROR ANALYSIS OF STOCHASTIC GRADIENT DESCENT . Backward error analysis has great potential to clarify the role of finite learning rates , and to help identify the implicit biases of different optimizers . We therefore give a detailed introduction to the core methodology in Section 2.1 , before deriving our main result in Section 2.2 . In Section 2.3 , we confirm empirically that the implicit regularizer can enhance the test accuracy of deep networks . 2.1 AN INTRODUCTION TO BACKWARD ERROR ANALYSIS . In numerical analysis , we often wish to integrate ODEs of the form ω̇ = f ( ω ) . This system usually can not be solved analytically , forcing us to simulate the continuous flow with discrete updates , like the Euler step ω ( t+ ) ≈ ω ( t ) + f ( ω ( t ) ) . However discrete updates will introduce approximation error when the step size is finite . In order to study the bias introduced by this approximation error , we assume the learning rate is relatively small , and introduce a modified flow ω̇ = f̃ ( ω ) , where , f̃ ( ω ) = f ( ω ) + f1 ( ω ) + 2f2 ( ω ) + ... . ( 3 ) The modified flow of f̃ ( ω ) is equal to the original flow of f ( ω ) when → 0 , but it differs from the original flow if is finite . The goal of backward error analysis is to choose the correction terms fi ( ω ) such that the iterates obtained from discrete updates of the original flow with small finite step sizes lie on the path taken by the continuous solution to the modified flow with vanishing step sizes . The standard derivation of backward error analysis begins by taking a Taylor expansion in of the solution to the modified flow ω ( t + ) . We obtain the derivatives of ω ( t + ) recursively using the modified flow equation ω̇ = f̃ ( ω ) ( see Hairer et al . ( 2006 ) ) , and we identify the correction terms fi ( ω ) by ensuring this Taylor expansion matches the discrete update ( e.g. , ωt+1 = ωt + f ( ωt ) ) for all powers of . However , this approach does not clarify why these correction terms arise . To build our intuition for the origin of the corrections terms , and to clarify how we might apply this analysis to SGD , we take a different approach . First , we will identify the path taken by the continuous modified flow by considering the combined influence of an infinite number of discrete steps in the limit of vanishing learning rates , and then we will compare this continuous path to either a single step of GD or a single epoch of SGD . Imagine taking n Euler steps on the modified flow f̃ ( ω ) with step size α , ωt+n = ωt + αf̃ ( ωt ) + αf̃ ( ωt+1 ) + αf̃ ( ωt+2 ) + ... ( 4 ) = ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) + αf̃ ( ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) ) + ... ( 5 ) = ωt + nαf̃ ( ωt ) + ( n/2 ) ( n− 1 ) α2∇f̃ ( ωt ) f̃ ( ωt ) +O ( n3α3 ) . ( 6 ) We arrived at Equation 6 by taking the Taylor expansion of f̃ and then counting the number of terms of type ∇f̃ ( ωt ) f̃ ( ωt ) using the formula for an arithmetic series . Note that we assume ∇f̃ exists . Next , to ensure ωt+n in Equation 6 coincides with the solution ω ( t+ ) of the continuous modified flow ω̇ = f̃ ( ω ) for small but finite , we let the number of steps n→∞ while setting α = /n , ω ( t+ ) = ω ( t ) + f̃ ( ω ( t ) ) + ( 2/2 ) ∇f̃ ( ω ( t ) ) f̃ ( ω ( t ) ) +O ( 3 ) ( 7 ) = ω ( t ) + f ( ω ( t ) ) + 2 ( f1 ( ω ( t ) ) + ( 1/2 ) ∇f ( ω ( t ) ) f ( ω ( t ) ) ) +O ( 3 ) . ( 8 ) We have replaced f̃ ( ω ) with its definition from Equation 3 . As we will see below , Equation 8 is the key component of backward error analysis , which describes the path taken when integrating the continuous modified flow f̃ ( ω ) with vanishing learning rates over a discrete time step of length . Notice that we have assumed that the Taylor expansion in Equation 8 converges , while the higher order terms at O ( 3 ) will contain higher order derivatives of the original flow f ( ω ) . Backward error analysis therefore implicitly assumes that f ( ω ) is an analytic function in the vicinity of the current parameters ω . We refer the reader to Hairer et al . ( 2006 ) for a detailed introduction . Gradient descent : As a simple example , we will now derive the first order correction f1 ( ω ) of the modified flow for GD . First , we recall that the discrete updates obey ωi+1 = ωi− ∇C ( ωi ) , and we therefore fix f ( ω ) = −∇C ( ω ) . In order to ensure that the continuous modified flow coincides with this discrete update , we need all terms at O ( 2 ) and above in Equation 8 to vanish . At order 2 , this implies that f1 ( ω ) + ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = 0 , which yields the first order correction , f1 ( ω ) = − ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = − ( 1/4 ) ∇ ( ||∇C ( ω ) ||2 ) . ( 9 ) We conclude that , if the learning rate is sufficiently small such that we can neglect higher order terms in Equation 3 , then the discrete GD iterates lie on the path of the following ODE , ω̇ = −∇C ( ω ) − ( /4 ) ∇ ( ||∇C ( ω ) ||2 ) ( 10 ) = −∇C̃GD ( ω ) . ( 11 ) Equation 11 corresponds to gradient flow on the modified loss , C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 .
To analyze why the generalization error of SGD with larger learning rates achieves better test error, this paper analyzes the implicit regularization of SGD (with a finite step size) via a first order backward error analysis. Under this analysis the paper shows that the mean position of SGD with $m$ minibatches effectively follows the flow according to Eq (20) for a small but finite step size, while GD effectively follows the last inline equation in section 2.1. The paper shows empirically on an image classification task that by explicitly including the (implicit SGD) regularizer, SGD on the modified loss behaves similarly to using a larger learning rate when evaluating on the test set. The paper then extends this results to consider varying the batch size in section 3, showing that for small batchsizes the implicit regularization scales with the ratio of learning rate and batchsize $\epsilon/B$. Finally in section 4, the paper analyzes SGD when for each sampled minibatch in an epoch, we apply $n$ gradient steps with a stepsize $\epsilon/n$ and show that performance degrades as $n$ increases, suggesting that the benefit of SGD with larger learning rates is due to the implicit regularizer and not the temperature of an associated SDE.
SP:eea0d9d66ccca3fab3cc7077d8e003be5cfcfe29
On the Origin of Implicit Regularization in Stochastic Gradient Descent
1 INTRODUCTION . In the limit of vanishing learning rates , stochastic gradient descent with minibatch gradients ( SGD ) follows the path of gradient flow on the full batch loss function ( Yaida , 2019 ) . However in deep networks , SGD often achieves higher test accuracies when the learning rate is moderately large ( LeCun et al. , 2012 ; Keskar et al. , 2017 ) . This generalization benefit is not explained by convergence rate bounds ( Ma et al. , 2018 ; Zhang et al. , 2019 ) , because it arises even for large compute budgets for which smaller learning rates often achieve lower training losses ( Smith et al. , 2020 ) . Although many authors have studied this phenomenon ( Jastrzębski et al. , 2018 ; Smith & Le , 2018 ; Chaudhari & Soatto , 2018 ; Shallue et al. , 2018 ; Park et al. , 2019 ; Li et al. , 2019 ; Lewkowycz et al. , 2020 ) , it remains poorly understood , and is an important open question in the theory of deep learning . In a recent work , Barrett & Dherin ( 2021 ) analyzed the influence of finite learning rates on the iterates of gradient descent ( GD ) . Their approach is inspired by backward error analysis , a method for the numerical analysis of ordinary differential equation ( ODE ) solvers ( Hairer et al. , 2006 ) . The key insight of backward error analysis is that we can describe the bias introduced when integrating an ODE with finite step sizes by introducing an ancillary modified flow . This modified flow is derived to ensure that discrete iterates of the original ODE lie on the path of the continuous solution to the modified flow . Using this technique , the authors show that if the learning rate is not too large , the discrete iterates of GD lie close to the path of gradient flow on a modified loss C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 . This modified loss is composed of the original loss C ( ω ) and an implicit regularizer proportional to the learning rate which penalizes the euclidean norm of the gradient . However these results only hold for full batch GD , while in practice SGD with small or moderately large batch sizes usually achieves higher test accuracies ( Keskar et al. , 2017 ; Smith et al. , 2020 ) . In this work , we devise an alternative approach to backward error analysis , which accounts for the correlations between minibatches during one epoch of training . Using this novel approach , we prove that for small finite learning rates , the mean SGD iterate after one epoch , averaged over all possible sequences of minibatches , lies close to the path of gradient flow on a second modified loss C̃SGD ( ω ) , which we define in equation 1 . This new modified loss is also composed of the full batch loss function and an implicit regularizer , however the structure of the implicit regularizers for GD and SGD differ , and their modified losses can have different local and global minima . Our analysis therefore helps explain both why finite learning rates can aid generalization , and why SGD can achieve higher test accuracies than GD . We assume that each training example is sampled once per epoch , in line with best practice ( Bottou , 2012 ) , and we confirm empirically that explicitly including the implicit regularization term of SGD in the training loss can enhance the test accuracy when the learning rate is small . Furthermore , we prove that if the batch size is small and the gradients are sufficiently diverse , then the expected magnitude of the implicit regularization term of SGD is proportional to the ratio of the learning rate to the batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ) . We note that many previous authors have sought to explain the generalization benefit of SGD using an analogy between SGD and stochastic differential equations ( SDEs ) ( Mandt et al. , 2017 ; Smith & Le , 2018 ; Jastrzębski et al. , 2018 ; Chaudhari & Soatto , 2018 ) . However this SDE analogy assumes that each minibatch is randomly sampled from the full dataset , which implies that some examples will be sampled multiple times in one epoch . Furthermore , the most common SDE analogy holds only for vanishing learning rates ( Yaida , 2019 ) and therefore misses the generalization benefits of finite learning rates which we identify in this work . An important exception is Li et al . ( 2017 ) , who applied backward error analysis to identify a modified SDE which holds when the learning rate is finite . However this work still relies on the assumption that minibatches are sampled randomly . It also focused on the convergence rate , and did not discuss the performance of SGD on the test set . Main Result . We now introduce our main result . We define the cost function over parameters ω as C ( ω ) = ( 1/N ) ∑N j=1 Cj ( ω ) , which is the mean of the per-example costs Cj ( ω ) , where N denotes the training set size . Gradient flow follows the ODE ω̇ = −∇C ( ω ) , while gradient descent computes discrete updates ωi+1 = ωi − ∇C ( ωi ) , where is the learning rate . For simplicity , we assume that the batch size B perfectly splits the training set such that N % B = 0 , where % denotes the modulo operation , and for convenience we define the number of batches per epoch m = N/B . We can therefore re-write the cost function as a sum over minibatches C ( ω ) = ( 1/m ) ∑m−1 k=0 Ĉk ( ω ) , where the minibatch cost Ĉk ( ω ) = ( 1/B ) ∑kB+B j=kB+1 Cj ( ω ) . In order to guarantee that we sample each example precisely once per epoch , we define SGD by the discrete update ωi+1 = ωi− ∇Ĉi % m ( ωi ) . Informally , our main result is as follows . After one epoch , the mean iterate of SGD with a small but finite learning rate , averaged over all possible shuffles of the batch indices , stays close to the path of gradient flow on a modified loss ω̇ = −∇C̃SGD ( ω ) , where the modified loss C̃SGD is given by : C̃SGD ( ω ) = C ( ω ) + 4m ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . ( 1 ) We emphasize that our analysis studies the mean evolution of SGD , not the path of individual trajectories . The modified loss C̃SGD ( ω ) is composed of the original loss C ( ω ) and an implicit regularizer Creg ( ω ) = ( 1/4m ) ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . The scale of this implicit regularization term is proportional to the learning rate , and it penalizes the mean squared norm of the gradient evaluated on a batch of B examples . To help us compare the modified losses of GD and SGD , we can expand , C̃SGD ( ω ) = C ( ω ) + 4 ||∇C ( ω ) ||2 + 4m ∑m−1 i=0 ||∇Ĉi ( ω ) −∇C ( ω ) ||2 . ( 2 ) We arrive at Equation 2 from Equation 1 by noting that ∑m−1 i=0 ( ∇Ĉi ( ω ) − ∇C ( ω ) ) = 0 . In the limit B → N , we identify the modified loss of gradient descent , C̃GD = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 , which penalizes “ sharp ” regions where the norm of the full-batch gradient ( ||∇C ( ω ) ||2 ) is large . However , as shown by Equation 2 , the modified loss of SGD penalizes both sharp regions where the full-batch gradient is large , and also “ non-uniform ” regions where the norms of the errors in the minibatch gradients ( ||∇Ĉ ( ω ) − ∇C ( ω ) ||2 ) are large ( Wu et al. , 2018 ) . Although global minima of C ( ω ) are global minima of C̃GD ( ω ) , global minima of C ( ω ) may not be global ( or even local ) minima of C̃SGD ( ω ) . Note however that C ( ω ) and C̃SGD ( ω ) do share the same global minima on over-parameterized models which can interpolate the training set ( Ma et al. , 2018 ) . We verify in our experiments that the implicit regularizer can enhance the test accuracy of models trained with SGD . Paper structure . In Section 2 , we derive our main result ( Equation 1 ) , and we confirm empirically that we can close the generalization gap between small and large learning rates by including the implicit regularizer explicitly in the loss function . In Section 3 , we confirm Equation 1 satisfies the linear scaling rule between learning rate and batch size ( Goyal et al. , 2017 ) . In Section 4 , we provide additional experiments which challenge the prevailing view that the generalization benefit of small batch SGD arises from the temperature of an associated SDE ( Mandt et al. , 2017 ; Park et al. , 2019 ) . 2 A BACKWARD ERROR ANALYSIS OF STOCHASTIC GRADIENT DESCENT . Backward error analysis has great potential to clarify the role of finite learning rates , and to help identify the implicit biases of different optimizers . We therefore give a detailed introduction to the core methodology in Section 2.1 , before deriving our main result in Section 2.2 . In Section 2.3 , we confirm empirically that the implicit regularizer can enhance the test accuracy of deep networks . 2.1 AN INTRODUCTION TO BACKWARD ERROR ANALYSIS . In numerical analysis , we often wish to integrate ODEs of the form ω̇ = f ( ω ) . This system usually can not be solved analytically , forcing us to simulate the continuous flow with discrete updates , like the Euler step ω ( t+ ) ≈ ω ( t ) + f ( ω ( t ) ) . However discrete updates will introduce approximation error when the step size is finite . In order to study the bias introduced by this approximation error , we assume the learning rate is relatively small , and introduce a modified flow ω̇ = f̃ ( ω ) , where , f̃ ( ω ) = f ( ω ) + f1 ( ω ) + 2f2 ( ω ) + ... . ( 3 ) The modified flow of f̃ ( ω ) is equal to the original flow of f ( ω ) when → 0 , but it differs from the original flow if is finite . The goal of backward error analysis is to choose the correction terms fi ( ω ) such that the iterates obtained from discrete updates of the original flow with small finite step sizes lie on the path taken by the continuous solution to the modified flow with vanishing step sizes . The standard derivation of backward error analysis begins by taking a Taylor expansion in of the solution to the modified flow ω ( t + ) . We obtain the derivatives of ω ( t + ) recursively using the modified flow equation ω̇ = f̃ ( ω ) ( see Hairer et al . ( 2006 ) ) , and we identify the correction terms fi ( ω ) by ensuring this Taylor expansion matches the discrete update ( e.g. , ωt+1 = ωt + f ( ωt ) ) for all powers of . However , this approach does not clarify why these correction terms arise . To build our intuition for the origin of the corrections terms , and to clarify how we might apply this analysis to SGD , we take a different approach . First , we will identify the path taken by the continuous modified flow by considering the combined influence of an infinite number of discrete steps in the limit of vanishing learning rates , and then we will compare this continuous path to either a single step of GD or a single epoch of SGD . Imagine taking n Euler steps on the modified flow f̃ ( ω ) with step size α , ωt+n = ωt + αf̃ ( ωt ) + αf̃ ( ωt+1 ) + αf̃ ( ωt+2 ) + ... ( 4 ) = ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) + αf̃ ( ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) ) + ... ( 5 ) = ωt + nαf̃ ( ωt ) + ( n/2 ) ( n− 1 ) α2∇f̃ ( ωt ) f̃ ( ωt ) +O ( n3α3 ) . ( 6 ) We arrived at Equation 6 by taking the Taylor expansion of f̃ and then counting the number of terms of type ∇f̃ ( ωt ) f̃ ( ωt ) using the formula for an arithmetic series . Note that we assume ∇f̃ exists . Next , to ensure ωt+n in Equation 6 coincides with the solution ω ( t+ ) of the continuous modified flow ω̇ = f̃ ( ω ) for small but finite , we let the number of steps n→∞ while setting α = /n , ω ( t+ ) = ω ( t ) + f̃ ( ω ( t ) ) + ( 2/2 ) ∇f̃ ( ω ( t ) ) f̃ ( ω ( t ) ) +O ( 3 ) ( 7 ) = ω ( t ) + f ( ω ( t ) ) + 2 ( f1 ( ω ( t ) ) + ( 1/2 ) ∇f ( ω ( t ) ) f ( ω ( t ) ) ) +O ( 3 ) . ( 8 ) We have replaced f̃ ( ω ) with its definition from Equation 3 . As we will see below , Equation 8 is the key component of backward error analysis , which describes the path taken when integrating the continuous modified flow f̃ ( ω ) with vanishing learning rates over a discrete time step of length . Notice that we have assumed that the Taylor expansion in Equation 8 converges , while the higher order terms at O ( 3 ) will contain higher order derivatives of the original flow f ( ω ) . Backward error analysis therefore implicitly assumes that f ( ω ) is an analytic function in the vicinity of the current parameters ω . We refer the reader to Hairer et al . ( 2006 ) for a detailed introduction . Gradient descent : As a simple example , we will now derive the first order correction f1 ( ω ) of the modified flow for GD . First , we recall that the discrete updates obey ωi+1 = ωi− ∇C ( ωi ) , and we therefore fix f ( ω ) = −∇C ( ω ) . In order to ensure that the continuous modified flow coincides with this discrete update , we need all terms at O ( 2 ) and above in Equation 8 to vanish . At order 2 , this implies that f1 ( ω ) + ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = 0 , which yields the first order correction , f1 ( ω ) = − ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = − ( 1/4 ) ∇ ( ||∇C ( ω ) ||2 ) . ( 9 ) We conclude that , if the learning rate is sufficiently small such that we can neglect higher order terms in Equation 3 , then the discrete GD iterates lie on the path of the following ODE , ω̇ = −∇C ( ω ) − ( /4 ) ∇ ( ||∇C ( ω ) ||2 ) ( 10 ) = −∇C̃GD ( ω ) . ( 11 ) Equation 11 corresponds to gradient flow on the modified loss , C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 .
Using backward error analysis, the paper argues that SGD with small but finite step sizes stays on the path of a gradient flow ODE of a modified loss, which penalizes the squared norms of the mini-batch gradients. This offers a possible explanation of the empirically observed positive effect of (relatively) large step sizes on generalization performance. The paper further contests previous findings based on a vanishing step size assumption.
SP:eea0d9d66ccca3fab3cc7077d8e003be5cfcfe29
On the Origin of Implicit Regularization in Stochastic Gradient Descent
1 INTRODUCTION . In the limit of vanishing learning rates , stochastic gradient descent with minibatch gradients ( SGD ) follows the path of gradient flow on the full batch loss function ( Yaida , 2019 ) . However in deep networks , SGD often achieves higher test accuracies when the learning rate is moderately large ( LeCun et al. , 2012 ; Keskar et al. , 2017 ) . This generalization benefit is not explained by convergence rate bounds ( Ma et al. , 2018 ; Zhang et al. , 2019 ) , because it arises even for large compute budgets for which smaller learning rates often achieve lower training losses ( Smith et al. , 2020 ) . Although many authors have studied this phenomenon ( Jastrzębski et al. , 2018 ; Smith & Le , 2018 ; Chaudhari & Soatto , 2018 ; Shallue et al. , 2018 ; Park et al. , 2019 ; Li et al. , 2019 ; Lewkowycz et al. , 2020 ) , it remains poorly understood , and is an important open question in the theory of deep learning . In a recent work , Barrett & Dherin ( 2021 ) analyzed the influence of finite learning rates on the iterates of gradient descent ( GD ) . Their approach is inspired by backward error analysis , a method for the numerical analysis of ordinary differential equation ( ODE ) solvers ( Hairer et al. , 2006 ) . The key insight of backward error analysis is that we can describe the bias introduced when integrating an ODE with finite step sizes by introducing an ancillary modified flow . This modified flow is derived to ensure that discrete iterates of the original ODE lie on the path of the continuous solution to the modified flow . Using this technique , the authors show that if the learning rate is not too large , the discrete iterates of GD lie close to the path of gradient flow on a modified loss C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 . This modified loss is composed of the original loss C ( ω ) and an implicit regularizer proportional to the learning rate which penalizes the euclidean norm of the gradient . However these results only hold for full batch GD , while in practice SGD with small or moderately large batch sizes usually achieves higher test accuracies ( Keskar et al. , 2017 ; Smith et al. , 2020 ) . In this work , we devise an alternative approach to backward error analysis , which accounts for the correlations between minibatches during one epoch of training . Using this novel approach , we prove that for small finite learning rates , the mean SGD iterate after one epoch , averaged over all possible sequences of minibatches , lies close to the path of gradient flow on a second modified loss C̃SGD ( ω ) , which we define in equation 1 . This new modified loss is also composed of the full batch loss function and an implicit regularizer , however the structure of the implicit regularizers for GD and SGD differ , and their modified losses can have different local and global minima . Our analysis therefore helps explain both why finite learning rates can aid generalization , and why SGD can achieve higher test accuracies than GD . We assume that each training example is sampled once per epoch , in line with best practice ( Bottou , 2012 ) , and we confirm empirically that explicitly including the implicit regularization term of SGD in the training loss can enhance the test accuracy when the learning rate is small . Furthermore , we prove that if the batch size is small and the gradients are sufficiently diverse , then the expected magnitude of the implicit regularization term of SGD is proportional to the ratio of the learning rate to the batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ) . We note that many previous authors have sought to explain the generalization benefit of SGD using an analogy between SGD and stochastic differential equations ( SDEs ) ( Mandt et al. , 2017 ; Smith & Le , 2018 ; Jastrzębski et al. , 2018 ; Chaudhari & Soatto , 2018 ) . However this SDE analogy assumes that each minibatch is randomly sampled from the full dataset , which implies that some examples will be sampled multiple times in one epoch . Furthermore , the most common SDE analogy holds only for vanishing learning rates ( Yaida , 2019 ) and therefore misses the generalization benefits of finite learning rates which we identify in this work . An important exception is Li et al . ( 2017 ) , who applied backward error analysis to identify a modified SDE which holds when the learning rate is finite . However this work still relies on the assumption that minibatches are sampled randomly . It also focused on the convergence rate , and did not discuss the performance of SGD on the test set . Main Result . We now introduce our main result . We define the cost function over parameters ω as C ( ω ) = ( 1/N ) ∑N j=1 Cj ( ω ) , which is the mean of the per-example costs Cj ( ω ) , where N denotes the training set size . Gradient flow follows the ODE ω̇ = −∇C ( ω ) , while gradient descent computes discrete updates ωi+1 = ωi − ∇C ( ωi ) , where is the learning rate . For simplicity , we assume that the batch size B perfectly splits the training set such that N % B = 0 , where % denotes the modulo operation , and for convenience we define the number of batches per epoch m = N/B . We can therefore re-write the cost function as a sum over minibatches C ( ω ) = ( 1/m ) ∑m−1 k=0 Ĉk ( ω ) , where the minibatch cost Ĉk ( ω ) = ( 1/B ) ∑kB+B j=kB+1 Cj ( ω ) . In order to guarantee that we sample each example precisely once per epoch , we define SGD by the discrete update ωi+1 = ωi− ∇Ĉi % m ( ωi ) . Informally , our main result is as follows . After one epoch , the mean iterate of SGD with a small but finite learning rate , averaged over all possible shuffles of the batch indices , stays close to the path of gradient flow on a modified loss ω̇ = −∇C̃SGD ( ω ) , where the modified loss C̃SGD is given by : C̃SGD ( ω ) = C ( ω ) + 4m ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . ( 1 ) We emphasize that our analysis studies the mean evolution of SGD , not the path of individual trajectories . The modified loss C̃SGD ( ω ) is composed of the original loss C ( ω ) and an implicit regularizer Creg ( ω ) = ( 1/4m ) ∑m−1 k=0 ||∇Ĉk ( ω ) ||2 . The scale of this implicit regularization term is proportional to the learning rate , and it penalizes the mean squared norm of the gradient evaluated on a batch of B examples . To help us compare the modified losses of GD and SGD , we can expand , C̃SGD ( ω ) = C ( ω ) + 4 ||∇C ( ω ) ||2 + 4m ∑m−1 i=0 ||∇Ĉi ( ω ) −∇C ( ω ) ||2 . ( 2 ) We arrive at Equation 2 from Equation 1 by noting that ∑m−1 i=0 ( ∇Ĉi ( ω ) − ∇C ( ω ) ) = 0 . In the limit B → N , we identify the modified loss of gradient descent , C̃GD = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 , which penalizes “ sharp ” regions where the norm of the full-batch gradient ( ||∇C ( ω ) ||2 ) is large . However , as shown by Equation 2 , the modified loss of SGD penalizes both sharp regions where the full-batch gradient is large , and also “ non-uniform ” regions where the norms of the errors in the minibatch gradients ( ||∇Ĉ ( ω ) − ∇C ( ω ) ||2 ) are large ( Wu et al. , 2018 ) . Although global minima of C ( ω ) are global minima of C̃GD ( ω ) , global minima of C ( ω ) may not be global ( or even local ) minima of C̃SGD ( ω ) . Note however that C ( ω ) and C̃SGD ( ω ) do share the same global minima on over-parameterized models which can interpolate the training set ( Ma et al. , 2018 ) . We verify in our experiments that the implicit regularizer can enhance the test accuracy of models trained with SGD . Paper structure . In Section 2 , we derive our main result ( Equation 1 ) , and we confirm empirically that we can close the generalization gap between small and large learning rates by including the implicit regularizer explicitly in the loss function . In Section 3 , we confirm Equation 1 satisfies the linear scaling rule between learning rate and batch size ( Goyal et al. , 2017 ) . In Section 4 , we provide additional experiments which challenge the prevailing view that the generalization benefit of small batch SGD arises from the temperature of an associated SDE ( Mandt et al. , 2017 ; Park et al. , 2019 ) . 2 A BACKWARD ERROR ANALYSIS OF STOCHASTIC GRADIENT DESCENT . Backward error analysis has great potential to clarify the role of finite learning rates , and to help identify the implicit biases of different optimizers . We therefore give a detailed introduction to the core methodology in Section 2.1 , before deriving our main result in Section 2.2 . In Section 2.3 , we confirm empirically that the implicit regularizer can enhance the test accuracy of deep networks . 2.1 AN INTRODUCTION TO BACKWARD ERROR ANALYSIS . In numerical analysis , we often wish to integrate ODEs of the form ω̇ = f ( ω ) . This system usually can not be solved analytically , forcing us to simulate the continuous flow with discrete updates , like the Euler step ω ( t+ ) ≈ ω ( t ) + f ( ω ( t ) ) . However discrete updates will introduce approximation error when the step size is finite . In order to study the bias introduced by this approximation error , we assume the learning rate is relatively small , and introduce a modified flow ω̇ = f̃ ( ω ) , where , f̃ ( ω ) = f ( ω ) + f1 ( ω ) + 2f2 ( ω ) + ... . ( 3 ) The modified flow of f̃ ( ω ) is equal to the original flow of f ( ω ) when → 0 , but it differs from the original flow if is finite . The goal of backward error analysis is to choose the correction terms fi ( ω ) such that the iterates obtained from discrete updates of the original flow with small finite step sizes lie on the path taken by the continuous solution to the modified flow with vanishing step sizes . The standard derivation of backward error analysis begins by taking a Taylor expansion in of the solution to the modified flow ω ( t + ) . We obtain the derivatives of ω ( t + ) recursively using the modified flow equation ω̇ = f̃ ( ω ) ( see Hairer et al . ( 2006 ) ) , and we identify the correction terms fi ( ω ) by ensuring this Taylor expansion matches the discrete update ( e.g. , ωt+1 = ωt + f ( ωt ) ) for all powers of . However , this approach does not clarify why these correction terms arise . To build our intuition for the origin of the corrections terms , and to clarify how we might apply this analysis to SGD , we take a different approach . First , we will identify the path taken by the continuous modified flow by considering the combined influence of an infinite number of discrete steps in the limit of vanishing learning rates , and then we will compare this continuous path to either a single step of GD or a single epoch of SGD . Imagine taking n Euler steps on the modified flow f̃ ( ω ) with step size α , ωt+n = ωt + αf̃ ( ωt ) + αf̃ ( ωt+1 ) + αf̃ ( ωt+2 ) + ... ( 4 ) = ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) + αf̃ ( ωt + αf̃ ( ωt ) + αf̃ ( ωt + αf̃ ( ωt ) ) ) + ... ( 5 ) = ωt + nαf̃ ( ωt ) + ( n/2 ) ( n− 1 ) α2∇f̃ ( ωt ) f̃ ( ωt ) +O ( n3α3 ) . ( 6 ) We arrived at Equation 6 by taking the Taylor expansion of f̃ and then counting the number of terms of type ∇f̃ ( ωt ) f̃ ( ωt ) using the formula for an arithmetic series . Note that we assume ∇f̃ exists . Next , to ensure ωt+n in Equation 6 coincides with the solution ω ( t+ ) of the continuous modified flow ω̇ = f̃ ( ω ) for small but finite , we let the number of steps n→∞ while setting α = /n , ω ( t+ ) = ω ( t ) + f̃ ( ω ( t ) ) + ( 2/2 ) ∇f̃ ( ω ( t ) ) f̃ ( ω ( t ) ) +O ( 3 ) ( 7 ) = ω ( t ) + f ( ω ( t ) ) + 2 ( f1 ( ω ( t ) ) + ( 1/2 ) ∇f ( ω ( t ) ) f ( ω ( t ) ) ) +O ( 3 ) . ( 8 ) We have replaced f̃ ( ω ) with its definition from Equation 3 . As we will see below , Equation 8 is the key component of backward error analysis , which describes the path taken when integrating the continuous modified flow f̃ ( ω ) with vanishing learning rates over a discrete time step of length . Notice that we have assumed that the Taylor expansion in Equation 8 converges , while the higher order terms at O ( 3 ) will contain higher order derivatives of the original flow f ( ω ) . Backward error analysis therefore implicitly assumes that f ( ω ) is an analytic function in the vicinity of the current parameters ω . We refer the reader to Hairer et al . ( 2006 ) for a detailed introduction . Gradient descent : As a simple example , we will now derive the first order correction f1 ( ω ) of the modified flow for GD . First , we recall that the discrete updates obey ωi+1 = ωi− ∇C ( ωi ) , and we therefore fix f ( ω ) = −∇C ( ω ) . In order to ensure that the continuous modified flow coincides with this discrete update , we need all terms at O ( 2 ) and above in Equation 8 to vanish . At order 2 , this implies that f1 ( ω ) + ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = 0 , which yields the first order correction , f1 ( ω ) = − ( 1/2 ) ∇∇C ( ω ) ∇C ( ω ) = − ( 1/4 ) ∇ ( ||∇C ( ω ) ||2 ) . ( 9 ) We conclude that , if the learning rate is sufficiently small such that we can neglect higher order terms in Equation 3 , then the discrete GD iterates lie on the path of the following ODE , ω̇ = −∇C ( ω ) − ( /4 ) ∇ ( ||∇C ( ω ) ||2 ) ( 10 ) = −∇C̃GD ( ω ) . ( 11 ) Equation 11 corresponds to gradient flow on the modified loss , C̃GD ( ω ) = C ( ω ) + ( /4 ) ||∇C ( ω ) ||2 .
This paper analyzes the implicit regularization in SGD with finite learning rates via backward error analysis. The modified flow introduced in this paper better approximates the practical behavior of SGD as it does not require vanishing learning rates and it allows to use random shuffling in stead of i.i.d sampling. The numerical experiments validates the existence of the implicit regularization and how it affects the generalization of the model trained by SGD. The difference from SDE analysis is also discussed.
SP:eea0d9d66ccca3fab3cc7077d8e003be5cfcfe29
Fourier Representations for Black-Box Optimization over Categorical Variables
1 INTRODUCTION . A plethora of practical optimization problems involve black-box functions , with no simple analytical closed forms , that can be evaluated at any arbitrary point in the domain . Optimization of such black-box functions poses a unique challenge due to restrictions on the number of possible function evaluations , as evaluating functions of real-world complex processes is often expensive and time consuming . Efficient algorithms for global optimization of expensive black-box functions take past queries into account in order to select the next query to the black-box function more intelligently . While black-box optimization of real-world functions defined over integer , continuous , and mixed variables has been studied extensively in the literature , limited work has addressed incorporation of purely categorical type input variables . Categorical type variables are particularly challenging when compared to integer or continuous variables , as they do not have a natural ordering . However , many real-world functions are defined over categorical variables . One such problem , which is of wide interest , is the design of optimal chemical or biological ( protein , RNA , and DNA ) molecule sequences , which are constructed using a vocabulary of fixed size , e.g . 4 for DNA/RNA . Designing optimal molecular sequences with improved or novel structures and/or functionalities is of paramount importance in material science , drug and vaccine design , synthetic biology and many other applications ( see Dixon et al . ( 2010 ) ; Ng et al . ( 2019 ) ; Hoshika et al . ( 2019 ) ; Yamagami et al . ( 2019 ) ) . Design of optimal sequences is a difficult black-box optimization problem over a combinatorially large search space ( Stephens et al . ( 2015 ) ) , in which function evaluations often rely on either wet-lab experiments , physics-inspired simulators , or knowledge-based computational algorithms , which are slow and expensive in practice . Another problem of interest is the constrained design problem , e.g . find a sequence given a specific structure ( or property ) , which is inverse of the well-known folding problem discussed in Dill & MacCallum ( 2012 ) . This problem is complex due to the strict structural constraints imposed on the sequence . In fact one of the ways to represent such a complex structural constraint is to constrain the next choice sequentially based on the sequence elements that have been chosen a priori . Therefore , we divide the black box optimization problem into two settings , depending on the constraint set : ( i ) Generic Black Box Optimization ( BBO ) problem referring to the unconstrained case and ( ii ) Design Problem that refers to the case with complex sequential constraints . Let xt be the t-th sequence evaluated by the black box function f . The key question in both settings is the following : Given prior queries x1 , x2 . . . xt and their evaluations f ( x1 ) . . . f ( xt ) , how to choose the next query xt+1 ? This acquisition must be devised so that over a finite budget of black-box evaluations , one is closest to the minimizer in an expected sense over the acquisition randomness . In the literature , for design problems with sequential constraints , MCTS ( Monte Carlo Tree Search ) based acquisitions are often used with real function evaluations f ( xt ) . In the generic BBO problems in the unconstrained scenario , Simulated Annealing ( SA ) based techniques are typically used as acquisition functions . A key missing ingredient in the categorical domain is a surrogate model for the black-box evaluations that can interpolate between such evaluations and use cost-free approximate evaluations from the surrogate model internally ( in acquisition functions ) in order to reduce the need for frequently accessing real evaluations . This leads to improved sample efficiency in acquisition functions . Due to the lack of efficient interpolators in the categorical domains , existing acquisition functions suffer under a finite budget constraint , due to reliance on only real black-box evaluations . Contributions : We address the above problem in our work . Our main contributions are as follows : 1 . We present two representations for modeling real-valued combinatorial functions over categorical variables , which we then use in order to learn a surrogate model for the generic BBO problem and the design problem . The surrogate model is updated via a hedge algorithm where the basis functions in our representations act as experts . The latter update happens once for every real black-box evaluation . To the best of our knowledge , the representations and/or their use in black-box optimization of functions over categorical variables are novel to this work . 2 . In the BBO problem , the proposed method uses a version of simulated annealing that utilizes the current surrogate model for many internal cost-free evaluations before producing the next black-box query . 3 . In the design problem , the proposed method uses a version of MCTS in conjunction with the current surrogate model as reward function of the terminal states during intermediate tree traversals/backups in order to improve the sample efficiency of the search algorithm . 4 . Numerical results , over synthetic benchmarks as well as real-world biological ( RNA ) sequence optimization and design problems demonstrate the competitive or superior performance of the proposed methods over state-of-the-art counterparts , while substantially reducing the computation time and sample efficiency , respectively . 2 RELATED WORK . Hutter et al . ( 2011 ) suggests a surrogate model based on random forests to address optimization problems over categorical variables . The proposed SMAC algorithm uses a randomized local search under the expected improvement acquisition criterion in order to obtain candidate points for black-box evaluations . Bergstra et al . ( 2011 ) suggests a tree-structured Parzen estimator ( TPE ) for approximating the surrogate model , and maximizes the expected improvement criterion to find candidate points for evaluation . For optimization problems over Boolean variables , multilinear polynomials Ricardo Baptista ( 2018 ) ; Dadkhahi et al . ( 2020 ) and Walsh functions Leprêtre et al . ( 2019 ) have been used in the literature . Bayesian Optimization ( BO ) is a commonly used approach for optimization of black-box functions ( Shahriari et al . ( 2015 ) ) . However , limited work has addressed incorporation of categorical variables in BO . Early attempts based on converting the black-box optimization problem over categorical variables to that of continuous variables have not been very successful ( Gómez-Bombarelli et al . ( 2018 ) ; Golovin et al . ( 2017 ) ; Garrido-Merchán & Hernández-Lobato ( 2020 ) ) . A few BO algorithms have been specifically designed for black-box functions over combinatorial domains . In particular , the BOCS algorithm Ricardo Baptista ( 2018 ) , primarily devised for Boolean functions , employs a sparse monomial representation to model the interactions among different variables , and uses a sparse Bayesian linear regression method to learn the model coefficients . The COMBO algorithm of Oh et al . ( 2019 ) uses Graph Fourier Transform ( GFT ) over a combinatorial graph , constructed via graph cartesian product of variable subgraphs , to gauge the smoothness of the black-box function . However , both BOCS and COMBO are hindered by associated high computational complexities , which grow polynomially with both the number of variables and the number of function evaluations . More recently , a computationally efficient black-box optimization algorithm ( COMEX ) ( Dadkhahi et al . ( 2020 ) ) was introduced to address the computational impediments of its Bayesian counterparts . COMEX adopts a Boolean Fourier representation as its surrogate model , which is updated via an exponential weight update rule . Nevertheless , COMEX is limited to functions over the Boolean hypercube . We generalize COMEX to handle functions over categorical variables by proposing two representations for modeling functions over categorical variables : an abridged one-hot encoded Boolean Fourier representation and Fourier representation on finite Abelian groups . The utilization of the latter representation as a surrogate model in combinatorial optimization algorithms is novel to this work . Factorizations based on one-hot encoding has been previously ( albeit briefly ) suggested in Ricardo Baptista ( 2018 ) to enable black-box optimization algorithms designed for Boolean variables to address problems over categorical variables . Different from Ricardo Baptista ( 2018 ) , we show that we can significantly reduce the number of additional variables introduced upon one-hot encoding , and that such a reduced representation is in fact complete and unique . For design problems , we focus on the RNA sequence design problem ( RNA inverse folding ) . The goal is to find an RNA sequence consistent with a given secondary structure , as the functional state of the RNA molecule is determined by the latter structure ( Hofacker et al . ( 1994 ) ) . Earlier RNA design methods explore the search space by trial and error and use classic cost function minimization approaches such as adaptive random walk ( Hofacker ( 2003 ) ) , probabilistic sampling ( Zadeh et al . ( 2011 ) ) , and genetic algorithms ( Taneda ( 2015 ) ) . Recent efforts employ more advanced machine learning methods such as different Monte Carlo Tree Search ( MCTS ) algorithms , e.g . MCTS-RNA ( Yang et al . ( 2017 ) ) or Nested MCTS ( Portela ( 2018 ) ) , and reinforcement learning that either performs a local search as in Eastman et al . ( 2018 ) or learns complete candidate solutions from scratch ( Runge et al . ( 2018 ) ) . In all these approaches , the assumption is that the algorithm has access to a large number of function evaluations , whereas we are interested in sample efficiency of each algorithm . As an alternative to parameter free search methods ( such as SA ) , Swersky et al . ( 2020 ) suggests to use a parameterized policy to generate candidates that maximize the acquisition function in Bayesian optimization over discrete search spaces . Our MCTS acquisition method is similar in concept to Swersky et al . ( 2020 ) in the sense that the tabular value functions are constructed and maintained over different time steps . However , we are maintaining value functions rather than a policy network . 3 BLACK-BOX OPTIMIZATION OVER CATEGORICAL VARIABLES . Problem Setting : Given the combinatorial categorical domain X = [ k ] n and a constraint set C ⊆ X , with n variables each of cardinality k , the objective is to find x∗ = arg min x∈C f ( x ) ( 1 ) where f : X 7→ R is a real-valued combinatorial function . We assume that f is a black-box function , which is computationally expensive to evaluate . As such , we are interested in finding x∗ in as few evaluations as possible . We consider two variations of the problem depending on how the constraint set C is specified . Generic BBO Problem : In this case , the constraint set C = X . For example , RNA sequence optimization problem that searches for an RNA sequence with a specific property optimized lies within this category . A score for every RNA sequence , reflecting the property we wish to optimize , is evaluated by a black box function . Design Problem : The constraint set is complex and is only sequentially specified . For every sequence of x1x2 . . . xi consisting of i characters from the alphabet [ k ] , the choice of the next character xi+1 ∈ C ( x1x2 . . . xi ) ⊆ [ k ] is specified by a constraint set function C ( x1 . . . xi ) . The RNA inverse folding problem in Runge et al . ( 2018 ) falls into this category , where the constraints on the RNA sequence are determined by the sequential choices one makes during the sequence design . The goal is to find the sequence that is optimal with respect to a pre-specified structure that also obeys complex sequential constraints . Our Techniques : In order to address this problem , we adopt a surrogate model-acquisition function based learning framework , where an estimate for the black-box function f̂ ( i.e . the surrogate model ) is updated sequentially via black-box function evaluations observed until time step t. The selection of candidate points for black-box function evaluation is carried out via an acquisition function , which uses the surrogate model f̂ as an inexpensive proxy ( to make many internal calls ) for the black-box function and produces the next candidate point to be evaluated . The sequence proceeds as follows : Surrogate model updated on ( xt , f ( xt ) ) → Acquisition function makes ( many ) calls to Surrogate model to propose xt+1 → Surrogate model updated on ( xt+1 , f ( xt+1 ) ) In the sequel , we propose two representations that can be used as surrogate models for black-box combinatorial functions over categorical variables . These representations serve as direct generalizations of the Boolean surrogate model based on Fourier expansion proposed in Dadkhahi et al . ( 2020 ) in the sense that they reduce to the Fourier representation for real-valued Boolean functions when the cardinality of the categorical variables is two . In addition , both approaches can be modified to address the more general case where different variables are of different cardinalities . However , for ease of exposition , we assume that all the variables are of the same cardinality . Finally , we introduce two popular acquisition function to be used in conjunction with the proposed surrogate models in order to propose new queries for subsequent black-box function evaluations .
The paper proposes two representations, namely one-hot encoded Boolean expansion and group-theoretical Fourier expansion, for the surrogate model used for the black-box evaluations on purely categorical variables. With the two surrogate models, the authors tackle both the black-box optimization problem and the design problem. Two forms of acquisition functions are applied for query selection – simulated annealing and Monte Carlo Tree Search. The new algorithms are compared with the existing methods in simulations and have advantage for the objective value and speed-up.
SP:d42f0ce82c552abd6dca4300796a3f5678a9409a
Fourier Representations for Black-Box Optimization over Categorical Variables
1 INTRODUCTION . A plethora of practical optimization problems involve black-box functions , with no simple analytical closed forms , that can be evaluated at any arbitrary point in the domain . Optimization of such black-box functions poses a unique challenge due to restrictions on the number of possible function evaluations , as evaluating functions of real-world complex processes is often expensive and time consuming . Efficient algorithms for global optimization of expensive black-box functions take past queries into account in order to select the next query to the black-box function more intelligently . While black-box optimization of real-world functions defined over integer , continuous , and mixed variables has been studied extensively in the literature , limited work has addressed incorporation of purely categorical type input variables . Categorical type variables are particularly challenging when compared to integer or continuous variables , as they do not have a natural ordering . However , many real-world functions are defined over categorical variables . One such problem , which is of wide interest , is the design of optimal chemical or biological ( protein , RNA , and DNA ) molecule sequences , which are constructed using a vocabulary of fixed size , e.g . 4 for DNA/RNA . Designing optimal molecular sequences with improved or novel structures and/or functionalities is of paramount importance in material science , drug and vaccine design , synthetic biology and many other applications ( see Dixon et al . ( 2010 ) ; Ng et al . ( 2019 ) ; Hoshika et al . ( 2019 ) ; Yamagami et al . ( 2019 ) ) . Design of optimal sequences is a difficult black-box optimization problem over a combinatorially large search space ( Stephens et al . ( 2015 ) ) , in which function evaluations often rely on either wet-lab experiments , physics-inspired simulators , or knowledge-based computational algorithms , which are slow and expensive in practice . Another problem of interest is the constrained design problem , e.g . find a sequence given a specific structure ( or property ) , which is inverse of the well-known folding problem discussed in Dill & MacCallum ( 2012 ) . This problem is complex due to the strict structural constraints imposed on the sequence . In fact one of the ways to represent such a complex structural constraint is to constrain the next choice sequentially based on the sequence elements that have been chosen a priori . Therefore , we divide the black box optimization problem into two settings , depending on the constraint set : ( i ) Generic Black Box Optimization ( BBO ) problem referring to the unconstrained case and ( ii ) Design Problem that refers to the case with complex sequential constraints . Let xt be the t-th sequence evaluated by the black box function f . The key question in both settings is the following : Given prior queries x1 , x2 . . . xt and their evaluations f ( x1 ) . . . f ( xt ) , how to choose the next query xt+1 ? This acquisition must be devised so that over a finite budget of black-box evaluations , one is closest to the minimizer in an expected sense over the acquisition randomness . In the literature , for design problems with sequential constraints , MCTS ( Monte Carlo Tree Search ) based acquisitions are often used with real function evaluations f ( xt ) . In the generic BBO problems in the unconstrained scenario , Simulated Annealing ( SA ) based techniques are typically used as acquisition functions . A key missing ingredient in the categorical domain is a surrogate model for the black-box evaluations that can interpolate between such evaluations and use cost-free approximate evaluations from the surrogate model internally ( in acquisition functions ) in order to reduce the need for frequently accessing real evaluations . This leads to improved sample efficiency in acquisition functions . Due to the lack of efficient interpolators in the categorical domains , existing acquisition functions suffer under a finite budget constraint , due to reliance on only real black-box evaluations . Contributions : We address the above problem in our work . Our main contributions are as follows : 1 . We present two representations for modeling real-valued combinatorial functions over categorical variables , which we then use in order to learn a surrogate model for the generic BBO problem and the design problem . The surrogate model is updated via a hedge algorithm where the basis functions in our representations act as experts . The latter update happens once for every real black-box evaluation . To the best of our knowledge , the representations and/or their use in black-box optimization of functions over categorical variables are novel to this work . 2 . In the BBO problem , the proposed method uses a version of simulated annealing that utilizes the current surrogate model for many internal cost-free evaluations before producing the next black-box query . 3 . In the design problem , the proposed method uses a version of MCTS in conjunction with the current surrogate model as reward function of the terminal states during intermediate tree traversals/backups in order to improve the sample efficiency of the search algorithm . 4 . Numerical results , over synthetic benchmarks as well as real-world biological ( RNA ) sequence optimization and design problems demonstrate the competitive or superior performance of the proposed methods over state-of-the-art counterparts , while substantially reducing the computation time and sample efficiency , respectively . 2 RELATED WORK . Hutter et al . ( 2011 ) suggests a surrogate model based on random forests to address optimization problems over categorical variables . The proposed SMAC algorithm uses a randomized local search under the expected improvement acquisition criterion in order to obtain candidate points for black-box evaluations . Bergstra et al . ( 2011 ) suggests a tree-structured Parzen estimator ( TPE ) for approximating the surrogate model , and maximizes the expected improvement criterion to find candidate points for evaluation . For optimization problems over Boolean variables , multilinear polynomials Ricardo Baptista ( 2018 ) ; Dadkhahi et al . ( 2020 ) and Walsh functions Leprêtre et al . ( 2019 ) have been used in the literature . Bayesian Optimization ( BO ) is a commonly used approach for optimization of black-box functions ( Shahriari et al . ( 2015 ) ) . However , limited work has addressed incorporation of categorical variables in BO . Early attempts based on converting the black-box optimization problem over categorical variables to that of continuous variables have not been very successful ( Gómez-Bombarelli et al . ( 2018 ) ; Golovin et al . ( 2017 ) ; Garrido-Merchán & Hernández-Lobato ( 2020 ) ) . A few BO algorithms have been specifically designed for black-box functions over combinatorial domains . In particular , the BOCS algorithm Ricardo Baptista ( 2018 ) , primarily devised for Boolean functions , employs a sparse monomial representation to model the interactions among different variables , and uses a sparse Bayesian linear regression method to learn the model coefficients . The COMBO algorithm of Oh et al . ( 2019 ) uses Graph Fourier Transform ( GFT ) over a combinatorial graph , constructed via graph cartesian product of variable subgraphs , to gauge the smoothness of the black-box function . However , both BOCS and COMBO are hindered by associated high computational complexities , which grow polynomially with both the number of variables and the number of function evaluations . More recently , a computationally efficient black-box optimization algorithm ( COMEX ) ( Dadkhahi et al . ( 2020 ) ) was introduced to address the computational impediments of its Bayesian counterparts . COMEX adopts a Boolean Fourier representation as its surrogate model , which is updated via an exponential weight update rule . Nevertheless , COMEX is limited to functions over the Boolean hypercube . We generalize COMEX to handle functions over categorical variables by proposing two representations for modeling functions over categorical variables : an abridged one-hot encoded Boolean Fourier representation and Fourier representation on finite Abelian groups . The utilization of the latter representation as a surrogate model in combinatorial optimization algorithms is novel to this work . Factorizations based on one-hot encoding has been previously ( albeit briefly ) suggested in Ricardo Baptista ( 2018 ) to enable black-box optimization algorithms designed for Boolean variables to address problems over categorical variables . Different from Ricardo Baptista ( 2018 ) , we show that we can significantly reduce the number of additional variables introduced upon one-hot encoding , and that such a reduced representation is in fact complete and unique . For design problems , we focus on the RNA sequence design problem ( RNA inverse folding ) . The goal is to find an RNA sequence consistent with a given secondary structure , as the functional state of the RNA molecule is determined by the latter structure ( Hofacker et al . ( 1994 ) ) . Earlier RNA design methods explore the search space by trial and error and use classic cost function minimization approaches such as adaptive random walk ( Hofacker ( 2003 ) ) , probabilistic sampling ( Zadeh et al . ( 2011 ) ) , and genetic algorithms ( Taneda ( 2015 ) ) . Recent efforts employ more advanced machine learning methods such as different Monte Carlo Tree Search ( MCTS ) algorithms , e.g . MCTS-RNA ( Yang et al . ( 2017 ) ) or Nested MCTS ( Portela ( 2018 ) ) , and reinforcement learning that either performs a local search as in Eastman et al . ( 2018 ) or learns complete candidate solutions from scratch ( Runge et al . ( 2018 ) ) . In all these approaches , the assumption is that the algorithm has access to a large number of function evaluations , whereas we are interested in sample efficiency of each algorithm . As an alternative to parameter free search methods ( such as SA ) , Swersky et al . ( 2020 ) suggests to use a parameterized policy to generate candidates that maximize the acquisition function in Bayesian optimization over discrete search spaces . Our MCTS acquisition method is similar in concept to Swersky et al . ( 2020 ) in the sense that the tabular value functions are constructed and maintained over different time steps . However , we are maintaining value functions rather than a policy network . 3 BLACK-BOX OPTIMIZATION OVER CATEGORICAL VARIABLES . Problem Setting : Given the combinatorial categorical domain X = [ k ] n and a constraint set C ⊆ X , with n variables each of cardinality k , the objective is to find x∗ = arg min x∈C f ( x ) ( 1 ) where f : X 7→ R is a real-valued combinatorial function . We assume that f is a black-box function , which is computationally expensive to evaluate . As such , we are interested in finding x∗ in as few evaluations as possible . We consider two variations of the problem depending on how the constraint set C is specified . Generic BBO Problem : In this case , the constraint set C = X . For example , RNA sequence optimization problem that searches for an RNA sequence with a specific property optimized lies within this category . A score for every RNA sequence , reflecting the property we wish to optimize , is evaluated by a black box function . Design Problem : The constraint set is complex and is only sequentially specified . For every sequence of x1x2 . . . xi consisting of i characters from the alphabet [ k ] , the choice of the next character xi+1 ∈ C ( x1x2 . . . xi ) ⊆ [ k ] is specified by a constraint set function C ( x1 . . . xi ) . The RNA inverse folding problem in Runge et al . ( 2018 ) falls into this category , where the constraints on the RNA sequence are determined by the sequential choices one makes during the sequence design . The goal is to find the sequence that is optimal with respect to a pre-specified structure that also obeys complex sequential constraints . Our Techniques : In order to address this problem , we adopt a surrogate model-acquisition function based learning framework , where an estimate for the black-box function f̂ ( i.e . the surrogate model ) is updated sequentially via black-box function evaluations observed until time step t. The selection of candidate points for black-box function evaluation is carried out via an acquisition function , which uses the surrogate model f̂ as an inexpensive proxy ( to make many internal calls ) for the black-box function and produces the next candidate point to be evaluated . The sequence proceeds as follows : Surrogate model updated on ( xt , f ( xt ) ) → Acquisition function makes ( many ) calls to Surrogate model to propose xt+1 → Surrogate model updated on ( xt+1 , f ( xt+1 ) ) In the sequel , we propose two representations that can be used as surrogate models for black-box combinatorial functions over categorical variables . These representations serve as direct generalizations of the Boolean surrogate model based on Fourier expansion proposed in Dadkhahi et al . ( 2020 ) in the sense that they reduce to the Fourier representation for real-valued Boolean functions when the cardinality of the categorical variables is two . In addition , both approaches can be modified to address the more general case where different variables are of different cardinalities . However , for ease of exposition , we assume that all the variables are of the same cardinality . Finally , we introduce two popular acquisition function to be used in conjunction with the proposed surrogate models in order to propose new queries for subsequent black-box function evaluations .
This paper proposes a model-based black-box function optimization on purely categorical variables. Two different representations for categorical variables are proposed, one is an improved pseudo-boolean function form capable of representing non-binary categorical variables in a compact way and another is to rely on (mathematical) group representation theory after mapping each categorical variable to a cyclic group. In acquisition function optimization, SA is used for generic BO and MCTS is used for design problems. The proposed EGD-F/G are compared with baselines and shown to have competitive computational efficiency with comparable performance.
SP:d42f0ce82c552abd6dca4300796a3f5678a9409a
Fourier Representations for Black-Box Optimization over Categorical Variables
1 INTRODUCTION . A plethora of practical optimization problems involve black-box functions , with no simple analytical closed forms , that can be evaluated at any arbitrary point in the domain . Optimization of such black-box functions poses a unique challenge due to restrictions on the number of possible function evaluations , as evaluating functions of real-world complex processes is often expensive and time consuming . Efficient algorithms for global optimization of expensive black-box functions take past queries into account in order to select the next query to the black-box function more intelligently . While black-box optimization of real-world functions defined over integer , continuous , and mixed variables has been studied extensively in the literature , limited work has addressed incorporation of purely categorical type input variables . Categorical type variables are particularly challenging when compared to integer or continuous variables , as they do not have a natural ordering . However , many real-world functions are defined over categorical variables . One such problem , which is of wide interest , is the design of optimal chemical or biological ( protein , RNA , and DNA ) molecule sequences , which are constructed using a vocabulary of fixed size , e.g . 4 for DNA/RNA . Designing optimal molecular sequences with improved or novel structures and/or functionalities is of paramount importance in material science , drug and vaccine design , synthetic biology and many other applications ( see Dixon et al . ( 2010 ) ; Ng et al . ( 2019 ) ; Hoshika et al . ( 2019 ) ; Yamagami et al . ( 2019 ) ) . Design of optimal sequences is a difficult black-box optimization problem over a combinatorially large search space ( Stephens et al . ( 2015 ) ) , in which function evaluations often rely on either wet-lab experiments , physics-inspired simulators , or knowledge-based computational algorithms , which are slow and expensive in practice . Another problem of interest is the constrained design problem , e.g . find a sequence given a specific structure ( or property ) , which is inverse of the well-known folding problem discussed in Dill & MacCallum ( 2012 ) . This problem is complex due to the strict structural constraints imposed on the sequence . In fact one of the ways to represent such a complex structural constraint is to constrain the next choice sequentially based on the sequence elements that have been chosen a priori . Therefore , we divide the black box optimization problem into two settings , depending on the constraint set : ( i ) Generic Black Box Optimization ( BBO ) problem referring to the unconstrained case and ( ii ) Design Problem that refers to the case with complex sequential constraints . Let xt be the t-th sequence evaluated by the black box function f . The key question in both settings is the following : Given prior queries x1 , x2 . . . xt and their evaluations f ( x1 ) . . . f ( xt ) , how to choose the next query xt+1 ? This acquisition must be devised so that over a finite budget of black-box evaluations , one is closest to the minimizer in an expected sense over the acquisition randomness . In the literature , for design problems with sequential constraints , MCTS ( Monte Carlo Tree Search ) based acquisitions are often used with real function evaluations f ( xt ) . In the generic BBO problems in the unconstrained scenario , Simulated Annealing ( SA ) based techniques are typically used as acquisition functions . A key missing ingredient in the categorical domain is a surrogate model for the black-box evaluations that can interpolate between such evaluations and use cost-free approximate evaluations from the surrogate model internally ( in acquisition functions ) in order to reduce the need for frequently accessing real evaluations . This leads to improved sample efficiency in acquisition functions . Due to the lack of efficient interpolators in the categorical domains , existing acquisition functions suffer under a finite budget constraint , due to reliance on only real black-box evaluations . Contributions : We address the above problem in our work . Our main contributions are as follows : 1 . We present two representations for modeling real-valued combinatorial functions over categorical variables , which we then use in order to learn a surrogate model for the generic BBO problem and the design problem . The surrogate model is updated via a hedge algorithm where the basis functions in our representations act as experts . The latter update happens once for every real black-box evaluation . To the best of our knowledge , the representations and/or their use in black-box optimization of functions over categorical variables are novel to this work . 2 . In the BBO problem , the proposed method uses a version of simulated annealing that utilizes the current surrogate model for many internal cost-free evaluations before producing the next black-box query . 3 . In the design problem , the proposed method uses a version of MCTS in conjunction with the current surrogate model as reward function of the terminal states during intermediate tree traversals/backups in order to improve the sample efficiency of the search algorithm . 4 . Numerical results , over synthetic benchmarks as well as real-world biological ( RNA ) sequence optimization and design problems demonstrate the competitive or superior performance of the proposed methods over state-of-the-art counterparts , while substantially reducing the computation time and sample efficiency , respectively . 2 RELATED WORK . Hutter et al . ( 2011 ) suggests a surrogate model based on random forests to address optimization problems over categorical variables . The proposed SMAC algorithm uses a randomized local search under the expected improvement acquisition criterion in order to obtain candidate points for black-box evaluations . Bergstra et al . ( 2011 ) suggests a tree-structured Parzen estimator ( TPE ) for approximating the surrogate model , and maximizes the expected improvement criterion to find candidate points for evaluation . For optimization problems over Boolean variables , multilinear polynomials Ricardo Baptista ( 2018 ) ; Dadkhahi et al . ( 2020 ) and Walsh functions Leprêtre et al . ( 2019 ) have been used in the literature . Bayesian Optimization ( BO ) is a commonly used approach for optimization of black-box functions ( Shahriari et al . ( 2015 ) ) . However , limited work has addressed incorporation of categorical variables in BO . Early attempts based on converting the black-box optimization problem over categorical variables to that of continuous variables have not been very successful ( Gómez-Bombarelli et al . ( 2018 ) ; Golovin et al . ( 2017 ) ; Garrido-Merchán & Hernández-Lobato ( 2020 ) ) . A few BO algorithms have been specifically designed for black-box functions over combinatorial domains . In particular , the BOCS algorithm Ricardo Baptista ( 2018 ) , primarily devised for Boolean functions , employs a sparse monomial representation to model the interactions among different variables , and uses a sparse Bayesian linear regression method to learn the model coefficients . The COMBO algorithm of Oh et al . ( 2019 ) uses Graph Fourier Transform ( GFT ) over a combinatorial graph , constructed via graph cartesian product of variable subgraphs , to gauge the smoothness of the black-box function . However , both BOCS and COMBO are hindered by associated high computational complexities , which grow polynomially with both the number of variables and the number of function evaluations . More recently , a computationally efficient black-box optimization algorithm ( COMEX ) ( Dadkhahi et al . ( 2020 ) ) was introduced to address the computational impediments of its Bayesian counterparts . COMEX adopts a Boolean Fourier representation as its surrogate model , which is updated via an exponential weight update rule . Nevertheless , COMEX is limited to functions over the Boolean hypercube . We generalize COMEX to handle functions over categorical variables by proposing two representations for modeling functions over categorical variables : an abridged one-hot encoded Boolean Fourier representation and Fourier representation on finite Abelian groups . The utilization of the latter representation as a surrogate model in combinatorial optimization algorithms is novel to this work . Factorizations based on one-hot encoding has been previously ( albeit briefly ) suggested in Ricardo Baptista ( 2018 ) to enable black-box optimization algorithms designed for Boolean variables to address problems over categorical variables . Different from Ricardo Baptista ( 2018 ) , we show that we can significantly reduce the number of additional variables introduced upon one-hot encoding , and that such a reduced representation is in fact complete and unique . For design problems , we focus on the RNA sequence design problem ( RNA inverse folding ) . The goal is to find an RNA sequence consistent with a given secondary structure , as the functional state of the RNA molecule is determined by the latter structure ( Hofacker et al . ( 1994 ) ) . Earlier RNA design methods explore the search space by trial and error and use classic cost function minimization approaches such as adaptive random walk ( Hofacker ( 2003 ) ) , probabilistic sampling ( Zadeh et al . ( 2011 ) ) , and genetic algorithms ( Taneda ( 2015 ) ) . Recent efforts employ more advanced machine learning methods such as different Monte Carlo Tree Search ( MCTS ) algorithms , e.g . MCTS-RNA ( Yang et al . ( 2017 ) ) or Nested MCTS ( Portela ( 2018 ) ) , and reinforcement learning that either performs a local search as in Eastman et al . ( 2018 ) or learns complete candidate solutions from scratch ( Runge et al . ( 2018 ) ) . In all these approaches , the assumption is that the algorithm has access to a large number of function evaluations , whereas we are interested in sample efficiency of each algorithm . As an alternative to parameter free search methods ( such as SA ) , Swersky et al . ( 2020 ) suggests to use a parameterized policy to generate candidates that maximize the acquisition function in Bayesian optimization over discrete search spaces . Our MCTS acquisition method is similar in concept to Swersky et al . ( 2020 ) in the sense that the tabular value functions are constructed and maintained over different time steps . However , we are maintaining value functions rather than a policy network . 3 BLACK-BOX OPTIMIZATION OVER CATEGORICAL VARIABLES . Problem Setting : Given the combinatorial categorical domain X = [ k ] n and a constraint set C ⊆ X , with n variables each of cardinality k , the objective is to find x∗ = arg min x∈C f ( x ) ( 1 ) where f : X 7→ R is a real-valued combinatorial function . We assume that f is a black-box function , which is computationally expensive to evaluate . As such , we are interested in finding x∗ in as few evaluations as possible . We consider two variations of the problem depending on how the constraint set C is specified . Generic BBO Problem : In this case , the constraint set C = X . For example , RNA sequence optimization problem that searches for an RNA sequence with a specific property optimized lies within this category . A score for every RNA sequence , reflecting the property we wish to optimize , is evaluated by a black box function . Design Problem : The constraint set is complex and is only sequentially specified . For every sequence of x1x2 . . . xi consisting of i characters from the alphabet [ k ] , the choice of the next character xi+1 ∈ C ( x1x2 . . . xi ) ⊆ [ k ] is specified by a constraint set function C ( x1 . . . xi ) . The RNA inverse folding problem in Runge et al . ( 2018 ) falls into this category , where the constraints on the RNA sequence are determined by the sequential choices one makes during the sequence design . The goal is to find the sequence that is optimal with respect to a pre-specified structure that also obeys complex sequential constraints . Our Techniques : In order to address this problem , we adopt a surrogate model-acquisition function based learning framework , where an estimate for the black-box function f̂ ( i.e . the surrogate model ) is updated sequentially via black-box function evaluations observed until time step t. The selection of candidate points for black-box function evaluation is carried out via an acquisition function , which uses the surrogate model f̂ as an inexpensive proxy ( to make many internal calls ) for the black-box function and produces the next candidate point to be evaluated . The sequence proceeds as follows : Surrogate model updated on ( xt , f ( xt ) ) → Acquisition function makes ( many ) calls to Surrogate model to propose xt+1 → Surrogate model updated on ( xt+1 , f ( xt+1 ) ) In the sequel , we propose two representations that can be used as surrogate models for black-box combinatorial functions over categorical variables . These representations serve as direct generalizations of the Boolean surrogate model based on Fourier expansion proposed in Dadkhahi et al . ( 2020 ) in the sense that they reduce to the Fourier representation for real-valued Boolean functions when the cardinality of the categorical variables is two . In addition , both approaches can be modified to address the more general case where different variables are of different cardinalities . However , for ease of exposition , we assume that all the variables are of the same cardinality . Finally , we introduce two popular acquisition function to be used in conjunction with the proposed surrogate models in order to propose new queries for subsequent black-box function evaluations .
The paper considers the problem of black-box optimization of expensive functions defined over categorical variables. A surrogate model-based optimization approach is proposed to tackle this problem. Fourier representations are proposed as surrogate model by treating the categorical input as the direct sum of cyclic groups Z/kZ (k is the arity/category size). The coefficients of this representation are learned via exponentially-weighted update rule. The selection of each subsequent input for evaluation is performed via direct optimization of the surrogate model built over inputs collected previously. Simulated Annealing and Monte Carlo Tree Search is proposed as the acquisition function optimization procedure for unconstrained and constrained problems respectively. Experiments are performed on two synthetic problems and RNA-sequence optimization.
SP:d42f0ce82c552abd6dca4300796a3f5678a9409a
Training By Vanilla SGD with Larger Learning Rates
1 INTRODUCTION . We are interested in minimizing a function f : Rd → R with an expectation form : min x∈Rd f ( x ) : = Eξ [ K ( x , ξ ) ] , ( 1a ) where the subscript indicates expectation is computed on the random variable ξ . Specially , if the ξ probability distribution is clear and random variable ξ is uniformly distributed on N terms , the objective function f can be expressed into a finite-sum form : min x∈Rd f ( x ) : = 1 N N∑ i=1 fi ( x ) , ( 1b ) where fi ( x ) : Rd → R is the i-th component function . The optimization of Eqs . ( 1a ) and ( 1b ) is widely encountered in machine learning tasks ( Goodfellow et al. , 2016 ; Simonyan & Zisserman , 2014 ) . To solve this problem given in Eq . ( 1b ) , we can compute the gradient of objective function directly with a classic GD ( Gradient Descent ) algorithm . However , this method suffers from expensive gradient computation for extremely large N , and hence people apply stochastic gradient descent method ( SGM ) to address this issue . Incremental gradient descent ( IGD ) is a primary version of SGM , where its calculation of gradient proceeds on single component fi at each iteration , instead of the whole . As a special case of IGD , SGD ( Robbins & Monro , 1951 ) , a fundamental method to train neural networks , always updates parameters by the gradient computed on a minibatch . There exists an intuitive view that SGD with constant step size ( SGD-CS ) potentially leads to faster convergence rate . Some studies ( Solodov , 1998 ; Tseng , 1998 ) show that , under a so-called strong growth condition ( SGC ) , SGD-CS converges to an optimal point faster than SGD with a diminishing step size . In this work , we study the local convergence ( or last-iterate convergence as is called in Jain et al . ( 2019 ) ) of SGD-CS on nonconvex functions . Note that SGD-CS does not provide a guarantee of converge when starting from any initialization point . Therefore , a useful strategy is to use SGD with a decreasing step size at the beginning , and then switch to SGD-CS in a neighborhood of a minimizer . Fig.1 illustrates the range of the step size of SGD versus the number of iterations . Our main theoretical and experimental contributions are as follows . • We establish local ( or last-iterate ) convergence of SGD with a constant step size ( SGDCS ) on nonconvex functions under the interpolation condition . We note that previous results are mostly for strongly convex functions under strong ( or weak ) growth condition . Our result is much closer to common situations in practice . • We discover that on linear regression problems with ` 2 regularization , the size of convergent learning rates can be quite large for incremental gradient descent ( IGD ) . Our numerical results show that , within a fairly large range , the larger step size is , the smaller spectral radius is , and the faster the convergence rate is . • Based on the above observations , we further propose a strategy called SGDL that uses the SGD with a large initial learning rate ( more than 10 times larger than the learning rate in SGD with momentum ) , while still being a vanilla SGD . We conduct extensive experiments on various popular deep-learning tasks and models in computer vision , audio recognition and natural language processing . Our results show that the method converges successfully and has a strong generalization performance , and sometimes outperforms its advanced variant ( SGDM ) and other several popular adaptive methods ( e.g. , Adam , AdaDelta , etc ) . 2 RELATED WORK . There are many papers on stochastic optimization and we summarize typical ones which are most relevant with our work . The convergence of SGD for over-parameterized models is analyzed in ( Vaswani et al. , 2018 ; Mai & Johansson , 2020 ; Allen-Zhu et al. , 2019 ; Li & Liang , 2018 ) . The power of interpolation is studied in ( Ma et al. , 2018 ; Vaswani et al. , 2019 ) . The work ( Jastrzębski et al. , 2017 ) investigates a large ratio of learning rate to batch size often leads to a wide endpoint . The work ( Smith & Topin , 2019 ) shows a phenomenon called super-convergence which is in contrast to the results in ( Bottou et al. , 2018 ) . More recently , several new learning rate schedules have proposed for SGD ( Loshchilov & Hutter , 2016 ; Smith , 2017 ; Agarwal et al. , 2017 ; Carmon et al. , 2018 ) . Adaptive gradient methods are widely in deep learning application . Popular solutions include AdaDelta ( Zeiler , 2012 ) , RMSProp ( Hinton et al. , 2012 ) , Adam ( Kingma & Ba , 2014 ) and so on . Unfortunately , it is believed that the adaptive methods may have a poor empirically performance . For example , Wilson et al . ( 2017 ) have observed that Adam hurts generalization performance in comparison to SGD with or without momentum . The work ( Schmidt & Roux , 2013 ) introduces SGD-CS that attains linear convergence rate for strongly convex functions under the strong growth condition ( SGC ) , and sublinear convergence rate for convex functions under the SGC . The work ( Cevher & Vu , 2018 ) investigates the weak growth condition ( WGC ) , the necessary condition for linear convergence of SGD-CS . For a general convex function , the work ( Ma et al. , 2018 ) shows that SGD-CS attains linear convergence rate under the interpolation property . For a finite sum f , the interpolation property means ∇fi ( x∗ ) = 0 for i = 1 , . . . , N , which is held apparently in over-parameterized DNN . However , the theoretical analysis of SGD-CS for nonconvex functions is less as mature as in the convex case . 3 PRELIMINARIES . 3.1 NOTATIONS . We denote the minimizer of object function f as x∗ and use usual partial ordering for symmetric matrices : A B means A−B is positive semidefinite ; similar for the relations , , ≺ . The norm ‖ · ‖ either denotes the Euclidean norm for vectors or Frobenius norm for matrices . The Hessian matrix of each component function fi ( x ) is denoted as Hi ( x ) . With slight abuse of notation , the Hessian matrix Hi at x∗ is denoted as H∗i . We also denote the mean and variance of { H∗1 , . . . , H∗N } as H∗ ≡ 1N ∑N i=1H ∗ i and Σ ∗ ≡ 1N ∑N i=1 ( H ∗ i ) 2 − ( H∗ ) 2 , and define a ∧ b = min ( a , b ) . X P−→ Y means random variable X converges to random variable Y in probability , while X L 1 −−→ Y means X converges to random variable Y in L1 norm . 3.2 ASSUMPTIONS . Our results are under the following mild assumptions : ( A.1 ) The objective function f has the same structure as given in Eq. ( 1b ) . ( A.2 ) Each component function fi in Eq . ( 1b ) is twice continously differentiable , with the corresponding Hessian matrix Hi being Lipschitz continuous for constant Li at the minimizer x∗ . Without loss of generality , we suppose that ‖Hi ( x ) −Hi ( x∗ ) ‖ ≤ L‖x− x∗‖ , for i = 1 , . . . , N , where L = max i=1 , ... , N Li . ( A.3 ) As in ( Zhang et al. , 2000 , Remark 5.2 ) , we assume the point of interest x∗ is a strong minimizer ( i.e . H ( x∗ ) 0 ) . Assumption ( A.3 ) restricts that the objective function is essentially strongly convex in a sufficiently small neighborhood of a minimizer . The work ( Liu et al. , 2020 ) investigates that the loss function is typically nonconvex in any neighborhood of a minimizer . However , this assumption is not restrictive in the regularization setting . Remark 1 . Even if the Hessian matrix of the point of interest x∗ has zero eigenvalues , we can study the ` 2 regularized problem instead , and then the Hessian matrix becomes positive definite . This phenomenon is also validated in our numerical experiment in Section 5 , and we add ` 2 regularizer in DNNs in Section 6 . Based on the above technical assumptions , we focus on the convergence analysis of SGD-CS by discussing the convergence behavior precisely : xk+1 = xk − α 1 m m∑ j=1 ∇f ξ ( j ) k ( xk ) . ( 2 ) Next , we introduce the notion of point attraction to help us understand the convergence behavior to Eq. ( 2 ) . Definition 1 . We say x∗ is a point of attraction to Eq . ( 2 ) if there is an open ball N ( x∗ , ) of x∗ , such that for any x0 ∈ N , { xk } generated by Eq . ( 2 ) all lie inN and converges to x∗ in the ` 1 norm . The Ostrowski Theorem says a sufficient condition for x∗ to be a point of attraction of the deterministic iteration xk+1 = T ( xk ) is that the spectral radius of T ′ ( x ) is strictly less than one , which further implies the condition that there exists an open ball N such that once the initial x0 ∈ N , the iterates { xk } will converge to x∗ with linear rate . We define the strong minimizer x∗ as a point of strong attraction following the similar manner . Definition 2 . We say x∗ is a point of strong attraction to Eq . ( 2 ) if there exists a neighborhoodN of x∗ , such that for any x0 ∈ N , the sequence { xk } generated by Eq . ( 2 ) all lie in N and satisfy E‖xk − x∗‖2 ≤ ρk · ‖x0 − x∗‖2 , for some ρ ∈ [ 0 , 1 ) . The following discussion studies necessary and sufficient conditions for the minimizer x∗ being a point of attraction of SGD with the constant step size α . However , starting from any initialization point , SGD-CS can not be guaranteed to find such a local neighborhood around x∗ , except in some special cases including the loss function studied in Section 5 and Appendix A.2 . Therefore , a practical strategy is to use diminishing step size when starting from a random initial point ( Allen-Zhu , 2018 ) , and as long as the iteration points belong to a neighborhood of a point of attraction , one can use a constant step size . 4 RESULTS FOR NONCONVEX FUNCTIONS . In this section , we rigorously show the necessary condition for the minimizer x∗ being a point of attraction , and Theorem 1 provides a sufficient condition for the strong minimizer x∗ to be a point of strong attraction with high probability . The detailed proofs are in Appendix.A.1 . 4.1 NECESSARY CONDITION . Lemma 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold , then ‖∇fi ( x ) ‖ < L 2 + ‖H∗i ‖ for i = 1 , . . . , N , provided that x ∈ N ( x∗ , ) . Theorem 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold . If the minimizer x∗ is a point of attraction of Eq . ( 2 ) , then the interpolation property is satisfied , i.e. , ∇fi ( x∗ ) = 0 for i = 1 , . . . , N .
This paper studies the smooth finite-sum problem under suitable conditions in the non-convex case. They show the necessary condition for the minimizer $x^*$ being a point of attraction, and Theorem 1 provides a sufficient condition for the strong minimizer $x^*$ to be a point of strong attraction with high probability. Based on the results, they introduce a modified SGD algorithm with a large initial learning rate (SGDL), and provide extensive experiments on various popular tasks and models in computer vision, audio recognition and natural language processing.
SP:03fd27c6a1e0c015dbd52eb08dac258efeaba5b1
Training By Vanilla SGD with Larger Learning Rates
1 INTRODUCTION . We are interested in minimizing a function f : Rd → R with an expectation form : min x∈Rd f ( x ) : = Eξ [ K ( x , ξ ) ] , ( 1a ) where the subscript indicates expectation is computed on the random variable ξ . Specially , if the ξ probability distribution is clear and random variable ξ is uniformly distributed on N terms , the objective function f can be expressed into a finite-sum form : min x∈Rd f ( x ) : = 1 N N∑ i=1 fi ( x ) , ( 1b ) where fi ( x ) : Rd → R is the i-th component function . The optimization of Eqs . ( 1a ) and ( 1b ) is widely encountered in machine learning tasks ( Goodfellow et al. , 2016 ; Simonyan & Zisserman , 2014 ) . To solve this problem given in Eq . ( 1b ) , we can compute the gradient of objective function directly with a classic GD ( Gradient Descent ) algorithm . However , this method suffers from expensive gradient computation for extremely large N , and hence people apply stochastic gradient descent method ( SGM ) to address this issue . Incremental gradient descent ( IGD ) is a primary version of SGM , where its calculation of gradient proceeds on single component fi at each iteration , instead of the whole . As a special case of IGD , SGD ( Robbins & Monro , 1951 ) , a fundamental method to train neural networks , always updates parameters by the gradient computed on a minibatch . There exists an intuitive view that SGD with constant step size ( SGD-CS ) potentially leads to faster convergence rate . Some studies ( Solodov , 1998 ; Tseng , 1998 ) show that , under a so-called strong growth condition ( SGC ) , SGD-CS converges to an optimal point faster than SGD with a diminishing step size . In this work , we study the local convergence ( or last-iterate convergence as is called in Jain et al . ( 2019 ) ) of SGD-CS on nonconvex functions . Note that SGD-CS does not provide a guarantee of converge when starting from any initialization point . Therefore , a useful strategy is to use SGD with a decreasing step size at the beginning , and then switch to SGD-CS in a neighborhood of a minimizer . Fig.1 illustrates the range of the step size of SGD versus the number of iterations . Our main theoretical and experimental contributions are as follows . • We establish local ( or last-iterate ) convergence of SGD with a constant step size ( SGDCS ) on nonconvex functions under the interpolation condition . We note that previous results are mostly for strongly convex functions under strong ( or weak ) growth condition . Our result is much closer to common situations in practice . • We discover that on linear regression problems with ` 2 regularization , the size of convergent learning rates can be quite large for incremental gradient descent ( IGD ) . Our numerical results show that , within a fairly large range , the larger step size is , the smaller spectral radius is , and the faster the convergence rate is . • Based on the above observations , we further propose a strategy called SGDL that uses the SGD with a large initial learning rate ( more than 10 times larger than the learning rate in SGD with momentum ) , while still being a vanilla SGD . We conduct extensive experiments on various popular deep-learning tasks and models in computer vision , audio recognition and natural language processing . Our results show that the method converges successfully and has a strong generalization performance , and sometimes outperforms its advanced variant ( SGDM ) and other several popular adaptive methods ( e.g. , Adam , AdaDelta , etc ) . 2 RELATED WORK . There are many papers on stochastic optimization and we summarize typical ones which are most relevant with our work . The convergence of SGD for over-parameterized models is analyzed in ( Vaswani et al. , 2018 ; Mai & Johansson , 2020 ; Allen-Zhu et al. , 2019 ; Li & Liang , 2018 ) . The power of interpolation is studied in ( Ma et al. , 2018 ; Vaswani et al. , 2019 ) . The work ( Jastrzębski et al. , 2017 ) investigates a large ratio of learning rate to batch size often leads to a wide endpoint . The work ( Smith & Topin , 2019 ) shows a phenomenon called super-convergence which is in contrast to the results in ( Bottou et al. , 2018 ) . More recently , several new learning rate schedules have proposed for SGD ( Loshchilov & Hutter , 2016 ; Smith , 2017 ; Agarwal et al. , 2017 ; Carmon et al. , 2018 ) . Adaptive gradient methods are widely in deep learning application . Popular solutions include AdaDelta ( Zeiler , 2012 ) , RMSProp ( Hinton et al. , 2012 ) , Adam ( Kingma & Ba , 2014 ) and so on . Unfortunately , it is believed that the adaptive methods may have a poor empirically performance . For example , Wilson et al . ( 2017 ) have observed that Adam hurts generalization performance in comparison to SGD with or without momentum . The work ( Schmidt & Roux , 2013 ) introduces SGD-CS that attains linear convergence rate for strongly convex functions under the strong growth condition ( SGC ) , and sublinear convergence rate for convex functions under the SGC . The work ( Cevher & Vu , 2018 ) investigates the weak growth condition ( WGC ) , the necessary condition for linear convergence of SGD-CS . For a general convex function , the work ( Ma et al. , 2018 ) shows that SGD-CS attains linear convergence rate under the interpolation property . For a finite sum f , the interpolation property means ∇fi ( x∗ ) = 0 for i = 1 , . . . , N , which is held apparently in over-parameterized DNN . However , the theoretical analysis of SGD-CS for nonconvex functions is less as mature as in the convex case . 3 PRELIMINARIES . 3.1 NOTATIONS . We denote the minimizer of object function f as x∗ and use usual partial ordering for symmetric matrices : A B means A−B is positive semidefinite ; similar for the relations , , ≺ . The norm ‖ · ‖ either denotes the Euclidean norm for vectors or Frobenius norm for matrices . The Hessian matrix of each component function fi ( x ) is denoted as Hi ( x ) . With slight abuse of notation , the Hessian matrix Hi at x∗ is denoted as H∗i . We also denote the mean and variance of { H∗1 , . . . , H∗N } as H∗ ≡ 1N ∑N i=1H ∗ i and Σ ∗ ≡ 1N ∑N i=1 ( H ∗ i ) 2 − ( H∗ ) 2 , and define a ∧ b = min ( a , b ) . X P−→ Y means random variable X converges to random variable Y in probability , while X L 1 −−→ Y means X converges to random variable Y in L1 norm . 3.2 ASSUMPTIONS . Our results are under the following mild assumptions : ( A.1 ) The objective function f has the same structure as given in Eq. ( 1b ) . ( A.2 ) Each component function fi in Eq . ( 1b ) is twice continously differentiable , with the corresponding Hessian matrix Hi being Lipschitz continuous for constant Li at the minimizer x∗ . Without loss of generality , we suppose that ‖Hi ( x ) −Hi ( x∗ ) ‖ ≤ L‖x− x∗‖ , for i = 1 , . . . , N , where L = max i=1 , ... , N Li . ( A.3 ) As in ( Zhang et al. , 2000 , Remark 5.2 ) , we assume the point of interest x∗ is a strong minimizer ( i.e . H ( x∗ ) 0 ) . Assumption ( A.3 ) restricts that the objective function is essentially strongly convex in a sufficiently small neighborhood of a minimizer . The work ( Liu et al. , 2020 ) investigates that the loss function is typically nonconvex in any neighborhood of a minimizer . However , this assumption is not restrictive in the regularization setting . Remark 1 . Even if the Hessian matrix of the point of interest x∗ has zero eigenvalues , we can study the ` 2 regularized problem instead , and then the Hessian matrix becomes positive definite . This phenomenon is also validated in our numerical experiment in Section 5 , and we add ` 2 regularizer in DNNs in Section 6 . Based on the above technical assumptions , we focus on the convergence analysis of SGD-CS by discussing the convergence behavior precisely : xk+1 = xk − α 1 m m∑ j=1 ∇f ξ ( j ) k ( xk ) . ( 2 ) Next , we introduce the notion of point attraction to help us understand the convergence behavior to Eq. ( 2 ) . Definition 1 . We say x∗ is a point of attraction to Eq . ( 2 ) if there is an open ball N ( x∗ , ) of x∗ , such that for any x0 ∈ N , { xk } generated by Eq . ( 2 ) all lie inN and converges to x∗ in the ` 1 norm . The Ostrowski Theorem says a sufficient condition for x∗ to be a point of attraction of the deterministic iteration xk+1 = T ( xk ) is that the spectral radius of T ′ ( x ) is strictly less than one , which further implies the condition that there exists an open ball N such that once the initial x0 ∈ N , the iterates { xk } will converge to x∗ with linear rate . We define the strong minimizer x∗ as a point of strong attraction following the similar manner . Definition 2 . We say x∗ is a point of strong attraction to Eq . ( 2 ) if there exists a neighborhoodN of x∗ , such that for any x0 ∈ N , the sequence { xk } generated by Eq . ( 2 ) all lie in N and satisfy E‖xk − x∗‖2 ≤ ρk · ‖x0 − x∗‖2 , for some ρ ∈ [ 0 , 1 ) . The following discussion studies necessary and sufficient conditions for the minimizer x∗ being a point of attraction of SGD with the constant step size α . However , starting from any initialization point , SGD-CS can not be guaranteed to find such a local neighborhood around x∗ , except in some special cases including the loss function studied in Section 5 and Appendix A.2 . Therefore , a practical strategy is to use diminishing step size when starting from a random initial point ( Allen-Zhu , 2018 ) , and as long as the iteration points belong to a neighborhood of a point of attraction , one can use a constant step size . 4 RESULTS FOR NONCONVEX FUNCTIONS . In this section , we rigorously show the necessary condition for the minimizer x∗ being a point of attraction , and Theorem 1 provides a sufficient condition for the strong minimizer x∗ to be a point of strong attraction with high probability . The detailed proofs are in Appendix.A.1 . 4.1 NECESSARY CONDITION . Lemma 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold , then ‖∇fi ( x ) ‖ < L 2 + ‖H∗i ‖ for i = 1 , . . . , N , provided that x ∈ N ( x∗ , ) . Theorem 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold . If the minimizer x∗ is a point of attraction of Eq . ( 2 ) , then the interpolation property is satisfied , i.e. , ∇fi ( x∗ ) = 0 for i = 1 , . . . , N .
This paper investigates the SGD with constant step size (SGD-CS) on non-conex optimization problems. Theoretically, the paper shows the conditions under which a minimizer $x^*$ is a point of attraction in a local neighborhood under the algorithm SGD-CS with sufficiently small step-size. Furthermore, the paper experimentally shows that vanilla SGD-CS with relatively large step-size performs well, or even outperforms its momentum and/or adaptive counterparts, on several popular deep learning tasks.
SP:03fd27c6a1e0c015dbd52eb08dac258efeaba5b1
Training By Vanilla SGD with Larger Learning Rates
1 INTRODUCTION . We are interested in minimizing a function f : Rd → R with an expectation form : min x∈Rd f ( x ) : = Eξ [ K ( x , ξ ) ] , ( 1a ) where the subscript indicates expectation is computed on the random variable ξ . Specially , if the ξ probability distribution is clear and random variable ξ is uniformly distributed on N terms , the objective function f can be expressed into a finite-sum form : min x∈Rd f ( x ) : = 1 N N∑ i=1 fi ( x ) , ( 1b ) where fi ( x ) : Rd → R is the i-th component function . The optimization of Eqs . ( 1a ) and ( 1b ) is widely encountered in machine learning tasks ( Goodfellow et al. , 2016 ; Simonyan & Zisserman , 2014 ) . To solve this problem given in Eq . ( 1b ) , we can compute the gradient of objective function directly with a classic GD ( Gradient Descent ) algorithm . However , this method suffers from expensive gradient computation for extremely large N , and hence people apply stochastic gradient descent method ( SGM ) to address this issue . Incremental gradient descent ( IGD ) is a primary version of SGM , where its calculation of gradient proceeds on single component fi at each iteration , instead of the whole . As a special case of IGD , SGD ( Robbins & Monro , 1951 ) , a fundamental method to train neural networks , always updates parameters by the gradient computed on a minibatch . There exists an intuitive view that SGD with constant step size ( SGD-CS ) potentially leads to faster convergence rate . Some studies ( Solodov , 1998 ; Tseng , 1998 ) show that , under a so-called strong growth condition ( SGC ) , SGD-CS converges to an optimal point faster than SGD with a diminishing step size . In this work , we study the local convergence ( or last-iterate convergence as is called in Jain et al . ( 2019 ) ) of SGD-CS on nonconvex functions . Note that SGD-CS does not provide a guarantee of converge when starting from any initialization point . Therefore , a useful strategy is to use SGD with a decreasing step size at the beginning , and then switch to SGD-CS in a neighborhood of a minimizer . Fig.1 illustrates the range of the step size of SGD versus the number of iterations . Our main theoretical and experimental contributions are as follows . • We establish local ( or last-iterate ) convergence of SGD with a constant step size ( SGDCS ) on nonconvex functions under the interpolation condition . We note that previous results are mostly for strongly convex functions under strong ( or weak ) growth condition . Our result is much closer to common situations in practice . • We discover that on linear regression problems with ` 2 regularization , the size of convergent learning rates can be quite large for incremental gradient descent ( IGD ) . Our numerical results show that , within a fairly large range , the larger step size is , the smaller spectral radius is , and the faster the convergence rate is . • Based on the above observations , we further propose a strategy called SGDL that uses the SGD with a large initial learning rate ( more than 10 times larger than the learning rate in SGD with momentum ) , while still being a vanilla SGD . We conduct extensive experiments on various popular deep-learning tasks and models in computer vision , audio recognition and natural language processing . Our results show that the method converges successfully and has a strong generalization performance , and sometimes outperforms its advanced variant ( SGDM ) and other several popular adaptive methods ( e.g. , Adam , AdaDelta , etc ) . 2 RELATED WORK . There are many papers on stochastic optimization and we summarize typical ones which are most relevant with our work . The convergence of SGD for over-parameterized models is analyzed in ( Vaswani et al. , 2018 ; Mai & Johansson , 2020 ; Allen-Zhu et al. , 2019 ; Li & Liang , 2018 ) . The power of interpolation is studied in ( Ma et al. , 2018 ; Vaswani et al. , 2019 ) . The work ( Jastrzębski et al. , 2017 ) investigates a large ratio of learning rate to batch size often leads to a wide endpoint . The work ( Smith & Topin , 2019 ) shows a phenomenon called super-convergence which is in contrast to the results in ( Bottou et al. , 2018 ) . More recently , several new learning rate schedules have proposed for SGD ( Loshchilov & Hutter , 2016 ; Smith , 2017 ; Agarwal et al. , 2017 ; Carmon et al. , 2018 ) . Adaptive gradient methods are widely in deep learning application . Popular solutions include AdaDelta ( Zeiler , 2012 ) , RMSProp ( Hinton et al. , 2012 ) , Adam ( Kingma & Ba , 2014 ) and so on . Unfortunately , it is believed that the adaptive methods may have a poor empirically performance . For example , Wilson et al . ( 2017 ) have observed that Adam hurts generalization performance in comparison to SGD with or without momentum . The work ( Schmidt & Roux , 2013 ) introduces SGD-CS that attains linear convergence rate for strongly convex functions under the strong growth condition ( SGC ) , and sublinear convergence rate for convex functions under the SGC . The work ( Cevher & Vu , 2018 ) investigates the weak growth condition ( WGC ) , the necessary condition for linear convergence of SGD-CS . For a general convex function , the work ( Ma et al. , 2018 ) shows that SGD-CS attains linear convergence rate under the interpolation property . For a finite sum f , the interpolation property means ∇fi ( x∗ ) = 0 for i = 1 , . . . , N , which is held apparently in over-parameterized DNN . However , the theoretical analysis of SGD-CS for nonconvex functions is less as mature as in the convex case . 3 PRELIMINARIES . 3.1 NOTATIONS . We denote the minimizer of object function f as x∗ and use usual partial ordering for symmetric matrices : A B means A−B is positive semidefinite ; similar for the relations , , ≺ . The norm ‖ · ‖ either denotes the Euclidean norm for vectors or Frobenius norm for matrices . The Hessian matrix of each component function fi ( x ) is denoted as Hi ( x ) . With slight abuse of notation , the Hessian matrix Hi at x∗ is denoted as H∗i . We also denote the mean and variance of { H∗1 , . . . , H∗N } as H∗ ≡ 1N ∑N i=1H ∗ i and Σ ∗ ≡ 1N ∑N i=1 ( H ∗ i ) 2 − ( H∗ ) 2 , and define a ∧ b = min ( a , b ) . X P−→ Y means random variable X converges to random variable Y in probability , while X L 1 −−→ Y means X converges to random variable Y in L1 norm . 3.2 ASSUMPTIONS . Our results are under the following mild assumptions : ( A.1 ) The objective function f has the same structure as given in Eq. ( 1b ) . ( A.2 ) Each component function fi in Eq . ( 1b ) is twice continously differentiable , with the corresponding Hessian matrix Hi being Lipschitz continuous for constant Li at the minimizer x∗ . Without loss of generality , we suppose that ‖Hi ( x ) −Hi ( x∗ ) ‖ ≤ L‖x− x∗‖ , for i = 1 , . . . , N , where L = max i=1 , ... , N Li . ( A.3 ) As in ( Zhang et al. , 2000 , Remark 5.2 ) , we assume the point of interest x∗ is a strong minimizer ( i.e . H ( x∗ ) 0 ) . Assumption ( A.3 ) restricts that the objective function is essentially strongly convex in a sufficiently small neighborhood of a minimizer . The work ( Liu et al. , 2020 ) investigates that the loss function is typically nonconvex in any neighborhood of a minimizer . However , this assumption is not restrictive in the regularization setting . Remark 1 . Even if the Hessian matrix of the point of interest x∗ has zero eigenvalues , we can study the ` 2 regularized problem instead , and then the Hessian matrix becomes positive definite . This phenomenon is also validated in our numerical experiment in Section 5 , and we add ` 2 regularizer in DNNs in Section 6 . Based on the above technical assumptions , we focus on the convergence analysis of SGD-CS by discussing the convergence behavior precisely : xk+1 = xk − α 1 m m∑ j=1 ∇f ξ ( j ) k ( xk ) . ( 2 ) Next , we introduce the notion of point attraction to help us understand the convergence behavior to Eq. ( 2 ) . Definition 1 . We say x∗ is a point of attraction to Eq . ( 2 ) if there is an open ball N ( x∗ , ) of x∗ , such that for any x0 ∈ N , { xk } generated by Eq . ( 2 ) all lie inN and converges to x∗ in the ` 1 norm . The Ostrowski Theorem says a sufficient condition for x∗ to be a point of attraction of the deterministic iteration xk+1 = T ( xk ) is that the spectral radius of T ′ ( x ) is strictly less than one , which further implies the condition that there exists an open ball N such that once the initial x0 ∈ N , the iterates { xk } will converge to x∗ with linear rate . We define the strong minimizer x∗ as a point of strong attraction following the similar manner . Definition 2 . We say x∗ is a point of strong attraction to Eq . ( 2 ) if there exists a neighborhoodN of x∗ , such that for any x0 ∈ N , the sequence { xk } generated by Eq . ( 2 ) all lie in N and satisfy E‖xk − x∗‖2 ≤ ρk · ‖x0 − x∗‖2 , for some ρ ∈ [ 0 , 1 ) . The following discussion studies necessary and sufficient conditions for the minimizer x∗ being a point of attraction of SGD with the constant step size α . However , starting from any initialization point , SGD-CS can not be guaranteed to find such a local neighborhood around x∗ , except in some special cases including the loss function studied in Section 5 and Appendix A.2 . Therefore , a practical strategy is to use diminishing step size when starting from a random initial point ( Allen-Zhu , 2018 ) , and as long as the iteration points belong to a neighborhood of a point of attraction , one can use a constant step size . 4 RESULTS FOR NONCONVEX FUNCTIONS . In this section , we rigorously show the necessary condition for the minimizer x∗ being a point of attraction , and Theorem 1 provides a sufficient condition for the strong minimizer x∗ to be a point of strong attraction with high probability . The detailed proofs are in Appendix.A.1 . 4.1 NECESSARY CONDITION . Lemma 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold , then ‖∇fi ( x ) ‖ < L 2 + ‖H∗i ‖ for i = 1 , . . . , N , provided that x ∈ N ( x∗ , ) . Theorem 1 . Suppose that the assumptions ( A.1 ) and ( A.2 ) hold . If the minimizer x∗ is a point of attraction of Eq . ( 2 ) , then the interpolation property is satisfied , i.e. , ∇fi ( x∗ ) = 0 for i = 1 , . . . , N .
This paper presents a theoretical analysis of SGD with constant step size (SGD-CS) and presents conditions under which SGD-CS leads to parameter updates that converge to a local minima, including parameters of non-convex functions. The authors then show, in context of some special functions, that the step size can be fairly large yet convergence is achieved. This is followed by a number of empirical studies of SGD with large (but annealed) step-size (SGDL) on a variety of tasks.
SP:03fd27c6a1e0c015dbd52eb08dac258efeaba5b1
Class Normalization for (Continual)? Generalized Zero-Shot Learning
1 INTRODUCTION . Zero-shot learning ( ZSL ) aims to understand new concepts based on their semantic descriptions instead of numerous input-output learning pairs . It is a key element of human intelligence and our best machines still struggle to master it ( Ferrari & Zisserman , 2008 ; Lampert et al. , 2009 ; Xian et al. , 2018a ) . Normalization techniques like batch/layer/group normalization ( Ioffe & Szegedy , 2015 ; Ba et al. , 2016 ; Wu & He , 2018 ) are now a common and important practice of modern deep learning . But despite their popularity in traditional supervised training , not much is explored in the realm of zero-shot learning , which motivated us to study and investigate normalization in ZSL models . We start by analyzing two ubiquitous tricks employed by ZSL and representation learning practitioners : normalize+scale ( NS ) and attributes normalization ( AN ) ( Bell et al. , 2016 ; Zhang et al. , 2019 ; Guo et al. , 2020 ; Chaudhry et al. , 2019 ) . Their dramatic influence on performance can be observed from Table 1 . When these two tricks are employed , a vanilla MLP model , described in Sec 3.1 , can outperform some recent sophisticated ZSL methods . Normalize+scale ( NS ) changes logits computation from usual dot-product to scaled cosine similarity : ŷc = z > pc =⇒ ŷc = ( γ · z ‖z‖2 ) > ( γ · pc ‖pc‖ ) ( 1 ) where z is an image feature , pc is c-th class prototype and γ is a hyperparameter , usually picked from [ 5 , 10 ] interval ( Li et al. , 2019 ; Zhang et al. , 2019 ) . Scaling by γ is equivalent to setting a high temperature of γ2 in softmax . In Sec . 3.2 , we theoretically justify the need for this trick and explain why the value of γ must be so high . Attributes Normalization ( AN ) technique simply divides class attributes by their L2 norms : ac 7−→ ac/‖ac‖2 ( 2 ) While this may look inconsiderable , it is surprising to see it being preferred in practice ( Li et al. , 2019 ; Narayan et al. , 2020 ; Chaudhry et al. , 2019 ) instead of the traditional zero-mean and unit-variance data standardization ( Glorot & Bengio , 2010 ) . In Sec 3 , we show that it helps in normalizing signal ’ s variance in and ablate its importance in Table 1 and Appx D. These two tricks work well and normalize the variance to a unit value when the underlying ZSL model is linear ( see Figure 1 ) , but they fail when we use a multi-layer architecture . To remedy this issue , we introduce Class Normalization ( CN ) : a novel normalization scheme , which is based on a different initialization and a class-wise standardization transform . Modern ZSL methods either utilize sophisticated architectural design like training generative models ( Narayan et al. , 2020 ; Felix et al. , 2018 ) or use heavy optimization schemes like episode-based training ( Yu et al. , 2020 ; Li et al. , 2019 ) . In contrast , we show that simply adding Class Normalization on top of a vanilla MLP is enough to set new state-of-the-art results on several standard ZSL datasets ( see Table 2 ) . Moreover , since it is optimized with plain gradient descent without any bells and whistles , training time for us takes 50-100 times less and runs in about 1 minute . We also demonstrate that many ZSL models tend to have more irregular loss surface compared to traditional supervised learning classifiers and apply the results of Santurkar et al . ( 2018 ) to show that our CN partially remedies the issue . We discuss and empirically validate this in Sec 3.5 and Appx F. Apart from the theoretical exposition and a new normalization scheme , we also propose a broader ZSL setup : continual zero-shot learning ( CZSL ) . Continual learning ( CL ) is an ability to acquire new knowledge without forgetting ( e.g . ( Kirkpatrick et al. , 2017 ) ) , which is scarcely investigated in ZSL . We develop the ideas of lifelong learning with class attributes , originally proposed by Chaudhry et al . ( 2019 ) and extended by Wei et al . ( 2020a ) , propose several principled metrics for it and test several classical CL methods in this new setup . 2 RELATED WORK . Zero-shot learning . Zero-shot learning ( ZSL ) aims at understand example of unseen classes from their language or semantic descriptions . Earlier ZSL methods directly predict attribute confidence from images to facilitate zero-shot recognition ( e.g. , Lampert et al . ( 2009 ) ; Farhadi et al . ( 2009 ) ; Lampert et al . ( 2013b ) ) . Recent ZSL methods for image classification can be categorized into two groups : generative-based and embedding-based . The main goal for generative-based approaches is to build a conditional generative model ( e.g. , GANs Goodfellow et al . ( 2014 ) and VAEs ( Kingma & Welling , 2014 ) ) to synthesize visual generations conditioned on class descriptors ( e.g. , Xian et al . ( 2018b ) ; Zhu et al . ( 2018 ) ; Elhoseiny & Elfeki ( 2019 ) ; Guo et al . ( 2017 ) ; Guo et al . ( 2017 ) ; Kumar Verma et al . ( 2018 ) ) . At test time , the trained generator is expected to produce synthetic/fake data of unseen classes given its semantic descriptor . The fake data is then used to train a traditional classifier or to perform a simple kNN-classification on the test images . Embedding-based approaches learn a mapping that projects semantic attributes and images into a common space where the distance between a class projection and the corresponding images is minimized ( e.g , Romera-Paredes & Torr ( 2015 ) ; Frome et al . ( 2013 ) ; Lei Ba et al . ( 2015 ) ; Akata et al . ( 2016a ) ; Zhang et al . ( 2017 ) ; Akata et al . ( 2015 ; 2016b ) ) . One question that arises is what space to choose to project the attributes or images to . Previous works projected images to the semantic space ( Elhoseiny et al. , 2013 ; Frome et al. , 2013 ; Lampert et al. , 2013a ) or some common space ( Zhang & Saligrama , 2015 ; Akata et al. , 2015 ) , but our approach follows the idea of Zhang et al . ( 2016 ) ; Li et al . ( 2019 ) that shows that projecting attributes to the image space reduces the bias towards seen data . Normalize+scale and attributes normalization . It was observed both in ZSL ( e.g. , Li et al . ( 2019 ) ; Zhang et al . ( 2019 ) ; Bell et al . ( 2016 ) ) and representation learning ( e.g. , Sohn ( 2016 ) ; Guo et al . ( 2020 ) ; Ye et al . ( 2020 ) ) fields that normalize+scale ( i.e . ( 1 ) ) and attributes normalization ( i.e . ( 2 ) ) tend to significantly improve the performance of a learning system . In the literature , these two techniques lack rigorous motivation and are usually introduced as practical heuristics that aid training ( Changpinyo et al. , 2017 ; Zhang et al. , 2019 ; 2021 ) . One of the earliest works that employ attributes normalization was done by ( Norouzi et al. , 2013 ) , and in ( Changpinyo et al. , 2016a ) authors also ablate its importance . The main consumers of normalize+scale trick had been similarity learning algorithms , which employ it to refine the distance metric between the representations ( Bellet et al. , 2013 ; Guo et al. , 2020 ; Shi et al. , 2020 ) . Luo et al . ( 2018 ) proposed to use cosine similarity in the final output projection matrix as a normalization procedure , but didn ’ t incorporate any analysis on how it affects the variance . They also didn ’ t use the scaling which our experiments in Table 5 show to be crucial . Gidaris & Komodakis ( 2018 ) demonstrated a greatly superior performance of an NS-enriched model compared to a dot-product based one in their setup where the classifying matrix is constructed dynamically . Li et al . ( 2019 ) motivated their usage of NS by variance reduction , but didn ’ t elaborate on this in their subsequent analysis . Chen et al . ( 2020 ) related the use of the normalized temperature-scaled cross entropy loss ( NT-Xent ) to different weighting of negative examples in contrastive learning framework . Overall , to the best of our knowledge , there is no precise understanding of the influence of these two tricks on the optimization process and benefits they provide . Initialization schemes . In the seminal work , Xavier ’ s init Glorot & Bengio ( 2010 ) , the authors showed how to preserve the variance during a forward pass . He et al . ( 2015 ) applied a similar analysis but taking ReLU nonlinearities into account . There is also a growing interest in two-step Jia et al . ( 2014 ) , data-dependent Krähenbühl et al . ( 2015 ) , and orthogonal Hu et al . ( 2020 ) initialization schemes . However , the importance of a good initialization for multi-modal embedding functions like attribute embedding is less studied and not well understood . We propose a proper initialization scheme based on a different initialization variance and a dynamic standardization layer . Our variance analyzis is similar in nature to Chang et al . ( 2020 ) since attribute embedder may be seen as a hypernetwork ( Ha et al. , 2016 ) that outputs a linear classifier . But the exact embedding transformation is different from a hypernetwork since it has matrix-wise input and in our derivations we have to use more loose assumptions about attributes distribution ( see Sec 3 and Appx H ) . Normalization techniques . A closely related branch of research is the development of normalization layers for deep neural networks ( Ioffe & Szegedy , 2015 ) since they also influence a signal ’ s variance . BatchNorm , being the most popular one , normalizes the location and scale of activations . It is applied in a batch-wise fashion and that ’ s why its performance is highly dependent on batch size ( Singh & Krishnan , 2020 ) . That ’ s why several normalization techniques have been proposed to eliminate the batch-size dependecy ( Wu & He , 2018 ; Ba et al. , 2016 ; Singh & Krishnan , 2020 ) . The proposed class normalization is very similar to a standardization procedure which underlies BatchNorm , but it is applied class-wise in the attribute embedder . This also makes it independent from the batch size . Continual zero-shot learning . We introduce continual zero-shot learning : a new benchmark for ZSL agents that is inspired by continual learning literature ( e.g. , Kirkpatrick et al . ( 2017 ) ) . It is a development of the scenario proposed in Chaudhry et al . ( 2019 ) , but authors there focused on ZSL performance only a single task ahead , while in our case we consider the performance on all seen ( previous tasks ) and all unseen data ( future tasks ) . This also contrasts our work to the very recent work by Wei et al . ( 2020b ) , where a sequence of seen class splits of existing ZSL benchmsks is trained and the zero-shot performance is reported for every task individually at test time . In contrast , for our setup , the label space is not restricted and covers the spectrum of all previous tasks ( seen tasks so far ) , and future tasks ( unseen tasks so far ) . Due to this difference , we need to introduce a set of new metrics and benchmarks to measure this continual generalized ZSL skill over time . From the lifelong learning perspective , the idea to consider all the processed data to evaluate the model is not new and was previously explored by Elhoseiny et al . ( 2018 ) ; van de Ven & Tolias ( 2019 ) . It lies in contrast with the common practice of providing task identity at test time , which limits the prediction space for a model , making the problem easier ( Kirkpatrick et al. , 2017 ; Aljundi et al. , 2017 ) . In Isele et al . ( 2016 ) ; Lopez-Paz & Ranzato ( 2017 ) authors motivate the use of task descriptors for zero-shot knowledge transfer , but in our work we consider class descriptors instead . We defined CZSL as a continual version of generalized-ZSL which allows us to naturally extend all the existing ZSL metrics Xian et al . ( 2018a ) ; Chao et al . ( 2016 ) to our new continual setup .
This paper presents a theoretical justification for normalization in model training on how it affects model performance and training time. It proposes two normalization tricks: normalize + scale trick and attributes normalization trick and apply in the zero-shot image classification task. This paper also shows that two normalization tricks are not enough to variance control in a deep architecture. To address this problem, a new initialization scheme is introduced. Apart from theoretical analysis and a new initialization scheme for normalization, it extends the zero-short learning approach in a continual learning framework. This new framework is called continual zero-shot learning (CZSL) and provides corresponding evaluation metrics. The experiments for CZSL are performed in two datasets, CUB and SUN. This paper experimentally shows the effectiveness of the initialization, normalization, and scaling trick.
SP:10eefcfc059363de145c70b8e711c6583c599ed8
Class Normalization for (Continual)? Generalized Zero-Shot Learning
1 INTRODUCTION . Zero-shot learning ( ZSL ) aims to understand new concepts based on their semantic descriptions instead of numerous input-output learning pairs . It is a key element of human intelligence and our best machines still struggle to master it ( Ferrari & Zisserman , 2008 ; Lampert et al. , 2009 ; Xian et al. , 2018a ) . Normalization techniques like batch/layer/group normalization ( Ioffe & Szegedy , 2015 ; Ba et al. , 2016 ; Wu & He , 2018 ) are now a common and important practice of modern deep learning . But despite their popularity in traditional supervised training , not much is explored in the realm of zero-shot learning , which motivated us to study and investigate normalization in ZSL models . We start by analyzing two ubiquitous tricks employed by ZSL and representation learning practitioners : normalize+scale ( NS ) and attributes normalization ( AN ) ( Bell et al. , 2016 ; Zhang et al. , 2019 ; Guo et al. , 2020 ; Chaudhry et al. , 2019 ) . Their dramatic influence on performance can be observed from Table 1 . When these two tricks are employed , a vanilla MLP model , described in Sec 3.1 , can outperform some recent sophisticated ZSL methods . Normalize+scale ( NS ) changes logits computation from usual dot-product to scaled cosine similarity : ŷc = z > pc =⇒ ŷc = ( γ · z ‖z‖2 ) > ( γ · pc ‖pc‖ ) ( 1 ) where z is an image feature , pc is c-th class prototype and γ is a hyperparameter , usually picked from [ 5 , 10 ] interval ( Li et al. , 2019 ; Zhang et al. , 2019 ) . Scaling by γ is equivalent to setting a high temperature of γ2 in softmax . In Sec . 3.2 , we theoretically justify the need for this trick and explain why the value of γ must be so high . Attributes Normalization ( AN ) technique simply divides class attributes by their L2 norms : ac 7−→ ac/‖ac‖2 ( 2 ) While this may look inconsiderable , it is surprising to see it being preferred in practice ( Li et al. , 2019 ; Narayan et al. , 2020 ; Chaudhry et al. , 2019 ) instead of the traditional zero-mean and unit-variance data standardization ( Glorot & Bengio , 2010 ) . In Sec 3 , we show that it helps in normalizing signal ’ s variance in and ablate its importance in Table 1 and Appx D. These two tricks work well and normalize the variance to a unit value when the underlying ZSL model is linear ( see Figure 1 ) , but they fail when we use a multi-layer architecture . To remedy this issue , we introduce Class Normalization ( CN ) : a novel normalization scheme , which is based on a different initialization and a class-wise standardization transform . Modern ZSL methods either utilize sophisticated architectural design like training generative models ( Narayan et al. , 2020 ; Felix et al. , 2018 ) or use heavy optimization schemes like episode-based training ( Yu et al. , 2020 ; Li et al. , 2019 ) . In contrast , we show that simply adding Class Normalization on top of a vanilla MLP is enough to set new state-of-the-art results on several standard ZSL datasets ( see Table 2 ) . Moreover , since it is optimized with plain gradient descent without any bells and whistles , training time for us takes 50-100 times less and runs in about 1 minute . We also demonstrate that many ZSL models tend to have more irregular loss surface compared to traditional supervised learning classifiers and apply the results of Santurkar et al . ( 2018 ) to show that our CN partially remedies the issue . We discuss and empirically validate this in Sec 3.5 and Appx F. Apart from the theoretical exposition and a new normalization scheme , we also propose a broader ZSL setup : continual zero-shot learning ( CZSL ) . Continual learning ( CL ) is an ability to acquire new knowledge without forgetting ( e.g . ( Kirkpatrick et al. , 2017 ) ) , which is scarcely investigated in ZSL . We develop the ideas of lifelong learning with class attributes , originally proposed by Chaudhry et al . ( 2019 ) and extended by Wei et al . ( 2020a ) , propose several principled metrics for it and test several classical CL methods in this new setup . 2 RELATED WORK . Zero-shot learning . Zero-shot learning ( ZSL ) aims at understand example of unseen classes from their language or semantic descriptions . Earlier ZSL methods directly predict attribute confidence from images to facilitate zero-shot recognition ( e.g. , Lampert et al . ( 2009 ) ; Farhadi et al . ( 2009 ) ; Lampert et al . ( 2013b ) ) . Recent ZSL methods for image classification can be categorized into two groups : generative-based and embedding-based . The main goal for generative-based approaches is to build a conditional generative model ( e.g. , GANs Goodfellow et al . ( 2014 ) and VAEs ( Kingma & Welling , 2014 ) ) to synthesize visual generations conditioned on class descriptors ( e.g. , Xian et al . ( 2018b ) ; Zhu et al . ( 2018 ) ; Elhoseiny & Elfeki ( 2019 ) ; Guo et al . ( 2017 ) ; Guo et al . ( 2017 ) ; Kumar Verma et al . ( 2018 ) ) . At test time , the trained generator is expected to produce synthetic/fake data of unseen classes given its semantic descriptor . The fake data is then used to train a traditional classifier or to perform a simple kNN-classification on the test images . Embedding-based approaches learn a mapping that projects semantic attributes and images into a common space where the distance between a class projection and the corresponding images is minimized ( e.g , Romera-Paredes & Torr ( 2015 ) ; Frome et al . ( 2013 ) ; Lei Ba et al . ( 2015 ) ; Akata et al . ( 2016a ) ; Zhang et al . ( 2017 ) ; Akata et al . ( 2015 ; 2016b ) ) . One question that arises is what space to choose to project the attributes or images to . Previous works projected images to the semantic space ( Elhoseiny et al. , 2013 ; Frome et al. , 2013 ; Lampert et al. , 2013a ) or some common space ( Zhang & Saligrama , 2015 ; Akata et al. , 2015 ) , but our approach follows the idea of Zhang et al . ( 2016 ) ; Li et al . ( 2019 ) that shows that projecting attributes to the image space reduces the bias towards seen data . Normalize+scale and attributes normalization . It was observed both in ZSL ( e.g. , Li et al . ( 2019 ) ; Zhang et al . ( 2019 ) ; Bell et al . ( 2016 ) ) and representation learning ( e.g. , Sohn ( 2016 ) ; Guo et al . ( 2020 ) ; Ye et al . ( 2020 ) ) fields that normalize+scale ( i.e . ( 1 ) ) and attributes normalization ( i.e . ( 2 ) ) tend to significantly improve the performance of a learning system . In the literature , these two techniques lack rigorous motivation and are usually introduced as practical heuristics that aid training ( Changpinyo et al. , 2017 ; Zhang et al. , 2019 ; 2021 ) . One of the earliest works that employ attributes normalization was done by ( Norouzi et al. , 2013 ) , and in ( Changpinyo et al. , 2016a ) authors also ablate its importance . The main consumers of normalize+scale trick had been similarity learning algorithms , which employ it to refine the distance metric between the representations ( Bellet et al. , 2013 ; Guo et al. , 2020 ; Shi et al. , 2020 ) . Luo et al . ( 2018 ) proposed to use cosine similarity in the final output projection matrix as a normalization procedure , but didn ’ t incorporate any analysis on how it affects the variance . They also didn ’ t use the scaling which our experiments in Table 5 show to be crucial . Gidaris & Komodakis ( 2018 ) demonstrated a greatly superior performance of an NS-enriched model compared to a dot-product based one in their setup where the classifying matrix is constructed dynamically . Li et al . ( 2019 ) motivated their usage of NS by variance reduction , but didn ’ t elaborate on this in their subsequent analysis . Chen et al . ( 2020 ) related the use of the normalized temperature-scaled cross entropy loss ( NT-Xent ) to different weighting of negative examples in contrastive learning framework . Overall , to the best of our knowledge , there is no precise understanding of the influence of these two tricks on the optimization process and benefits they provide . Initialization schemes . In the seminal work , Xavier ’ s init Glorot & Bengio ( 2010 ) , the authors showed how to preserve the variance during a forward pass . He et al . ( 2015 ) applied a similar analysis but taking ReLU nonlinearities into account . There is also a growing interest in two-step Jia et al . ( 2014 ) , data-dependent Krähenbühl et al . ( 2015 ) , and orthogonal Hu et al . ( 2020 ) initialization schemes . However , the importance of a good initialization for multi-modal embedding functions like attribute embedding is less studied and not well understood . We propose a proper initialization scheme based on a different initialization variance and a dynamic standardization layer . Our variance analyzis is similar in nature to Chang et al . ( 2020 ) since attribute embedder may be seen as a hypernetwork ( Ha et al. , 2016 ) that outputs a linear classifier . But the exact embedding transformation is different from a hypernetwork since it has matrix-wise input and in our derivations we have to use more loose assumptions about attributes distribution ( see Sec 3 and Appx H ) . Normalization techniques . A closely related branch of research is the development of normalization layers for deep neural networks ( Ioffe & Szegedy , 2015 ) since they also influence a signal ’ s variance . BatchNorm , being the most popular one , normalizes the location and scale of activations . It is applied in a batch-wise fashion and that ’ s why its performance is highly dependent on batch size ( Singh & Krishnan , 2020 ) . That ’ s why several normalization techniques have been proposed to eliminate the batch-size dependecy ( Wu & He , 2018 ; Ba et al. , 2016 ; Singh & Krishnan , 2020 ) . The proposed class normalization is very similar to a standardization procedure which underlies BatchNorm , but it is applied class-wise in the attribute embedder . This also makes it independent from the batch size . Continual zero-shot learning . We introduce continual zero-shot learning : a new benchmark for ZSL agents that is inspired by continual learning literature ( e.g. , Kirkpatrick et al . ( 2017 ) ) . It is a development of the scenario proposed in Chaudhry et al . ( 2019 ) , but authors there focused on ZSL performance only a single task ahead , while in our case we consider the performance on all seen ( previous tasks ) and all unseen data ( future tasks ) . This also contrasts our work to the very recent work by Wei et al . ( 2020b ) , where a sequence of seen class splits of existing ZSL benchmsks is trained and the zero-shot performance is reported for every task individually at test time . In contrast , for our setup , the label space is not restricted and covers the spectrum of all previous tasks ( seen tasks so far ) , and future tasks ( unseen tasks so far ) . Due to this difference , we need to introduce a set of new metrics and benchmarks to measure this continual generalized ZSL skill over time . From the lifelong learning perspective , the idea to consider all the processed data to evaluate the model is not new and was previously explored by Elhoseiny et al . ( 2018 ) ; van de Ven & Tolias ( 2019 ) . It lies in contrast with the common practice of providing task identity at test time , which limits the prediction space for a model , making the problem easier ( Kirkpatrick et al. , 2017 ; Aljundi et al. , 2017 ) . In Isele et al . ( 2016 ) ; Lopez-Paz & Ranzato ( 2017 ) authors motivate the use of task descriptors for zero-shot knowledge transfer , but in our work we consider class descriptors instead . We defined CZSL as a continual version of generalized-ZSL which allows us to naturally extend all the existing ZSL metrics Xian et al . ( 2018a ) ; Chao et al . ( 2016 ) to our new continual setup .
The paper shows that normalization is critical for zero-shot learning (ZSL). In the ZSL randomization is coming from the two sources, attribute and feature. Normalization of the two source helps to reduce the variance. The paper uses an embedding based model where normalize visual feature are projected to the attribute space and in the attribute space, cosine similarity is measured to predict the class label. Paper also extend ZSL framework to the continual learning ZSL (CZSL) setup where whole data are not present at a time; instead, data comes in the form of a task, sequentially. The author shows that normalization helps to improve the CZSL result.
SP:10eefcfc059363de145c70b8e711c6583c599ed8
Class Normalization for (Continual)? Generalized Zero-Shot Learning
1 INTRODUCTION . Zero-shot learning ( ZSL ) aims to understand new concepts based on their semantic descriptions instead of numerous input-output learning pairs . It is a key element of human intelligence and our best machines still struggle to master it ( Ferrari & Zisserman , 2008 ; Lampert et al. , 2009 ; Xian et al. , 2018a ) . Normalization techniques like batch/layer/group normalization ( Ioffe & Szegedy , 2015 ; Ba et al. , 2016 ; Wu & He , 2018 ) are now a common and important practice of modern deep learning . But despite their popularity in traditional supervised training , not much is explored in the realm of zero-shot learning , which motivated us to study and investigate normalization in ZSL models . We start by analyzing two ubiquitous tricks employed by ZSL and representation learning practitioners : normalize+scale ( NS ) and attributes normalization ( AN ) ( Bell et al. , 2016 ; Zhang et al. , 2019 ; Guo et al. , 2020 ; Chaudhry et al. , 2019 ) . Their dramatic influence on performance can be observed from Table 1 . When these two tricks are employed , a vanilla MLP model , described in Sec 3.1 , can outperform some recent sophisticated ZSL methods . Normalize+scale ( NS ) changes logits computation from usual dot-product to scaled cosine similarity : ŷc = z > pc =⇒ ŷc = ( γ · z ‖z‖2 ) > ( γ · pc ‖pc‖ ) ( 1 ) where z is an image feature , pc is c-th class prototype and γ is a hyperparameter , usually picked from [ 5 , 10 ] interval ( Li et al. , 2019 ; Zhang et al. , 2019 ) . Scaling by γ is equivalent to setting a high temperature of γ2 in softmax . In Sec . 3.2 , we theoretically justify the need for this trick and explain why the value of γ must be so high . Attributes Normalization ( AN ) technique simply divides class attributes by their L2 norms : ac 7−→ ac/‖ac‖2 ( 2 ) While this may look inconsiderable , it is surprising to see it being preferred in practice ( Li et al. , 2019 ; Narayan et al. , 2020 ; Chaudhry et al. , 2019 ) instead of the traditional zero-mean and unit-variance data standardization ( Glorot & Bengio , 2010 ) . In Sec 3 , we show that it helps in normalizing signal ’ s variance in and ablate its importance in Table 1 and Appx D. These two tricks work well and normalize the variance to a unit value when the underlying ZSL model is linear ( see Figure 1 ) , but they fail when we use a multi-layer architecture . To remedy this issue , we introduce Class Normalization ( CN ) : a novel normalization scheme , which is based on a different initialization and a class-wise standardization transform . Modern ZSL methods either utilize sophisticated architectural design like training generative models ( Narayan et al. , 2020 ; Felix et al. , 2018 ) or use heavy optimization schemes like episode-based training ( Yu et al. , 2020 ; Li et al. , 2019 ) . In contrast , we show that simply adding Class Normalization on top of a vanilla MLP is enough to set new state-of-the-art results on several standard ZSL datasets ( see Table 2 ) . Moreover , since it is optimized with plain gradient descent without any bells and whistles , training time for us takes 50-100 times less and runs in about 1 minute . We also demonstrate that many ZSL models tend to have more irregular loss surface compared to traditional supervised learning classifiers and apply the results of Santurkar et al . ( 2018 ) to show that our CN partially remedies the issue . We discuss and empirically validate this in Sec 3.5 and Appx F. Apart from the theoretical exposition and a new normalization scheme , we also propose a broader ZSL setup : continual zero-shot learning ( CZSL ) . Continual learning ( CL ) is an ability to acquire new knowledge without forgetting ( e.g . ( Kirkpatrick et al. , 2017 ) ) , which is scarcely investigated in ZSL . We develop the ideas of lifelong learning with class attributes , originally proposed by Chaudhry et al . ( 2019 ) and extended by Wei et al . ( 2020a ) , propose several principled metrics for it and test several classical CL methods in this new setup . 2 RELATED WORK . Zero-shot learning . Zero-shot learning ( ZSL ) aims at understand example of unseen classes from their language or semantic descriptions . Earlier ZSL methods directly predict attribute confidence from images to facilitate zero-shot recognition ( e.g. , Lampert et al . ( 2009 ) ; Farhadi et al . ( 2009 ) ; Lampert et al . ( 2013b ) ) . Recent ZSL methods for image classification can be categorized into two groups : generative-based and embedding-based . The main goal for generative-based approaches is to build a conditional generative model ( e.g. , GANs Goodfellow et al . ( 2014 ) and VAEs ( Kingma & Welling , 2014 ) ) to synthesize visual generations conditioned on class descriptors ( e.g. , Xian et al . ( 2018b ) ; Zhu et al . ( 2018 ) ; Elhoseiny & Elfeki ( 2019 ) ; Guo et al . ( 2017 ) ; Guo et al . ( 2017 ) ; Kumar Verma et al . ( 2018 ) ) . At test time , the trained generator is expected to produce synthetic/fake data of unseen classes given its semantic descriptor . The fake data is then used to train a traditional classifier or to perform a simple kNN-classification on the test images . Embedding-based approaches learn a mapping that projects semantic attributes and images into a common space where the distance between a class projection and the corresponding images is minimized ( e.g , Romera-Paredes & Torr ( 2015 ) ; Frome et al . ( 2013 ) ; Lei Ba et al . ( 2015 ) ; Akata et al . ( 2016a ) ; Zhang et al . ( 2017 ) ; Akata et al . ( 2015 ; 2016b ) ) . One question that arises is what space to choose to project the attributes or images to . Previous works projected images to the semantic space ( Elhoseiny et al. , 2013 ; Frome et al. , 2013 ; Lampert et al. , 2013a ) or some common space ( Zhang & Saligrama , 2015 ; Akata et al. , 2015 ) , but our approach follows the idea of Zhang et al . ( 2016 ) ; Li et al . ( 2019 ) that shows that projecting attributes to the image space reduces the bias towards seen data . Normalize+scale and attributes normalization . It was observed both in ZSL ( e.g. , Li et al . ( 2019 ) ; Zhang et al . ( 2019 ) ; Bell et al . ( 2016 ) ) and representation learning ( e.g. , Sohn ( 2016 ) ; Guo et al . ( 2020 ) ; Ye et al . ( 2020 ) ) fields that normalize+scale ( i.e . ( 1 ) ) and attributes normalization ( i.e . ( 2 ) ) tend to significantly improve the performance of a learning system . In the literature , these two techniques lack rigorous motivation and are usually introduced as practical heuristics that aid training ( Changpinyo et al. , 2017 ; Zhang et al. , 2019 ; 2021 ) . One of the earliest works that employ attributes normalization was done by ( Norouzi et al. , 2013 ) , and in ( Changpinyo et al. , 2016a ) authors also ablate its importance . The main consumers of normalize+scale trick had been similarity learning algorithms , which employ it to refine the distance metric between the representations ( Bellet et al. , 2013 ; Guo et al. , 2020 ; Shi et al. , 2020 ) . Luo et al . ( 2018 ) proposed to use cosine similarity in the final output projection matrix as a normalization procedure , but didn ’ t incorporate any analysis on how it affects the variance . They also didn ’ t use the scaling which our experiments in Table 5 show to be crucial . Gidaris & Komodakis ( 2018 ) demonstrated a greatly superior performance of an NS-enriched model compared to a dot-product based one in their setup where the classifying matrix is constructed dynamically . Li et al . ( 2019 ) motivated their usage of NS by variance reduction , but didn ’ t elaborate on this in their subsequent analysis . Chen et al . ( 2020 ) related the use of the normalized temperature-scaled cross entropy loss ( NT-Xent ) to different weighting of negative examples in contrastive learning framework . Overall , to the best of our knowledge , there is no precise understanding of the influence of these two tricks on the optimization process and benefits they provide . Initialization schemes . In the seminal work , Xavier ’ s init Glorot & Bengio ( 2010 ) , the authors showed how to preserve the variance during a forward pass . He et al . ( 2015 ) applied a similar analysis but taking ReLU nonlinearities into account . There is also a growing interest in two-step Jia et al . ( 2014 ) , data-dependent Krähenbühl et al . ( 2015 ) , and orthogonal Hu et al . ( 2020 ) initialization schemes . However , the importance of a good initialization for multi-modal embedding functions like attribute embedding is less studied and not well understood . We propose a proper initialization scheme based on a different initialization variance and a dynamic standardization layer . Our variance analyzis is similar in nature to Chang et al . ( 2020 ) since attribute embedder may be seen as a hypernetwork ( Ha et al. , 2016 ) that outputs a linear classifier . But the exact embedding transformation is different from a hypernetwork since it has matrix-wise input and in our derivations we have to use more loose assumptions about attributes distribution ( see Sec 3 and Appx H ) . Normalization techniques . A closely related branch of research is the development of normalization layers for deep neural networks ( Ioffe & Szegedy , 2015 ) since they also influence a signal ’ s variance . BatchNorm , being the most popular one , normalizes the location and scale of activations . It is applied in a batch-wise fashion and that ’ s why its performance is highly dependent on batch size ( Singh & Krishnan , 2020 ) . That ’ s why several normalization techniques have been proposed to eliminate the batch-size dependecy ( Wu & He , 2018 ; Ba et al. , 2016 ; Singh & Krishnan , 2020 ) . The proposed class normalization is very similar to a standardization procedure which underlies BatchNorm , but it is applied class-wise in the attribute embedder . This also makes it independent from the batch size . Continual zero-shot learning . We introduce continual zero-shot learning : a new benchmark for ZSL agents that is inspired by continual learning literature ( e.g. , Kirkpatrick et al . ( 2017 ) ) . It is a development of the scenario proposed in Chaudhry et al . ( 2019 ) , but authors there focused on ZSL performance only a single task ahead , while in our case we consider the performance on all seen ( previous tasks ) and all unseen data ( future tasks ) . This also contrasts our work to the very recent work by Wei et al . ( 2020b ) , where a sequence of seen class splits of existing ZSL benchmsks is trained and the zero-shot performance is reported for every task individually at test time . In contrast , for our setup , the label space is not restricted and covers the spectrum of all previous tasks ( seen tasks so far ) , and future tasks ( unseen tasks so far ) . Due to this difference , we need to introduce a set of new metrics and benchmarks to measure this continual generalized ZSL skill over time . From the lifelong learning perspective , the idea to consider all the processed data to evaluate the model is not new and was previously explored by Elhoseiny et al . ( 2018 ) ; van de Ven & Tolias ( 2019 ) . It lies in contrast with the common practice of providing task identity at test time , which limits the prediction space for a model , making the problem easier ( Kirkpatrick et al. , 2017 ; Aljundi et al. , 2017 ) . In Isele et al . ( 2016 ) ; Lopez-Paz & Ranzato ( 2017 ) authors motivate the use of task descriptors for zero-shot knowledge transfer , but in our work we consider class descriptors instead . We defined CZSL as a continual version of generalized-ZSL which allows us to naturally extend all the existing ZSL metrics Xian et al . ( 2018a ) ; Chao et al . ( 2016 ) to our new continual setup .
This paper provides a thorough analysis in the perspective of data variances on the widely used normalization tricks in the zero-shot learning research: normalize+scale and attribute normalization. It also demonstrates these tricks are not enough w.r.t. normalizing the variance in a non-linear model and propose a normalization trick to alleviate the issue. Both theoretical and empirical analysis are provided and results look convincing. Finally the authors propose a continual zero-shot learning problem scheme and illustrate some pioneering experimental results.
SP:10eefcfc059363de145c70b8e711c6583c599ed8
Adversarial Masking: Towards Understanding Robustness Trade-off for Generalization
1 INTRODUCTION . Deep neural networks have achieved unprecedented success over a variety of tasks and across different domains . However , studies have shown that neural networks are inherently vulnerable to adversarial examples ( Biggio et al. , 2013 ; Szegedy et al. , 2014 ) . To enhance model robustness against adversarial examples , adversarial training ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) has become one of the most effective and widely applied defense methods , which employs specific attacking algorithms to generate adversarial examples during training in order to learn robust models . Albeit effective in countering adversarial examples , adversarial training often suffers from inferior performance on clean data ( Zhang et al. , 2019 ; Balaji et al. , 2019 ) . This observation has led prior work to extrapolate that a trade-off between robustness and accuracy may be inevitable , particularly for image classification tasks ( Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . However , Yang et al . ( 2020 ) recently suggests that it is possible to learn classifiers both robust and highly accurate on real image data . The current state of adversarial training methods falls short of this prediction , and the discrepancy remains poorly understood . In this paper , we conduct an in-depth study on understanding the trade-off between robustness and clean accuracy in adversarial training , and introduce Adversarial Masking , a new hypothesis stating that a widely used technique , batch normalization ( BN ) , has a significant impact on the trade-off between robustness and natural accuracy . Specifically , we break down BN into normalization and rescaling operations , and find that the rescaling operation has a significant impact on the robustness trade-off while normalization only has marginal influence . Built upon this observation , we hypothesize that adversarial masking ( i.e. , the combination of the rescaling operation and the follow-up ReLU activation fucntion ) acts as a feature masking layer that can magnify or block feature maps to influence the performance of robust or clean generalization . In this hypothesis , different rescaling parameters in BN contribute to different adversarial maskings learned through training . By using a simple linear combination of two adversarial maskings , rather than using robust features learned by adversarial training ( Madry et al. , 2018 ; Ilyas et al. , 2019 ; Zhang et al. , 2019 ) , we show that a well-balanced trade-off can be readily achieved . Based on the Adversarial Masking hypothesis , we further propose RobMask ( Robust Masking ) , a new training scheme that learns an adaptive feature masking for different perturbation strengths . We use the learned adaptive feature masking to incorporate different features so that we could improve model generalization with a better robustness trade-off . Specifically , each perturbation strength is encoded as a low-dimensional vector , and we take this vector as input to a learnable linear projection layer together with ReLU activation , to obtain the adversarial masking for the corresponding perturbation strength . Therefore , for different perturbation strengths , we learn different maskings accordingly . By doing so , rather than hurting the performance on clean test data , we use adversarial examples as powerful regularization to boost model generalization . Experiments on multiple benchmarks demonstrate that RobMask achieves not only significantly better natural accuracy , but also a better trade-off between robustness and generalization . Our contributions are summarized as follows . ( i ) We conduct a detailed analysis to demonstrate that the rescaling operation in batch normalization has a significant impact on the trade-off between robustness and natural accuracy . ( ii ) We introduce Adversarial Masking , a new hypothesis to explain that this trade-off is caused by different feature maskings applied , and different combinations of maskings can lead to different trade-offs . ( iii ) We propose RobMask , a new training scheme to learn an adaptive masking for different perturbation strengths , in order to utilize adversarial examples to boost generalization on clean data . RobMask also achieves a better trade-off between robust and natural accuracy . 2 PRELIMINARY AND RELATED WORK . Adversarial Training Since the discovery of the vulnerability of deep neural networks , diverse approaches have been proposed to enhance model adversarial robustness . A natural idea is to iteratively generate adversarial examples , add them back to the training data , and then retrain the model . For example , Goodfellow et al . ( 2015 ) uses adversarial examples generated by FGSM to augment the data , and Kurakin et al . ( 2017 ) proposes to use a multi-step FGSM to further improve performance . Madry et al . ( 2018 ) shows that adversarial training can be formulated as a min-max optimization problem , and proposes PGD attack ( similar to multi-step FGSM ) to find adversarial examples for each batch . Specifically , for a K-class classification problem , let us denote D = { ( xi , yi ) } ni=1 as the set of training samples with xi ∈ Rd , yi ∈ { 1 , . . . , K } , where K is the number of classes . Considering a classification model fθ ( x ) : Rd → ∆K parameterized by θ , where ∆K represents a K-dimensional simplex , adversarial training can be formulated as : min θ 1 n n∑ i=1 max x′i∈Bp ( xi , ) ` ( fθ ( x ′ i ) , yi ) , ( 1 ) where Bp ( xi , ) denotes the ` p-norm ball centered at xi with radius , and ` ( · , · ) is the cross-entropy loss . The inner maximization problem aims to find an adversarial version of a given data point xi that yields the highest loss . In general , Bp ( xi , ) can be defined based on the threat model , but the ` ∞ ball is the most popular choice among recent work ( Madry et al. , 2018 ; Zhang et al. , 2019 ) , which is also adopted in this paper . For deep neural networks , the inner maximization does not have a closed-form solution . Thus , adversarial training typically uses a gradient-based iterative solver to approximately solve the inner problem . The most commonly used choice is multi-step PGD ( Madry et al. , 2018 ) and C & W attack ( Carlini & Wagner , 2017 ) . Since then , most defense algorithms ( Zhang et al. , 2019 ; Balaji et al. , 2019 ; Wang et al. , 2019 ; Ding et al. , 2018 ; Cheng et al. , 2020 ) are based on a similar min-max framework . Trade-off between Robustness and Accuracy While effective in improving model robustness , adversarial training is known to bear a performance drop on clean test data . Tsipras et al . ( 2019 ) provides a theoretical example of data distribution where any classifier with high test accuracy must also have low adversarial accuracy under ` ∞ perturbations . They claim that high performance on both accuracy and robustness may be unattainable due to their inherently opposing goals . Zhang et al . ( 2019 ) decomposes the robust error as the sum of natural ( classification ) error and boundary error , and provides a differentiable upper-bound using the theory of classification-calibrated loss , based on which they further propose TRADES to achieve different trade-offs by tuning the regularization term . Most recently , Xie et al . ( 2020 ) proposes AdvProp to assign another batch normalization for generating adversarial examples , and shows improved performance on clean data in image classification tasks . There are also parallel studies on applying adversarial training to improve clean data performance in language understanding and vision-and-language tasks ( Zhu et al. , 2019 ; Jiang et al. , 2019 ; Liu et al. , 2020 ; Gan et al. , 2020 ) . Batch Normalization Batch Normalization is a widely adopted technique that enables faster and more stable training of deep neural networks , below , we provide a brief overview of batch normalization , which paves the way to introduce our method . Specifically , batch normalization ( Ioffe & Szegedy , 2015 ) is proposed to reduce the internal co-variate shift to ease neural network training . Considering a convolutional neural network , we can define the input and output as Ib , c , x , y and Ob , c , x , y , respectively . The dimensions correspond to examples with a batch b , channel c , and two spatial dimensions x , y . A neural network applies the same normalization for all activations in a given channel : Ob , c , x , y ← γ Ib , c , x , y − µc√ σ2c + + β ∀b , c , x , y , ( 2 ) where µc = 1|B| ∑ b , x , y Ib , c , x , y denotes the mean for channel c , and σc denotes the corresponding standard deviation . γ and β are two learnable parameters for the channel-wise affine transformation , i.e. , rescaling operations . is a small number to control numerical stability . 3 ADVERSARIAL MASKING . 3.1 BATCH NORMALIZATION ACTS AS ADVERSARIAL MASKING . Ilyas et al . ( 2019 ) disentangles adversarial examples as a natural consequence of non-robust features . Specifically , they construct robust features from an adversarial trained “ robust model ” directly . Therefore , a common belief is that adversarial robustness comes from feature representations learned through adversarial training ( Ilyas et al. , 2019 ; Santurkar et al. , 2019 ) . An interesting question we would like to ask is : can we learn robust features from a vanilla standard-trained model , or , can we obtain non-robust features from an adversarial trained “ robust model ” ? To answer this question , we design the following experiments . We first train a ResNet-18 model with standard and adversarial training , then finetune the networks by allowing only batch normalization ( BN ) to be changed while freezing other parameters . Specifically , we finetune BN in a standard trained model using adversarial training , and finetune BN in an adversarial trained model with standard training , respectively . Results are summarized in Table 1 . Given a standard trained model , by only per- forming adversarial finetuning of the BN layers , the resulting model can already achieve a reasonably good robust accuracy 26.51 % ( the 1st block ) . Similarly , given an adversarial trained model , by only performing standard finetuning of the BN layers , the clean accuracy of the model increases significantly from 78.47 % to 86.96 % ( the 2nd block ) . This experiment demonstrates that we can control the trade-off between clean and robust errors by only tuning the BN layer , so here comes a natural question : which part in BN has contributed to this performance trade-off ? To investigate this , we take a step further to check the difference of every parameter used in BN . In particular , we check the first BN layer after the first convolution layer . As well known , BN uses a running average of the mean and variance during testing . Figure 1a and 1b illustrate the difference on the running mean µ and running variance σ . The batch statistics with and without further standard finetuning of BN ( under the setting in the 2nd block of Table 1 ) are nearly identical across all the dimensions . Figure 1c and 1d plot the learned rescaling parameters γ and β . We can clearly see that the fine-tuned rescaling parameter γ is completely different from the original one , with β unchanged , indicating that γ has a significant impact on the clean and robust trade-off while still performing similar normalization on both sides . On the other hand , Rectified Linear Unit ( ReLU ) ( Agarap , 2018 ) is the most commonly used activation function in deep neural networks . The function returns 0 if it receives any negative input , and for any positive value x it returns that value back ( i.e. , f ( x ) = max ( 0 , x ) ) . During the rescaling operation , γ would magnify or shrink the magnitude of feature maps . Together with β , after ReLU activation , features that become negative will be blocked as 0 . By combining the rescaling operation with the following ReLU activation function , the resulting layer can be viewed as a masking layer to magnify or block the features maps from the convolution layer ( see Figure 2 ( a ) for illustration ) . To further validate this , we plot the feature maps after ReLU activation functions in Figure 4 in the Appendix . Some feature maps are blocked after finetuning BN ( completely black when all pixels are set to 0 ) as well as some are magnified significantly . We term the above observation as Adversarial Masking , and hypothesize that this leads to the trade-off between robustness and natural accuracy .
The paper focuses on the generalization issue with adversarial training that various work has recently demonstrated. The paper studies the role of batch normalization (BN) in adversarial robustness and generalizability. The authors single out the rescaling operator in BN to significantly impact the clean and robustness trade-off in CNNs. They then introduce Robust Masking (Rob-Mask), which is shares similarities to the CVPR2020 paper by Xie et al. (2020). Xie et al. use an auxiliary BN in adversarial training, which uses different batch normalization parameters for adversarial samples, to improve the generalizability of CNNs. Still, the authors clearly state the differences between Rob-Mask and AdvProp.
SP:9c57304bbaef17f195d88f66ded5b2d0ee93fba8
Adversarial Masking: Towards Understanding Robustness Trade-off for Generalization
1 INTRODUCTION . Deep neural networks have achieved unprecedented success over a variety of tasks and across different domains . However , studies have shown that neural networks are inherently vulnerable to adversarial examples ( Biggio et al. , 2013 ; Szegedy et al. , 2014 ) . To enhance model robustness against adversarial examples , adversarial training ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) has become one of the most effective and widely applied defense methods , which employs specific attacking algorithms to generate adversarial examples during training in order to learn robust models . Albeit effective in countering adversarial examples , adversarial training often suffers from inferior performance on clean data ( Zhang et al. , 2019 ; Balaji et al. , 2019 ) . This observation has led prior work to extrapolate that a trade-off between robustness and accuracy may be inevitable , particularly for image classification tasks ( Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . However , Yang et al . ( 2020 ) recently suggests that it is possible to learn classifiers both robust and highly accurate on real image data . The current state of adversarial training methods falls short of this prediction , and the discrepancy remains poorly understood . In this paper , we conduct an in-depth study on understanding the trade-off between robustness and clean accuracy in adversarial training , and introduce Adversarial Masking , a new hypothesis stating that a widely used technique , batch normalization ( BN ) , has a significant impact on the trade-off between robustness and natural accuracy . Specifically , we break down BN into normalization and rescaling operations , and find that the rescaling operation has a significant impact on the robustness trade-off while normalization only has marginal influence . Built upon this observation , we hypothesize that adversarial masking ( i.e. , the combination of the rescaling operation and the follow-up ReLU activation fucntion ) acts as a feature masking layer that can magnify or block feature maps to influence the performance of robust or clean generalization . In this hypothesis , different rescaling parameters in BN contribute to different adversarial maskings learned through training . By using a simple linear combination of two adversarial maskings , rather than using robust features learned by adversarial training ( Madry et al. , 2018 ; Ilyas et al. , 2019 ; Zhang et al. , 2019 ) , we show that a well-balanced trade-off can be readily achieved . Based on the Adversarial Masking hypothesis , we further propose RobMask ( Robust Masking ) , a new training scheme that learns an adaptive feature masking for different perturbation strengths . We use the learned adaptive feature masking to incorporate different features so that we could improve model generalization with a better robustness trade-off . Specifically , each perturbation strength is encoded as a low-dimensional vector , and we take this vector as input to a learnable linear projection layer together with ReLU activation , to obtain the adversarial masking for the corresponding perturbation strength . Therefore , for different perturbation strengths , we learn different maskings accordingly . By doing so , rather than hurting the performance on clean test data , we use adversarial examples as powerful regularization to boost model generalization . Experiments on multiple benchmarks demonstrate that RobMask achieves not only significantly better natural accuracy , but also a better trade-off between robustness and generalization . Our contributions are summarized as follows . ( i ) We conduct a detailed analysis to demonstrate that the rescaling operation in batch normalization has a significant impact on the trade-off between robustness and natural accuracy . ( ii ) We introduce Adversarial Masking , a new hypothesis to explain that this trade-off is caused by different feature maskings applied , and different combinations of maskings can lead to different trade-offs . ( iii ) We propose RobMask , a new training scheme to learn an adaptive masking for different perturbation strengths , in order to utilize adversarial examples to boost generalization on clean data . RobMask also achieves a better trade-off between robust and natural accuracy . 2 PRELIMINARY AND RELATED WORK . Adversarial Training Since the discovery of the vulnerability of deep neural networks , diverse approaches have been proposed to enhance model adversarial robustness . A natural idea is to iteratively generate adversarial examples , add them back to the training data , and then retrain the model . For example , Goodfellow et al . ( 2015 ) uses adversarial examples generated by FGSM to augment the data , and Kurakin et al . ( 2017 ) proposes to use a multi-step FGSM to further improve performance . Madry et al . ( 2018 ) shows that adversarial training can be formulated as a min-max optimization problem , and proposes PGD attack ( similar to multi-step FGSM ) to find adversarial examples for each batch . Specifically , for a K-class classification problem , let us denote D = { ( xi , yi ) } ni=1 as the set of training samples with xi ∈ Rd , yi ∈ { 1 , . . . , K } , where K is the number of classes . Considering a classification model fθ ( x ) : Rd → ∆K parameterized by θ , where ∆K represents a K-dimensional simplex , adversarial training can be formulated as : min θ 1 n n∑ i=1 max x′i∈Bp ( xi , ) ` ( fθ ( x ′ i ) , yi ) , ( 1 ) where Bp ( xi , ) denotes the ` p-norm ball centered at xi with radius , and ` ( · , · ) is the cross-entropy loss . The inner maximization problem aims to find an adversarial version of a given data point xi that yields the highest loss . In general , Bp ( xi , ) can be defined based on the threat model , but the ` ∞ ball is the most popular choice among recent work ( Madry et al. , 2018 ; Zhang et al. , 2019 ) , which is also adopted in this paper . For deep neural networks , the inner maximization does not have a closed-form solution . Thus , adversarial training typically uses a gradient-based iterative solver to approximately solve the inner problem . The most commonly used choice is multi-step PGD ( Madry et al. , 2018 ) and C & W attack ( Carlini & Wagner , 2017 ) . Since then , most defense algorithms ( Zhang et al. , 2019 ; Balaji et al. , 2019 ; Wang et al. , 2019 ; Ding et al. , 2018 ; Cheng et al. , 2020 ) are based on a similar min-max framework . Trade-off between Robustness and Accuracy While effective in improving model robustness , adversarial training is known to bear a performance drop on clean test data . Tsipras et al . ( 2019 ) provides a theoretical example of data distribution where any classifier with high test accuracy must also have low adversarial accuracy under ` ∞ perturbations . They claim that high performance on both accuracy and robustness may be unattainable due to their inherently opposing goals . Zhang et al . ( 2019 ) decomposes the robust error as the sum of natural ( classification ) error and boundary error , and provides a differentiable upper-bound using the theory of classification-calibrated loss , based on which they further propose TRADES to achieve different trade-offs by tuning the regularization term . Most recently , Xie et al . ( 2020 ) proposes AdvProp to assign another batch normalization for generating adversarial examples , and shows improved performance on clean data in image classification tasks . There are also parallel studies on applying adversarial training to improve clean data performance in language understanding and vision-and-language tasks ( Zhu et al. , 2019 ; Jiang et al. , 2019 ; Liu et al. , 2020 ; Gan et al. , 2020 ) . Batch Normalization Batch Normalization is a widely adopted technique that enables faster and more stable training of deep neural networks , below , we provide a brief overview of batch normalization , which paves the way to introduce our method . Specifically , batch normalization ( Ioffe & Szegedy , 2015 ) is proposed to reduce the internal co-variate shift to ease neural network training . Considering a convolutional neural network , we can define the input and output as Ib , c , x , y and Ob , c , x , y , respectively . The dimensions correspond to examples with a batch b , channel c , and two spatial dimensions x , y . A neural network applies the same normalization for all activations in a given channel : Ob , c , x , y ← γ Ib , c , x , y − µc√ σ2c + + β ∀b , c , x , y , ( 2 ) where µc = 1|B| ∑ b , x , y Ib , c , x , y denotes the mean for channel c , and σc denotes the corresponding standard deviation . γ and β are two learnable parameters for the channel-wise affine transformation , i.e. , rescaling operations . is a small number to control numerical stability . 3 ADVERSARIAL MASKING . 3.1 BATCH NORMALIZATION ACTS AS ADVERSARIAL MASKING . Ilyas et al . ( 2019 ) disentangles adversarial examples as a natural consequence of non-robust features . Specifically , they construct robust features from an adversarial trained “ robust model ” directly . Therefore , a common belief is that adversarial robustness comes from feature representations learned through adversarial training ( Ilyas et al. , 2019 ; Santurkar et al. , 2019 ) . An interesting question we would like to ask is : can we learn robust features from a vanilla standard-trained model , or , can we obtain non-robust features from an adversarial trained “ robust model ” ? To answer this question , we design the following experiments . We first train a ResNet-18 model with standard and adversarial training , then finetune the networks by allowing only batch normalization ( BN ) to be changed while freezing other parameters . Specifically , we finetune BN in a standard trained model using adversarial training , and finetune BN in an adversarial trained model with standard training , respectively . Results are summarized in Table 1 . Given a standard trained model , by only per- forming adversarial finetuning of the BN layers , the resulting model can already achieve a reasonably good robust accuracy 26.51 % ( the 1st block ) . Similarly , given an adversarial trained model , by only performing standard finetuning of the BN layers , the clean accuracy of the model increases significantly from 78.47 % to 86.96 % ( the 2nd block ) . This experiment demonstrates that we can control the trade-off between clean and robust errors by only tuning the BN layer , so here comes a natural question : which part in BN has contributed to this performance trade-off ? To investigate this , we take a step further to check the difference of every parameter used in BN . In particular , we check the first BN layer after the first convolution layer . As well known , BN uses a running average of the mean and variance during testing . Figure 1a and 1b illustrate the difference on the running mean µ and running variance σ . The batch statistics with and without further standard finetuning of BN ( under the setting in the 2nd block of Table 1 ) are nearly identical across all the dimensions . Figure 1c and 1d plot the learned rescaling parameters γ and β . We can clearly see that the fine-tuned rescaling parameter γ is completely different from the original one , with β unchanged , indicating that γ has a significant impact on the clean and robust trade-off while still performing similar normalization on both sides . On the other hand , Rectified Linear Unit ( ReLU ) ( Agarap , 2018 ) is the most commonly used activation function in deep neural networks . The function returns 0 if it receives any negative input , and for any positive value x it returns that value back ( i.e. , f ( x ) = max ( 0 , x ) ) . During the rescaling operation , γ would magnify or shrink the magnitude of feature maps . Together with β , after ReLU activation , features that become negative will be blocked as 0 . By combining the rescaling operation with the following ReLU activation function , the resulting layer can be viewed as a masking layer to magnify or block the features maps from the convolution layer ( see Figure 2 ( a ) for illustration ) . To further validate this , we plot the feature maps after ReLU activation functions in Figure 4 in the Appendix . Some feature maps are blocked after finetuning BN ( completely black when all pixels are set to 0 ) as well as some are magnified significantly . We term the above observation as Adversarial Masking , and hypothesize that this leads to the trade-off between robustness and natural accuracy .
The paper investigates the role of Batch Normalization (BN) in the generalization of deep networks, and its impact in the trade-off between clean and robust accuracy in adversarially trained networks. The authors demonstrate that the rescaling operations in BN when considered in conjunction with the ReLU activation, serve as a feature masking operation. Based on these observations, the authors propose RobMask, which uses a linear combination of such rescaling operations to achieve improved generalization in deep networks.
SP:9c57304bbaef17f195d88f66ded5b2d0ee93fba8
Adversarial Masking: Towards Understanding Robustness Trade-off for Generalization
1 INTRODUCTION . Deep neural networks have achieved unprecedented success over a variety of tasks and across different domains . However , studies have shown that neural networks are inherently vulnerable to adversarial examples ( Biggio et al. , 2013 ; Szegedy et al. , 2014 ) . To enhance model robustness against adversarial examples , adversarial training ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) has become one of the most effective and widely applied defense methods , which employs specific attacking algorithms to generate adversarial examples during training in order to learn robust models . Albeit effective in countering adversarial examples , adversarial training often suffers from inferior performance on clean data ( Zhang et al. , 2019 ; Balaji et al. , 2019 ) . This observation has led prior work to extrapolate that a trade-off between robustness and accuracy may be inevitable , particularly for image classification tasks ( Zhang et al. , 2019 ; Tsipras et al. , 2019 ) . However , Yang et al . ( 2020 ) recently suggests that it is possible to learn classifiers both robust and highly accurate on real image data . The current state of adversarial training methods falls short of this prediction , and the discrepancy remains poorly understood . In this paper , we conduct an in-depth study on understanding the trade-off between robustness and clean accuracy in adversarial training , and introduce Adversarial Masking , a new hypothesis stating that a widely used technique , batch normalization ( BN ) , has a significant impact on the trade-off between robustness and natural accuracy . Specifically , we break down BN into normalization and rescaling operations , and find that the rescaling operation has a significant impact on the robustness trade-off while normalization only has marginal influence . Built upon this observation , we hypothesize that adversarial masking ( i.e. , the combination of the rescaling operation and the follow-up ReLU activation fucntion ) acts as a feature masking layer that can magnify or block feature maps to influence the performance of robust or clean generalization . In this hypothesis , different rescaling parameters in BN contribute to different adversarial maskings learned through training . By using a simple linear combination of two adversarial maskings , rather than using robust features learned by adversarial training ( Madry et al. , 2018 ; Ilyas et al. , 2019 ; Zhang et al. , 2019 ) , we show that a well-balanced trade-off can be readily achieved . Based on the Adversarial Masking hypothesis , we further propose RobMask ( Robust Masking ) , a new training scheme that learns an adaptive feature masking for different perturbation strengths . We use the learned adaptive feature masking to incorporate different features so that we could improve model generalization with a better robustness trade-off . Specifically , each perturbation strength is encoded as a low-dimensional vector , and we take this vector as input to a learnable linear projection layer together with ReLU activation , to obtain the adversarial masking for the corresponding perturbation strength . Therefore , for different perturbation strengths , we learn different maskings accordingly . By doing so , rather than hurting the performance on clean test data , we use adversarial examples as powerful regularization to boost model generalization . Experiments on multiple benchmarks demonstrate that RobMask achieves not only significantly better natural accuracy , but also a better trade-off between robustness and generalization . Our contributions are summarized as follows . ( i ) We conduct a detailed analysis to demonstrate that the rescaling operation in batch normalization has a significant impact on the trade-off between robustness and natural accuracy . ( ii ) We introduce Adversarial Masking , a new hypothesis to explain that this trade-off is caused by different feature maskings applied , and different combinations of maskings can lead to different trade-offs . ( iii ) We propose RobMask , a new training scheme to learn an adaptive masking for different perturbation strengths , in order to utilize adversarial examples to boost generalization on clean data . RobMask also achieves a better trade-off between robust and natural accuracy . 2 PRELIMINARY AND RELATED WORK . Adversarial Training Since the discovery of the vulnerability of deep neural networks , diverse approaches have been proposed to enhance model adversarial robustness . A natural idea is to iteratively generate adversarial examples , add them back to the training data , and then retrain the model . For example , Goodfellow et al . ( 2015 ) uses adversarial examples generated by FGSM to augment the data , and Kurakin et al . ( 2017 ) proposes to use a multi-step FGSM to further improve performance . Madry et al . ( 2018 ) shows that adversarial training can be formulated as a min-max optimization problem , and proposes PGD attack ( similar to multi-step FGSM ) to find adversarial examples for each batch . Specifically , for a K-class classification problem , let us denote D = { ( xi , yi ) } ni=1 as the set of training samples with xi ∈ Rd , yi ∈ { 1 , . . . , K } , where K is the number of classes . Considering a classification model fθ ( x ) : Rd → ∆K parameterized by θ , where ∆K represents a K-dimensional simplex , adversarial training can be formulated as : min θ 1 n n∑ i=1 max x′i∈Bp ( xi , ) ` ( fθ ( x ′ i ) , yi ) , ( 1 ) where Bp ( xi , ) denotes the ` p-norm ball centered at xi with radius , and ` ( · , · ) is the cross-entropy loss . The inner maximization problem aims to find an adversarial version of a given data point xi that yields the highest loss . In general , Bp ( xi , ) can be defined based on the threat model , but the ` ∞ ball is the most popular choice among recent work ( Madry et al. , 2018 ; Zhang et al. , 2019 ) , which is also adopted in this paper . For deep neural networks , the inner maximization does not have a closed-form solution . Thus , adversarial training typically uses a gradient-based iterative solver to approximately solve the inner problem . The most commonly used choice is multi-step PGD ( Madry et al. , 2018 ) and C & W attack ( Carlini & Wagner , 2017 ) . Since then , most defense algorithms ( Zhang et al. , 2019 ; Balaji et al. , 2019 ; Wang et al. , 2019 ; Ding et al. , 2018 ; Cheng et al. , 2020 ) are based on a similar min-max framework . Trade-off between Robustness and Accuracy While effective in improving model robustness , adversarial training is known to bear a performance drop on clean test data . Tsipras et al . ( 2019 ) provides a theoretical example of data distribution where any classifier with high test accuracy must also have low adversarial accuracy under ` ∞ perturbations . They claim that high performance on both accuracy and robustness may be unattainable due to their inherently opposing goals . Zhang et al . ( 2019 ) decomposes the robust error as the sum of natural ( classification ) error and boundary error , and provides a differentiable upper-bound using the theory of classification-calibrated loss , based on which they further propose TRADES to achieve different trade-offs by tuning the regularization term . Most recently , Xie et al . ( 2020 ) proposes AdvProp to assign another batch normalization for generating adversarial examples , and shows improved performance on clean data in image classification tasks . There are also parallel studies on applying adversarial training to improve clean data performance in language understanding and vision-and-language tasks ( Zhu et al. , 2019 ; Jiang et al. , 2019 ; Liu et al. , 2020 ; Gan et al. , 2020 ) . Batch Normalization Batch Normalization is a widely adopted technique that enables faster and more stable training of deep neural networks , below , we provide a brief overview of batch normalization , which paves the way to introduce our method . Specifically , batch normalization ( Ioffe & Szegedy , 2015 ) is proposed to reduce the internal co-variate shift to ease neural network training . Considering a convolutional neural network , we can define the input and output as Ib , c , x , y and Ob , c , x , y , respectively . The dimensions correspond to examples with a batch b , channel c , and two spatial dimensions x , y . A neural network applies the same normalization for all activations in a given channel : Ob , c , x , y ← γ Ib , c , x , y − µc√ σ2c + + β ∀b , c , x , y , ( 2 ) where µc = 1|B| ∑ b , x , y Ib , c , x , y denotes the mean for channel c , and σc denotes the corresponding standard deviation . γ and β are two learnable parameters for the channel-wise affine transformation , i.e. , rescaling operations . is a small number to control numerical stability . 3 ADVERSARIAL MASKING . 3.1 BATCH NORMALIZATION ACTS AS ADVERSARIAL MASKING . Ilyas et al . ( 2019 ) disentangles adversarial examples as a natural consequence of non-robust features . Specifically , they construct robust features from an adversarial trained “ robust model ” directly . Therefore , a common belief is that adversarial robustness comes from feature representations learned through adversarial training ( Ilyas et al. , 2019 ; Santurkar et al. , 2019 ) . An interesting question we would like to ask is : can we learn robust features from a vanilla standard-trained model , or , can we obtain non-robust features from an adversarial trained “ robust model ” ? To answer this question , we design the following experiments . We first train a ResNet-18 model with standard and adversarial training , then finetune the networks by allowing only batch normalization ( BN ) to be changed while freezing other parameters . Specifically , we finetune BN in a standard trained model using adversarial training , and finetune BN in an adversarial trained model with standard training , respectively . Results are summarized in Table 1 . Given a standard trained model , by only per- forming adversarial finetuning of the BN layers , the resulting model can already achieve a reasonably good robust accuracy 26.51 % ( the 1st block ) . Similarly , given an adversarial trained model , by only performing standard finetuning of the BN layers , the clean accuracy of the model increases significantly from 78.47 % to 86.96 % ( the 2nd block ) . This experiment demonstrates that we can control the trade-off between clean and robust errors by only tuning the BN layer , so here comes a natural question : which part in BN has contributed to this performance trade-off ? To investigate this , we take a step further to check the difference of every parameter used in BN . In particular , we check the first BN layer after the first convolution layer . As well known , BN uses a running average of the mean and variance during testing . Figure 1a and 1b illustrate the difference on the running mean µ and running variance σ . The batch statistics with and without further standard finetuning of BN ( under the setting in the 2nd block of Table 1 ) are nearly identical across all the dimensions . Figure 1c and 1d plot the learned rescaling parameters γ and β . We can clearly see that the fine-tuned rescaling parameter γ is completely different from the original one , with β unchanged , indicating that γ has a significant impact on the clean and robust trade-off while still performing similar normalization on both sides . On the other hand , Rectified Linear Unit ( ReLU ) ( Agarap , 2018 ) is the most commonly used activation function in deep neural networks . The function returns 0 if it receives any negative input , and for any positive value x it returns that value back ( i.e. , f ( x ) = max ( 0 , x ) ) . During the rescaling operation , γ would magnify or shrink the magnitude of feature maps . Together with β , after ReLU activation , features that become negative will be blocked as 0 . By combining the rescaling operation with the following ReLU activation function , the resulting layer can be viewed as a masking layer to magnify or block the features maps from the convolution layer ( see Figure 2 ( a ) for illustration ) . To further validate this , we plot the feature maps after ReLU activation functions in Figure 4 in the Appendix . Some feature maps are blocked after finetuning BN ( completely black when all pixels are set to 0 ) as well as some are magnified significantly . We term the above observation as Adversarial Masking , and hypothesize that this leads to the trade-off between robustness and natural accuracy .
This paper follows the direction of previous work AdvProp (Xie et al. (2020)) and aims to use adversarial training as a regularizer to improve the network generalization on clean data. The authors analyze that the different rescaling operation in the batch normalization layer along with ReLU acts as feature masking/selection layer, which can control the trade-off between adversarial robustness and clean data performance. Unlike AdvProp, which uses different batch normalization layer for clean images and adversarial images at a specific perturbation strength, here the authors propose a technique called RobMask that adapts the rescaling parameters of batch normalization based on the perturbation strength during training. The authors show that such adapting technique is more effective than using different batch normalization layers (as in AdvProp) for each perturbation strength and thus improves the clean data performance on CIFAR10/100.
SP:9c57304bbaef17f195d88f66ded5b2d0ee93fba8
Offline Meta-Reinforcement Learning with Advantage Weighting
1 INTRODUCTION . Meta-reinforcement learning ( meta-RL ) has emerged as a promising strategy for tackling the high sample complexity of reinforcement learning algorithms , when the goal is to ultimately learn many tasks . Meta-RL algorithms exploit shared structure among tasks during meta-training , amortizing the cost of learning across tasks and enabling rapid adaptation to new tasks during meta-testing from only a small amount of experience . Yet unlike in supervised learning , where large amounts of pre-collected data can be pooled from many sources to train a single model , existing meta-RL algorithms assume the ability to collect millions of environment interactions online during meta-training . Developing offline meta-RL methods would enable such methods , in principle , to leverage existing data from any source , making them easier to scale to real-world problems where large amounts of data might be necessary to generalize broadly . To this end , we propose the offline meta-RL problem setting and a corresponding algorithm that uses only offline ( or batch ) experience from a set of training tasks to enable efficient transfer to new tasks without any further interaction with either the training or testing environments . See Figure 1 for a comparison of offline meta-RL and standard meta-RL . Because the offline setting does not allow additional data collection during training , it highlights the desirability of a consistent meta-RL algorithm . A meta-RL algorithm is consistent if , given enough diverse data on the test task , adaptation can find a good policy for the task regardless of the training task distribution . Such an algorithm would provide a ) rapid adaptation to new tasks from the same distribution as the train tasks while b ) allowing for improvement even for out of distribution test tasks . However , designing a consistent meta-RL algorithm in the offline setting is difficult : the consistency requirement suggests we might aim to extend the model-agnostic meta-learning ( MAML ) algorithm ( Finn et al. , 2017a ) , since it directly corresponds to fine-tuning at meta-test time . However , existing MAML approaches use online policy gradients , and only value-based approaches have proven effective in the offline setting . Yet combining MAML with value-based RL subroutines is not straightforward : the higher-order optimization in MAML-like methods demands stable and efficient gradient-descent updates , while TD backups are both somewhat unstable and require a large number of steps to propagate reward information across long time horizons . To address these challenges , one might combine MAML with a supervised , bootstrap-free RL subroutine , such as advantage-weighted regression ( AWR ) ( Peters and Schaal , 2007 ; Peng et al. , 2019 ) , for both for the inner and outer loop of a gradient-based meta-learning algorithm , yielding a ‘ MAML+AWR ’ algorithm . However , as we will discuss in Section 4 and find empirically in Section 5 , naïvely combining MAML and AWR in this way does not provide satisfactory performance because the AWR policy update is not sufficiently expressive . Motivated by prior work that studies the expressive power of MAML ( Finn and Levine , 2018 ) , we increase the expressive power of the meta-learner by introducing a carefully chosen policy update in the inner loop . We theoretically prove that this change increases the richness of the policy ’ s update and find empirically that this policy update dramatically improves adaptation performance and stability in some settings . We further observe that standard feedforward neural network architectures used in reinforcement learning are not well-suited to optimization-based meta-learning and suggest an alternative that proves critical for good performance across four different environments . We call the resulting meta-RL algorithm and architecture Meta-Actor Critic with Advantage Weighting , or MACAW . Our main contributions are the offline meta-RL problem setting itself and MACAW , an offline meta-reinforcement learning algorithm that possesses three key properties : sample efficiency , offline meta-training , and consistency at meta-test time . To our knowledge , MACAW is the first algorithm to successfully combine gradient-based meta-learning and off-policy value-based RL . Our evaluations include experiments on offline variants of standard continuous control meta-RL benchmarks as well as settings specifically designed to test the robustness of an offline meta-learner when training tasks are scarce . In all of these settings , MACAW significantly outperforms fully offline variants state-of-the-art off-policy RL and meta-RL baselines . 2 PRELIMINARIES . In reinforcement learning , an agent interacts with a Markov Decision Process ( MDP ) to maximize its cumulative reward . An MDP is a tuple ( S , A , T , r ) consisting of a state space S , an action space A , stochastic transition dynamics T : S ×A× S → [ 0 , 1 ] , and a reward function r. At each time step , the agent receives reward rt = r ( st , at , st+1 ) . The agent ’ s objective is to maximize the expected return ( i.e . discounted sum of rewards ) R = ∑ t γ trt , where γ ∈ [ 0 , 1 ] is a discount factor . To extend this setting to meta-RL , we consider tasks drawn from a distribution Ti ∼ p ( T ) , where each task Ti = ( S , A , pi , ri ) represents a different MDP . Both the dynamics and reward function may vary across tasks . The tasks are generally assumed to exhibit some ( unknown ) shared structure . During meta-training , the agent is presented with tasks sampled from p ( T ) ; at meta-test time , an agent ’ s objective is to rapidly find a high-performing policy for a ( potentially unseen ) task T ′ ∼ p ( T ) . That is , with only a small amount of experience on T ′ , the agent should find a policy that achieves high expected return on that task . During meta-training , the agent meta-learns parameters or update rules that enables such rapid adaptation at test-time . Model-agnostic meta-learning One class of algorithms for addressing the meta-RL problem ( as well as meta-supervised learning ) are variants of the MAML algorithm ( Finn et al. , 2017a ) , which involves a bi-level optimization that aims to achieve fast adaptation via a few gradient updates . Specifically , MAML optimizes a set of initial policy parameters θ such that a few gradient-descent steps from θ leads to policy parameters that achieve good task performance . At each meta-training step , the inner loop adapts θ to a task T by computing θ′ = θ − α∇θLT ( θ ) , where L is the loss function for task T and α is the step size ( in general , θ′ might be computed from multiple gradient steps , rather than just one as is written here ) . The outer loop updates the initial parameters as θ ← θ − β∇θL′T ( θ′ ) , where L′T is a loss function for task T , which may or may not be the same as the inner-loop loss function LT , and β is the step size . MAML has been previously instantiated with policy gradient updates in the inner and outer loops ( Finn et al. , 2017a ; Rothfuss et al. , 2018 ) , which can only be applied to on-policy meta-RL settings ; we address this shortcoming in this work . Advantage-weighted regression . To develop an offline meta-RL algorithm , we build upon advantage-weighted regression ( AWR ) ( Peng et al. , 2019 ) , a simple offline RL method . The AWR policy objective is given by LAWR ( ϑ , ϕ , B ) = Es , a∼B [ −log πϑ ( a|s ) exp ( 1 T ( RB ( s , a ) − Vϕ ( s ) ) ) ] , ( 1 ) where B = { sj , aj , s′j , rj } can be an arbitrary dataset of transition tuples sampled from some behavior policy , andRB ( s , a ) is the return recorded in the dataset for performing action a in state s , Vϕ ( s ) is the learned value function for the behavior policy evaluated at state s , and T > 0 is a temperature parameter . The termRB ( s , a ) − Vϕ ( s ) represents the advantage of a particular action . The objective can be interpreted as a weighted regression problem , where actions that lead to higher advantages are assigned larger weights . The value function parameters ϕ are typically trained using simple regression onto Monte Carlo returns , and the policy parameters ϑ are trained using LAWR . Next , we discuss the offline meta-RL problem and some of the challenges it poses . 3 THE OFFLINE META-RL PROBLEM . In the offline meta-RL problem setting , we aim to leverage offline multi-task experience to enable fast adaptation to new downstream tasks . Each task Ti is drawn from a task distribution p ( T ) . In the offline setting , the meta-training algorithm is not permitted to directly interact with the meta-training tasks Ti , but instead is provided with a fixed dataset of transition tuples Bi = { si , j , ai , j , s′i , j , ri , j } for each task . Each Bi is populated with trajectories sampled from a corresponding behavior policy µi . Each µi might be an expert policy , sub-optimal demonstrations , other RL agents , or some mixture thereof . Regardless of the behavior policies µi , the objective of offline meta-RL is to maximize return after adaptation on the test tasks . However , depending on the quality of the behavior policies , the maximum attainable return may vary . We observe such a phenomenon in a offline data quality ablation experiment in Section 5 . Sampling data from a fixed dataset at both meta-training and meta-testing time , rather than from the learned policy itself , distinguishes offline meta-RL from the standard meta-RL setting . This constraint is significant , because most algorithms for meta-RL require a large amount of on-policy experience from the environment during meta-training ; these algorithms are generally unable to fully make use of data collected by external sources . During meta-testing , a ( generally unseen ) test task Ttest is drawn from p ( T ) , and the meta-trained agent is presented with a new batch of experience D sampled from a distribution Btest . The agent ’ s objective is to use this batch of data to find the highest-performing policy for the test task . We consider the case where only Bi is fixed during meta-training and Btest corresponds to sampling online trajectories to be the offline meta-RL problem . The case where both Bi and Btest are fixed data buffers is called the fully offline meta-RL problem , which is especially applicable in situations when allowing online exploration might be difficult or dangerous . In the fully offline case , we might also consider the setting where we perform additional online rollouts with our adapted policy and fine-tune with this online data after the initial offline adaptation step . We call this the fully offline meta-RL problem with online fine-tuning . The experiments performed in this paper mostly correspond to the fully offline setting . In Appendix C.2 we also conduct an experiment in the setting of fully offline meta-RL with online fine-tuning . Prior meta-RL methods require interaction with the MDP for each of the meta-training tasks ( Finn et al. , 2017a ) , and though some prior methods build on off-policy RL algorithms ( Rakelly et al. , 2019 ) , these algorithms are known to perform poorly in the fully offline setting ( Levine et al. , 2020 ) . Both of the offline meta-RL settings described above inherit the distributional difficulties of offline RL , which means that addressing this problem setting requires a new type of meta-RL method that is capable of meta-training from offline data . 4 MACAW : META ACTOR-CRITIC WITH ADVANTAGE WEIGHTING Algorithm 1 MACAW Meta-Training 1 : Input : Tasks { Ti } , offline buffers { Di } 2 : Hyperparameters : learning rates α1 , α2 , η1 , η2 , training iterations n , temperature T 3 : Randomly initialize meta-parameters θ , φ 4 : for n steps do 5 : for task Ti ∈ { Ti } do 6 : Sample disjoint batches Dtri , D ts i ∼ Di 7 : φ′i ← φ− η1∇φLV ( φ , Dtri ) 8 : θ′i ← θ − α1∇θLπ ( θ , φ′i , Dtri ) 9 : φ← φ− η2 ∑ i [ ∇φLV ( φ′i , Dtsi ) ] 10 : θ ← θ − α2 ∑ i [ ∇θLAWR ( θ′i , φ′i , Dtsi ) ] Algorithm 2 MACAW Meta-Testing 1 : Input : Test task Tj , offline experience D , meta-policy πθ , meta-value function Vφ 2 : Hyperparameters : learning rates α1 , η , adaptation iterations n , temperature T 3 : Initialize θ0 ← θ , φ0 ← φ . 4 : for n steps do 5 : φt+1 ← φt − η1∇φtLV ( φt , D ) 6 : θt+1 ← θt − α1∇θtLπ ( θt , φt+1 , D ) In addition to satisfying the demands of the offline setting , an ideal method for offline meta-RL should not be limited to the distribution of tasks observed at training time . This is especially important in the offline meta-RL setting , in which the sampling of the training data is out of the control of the agent . In other words , it is critical that an offline meta-RL algorithm be consistent , in the sense that given enough , sufficiently diverse adaptation data at meta-test time , the algorithm can find a good solution to that task , regardless of the meta-training tasks . To address the numerous challenges posed by offline meta-RL , we propose meta actor-critic with advantage weighting ( MACAW ) . MACAW is an offline meta-RL algorithm that learns initializations φ and θ for a value function Vφ and policy πθ , respectively , that can rapidly adapt to a new task seen at meta-test time via gradient descent . Both the value function and the policy objectives correspond to simple regression losses in both the inner and outer loop , leading to a stable and consistent inner-loop adaptation process and outer-loop meta-training signal . While these objectives build upon AWR , we show that the naive application of an AWR update in the inner loop leads to unsatisfactory performance , motivating the enriched policy update that we describe in Section 4.1 . In Sections 4.2 and 4.3 , we detail the full meta-training procedure and an important architectural component of the policy and value networks .
This paper introduces a new problem setting in meta reinforcement learning, namely metaRL. Here the agent is trained on a fixed offline dataset, which distinguishes it from most metaRL algorithms that interact with the environment during meta training. The authors propose a gradient-based meta learning method (MACAW) to approach this problem, which uses an actor-critic method combined with advantage weighting which is an offline RL method. In experiments they show that this outperforms the offline metaRL method PEARL, and combining multi-task offline RL with AWR in a naive way.
SP:0c0358ba5e6e771c7684604f3163516c7f38d6eb
Offline Meta-Reinforcement Learning with Advantage Weighting
1 INTRODUCTION . Meta-reinforcement learning ( meta-RL ) has emerged as a promising strategy for tackling the high sample complexity of reinforcement learning algorithms , when the goal is to ultimately learn many tasks . Meta-RL algorithms exploit shared structure among tasks during meta-training , amortizing the cost of learning across tasks and enabling rapid adaptation to new tasks during meta-testing from only a small amount of experience . Yet unlike in supervised learning , where large amounts of pre-collected data can be pooled from many sources to train a single model , existing meta-RL algorithms assume the ability to collect millions of environment interactions online during meta-training . Developing offline meta-RL methods would enable such methods , in principle , to leverage existing data from any source , making them easier to scale to real-world problems where large amounts of data might be necessary to generalize broadly . To this end , we propose the offline meta-RL problem setting and a corresponding algorithm that uses only offline ( or batch ) experience from a set of training tasks to enable efficient transfer to new tasks without any further interaction with either the training or testing environments . See Figure 1 for a comparison of offline meta-RL and standard meta-RL . Because the offline setting does not allow additional data collection during training , it highlights the desirability of a consistent meta-RL algorithm . A meta-RL algorithm is consistent if , given enough diverse data on the test task , adaptation can find a good policy for the task regardless of the training task distribution . Such an algorithm would provide a ) rapid adaptation to new tasks from the same distribution as the train tasks while b ) allowing for improvement even for out of distribution test tasks . However , designing a consistent meta-RL algorithm in the offline setting is difficult : the consistency requirement suggests we might aim to extend the model-agnostic meta-learning ( MAML ) algorithm ( Finn et al. , 2017a ) , since it directly corresponds to fine-tuning at meta-test time . However , existing MAML approaches use online policy gradients , and only value-based approaches have proven effective in the offline setting . Yet combining MAML with value-based RL subroutines is not straightforward : the higher-order optimization in MAML-like methods demands stable and efficient gradient-descent updates , while TD backups are both somewhat unstable and require a large number of steps to propagate reward information across long time horizons . To address these challenges , one might combine MAML with a supervised , bootstrap-free RL subroutine , such as advantage-weighted regression ( AWR ) ( Peters and Schaal , 2007 ; Peng et al. , 2019 ) , for both for the inner and outer loop of a gradient-based meta-learning algorithm , yielding a ‘ MAML+AWR ’ algorithm . However , as we will discuss in Section 4 and find empirically in Section 5 , naïvely combining MAML and AWR in this way does not provide satisfactory performance because the AWR policy update is not sufficiently expressive . Motivated by prior work that studies the expressive power of MAML ( Finn and Levine , 2018 ) , we increase the expressive power of the meta-learner by introducing a carefully chosen policy update in the inner loop . We theoretically prove that this change increases the richness of the policy ’ s update and find empirically that this policy update dramatically improves adaptation performance and stability in some settings . We further observe that standard feedforward neural network architectures used in reinforcement learning are not well-suited to optimization-based meta-learning and suggest an alternative that proves critical for good performance across four different environments . We call the resulting meta-RL algorithm and architecture Meta-Actor Critic with Advantage Weighting , or MACAW . Our main contributions are the offline meta-RL problem setting itself and MACAW , an offline meta-reinforcement learning algorithm that possesses three key properties : sample efficiency , offline meta-training , and consistency at meta-test time . To our knowledge , MACAW is the first algorithm to successfully combine gradient-based meta-learning and off-policy value-based RL . Our evaluations include experiments on offline variants of standard continuous control meta-RL benchmarks as well as settings specifically designed to test the robustness of an offline meta-learner when training tasks are scarce . In all of these settings , MACAW significantly outperforms fully offline variants state-of-the-art off-policy RL and meta-RL baselines . 2 PRELIMINARIES . In reinforcement learning , an agent interacts with a Markov Decision Process ( MDP ) to maximize its cumulative reward . An MDP is a tuple ( S , A , T , r ) consisting of a state space S , an action space A , stochastic transition dynamics T : S ×A× S → [ 0 , 1 ] , and a reward function r. At each time step , the agent receives reward rt = r ( st , at , st+1 ) . The agent ’ s objective is to maximize the expected return ( i.e . discounted sum of rewards ) R = ∑ t γ trt , where γ ∈ [ 0 , 1 ] is a discount factor . To extend this setting to meta-RL , we consider tasks drawn from a distribution Ti ∼ p ( T ) , where each task Ti = ( S , A , pi , ri ) represents a different MDP . Both the dynamics and reward function may vary across tasks . The tasks are generally assumed to exhibit some ( unknown ) shared structure . During meta-training , the agent is presented with tasks sampled from p ( T ) ; at meta-test time , an agent ’ s objective is to rapidly find a high-performing policy for a ( potentially unseen ) task T ′ ∼ p ( T ) . That is , with only a small amount of experience on T ′ , the agent should find a policy that achieves high expected return on that task . During meta-training , the agent meta-learns parameters or update rules that enables such rapid adaptation at test-time . Model-agnostic meta-learning One class of algorithms for addressing the meta-RL problem ( as well as meta-supervised learning ) are variants of the MAML algorithm ( Finn et al. , 2017a ) , which involves a bi-level optimization that aims to achieve fast adaptation via a few gradient updates . Specifically , MAML optimizes a set of initial policy parameters θ such that a few gradient-descent steps from θ leads to policy parameters that achieve good task performance . At each meta-training step , the inner loop adapts θ to a task T by computing θ′ = θ − α∇θLT ( θ ) , where L is the loss function for task T and α is the step size ( in general , θ′ might be computed from multiple gradient steps , rather than just one as is written here ) . The outer loop updates the initial parameters as θ ← θ − β∇θL′T ( θ′ ) , where L′T is a loss function for task T , which may or may not be the same as the inner-loop loss function LT , and β is the step size . MAML has been previously instantiated with policy gradient updates in the inner and outer loops ( Finn et al. , 2017a ; Rothfuss et al. , 2018 ) , which can only be applied to on-policy meta-RL settings ; we address this shortcoming in this work . Advantage-weighted regression . To develop an offline meta-RL algorithm , we build upon advantage-weighted regression ( AWR ) ( Peng et al. , 2019 ) , a simple offline RL method . The AWR policy objective is given by LAWR ( ϑ , ϕ , B ) = Es , a∼B [ −log πϑ ( a|s ) exp ( 1 T ( RB ( s , a ) − Vϕ ( s ) ) ) ] , ( 1 ) where B = { sj , aj , s′j , rj } can be an arbitrary dataset of transition tuples sampled from some behavior policy , andRB ( s , a ) is the return recorded in the dataset for performing action a in state s , Vϕ ( s ) is the learned value function for the behavior policy evaluated at state s , and T > 0 is a temperature parameter . The termRB ( s , a ) − Vϕ ( s ) represents the advantage of a particular action . The objective can be interpreted as a weighted regression problem , where actions that lead to higher advantages are assigned larger weights . The value function parameters ϕ are typically trained using simple regression onto Monte Carlo returns , and the policy parameters ϑ are trained using LAWR . Next , we discuss the offline meta-RL problem and some of the challenges it poses . 3 THE OFFLINE META-RL PROBLEM . In the offline meta-RL problem setting , we aim to leverage offline multi-task experience to enable fast adaptation to new downstream tasks . Each task Ti is drawn from a task distribution p ( T ) . In the offline setting , the meta-training algorithm is not permitted to directly interact with the meta-training tasks Ti , but instead is provided with a fixed dataset of transition tuples Bi = { si , j , ai , j , s′i , j , ri , j } for each task . Each Bi is populated with trajectories sampled from a corresponding behavior policy µi . Each µi might be an expert policy , sub-optimal demonstrations , other RL agents , or some mixture thereof . Regardless of the behavior policies µi , the objective of offline meta-RL is to maximize return after adaptation on the test tasks . However , depending on the quality of the behavior policies , the maximum attainable return may vary . We observe such a phenomenon in a offline data quality ablation experiment in Section 5 . Sampling data from a fixed dataset at both meta-training and meta-testing time , rather than from the learned policy itself , distinguishes offline meta-RL from the standard meta-RL setting . This constraint is significant , because most algorithms for meta-RL require a large amount of on-policy experience from the environment during meta-training ; these algorithms are generally unable to fully make use of data collected by external sources . During meta-testing , a ( generally unseen ) test task Ttest is drawn from p ( T ) , and the meta-trained agent is presented with a new batch of experience D sampled from a distribution Btest . The agent ’ s objective is to use this batch of data to find the highest-performing policy for the test task . We consider the case where only Bi is fixed during meta-training and Btest corresponds to sampling online trajectories to be the offline meta-RL problem . The case where both Bi and Btest are fixed data buffers is called the fully offline meta-RL problem , which is especially applicable in situations when allowing online exploration might be difficult or dangerous . In the fully offline case , we might also consider the setting where we perform additional online rollouts with our adapted policy and fine-tune with this online data after the initial offline adaptation step . We call this the fully offline meta-RL problem with online fine-tuning . The experiments performed in this paper mostly correspond to the fully offline setting . In Appendix C.2 we also conduct an experiment in the setting of fully offline meta-RL with online fine-tuning . Prior meta-RL methods require interaction with the MDP for each of the meta-training tasks ( Finn et al. , 2017a ) , and though some prior methods build on off-policy RL algorithms ( Rakelly et al. , 2019 ) , these algorithms are known to perform poorly in the fully offline setting ( Levine et al. , 2020 ) . Both of the offline meta-RL settings described above inherit the distributional difficulties of offline RL , which means that addressing this problem setting requires a new type of meta-RL method that is capable of meta-training from offline data . 4 MACAW : META ACTOR-CRITIC WITH ADVANTAGE WEIGHTING Algorithm 1 MACAW Meta-Training 1 : Input : Tasks { Ti } , offline buffers { Di } 2 : Hyperparameters : learning rates α1 , α2 , η1 , η2 , training iterations n , temperature T 3 : Randomly initialize meta-parameters θ , φ 4 : for n steps do 5 : for task Ti ∈ { Ti } do 6 : Sample disjoint batches Dtri , D ts i ∼ Di 7 : φ′i ← φ− η1∇φLV ( φ , Dtri ) 8 : θ′i ← θ − α1∇θLπ ( θ , φ′i , Dtri ) 9 : φ← φ− η2 ∑ i [ ∇φLV ( φ′i , Dtsi ) ] 10 : θ ← θ − α2 ∑ i [ ∇θLAWR ( θ′i , φ′i , Dtsi ) ] Algorithm 2 MACAW Meta-Testing 1 : Input : Test task Tj , offline experience D , meta-policy πθ , meta-value function Vφ 2 : Hyperparameters : learning rates α1 , η , adaptation iterations n , temperature T 3 : Initialize θ0 ← θ , φ0 ← φ . 4 : for n steps do 5 : φt+1 ← φt − η1∇φtLV ( φt , D ) 6 : θt+1 ← θt − α1∇θtLπ ( θt , φt+1 , D ) In addition to satisfying the demands of the offline setting , an ideal method for offline meta-RL should not be limited to the distribution of tasks observed at training time . This is especially important in the offline meta-RL setting , in which the sampling of the training data is out of the control of the agent . In other words , it is critical that an offline meta-RL algorithm be consistent , in the sense that given enough , sufficiently diverse adaptation data at meta-test time , the algorithm can find a good solution to that task , regardless of the meta-training tasks . To address the numerous challenges posed by offline meta-RL , we propose meta actor-critic with advantage weighting ( MACAW ) . MACAW is an offline meta-RL algorithm that learns initializations φ and θ for a value function Vφ and policy πθ , respectively , that can rapidly adapt to a new task seen at meta-test time via gradient descent . Both the value function and the policy objectives correspond to simple regression losses in both the inner and outer loop , leading to a stable and consistent inner-loop adaptation process and outer-loop meta-training signal . While these objectives build upon AWR , we show that the naive application of an AWR update in the inner loop leads to unsatisfactory performance , motivating the enriched policy update that we describe in Section 4.1 . In Sections 4.2 and 4.3 , we detail the full meta-training procedure and an important architectural component of the policy and value networks .
The paper proposes the problem of fully offline meta-RL. Here, the idea is to leverage offline experience from multiple tasks to enable fast adaptation to new tasks. The paper distinguishes two settings of offline meta-RL, one where only the training data is collected offline and testing corresponds to sampling online trajectories, the other where both training and testing data are collected offline. The latter is termed as fully offline meta-RL and is the problem setting considered in this work.
SP:0c0358ba5e6e771c7684604f3163516c7f38d6eb
Offline Meta-Reinforcement Learning with Advantage Weighting
1 INTRODUCTION . Meta-reinforcement learning ( meta-RL ) has emerged as a promising strategy for tackling the high sample complexity of reinforcement learning algorithms , when the goal is to ultimately learn many tasks . Meta-RL algorithms exploit shared structure among tasks during meta-training , amortizing the cost of learning across tasks and enabling rapid adaptation to new tasks during meta-testing from only a small amount of experience . Yet unlike in supervised learning , where large amounts of pre-collected data can be pooled from many sources to train a single model , existing meta-RL algorithms assume the ability to collect millions of environment interactions online during meta-training . Developing offline meta-RL methods would enable such methods , in principle , to leverage existing data from any source , making them easier to scale to real-world problems where large amounts of data might be necessary to generalize broadly . To this end , we propose the offline meta-RL problem setting and a corresponding algorithm that uses only offline ( or batch ) experience from a set of training tasks to enable efficient transfer to new tasks without any further interaction with either the training or testing environments . See Figure 1 for a comparison of offline meta-RL and standard meta-RL . Because the offline setting does not allow additional data collection during training , it highlights the desirability of a consistent meta-RL algorithm . A meta-RL algorithm is consistent if , given enough diverse data on the test task , adaptation can find a good policy for the task regardless of the training task distribution . Such an algorithm would provide a ) rapid adaptation to new tasks from the same distribution as the train tasks while b ) allowing for improvement even for out of distribution test tasks . However , designing a consistent meta-RL algorithm in the offline setting is difficult : the consistency requirement suggests we might aim to extend the model-agnostic meta-learning ( MAML ) algorithm ( Finn et al. , 2017a ) , since it directly corresponds to fine-tuning at meta-test time . However , existing MAML approaches use online policy gradients , and only value-based approaches have proven effective in the offline setting . Yet combining MAML with value-based RL subroutines is not straightforward : the higher-order optimization in MAML-like methods demands stable and efficient gradient-descent updates , while TD backups are both somewhat unstable and require a large number of steps to propagate reward information across long time horizons . To address these challenges , one might combine MAML with a supervised , bootstrap-free RL subroutine , such as advantage-weighted regression ( AWR ) ( Peters and Schaal , 2007 ; Peng et al. , 2019 ) , for both for the inner and outer loop of a gradient-based meta-learning algorithm , yielding a ‘ MAML+AWR ’ algorithm . However , as we will discuss in Section 4 and find empirically in Section 5 , naïvely combining MAML and AWR in this way does not provide satisfactory performance because the AWR policy update is not sufficiently expressive . Motivated by prior work that studies the expressive power of MAML ( Finn and Levine , 2018 ) , we increase the expressive power of the meta-learner by introducing a carefully chosen policy update in the inner loop . We theoretically prove that this change increases the richness of the policy ’ s update and find empirically that this policy update dramatically improves adaptation performance and stability in some settings . We further observe that standard feedforward neural network architectures used in reinforcement learning are not well-suited to optimization-based meta-learning and suggest an alternative that proves critical for good performance across four different environments . We call the resulting meta-RL algorithm and architecture Meta-Actor Critic with Advantage Weighting , or MACAW . Our main contributions are the offline meta-RL problem setting itself and MACAW , an offline meta-reinforcement learning algorithm that possesses three key properties : sample efficiency , offline meta-training , and consistency at meta-test time . To our knowledge , MACAW is the first algorithm to successfully combine gradient-based meta-learning and off-policy value-based RL . Our evaluations include experiments on offline variants of standard continuous control meta-RL benchmarks as well as settings specifically designed to test the robustness of an offline meta-learner when training tasks are scarce . In all of these settings , MACAW significantly outperforms fully offline variants state-of-the-art off-policy RL and meta-RL baselines . 2 PRELIMINARIES . In reinforcement learning , an agent interacts with a Markov Decision Process ( MDP ) to maximize its cumulative reward . An MDP is a tuple ( S , A , T , r ) consisting of a state space S , an action space A , stochastic transition dynamics T : S ×A× S → [ 0 , 1 ] , and a reward function r. At each time step , the agent receives reward rt = r ( st , at , st+1 ) . The agent ’ s objective is to maximize the expected return ( i.e . discounted sum of rewards ) R = ∑ t γ trt , where γ ∈ [ 0 , 1 ] is a discount factor . To extend this setting to meta-RL , we consider tasks drawn from a distribution Ti ∼ p ( T ) , where each task Ti = ( S , A , pi , ri ) represents a different MDP . Both the dynamics and reward function may vary across tasks . The tasks are generally assumed to exhibit some ( unknown ) shared structure . During meta-training , the agent is presented with tasks sampled from p ( T ) ; at meta-test time , an agent ’ s objective is to rapidly find a high-performing policy for a ( potentially unseen ) task T ′ ∼ p ( T ) . That is , with only a small amount of experience on T ′ , the agent should find a policy that achieves high expected return on that task . During meta-training , the agent meta-learns parameters or update rules that enables such rapid adaptation at test-time . Model-agnostic meta-learning One class of algorithms for addressing the meta-RL problem ( as well as meta-supervised learning ) are variants of the MAML algorithm ( Finn et al. , 2017a ) , which involves a bi-level optimization that aims to achieve fast adaptation via a few gradient updates . Specifically , MAML optimizes a set of initial policy parameters θ such that a few gradient-descent steps from θ leads to policy parameters that achieve good task performance . At each meta-training step , the inner loop adapts θ to a task T by computing θ′ = θ − α∇θLT ( θ ) , where L is the loss function for task T and α is the step size ( in general , θ′ might be computed from multiple gradient steps , rather than just one as is written here ) . The outer loop updates the initial parameters as θ ← θ − β∇θL′T ( θ′ ) , where L′T is a loss function for task T , which may or may not be the same as the inner-loop loss function LT , and β is the step size . MAML has been previously instantiated with policy gradient updates in the inner and outer loops ( Finn et al. , 2017a ; Rothfuss et al. , 2018 ) , which can only be applied to on-policy meta-RL settings ; we address this shortcoming in this work . Advantage-weighted regression . To develop an offline meta-RL algorithm , we build upon advantage-weighted regression ( AWR ) ( Peng et al. , 2019 ) , a simple offline RL method . The AWR policy objective is given by LAWR ( ϑ , ϕ , B ) = Es , a∼B [ −log πϑ ( a|s ) exp ( 1 T ( RB ( s , a ) − Vϕ ( s ) ) ) ] , ( 1 ) where B = { sj , aj , s′j , rj } can be an arbitrary dataset of transition tuples sampled from some behavior policy , andRB ( s , a ) is the return recorded in the dataset for performing action a in state s , Vϕ ( s ) is the learned value function for the behavior policy evaluated at state s , and T > 0 is a temperature parameter . The termRB ( s , a ) − Vϕ ( s ) represents the advantage of a particular action . The objective can be interpreted as a weighted regression problem , where actions that lead to higher advantages are assigned larger weights . The value function parameters ϕ are typically trained using simple regression onto Monte Carlo returns , and the policy parameters ϑ are trained using LAWR . Next , we discuss the offline meta-RL problem and some of the challenges it poses . 3 THE OFFLINE META-RL PROBLEM . In the offline meta-RL problem setting , we aim to leverage offline multi-task experience to enable fast adaptation to new downstream tasks . Each task Ti is drawn from a task distribution p ( T ) . In the offline setting , the meta-training algorithm is not permitted to directly interact with the meta-training tasks Ti , but instead is provided with a fixed dataset of transition tuples Bi = { si , j , ai , j , s′i , j , ri , j } for each task . Each Bi is populated with trajectories sampled from a corresponding behavior policy µi . Each µi might be an expert policy , sub-optimal demonstrations , other RL agents , or some mixture thereof . Regardless of the behavior policies µi , the objective of offline meta-RL is to maximize return after adaptation on the test tasks . However , depending on the quality of the behavior policies , the maximum attainable return may vary . We observe such a phenomenon in a offline data quality ablation experiment in Section 5 . Sampling data from a fixed dataset at both meta-training and meta-testing time , rather than from the learned policy itself , distinguishes offline meta-RL from the standard meta-RL setting . This constraint is significant , because most algorithms for meta-RL require a large amount of on-policy experience from the environment during meta-training ; these algorithms are generally unable to fully make use of data collected by external sources . During meta-testing , a ( generally unseen ) test task Ttest is drawn from p ( T ) , and the meta-trained agent is presented with a new batch of experience D sampled from a distribution Btest . The agent ’ s objective is to use this batch of data to find the highest-performing policy for the test task . We consider the case where only Bi is fixed during meta-training and Btest corresponds to sampling online trajectories to be the offline meta-RL problem . The case where both Bi and Btest are fixed data buffers is called the fully offline meta-RL problem , which is especially applicable in situations when allowing online exploration might be difficult or dangerous . In the fully offline case , we might also consider the setting where we perform additional online rollouts with our adapted policy and fine-tune with this online data after the initial offline adaptation step . We call this the fully offline meta-RL problem with online fine-tuning . The experiments performed in this paper mostly correspond to the fully offline setting . In Appendix C.2 we also conduct an experiment in the setting of fully offline meta-RL with online fine-tuning . Prior meta-RL methods require interaction with the MDP for each of the meta-training tasks ( Finn et al. , 2017a ) , and though some prior methods build on off-policy RL algorithms ( Rakelly et al. , 2019 ) , these algorithms are known to perform poorly in the fully offline setting ( Levine et al. , 2020 ) . Both of the offline meta-RL settings described above inherit the distributional difficulties of offline RL , which means that addressing this problem setting requires a new type of meta-RL method that is capable of meta-training from offline data . 4 MACAW : META ACTOR-CRITIC WITH ADVANTAGE WEIGHTING Algorithm 1 MACAW Meta-Training 1 : Input : Tasks { Ti } , offline buffers { Di } 2 : Hyperparameters : learning rates α1 , α2 , η1 , η2 , training iterations n , temperature T 3 : Randomly initialize meta-parameters θ , φ 4 : for n steps do 5 : for task Ti ∈ { Ti } do 6 : Sample disjoint batches Dtri , D ts i ∼ Di 7 : φ′i ← φ− η1∇φLV ( φ , Dtri ) 8 : θ′i ← θ − α1∇θLπ ( θ , φ′i , Dtri ) 9 : φ← φ− η2 ∑ i [ ∇φLV ( φ′i , Dtsi ) ] 10 : θ ← θ − α2 ∑ i [ ∇θLAWR ( θ′i , φ′i , Dtsi ) ] Algorithm 2 MACAW Meta-Testing 1 : Input : Test task Tj , offline experience D , meta-policy πθ , meta-value function Vφ 2 : Hyperparameters : learning rates α1 , η , adaptation iterations n , temperature T 3 : Initialize θ0 ← θ , φ0 ← φ . 4 : for n steps do 5 : φt+1 ← φt − η1∇φtLV ( φt , D ) 6 : θt+1 ← θt − α1∇θtLπ ( θt , φt+1 , D ) In addition to satisfying the demands of the offline setting , an ideal method for offline meta-RL should not be limited to the distribution of tasks observed at training time . This is especially important in the offline meta-RL setting , in which the sampling of the training data is out of the control of the agent . In other words , it is critical that an offline meta-RL algorithm be consistent , in the sense that given enough , sufficiently diverse adaptation data at meta-test time , the algorithm can find a good solution to that task , regardless of the meta-training tasks . To address the numerous challenges posed by offline meta-RL , we propose meta actor-critic with advantage weighting ( MACAW ) . MACAW is an offline meta-RL algorithm that learns initializations φ and θ for a value function Vφ and policy πθ , respectively , that can rapidly adapt to a new task seen at meta-test time via gradient descent . Both the value function and the policy objectives correspond to simple regression losses in both the inner and outer loop , leading to a stable and consistent inner-loop adaptation process and outer-loop meta-training signal . While these objectives build upon AWR , we show that the naive application of an AWR update in the inner loop leads to unsatisfactory performance , motivating the enriched policy update that we describe in Section 4.1 . In Sections 4.2 and 4.3 , we detail the full meta-training procedure and an important architectural component of the policy and value networks .
This paper proposes a method for "fully" offline meta-RL. Specifically, they assume there is no interaction with the environment at all neither during meta-train nor meta-test and this method only sees previously collected data at all times. Their method is built on top of AWR [1] in which policy updates are weighted by the advantage term. Except for section 4.3 and the last paragraph of section 4.1 (see below), the paper is well-written and easy to follow.
SP:0c0358ba5e6e771c7684604f3163516c7f38d6eb
Towards Adversarial Robustness of Bayesian Neural Network through Hierarchical Variational Inference
Recent works have applied Bayesian Neural Network ( BNN ) to adversarial training , and shown the improvement of adversarial robustness via the BNN ’ s strength of stochastic gradient defense . However , we have found that in general , the BNN loses its stochasticity after its training with the BNN ’ s posterior . As a result , the lack of the stochasticity leads to weak regularization effect to the BNN , which increases KL divergence in ELBO from variational inference . In this paper , we propose an enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness against gradient-based attack . Furthermore , we also prove that the proposed method allows the BNN ’ s stochasticity to be elevated with the reduced KL divergence . Exhaustive experiment results demonstrate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack and EOT-PGD attack to the L∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 1 INTRODUCTION . Deep neural networks have achieved impressive performance in a wide variety of machine learning tasks . Despite the breakthrough outcomes , deep neural networks are easily deceived from adversarial attack with the carefully crafted perturbations ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Chen et al. , 2017 ; Carlini & Wagner , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Madry et al. , 2018 ) . Injecting these perturbations into clean inputs ( i.e. , adversarial examples ) , which are imperceptible to the human eyes , fools the estimators in the deep neural networks . Weak reliability due to the invisible perturbations has affected security problems in deep learning applications ( Apruzzese et al. , 2019 ; Wang et al. , 2019b ; Sagduyu et al. , 2019 ; Rosenberg et al. , 2020 ) . To defend such adversarial examples , many algorithms have been studied to improve adversarial robustness so far . Adversarial training , where deep neural networks are trained on adversarial examples , is one of the few defense strategies against strong adversarial attacks ( Huang et al. , 2015 ; Zantedeschi et al. , 2017 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ; Athalye et al. , 2018a ; Liu et al. , 2018 ) . Among them , Madry et al . ( 2018 ) has shown that adversarially trained networks can be robust to white-box attacks with the knowledge of the network parameters . Besides , most of the above studies have agreed with that adversarial training shows an effective adversarial robustness against several white-box attacks . Meanwhile , adversarial training and BNN have been combined to improve adversarial robustness with stochastic approach through variational inference . In fact , the variational inference maximizes Evidence Lower Bound ( ELBO ) to find an approximate posterior closely following the true posterior for the machine learning tasks ( Graves , 2011 ; Kingma & Welling , 2014 ; Blundell et al. , 2015 ; Hernández-Lobato & Adams , 2015 ) . Based on the variational inference , adversarial training with BNN has accomplished the achievement of adversarial robustness by implicitly using the approximate posterior against the adversarial perturbations ( Mescheder et al. , 2017 ; Ye & Zhu , 2018 ) . They have focused on training the network parameters or spaces itself on the maximum ELBO without obtaining the approximate posterior directly . Contrary to the above studies , Liu et al . ( 2019 ) presents an adversarial training with BNN , called “ adversarial-BNN ” to deal with the approximate posterior explicitly . They straightforwardly learn Gaussian parameters ( e.g. , mean and variance ) of the approximate posterior as follows : w ∼ N ( µ , σ2 ) , instead of the weight parameters . Alternatively , the weight parameters are sampled by the approximate posterior , such that w = µ + σ , where the stochastic sampler is gererated from ∼ N ( 0 , 1 ) . The stochastic sampler provides the change of the weight parameters with the learned Gaussian parameters . The variation of them creates stochastic gradient , helping the improvement of adversarial robustness ( Carbone et al. , 2020 ) . However , we find that in general , the approximate posterior ’ s variance converges to zero-like small value as follows : w ∼ N ( µ , σ2 ≈ 0 ) after training the BNN with its posterior . Although the stochastic sampler helps the weight parameters to change , they become fixed-like parameters , such that w = µ+σ ( ≈ 0 ) . The lack of their stochasticity causes the BNN ’ s stochasticity to be vanished so that the BNN can not easily respond to slightly different inputs within the same class . In other words , the vanished stochasticity breaks the regularization effect in the BNN , which increases KL divergence in the ELBO . The broken BNN regularizer produces an ill-posed posterior , thus resulting in weak adversarial robustness . This is because the broken regularizer hinders the maximum ELBO from approximating the true posterior against the adversarial perturbations . Therefore , an enhanced BNN regularizer is required to better approximate the true posterior for adversarial robustness . In this paper , we present the enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness compared to the BNN regularizer from variational inference . Furthermore , we also prove that the proposed method significantly intensifies the BNN ’ s stochasticity by introducing a closed form approximation of conjugate prior for the true posterior . In the end , we validate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack as well as EOT-PGD attack to theL∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . Our contributions of this paper can be summarized into two-fold as follows . • We newly design an enhanced Bayesian regularizer through hierarchical variational inference built with a concept of the conjugate prior , and verify that the proposed method further strengthens the BNN ’ s stochasticity , compared to the BNN regularizer based on variational inference . • We conduct exhaustive experiments to validate the effectiveness of the proposed method by adversarial robustness , and exhibit the outstanding performance compared with adversarial training and adversarial-BNN under both PGD attack and EOT-PGD attack on four benchmark datasets : CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 2 PRELIMINARY . In this section , we specify the notations used in our paper at first and summarize the related works on adversarial attack/defense , and adversarial training with BNN . Notations . Let x denote the clean image from a given dataset , and y denote the class label corresponding to the clean image . Let D and Dadv indicate each clean dataset and adversarial dataset , such that ( x , y ) ∼ D and ( xadv , y ) ∼ Dadv . A deep neural network f parameterized by weight parameters w is denoted by fw ( x ) . Adversarial examples are represented by xadv = x + δ , where δ denotes the adversarial perturbations . In order to align the experiments in the previous works , we use the cross-entropy loss J ( fw ( x ) , y ) for image classification . Moreover , we regard δ as the L∞ perturbation within γ-ball , such that ‖δ‖∞ ≤ γ . Here , ‖·‖∞ describes the L∞ . 2.1 ADVERSARIAL ATTACK/DEFENSE . Adversarial Attacks . The goal of adversarial attacks is generating the adversarial examples to deceive the prediction of the deep neural networks . Most of them produce the adversarial examples by the gradient of the loss function over the input . Goodfellow et al . ( 2015 ) introduces a single-step attack called Fast Gradient Sign Method ( FGSM ) . Kurakin et al . ( 2017 ) proposes iterative-FGSM with multiple-step attack . Further , Carlini & Wagner ( 2017 ) presents C & W attack to overcome defensive distillation ( Papernot et al. , 2016 ) , encompassing a range of attacks cast from the same optimization framework . On the other hand , Athalye et al . ( 2018a ) analyzes the effectiveness of Projected Gradient Descent ( PGD ) method ( Madry et al. , 2018 ) to perform adversarial attack to the L∞ perturbation . PGD attack is an iterative algorithm by computing the gradient of the loss in the direction of the highest loss and projecting it back to the L∞ perturbation around the clean image . We use the PGD attack for the experiments of adversarial robustness , which can be written as : xadvt+1 = ∏ x , γ [ xadvt + η · sign ( ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ) ] , ( 1 ) where ∏ x , γ is the function to project its argument to the surface of x ’ s γ-neighbor ball { x ∣∣ ∥∥xadv − x∥∥∞ ≤ γ } , and η denotes step size . For the adversarial defense utilizing randomized classifiers , an adaptive attack such as Expectation over Transformation ( EOT ) is known to be effective because it allows an attacker to compute the actual gradient over the expected transformation to the stochastic classifiers ( Athalye et al. , 2018a ; b ) . Inspired from the EOT attack , we can modify Eq . ( 1 ) and adjust more efficient PGD attack ( Zimmermann , 2019 ) . xadvt+1 = ∏ x , γ [ xadvt + η · sign ( E w [ ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ] ) ] , ( 2 ) Zimmermann ( 2019 ) applies the averaged-gradient over the multiple weight parameters to generate the adversarial examples , and shows that this efficient PGD attack degrades the BNN ’ s adversarial robustness . This is because the averaged-gradient can attack all of the possibly sampled weight parameters in the BNN . In other words , the averaged-gradient attack weakens the BNN ’ s advantage of stochastic gradient defense . In this paper , we call the efficient PGD attack , namely EOT-PGD attack , and take it to validate the effectiveness of the proposed method . Adversarial Defense . The aim of adversarial defense is to secure deep learning networks against adversarial attacks . There are generally three main categories of defense strategies ( Silva & Najafirad , 2020 ; Hao-Chen et al. , 2020 ) . ( 1 ) Gradient masking/obfuscation : a defender intentionally hides the gradient information of deep neural networks in order to confuse adversaries , because most attack algorithms are based on the classifier ’ s gradient information ( Papernot et al. , 2016 ; Buckman et al. , 2018 ; Guo et al. , 2018 ; Dhillon et al. , 2018 ) . ( 2 ) Adversarial detections : they focus on distinguishing whether the input is benign or adversarial ( Metzen et al. , 2017 ; Grosse et al. , 2017 ; Xu et al. , 2017 ) . When they succeed to detect the adversarial attack in the input , the classifiers stop making a decision . ( 3 ) Robust optimization : it is a well-known paradigm that aims to obtain solutions under bounded feasible regions . Especially , its main interest from an adversarial perspective , is improving the classifier ’ s robustness by changing the learning scheme of deep neural networks ( Cisse et al. , 2017 ; Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018 ; Wong & Kolter , 2018 ) . Adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ) is one of the famous robust optimization methods in deep learning fields , which allows the deep neural network to learn robust parameters against the adversarial examples . Madry et al . ( 2018 ) tries to find the optimal weight parameters against adversarial dataset Dadv to improve adversarial robustness under PGD attack to the L∞ perturbation , by minimizing the pre-defined loss L for the machine learning tasks . The formulation can be written as : w∗ = arg min w E ( xadv , y ) ∼Dadv [ L ( fw ( x adv ) , y ) ] , ( 3 ) where xadv is generated from the PGD attack as described in Eq . ( 1 ) . The optimal weight parameters w∗ get the capacity of adversarial defense to confront the adversarial perturbations .
In this paper the authors study the adversarial robustness of BNNs on large scale datasets. BNNs have been shown to be a more robust learning paradigm due to their uncertainty/stochasticity. Given the empirical observation that adversarially trained BNN posterior variances converge to zero (which the authors need to do much more to show as this is not a well-established phenomena), the authors propose a hierarchical prior where they put a prior over the parameters of the Gaussian prior normally used in mean-field variational inference. The authors show that performing approximate inference with a hierarchical prior leads to an increased variational posterior variance, which the authors claim is correlated to the observation of increased adversarial robustness.
SP:820ce414ae58e414bc7008fad4b4ea8fa7e511d1
Towards Adversarial Robustness of Bayesian Neural Network through Hierarchical Variational Inference
Recent works have applied Bayesian Neural Network ( BNN ) to adversarial training , and shown the improvement of adversarial robustness via the BNN ’ s strength of stochastic gradient defense . However , we have found that in general , the BNN loses its stochasticity after its training with the BNN ’ s posterior . As a result , the lack of the stochasticity leads to weak regularization effect to the BNN , which increases KL divergence in ELBO from variational inference . In this paper , we propose an enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness against gradient-based attack . Furthermore , we also prove that the proposed method allows the BNN ’ s stochasticity to be elevated with the reduced KL divergence . Exhaustive experiment results demonstrate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack and EOT-PGD attack to the L∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 1 INTRODUCTION . Deep neural networks have achieved impressive performance in a wide variety of machine learning tasks . Despite the breakthrough outcomes , deep neural networks are easily deceived from adversarial attack with the carefully crafted perturbations ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Chen et al. , 2017 ; Carlini & Wagner , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Madry et al. , 2018 ) . Injecting these perturbations into clean inputs ( i.e. , adversarial examples ) , which are imperceptible to the human eyes , fools the estimators in the deep neural networks . Weak reliability due to the invisible perturbations has affected security problems in deep learning applications ( Apruzzese et al. , 2019 ; Wang et al. , 2019b ; Sagduyu et al. , 2019 ; Rosenberg et al. , 2020 ) . To defend such adversarial examples , many algorithms have been studied to improve adversarial robustness so far . Adversarial training , where deep neural networks are trained on adversarial examples , is one of the few defense strategies against strong adversarial attacks ( Huang et al. , 2015 ; Zantedeschi et al. , 2017 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ; Athalye et al. , 2018a ; Liu et al. , 2018 ) . Among them , Madry et al . ( 2018 ) has shown that adversarially trained networks can be robust to white-box attacks with the knowledge of the network parameters . Besides , most of the above studies have agreed with that adversarial training shows an effective adversarial robustness against several white-box attacks . Meanwhile , adversarial training and BNN have been combined to improve adversarial robustness with stochastic approach through variational inference . In fact , the variational inference maximizes Evidence Lower Bound ( ELBO ) to find an approximate posterior closely following the true posterior for the machine learning tasks ( Graves , 2011 ; Kingma & Welling , 2014 ; Blundell et al. , 2015 ; Hernández-Lobato & Adams , 2015 ) . Based on the variational inference , adversarial training with BNN has accomplished the achievement of adversarial robustness by implicitly using the approximate posterior against the adversarial perturbations ( Mescheder et al. , 2017 ; Ye & Zhu , 2018 ) . They have focused on training the network parameters or spaces itself on the maximum ELBO without obtaining the approximate posterior directly . Contrary to the above studies , Liu et al . ( 2019 ) presents an adversarial training with BNN , called “ adversarial-BNN ” to deal with the approximate posterior explicitly . They straightforwardly learn Gaussian parameters ( e.g. , mean and variance ) of the approximate posterior as follows : w ∼ N ( µ , σ2 ) , instead of the weight parameters . Alternatively , the weight parameters are sampled by the approximate posterior , such that w = µ + σ , where the stochastic sampler is gererated from ∼ N ( 0 , 1 ) . The stochastic sampler provides the change of the weight parameters with the learned Gaussian parameters . The variation of them creates stochastic gradient , helping the improvement of adversarial robustness ( Carbone et al. , 2020 ) . However , we find that in general , the approximate posterior ’ s variance converges to zero-like small value as follows : w ∼ N ( µ , σ2 ≈ 0 ) after training the BNN with its posterior . Although the stochastic sampler helps the weight parameters to change , they become fixed-like parameters , such that w = µ+σ ( ≈ 0 ) . The lack of their stochasticity causes the BNN ’ s stochasticity to be vanished so that the BNN can not easily respond to slightly different inputs within the same class . In other words , the vanished stochasticity breaks the regularization effect in the BNN , which increases KL divergence in the ELBO . The broken BNN regularizer produces an ill-posed posterior , thus resulting in weak adversarial robustness . This is because the broken regularizer hinders the maximum ELBO from approximating the true posterior against the adversarial perturbations . Therefore , an enhanced BNN regularizer is required to better approximate the true posterior for adversarial robustness . In this paper , we present the enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness compared to the BNN regularizer from variational inference . Furthermore , we also prove that the proposed method significantly intensifies the BNN ’ s stochasticity by introducing a closed form approximation of conjugate prior for the true posterior . In the end , we validate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack as well as EOT-PGD attack to theL∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . Our contributions of this paper can be summarized into two-fold as follows . • We newly design an enhanced Bayesian regularizer through hierarchical variational inference built with a concept of the conjugate prior , and verify that the proposed method further strengthens the BNN ’ s stochasticity , compared to the BNN regularizer based on variational inference . • We conduct exhaustive experiments to validate the effectiveness of the proposed method by adversarial robustness , and exhibit the outstanding performance compared with adversarial training and adversarial-BNN under both PGD attack and EOT-PGD attack on four benchmark datasets : CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 2 PRELIMINARY . In this section , we specify the notations used in our paper at first and summarize the related works on adversarial attack/defense , and adversarial training with BNN . Notations . Let x denote the clean image from a given dataset , and y denote the class label corresponding to the clean image . Let D and Dadv indicate each clean dataset and adversarial dataset , such that ( x , y ) ∼ D and ( xadv , y ) ∼ Dadv . A deep neural network f parameterized by weight parameters w is denoted by fw ( x ) . Adversarial examples are represented by xadv = x + δ , where δ denotes the adversarial perturbations . In order to align the experiments in the previous works , we use the cross-entropy loss J ( fw ( x ) , y ) for image classification . Moreover , we regard δ as the L∞ perturbation within γ-ball , such that ‖δ‖∞ ≤ γ . Here , ‖·‖∞ describes the L∞ . 2.1 ADVERSARIAL ATTACK/DEFENSE . Adversarial Attacks . The goal of adversarial attacks is generating the adversarial examples to deceive the prediction of the deep neural networks . Most of them produce the adversarial examples by the gradient of the loss function over the input . Goodfellow et al . ( 2015 ) introduces a single-step attack called Fast Gradient Sign Method ( FGSM ) . Kurakin et al . ( 2017 ) proposes iterative-FGSM with multiple-step attack . Further , Carlini & Wagner ( 2017 ) presents C & W attack to overcome defensive distillation ( Papernot et al. , 2016 ) , encompassing a range of attacks cast from the same optimization framework . On the other hand , Athalye et al . ( 2018a ) analyzes the effectiveness of Projected Gradient Descent ( PGD ) method ( Madry et al. , 2018 ) to perform adversarial attack to the L∞ perturbation . PGD attack is an iterative algorithm by computing the gradient of the loss in the direction of the highest loss and projecting it back to the L∞ perturbation around the clean image . We use the PGD attack for the experiments of adversarial robustness , which can be written as : xadvt+1 = ∏ x , γ [ xadvt + η · sign ( ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ) ] , ( 1 ) where ∏ x , γ is the function to project its argument to the surface of x ’ s γ-neighbor ball { x ∣∣ ∥∥xadv − x∥∥∞ ≤ γ } , and η denotes step size . For the adversarial defense utilizing randomized classifiers , an adaptive attack such as Expectation over Transformation ( EOT ) is known to be effective because it allows an attacker to compute the actual gradient over the expected transformation to the stochastic classifiers ( Athalye et al. , 2018a ; b ) . Inspired from the EOT attack , we can modify Eq . ( 1 ) and adjust more efficient PGD attack ( Zimmermann , 2019 ) . xadvt+1 = ∏ x , γ [ xadvt + η · sign ( E w [ ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ] ) ] , ( 2 ) Zimmermann ( 2019 ) applies the averaged-gradient over the multiple weight parameters to generate the adversarial examples , and shows that this efficient PGD attack degrades the BNN ’ s adversarial robustness . This is because the averaged-gradient can attack all of the possibly sampled weight parameters in the BNN . In other words , the averaged-gradient attack weakens the BNN ’ s advantage of stochastic gradient defense . In this paper , we call the efficient PGD attack , namely EOT-PGD attack , and take it to validate the effectiveness of the proposed method . Adversarial Defense . The aim of adversarial defense is to secure deep learning networks against adversarial attacks . There are generally three main categories of defense strategies ( Silva & Najafirad , 2020 ; Hao-Chen et al. , 2020 ) . ( 1 ) Gradient masking/obfuscation : a defender intentionally hides the gradient information of deep neural networks in order to confuse adversaries , because most attack algorithms are based on the classifier ’ s gradient information ( Papernot et al. , 2016 ; Buckman et al. , 2018 ; Guo et al. , 2018 ; Dhillon et al. , 2018 ) . ( 2 ) Adversarial detections : they focus on distinguishing whether the input is benign or adversarial ( Metzen et al. , 2017 ; Grosse et al. , 2017 ; Xu et al. , 2017 ) . When they succeed to detect the adversarial attack in the input , the classifiers stop making a decision . ( 3 ) Robust optimization : it is a well-known paradigm that aims to obtain solutions under bounded feasible regions . Especially , its main interest from an adversarial perspective , is improving the classifier ’ s robustness by changing the learning scheme of deep neural networks ( Cisse et al. , 2017 ; Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018 ; Wong & Kolter , 2018 ) . Adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ) is one of the famous robust optimization methods in deep learning fields , which allows the deep neural network to learn robust parameters against the adversarial examples . Madry et al . ( 2018 ) tries to find the optimal weight parameters against adversarial dataset Dadv to improve adversarial robustness under PGD attack to the L∞ perturbation , by minimizing the pre-defined loss L for the machine learning tasks . The formulation can be written as : w∗ = arg min w E ( xadv , y ) ∼Dadv [ L ( fw ( x adv ) , y ) ] , ( 3 ) where xadv is generated from the PGD attack as described in Eq . ( 1 ) . The optimal weight parameters w∗ get the capacity of adversarial defense to confront the adversarial perturbations .
This paper presents a new adversarial training for BNNs with variational inference (VI). Specifically, Adv-BNN training of Liu et al. 2019 uses a standard normal prior for VI of BNNs. The paper observes that the above method may have vanished stochasticity that reduces the robustness and the proposed method extends it with a conjugate prior constructed by a normal distribution and an inverse gamma distribution. This extension results in a stronger regularisation of the weights of BNNs, which can enhance the robustness against adv attacks and leads to a hierarchical inference. The method is reported to have better performance than vanilla adv training and adv-BNN training on several benchmark datasets.
SP:820ce414ae58e414bc7008fad4b4ea8fa7e511d1
Towards Adversarial Robustness of Bayesian Neural Network through Hierarchical Variational Inference
Recent works have applied Bayesian Neural Network ( BNN ) to adversarial training , and shown the improvement of adversarial robustness via the BNN ’ s strength of stochastic gradient defense . However , we have found that in general , the BNN loses its stochasticity after its training with the BNN ’ s posterior . As a result , the lack of the stochasticity leads to weak regularization effect to the BNN , which increases KL divergence in ELBO from variational inference . In this paper , we propose an enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness against gradient-based attack . Furthermore , we also prove that the proposed method allows the BNN ’ s stochasticity to be elevated with the reduced KL divergence . Exhaustive experiment results demonstrate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack and EOT-PGD attack to the L∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 1 INTRODUCTION . Deep neural networks have achieved impressive performance in a wide variety of machine learning tasks . Despite the breakthrough outcomes , deep neural networks are easily deceived from adversarial attack with the carefully crafted perturbations ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ; Chen et al. , 2017 ; Carlini & Wagner , 2017 ; Papernot et al. , 2017 ; Eykholt et al. , 2018 ; Madry et al. , 2018 ) . Injecting these perturbations into clean inputs ( i.e. , adversarial examples ) , which are imperceptible to the human eyes , fools the estimators in the deep neural networks . Weak reliability due to the invisible perturbations has affected security problems in deep learning applications ( Apruzzese et al. , 2019 ; Wang et al. , 2019b ; Sagduyu et al. , 2019 ; Rosenberg et al. , 2020 ) . To defend such adversarial examples , many algorithms have been studied to improve adversarial robustness so far . Adversarial training , where deep neural networks are trained on adversarial examples , is one of the few defense strategies against strong adversarial attacks ( Huang et al. , 2015 ; Zantedeschi et al. , 2017 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ; Athalye et al. , 2018a ; Liu et al. , 2018 ) . Among them , Madry et al . ( 2018 ) has shown that adversarially trained networks can be robust to white-box attacks with the knowledge of the network parameters . Besides , most of the above studies have agreed with that adversarial training shows an effective adversarial robustness against several white-box attacks . Meanwhile , adversarial training and BNN have been combined to improve adversarial robustness with stochastic approach through variational inference . In fact , the variational inference maximizes Evidence Lower Bound ( ELBO ) to find an approximate posterior closely following the true posterior for the machine learning tasks ( Graves , 2011 ; Kingma & Welling , 2014 ; Blundell et al. , 2015 ; Hernández-Lobato & Adams , 2015 ) . Based on the variational inference , adversarial training with BNN has accomplished the achievement of adversarial robustness by implicitly using the approximate posterior against the adversarial perturbations ( Mescheder et al. , 2017 ; Ye & Zhu , 2018 ) . They have focused on training the network parameters or spaces itself on the maximum ELBO without obtaining the approximate posterior directly . Contrary to the above studies , Liu et al . ( 2019 ) presents an adversarial training with BNN , called “ adversarial-BNN ” to deal with the approximate posterior explicitly . They straightforwardly learn Gaussian parameters ( e.g. , mean and variance ) of the approximate posterior as follows : w ∼ N ( µ , σ2 ) , instead of the weight parameters . Alternatively , the weight parameters are sampled by the approximate posterior , such that w = µ + σ , where the stochastic sampler is gererated from ∼ N ( 0 , 1 ) . The stochastic sampler provides the change of the weight parameters with the learned Gaussian parameters . The variation of them creates stochastic gradient , helping the improvement of adversarial robustness ( Carbone et al. , 2020 ) . However , we find that in general , the approximate posterior ’ s variance converges to zero-like small value as follows : w ∼ N ( µ , σ2 ≈ 0 ) after training the BNN with its posterior . Although the stochastic sampler helps the weight parameters to change , they become fixed-like parameters , such that w = µ+σ ( ≈ 0 ) . The lack of their stochasticity causes the BNN ’ s stochasticity to be vanished so that the BNN can not easily respond to slightly different inputs within the same class . In other words , the vanished stochasticity breaks the regularization effect in the BNN , which increases KL divergence in the ELBO . The broken BNN regularizer produces an ill-posed posterior , thus resulting in weak adversarial robustness . This is because the broken regularizer hinders the maximum ELBO from approximating the true posterior against the adversarial perturbations . Therefore , an enhanced BNN regularizer is required to better approximate the true posterior for adversarial robustness . In this paper , we present the enhanced Bayesian regularizer through hierarchical variational inference in order to boost adversarial robustness compared to the BNN regularizer from variational inference . Furthermore , we also prove that the proposed method significantly intensifies the BNN ’ s stochasticity by introducing a closed form approximation of conjugate prior for the true posterior . In the end , we validate the effectiveness of the proposed method by showing the improvement of adversarial robustness , compared with adversarial training ( Madry et al. , 2018 ) and adversarial-BNN ( Liu et al. , 2019 ) under PGD attack as well as EOT-PGD attack to theL∞ perturbation on CIFAR-10/100 , STL-10 , and Tiny-ImageNet . Our contributions of this paper can be summarized into two-fold as follows . • We newly design an enhanced Bayesian regularizer through hierarchical variational inference built with a concept of the conjugate prior , and verify that the proposed method further strengthens the BNN ’ s stochasticity , compared to the BNN regularizer based on variational inference . • We conduct exhaustive experiments to validate the effectiveness of the proposed method by adversarial robustness , and exhibit the outstanding performance compared with adversarial training and adversarial-BNN under both PGD attack and EOT-PGD attack on four benchmark datasets : CIFAR-10/100 , STL-10 , and Tiny-ImageNet . 2 PRELIMINARY . In this section , we specify the notations used in our paper at first and summarize the related works on adversarial attack/defense , and adversarial training with BNN . Notations . Let x denote the clean image from a given dataset , and y denote the class label corresponding to the clean image . Let D and Dadv indicate each clean dataset and adversarial dataset , such that ( x , y ) ∼ D and ( xadv , y ) ∼ Dadv . A deep neural network f parameterized by weight parameters w is denoted by fw ( x ) . Adversarial examples are represented by xadv = x + δ , where δ denotes the adversarial perturbations . In order to align the experiments in the previous works , we use the cross-entropy loss J ( fw ( x ) , y ) for image classification . Moreover , we regard δ as the L∞ perturbation within γ-ball , such that ‖δ‖∞ ≤ γ . Here , ‖·‖∞ describes the L∞ . 2.1 ADVERSARIAL ATTACK/DEFENSE . Adversarial Attacks . The goal of adversarial attacks is generating the adversarial examples to deceive the prediction of the deep neural networks . Most of them produce the adversarial examples by the gradient of the loss function over the input . Goodfellow et al . ( 2015 ) introduces a single-step attack called Fast Gradient Sign Method ( FGSM ) . Kurakin et al . ( 2017 ) proposes iterative-FGSM with multiple-step attack . Further , Carlini & Wagner ( 2017 ) presents C & W attack to overcome defensive distillation ( Papernot et al. , 2016 ) , encompassing a range of attacks cast from the same optimization framework . On the other hand , Athalye et al . ( 2018a ) analyzes the effectiveness of Projected Gradient Descent ( PGD ) method ( Madry et al. , 2018 ) to perform adversarial attack to the L∞ perturbation . PGD attack is an iterative algorithm by computing the gradient of the loss in the direction of the highest loss and projecting it back to the L∞ perturbation around the clean image . We use the PGD attack for the experiments of adversarial robustness , which can be written as : xadvt+1 = ∏ x , γ [ xadvt + η · sign ( ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ) ] , ( 1 ) where ∏ x , γ is the function to project its argument to the surface of x ’ s γ-neighbor ball { x ∣∣ ∥∥xadv − x∥∥∞ ≤ γ } , and η denotes step size . For the adversarial defense utilizing randomized classifiers , an adaptive attack such as Expectation over Transformation ( EOT ) is known to be effective because it allows an attacker to compute the actual gradient over the expected transformation to the stochastic classifiers ( Athalye et al. , 2018a ; b ) . Inspired from the EOT attack , we can modify Eq . ( 1 ) and adjust more efficient PGD attack ( Zimmermann , 2019 ) . xadvt+1 = ∏ x , γ [ xadvt + η · sign ( E w [ ∇xJ ( fw ( x ) , y ) ∣∣ x=xadvt ] ) ] , ( 2 ) Zimmermann ( 2019 ) applies the averaged-gradient over the multiple weight parameters to generate the adversarial examples , and shows that this efficient PGD attack degrades the BNN ’ s adversarial robustness . This is because the averaged-gradient can attack all of the possibly sampled weight parameters in the BNN . In other words , the averaged-gradient attack weakens the BNN ’ s advantage of stochastic gradient defense . In this paper , we call the efficient PGD attack , namely EOT-PGD attack , and take it to validate the effectiveness of the proposed method . Adversarial Defense . The aim of adversarial defense is to secure deep learning networks against adversarial attacks . There are generally three main categories of defense strategies ( Silva & Najafirad , 2020 ; Hao-Chen et al. , 2020 ) . ( 1 ) Gradient masking/obfuscation : a defender intentionally hides the gradient information of deep neural networks in order to confuse adversaries , because most attack algorithms are based on the classifier ’ s gradient information ( Papernot et al. , 2016 ; Buckman et al. , 2018 ; Guo et al. , 2018 ; Dhillon et al. , 2018 ) . ( 2 ) Adversarial detections : they focus on distinguishing whether the input is benign or adversarial ( Metzen et al. , 2017 ; Grosse et al. , 2017 ; Xu et al. , 2017 ) . When they succeed to detect the adversarial attack in the input , the classifiers stop making a decision . ( 3 ) Robust optimization : it is a well-known paradigm that aims to obtain solutions under bounded feasible regions . Especially , its main interest from an adversarial perspective , is improving the classifier ’ s robustness by changing the learning scheme of deep neural networks ( Cisse et al. , 2017 ; Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018 ; Wong & Kolter , 2018 ) . Adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ; Madry et al. , 2018 ) is one of the famous robust optimization methods in deep learning fields , which allows the deep neural network to learn robust parameters against the adversarial examples . Madry et al . ( 2018 ) tries to find the optimal weight parameters against adversarial dataset Dadv to improve adversarial robustness under PGD attack to the L∞ perturbation , by minimizing the pre-defined loss L for the machine learning tasks . The formulation can be written as : w∗ = arg min w E ( xadv , y ) ∼Dadv [ L ( fw ( x adv ) , y ) ] , ( 3 ) where xadv is generated from the PGD attack as described in Eq . ( 1 ) . The optimal weight parameters w∗ get the capacity of adversarial defense to confront the adversarial perturbations .
This paper studies the adversarial robustness of DNNs with Bayesian neural networks. Although BNN has been integrated with adversarial training for better robustness, this paper argues that the previous method lacks the stochasticity (i.e., the posterior tends to have zero variance), thus limiting the robustness performance. In this paper, a new hierarchical variational inference is proposed to enhance the robustness when integrating with adversarial training. The proposed method is presented well. The experiments show the effectiveness of the proposed method.
SP:820ce414ae58e414bc7008fad4b4ea8fa7e511d1
Distributional Generalization: A New Kind of Generalization
1 INTRODUCTION . We begin with an experiment motivating the need for a notion of generalization beyond test error . Experiment 1 . Consider a binary classification version of CIFAR-10 , where CIFAR-10 images x have binary labels Animal/Object . Take 50K samples from this distribution as a train set , but apply the following label noise : flip the label of cats to Object with probability 30 % . Now train a WideResNet f to 0 train error on this train set . How does the trained classifier behave on test samples ? Options below : 1 . The test error is low across all classes , since there is only 3 % label noise in the train set 2 . Test error is “ spread ” across the animal class , After all , the classifier is not explicitly told what a cat or a dog is , just that they are all animals . 3 . The classifier misclassifies roughly 30 % of test cats as “ objects ” , but all other types of animals are largely unaffected . In fact , reality is closest to option ( 3 ) . Figure 1 shows the results of this experiment with a WideResNet . The left panel shows the joint density of train inputs x with train labels Object/Animal . Since the classifier is interpolating , the classifier outputs on the train set are identical to the left panel . The right panel shows the classifier predictions f ( x ) on test inputs x . There are several notable things about this experiment . First , the error is localized to cats in test set as it was in the train set , even though no explicit cat labels were provided . Second , the amount of error on the cat class is close to the noise applied on the train set . Thus , the behavior of the classifier on the train set generalizes to the test set in a certain sense . This type of similarity in behavior would not be captured solely by average test error — it requires reasoning about the entire distribution of classifier outputs . In our work , we show that this experiment is just one instance of a different type of generalization , which we call “ Distributional Generalization ” . We now describe the mathematical form of this generalization . Then , through extensive experiments , we will show that this type of generalization occurs widely in existing machine learning methods : neural networks , kernel machines and decision trees . 1.1 DISTRIBUTIONAL GENERALIZATION . Supervised learning aims to learn a model that correctly classifies inputs x ∈ X from a given distribution D into classes y ∈ Y . We want a model with small test error on this distribution . In practice , we find such a classifier by minimizing the train error of a model on the train set . This procedure is justified when we expect a small generalization gap : the gap between the error on the train and test set . That is , the trained model f should have : ErrorTrainSet ( f ) ≈ ErrorTestSet ( f ) . We now re-write this classical notion of generalization in a form better suited for our extension . Classical Generalization : Let f be a trained classifier . Then f generalizes if : E x∼TrainSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ≈ E x∼TestSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ( 1 ) Above , y ( x ) is the true class of x and ŷ is the predicted class . The LHS of Equation 1 is the train error of f , and the RHS is the test error . Crucially , both sides of Equation 1 are expectations of the same function ( Terr ( x , ŷ ) : = 1 { ŷ 6= y ( x ) } ) under different distributions . The LHS of Equation 1 is the expectation of Terr under the “ Train Distribution ” Dtr , which is the distribution over ( x , ŷ ) given by sampling a train point x along with its classifier-label f ( x ) . Similarly , the RHS is under the “ Test Distribution ” Dte , which is this same construction over the test set . These two distributions are the central objects in our study , and are defined formally in Section 2.1 . We can now introduce Distributional Generalization , which is a property of trained classifiers . It is parameterized by a set of bounded functions ( “ tests ” ) : T ⊆ { T : X × Y → [ 0 , 1 ] } . Distributional Generalization : Let f be a trained classifier . Then f satisfies Distributional Generalization with respect to tests T if : ∀T ∈ T : E x∼TrainSet ŷ←f ( x ) [ T ( x , ŷ ) ] ≈ E x∼TestSet ŷ←f ( x ) [ T ( x , ŷ ) ] ( 2 ) We write this property as Dtr ≈T Dte . This states that the train and test distribution have similar expectations for all functions in the family T . For the singleton set T = { Terr } , this is equivalent to classical generalization , but it may hold for much larger sets T . For example in Experiment 1 , the train and test distributions match with respect to the test function “ Fraction of true cats labeled as object. ” In fact , it is best to think of Distributional Generalization as stating that the distributions Dtr and Dte are close as distributions . This property becomes especially interesting for interpolating classifiers , which fit their train sets exactly . Here , the Train Distribution ( xi , f ( xi ) ) is exactly equal1 to the original distribution ( x , y ) ∼ D , since f ( xi ) = yi on the train set . In this case , distributional generalization claims that the output distribution ( x , f ( x ) ) of the model on test samples is close to the true distribution ( x , y ) . The following conjecture specializes Distributional Generalization to interpolating classifiers , and will be the main focus of our work . Interpolating Indistinguishability Meta-Conjecture ( informal ) : For interpolating classifiers f , and a large family T of test functions , the distributions : ( x , f ( x ) ) x∈TestSet ≈T ( x , f ( x ) ) x∈TrainSet ≡ ( x , y ) x , y∼D 1The formal definition of Train Distribution , in Section 2.1 , includes the randomness of sampling the train set as well . We consider a fixed train set in the Introduction for sake of exposition . This is a “ meta-conjecture ” , which becomes a concrete conjecture once the family of tests T is specified . One of the main contributions of our work is formally stating two concrete instances of this conjecture— specifying exactly the family of tests T and their dependence on problem parameters ( the distribution , model family , training procedure , etc ) . It captures behaviors far more general than Experiment 1 , and applies to neural networks , kernels , and decision trees . We give empirical evidence for conjectures across a variety of natural settings in machine learning . 1.2 SUMMARY OF CONTRIBUTIONS . We extend the classical framework of generalization by introducing Distributional Generalization , in which the train and test behavior of models are close as distributions . Informally , for trained classifiers f , its outputs on the train set ( x , f ( x ) ) x∈TrainSet are close in distribution to its outputs on the test set ( x , f ( x ) ) x∈TestSet , where the form of this closeness depends on specifics of the model , training procedure , and distribution . This notion is more fine-grained than classical generalization , since it considers the entire distribution of model outputs instead of just the test error . We initiate the study of Distributional Generalization across various domains in machine learning . For interpolating classifiers , we state two formal conjectures which predict the form of distributional closeness that can be expected for a given model and task : 1 . Feature Calibration Conjecture ( Section 3 ) : Interpolating classifiers , when trained on samples from a distribution , will match this distribution up to all “ distinguishable features ” ( Definition 1 ) . 2 . Agreement Conjecture ( Section 4 ) : For two interpolating classifiers of the same type , trained independently on the same distribution , their agreement probability with each other on test samples roughly matches their test accuracy . We perform a number of experiments surrounding these conjectures , which reveal new behaviors of standard interpolating classifiers ( e.g . ResNets , MLPs , kernels , decision trees ) . We prove our conjectures for 1-Nearest-Neighbors ( Theorem 1 ) , which suggests some form of “ locality ” as the underlying mechanism . Finally , we discuss extending these results to non-interpolating methods in Section 5 . Our experiments and conjectures shed new light on the structure of interpolating classifiers , which are extensively studied in recent years yet still poorly understood . Related Work . Our work is inspired by the broader study of interpolating and overparameterized methods in machine learning ( e.g . Zhang et al . ( 2016 ) ; Belkin et al . ( 2018a ; b ; 2019 ) ; Liang and Rakhlin ( 2018 ) ; Nakkiran et al . ( 2020 ) ; Schapire et al . ( 1998 ) ; Breiman ( 1995 ) ) . In a similar vein to our work , Wyner et al . ( 2017 ) ; Olson and Wyner ( 2018 ) investigate decision trees , and show that random forests are equivalent to a Nadaraya–Watson smoother ( Nadaraya , 1964 ; Watson , 1964 ) with a certain smoothing kernel . Our conjectures also describe neural networks under label noise , which has been empirically and theoretically studied in the past ( Zhang et al. , 2016 ; Belkin et al. , 2018b ; Rolnick et al. , 2017 ; Natarajan et al. , 2013 ; Thulasidasan et al. , 2019 ; Ziyin et al. , 2020 ; Chatterji and Long , 2020 ) , though not formally characterized . The behaviors we consider are also similar to conditional density estimation ( e.g . Tsybakov ( 2008 ) ; Dutordoir et al . ( 2018 ) ) , though we consider samplers , not density estimators . We include a full discussion of related works in Appendix A . 2 PRELIMINARIES . Notation . We consider joint distributionsD on x ∈ X and discrete y ∈ Y = [ k ] . LetDn denote n iid samples from D and S = { ( xi , yi ) } denote a train set . Let F denote the classifier family ( including architecture and training algorithm for neural networks ) , and let f ← TrainF ( S ) denote training a classifier f ∈ F on train-set S. We consider classifiers which output hard decisions f : X → Y . Let NNS ( x ) = xi denote the nearest-neighbor to x in train-set S , with respect to a distance metric d. Our theorems will apply to any distance metric , and so we leave this unspecified . Let NN ( y ) S ( x ) denote the nearest-neighbor estimator itself , that is , NN ( y ) S ( x ) : = yi where xi = NNS ( x ) . Experimental Setup . Full experimental details are provided in Appendix B . Briefly , we train all classifiers to interpolation ( to 0 train error ) . Neural networks ( MLPs and ResNets ( He et al. , 2016 ) ) are trained with SGD . Interpolating decision trees are trained using the growth rule from Random Forests ( Breiman , 2001 ) . For kernel classification , we consider kernel regression on one-hot labels and kernel SVM , with small or 0 of regularization ( which is often optimal Shankar et al . ( 2020 ) ) . Distributional Closeness . We consider the following notion of closeness for two probability distributions : For two distributions P , Q over X × Y , let a “ test ” ( or “ distinguisher ” ) be a function T : X × Y → [ 0 , 1 ] which accepts a sample from either distribution , and is intended to classify the sample as either from distribution P or Q . For any set C ⊆ { T : X × Y → [ 0 , 1 ] } of tests , we say distributions P and Q are “ ε-indistinguishable up to C-tests ” if they are close with respect to all tests in class C. That is , P ≈Cε Q ⇐⇒ sup T∈C ∣∣∣∣ E ( x , y ) ∼P [ T ( x , y ) ] − E ( x , y ) ∼Q [ T ( x , y ) ] ∣∣∣∣ ≤ ε ( 3 ) Total-Variation distance is equivalent to closeness in all tests , i.e . C = { T : X × Y → [ 0 , 1 ] } , but we consider closeness for restricted families of tests C. P ≈ε Q denotes ε-closeness in TV-distance .
This paper proposes an extended notion of generalization. The new proposed notion asks that for a family of tests $T: X \times Y → [0,1]$, $T(x, f(x))$ will be similar for train/test examples. The paper proposes three interesting conjectures that are related to distributional generalization. The paper proves Conjecture 1 for nearest-neighbor classifiers. The paper also gives empirical evidence supporting their conjectures.
SP:88f994339e8969434de7fbc81b5b94f6991a636c
Distributional Generalization: A New Kind of Generalization
1 INTRODUCTION . We begin with an experiment motivating the need for a notion of generalization beyond test error . Experiment 1 . Consider a binary classification version of CIFAR-10 , where CIFAR-10 images x have binary labels Animal/Object . Take 50K samples from this distribution as a train set , but apply the following label noise : flip the label of cats to Object with probability 30 % . Now train a WideResNet f to 0 train error on this train set . How does the trained classifier behave on test samples ? Options below : 1 . The test error is low across all classes , since there is only 3 % label noise in the train set 2 . Test error is “ spread ” across the animal class , After all , the classifier is not explicitly told what a cat or a dog is , just that they are all animals . 3 . The classifier misclassifies roughly 30 % of test cats as “ objects ” , but all other types of animals are largely unaffected . In fact , reality is closest to option ( 3 ) . Figure 1 shows the results of this experiment with a WideResNet . The left panel shows the joint density of train inputs x with train labels Object/Animal . Since the classifier is interpolating , the classifier outputs on the train set are identical to the left panel . The right panel shows the classifier predictions f ( x ) on test inputs x . There are several notable things about this experiment . First , the error is localized to cats in test set as it was in the train set , even though no explicit cat labels were provided . Second , the amount of error on the cat class is close to the noise applied on the train set . Thus , the behavior of the classifier on the train set generalizes to the test set in a certain sense . This type of similarity in behavior would not be captured solely by average test error — it requires reasoning about the entire distribution of classifier outputs . In our work , we show that this experiment is just one instance of a different type of generalization , which we call “ Distributional Generalization ” . We now describe the mathematical form of this generalization . Then , through extensive experiments , we will show that this type of generalization occurs widely in existing machine learning methods : neural networks , kernel machines and decision trees . 1.1 DISTRIBUTIONAL GENERALIZATION . Supervised learning aims to learn a model that correctly classifies inputs x ∈ X from a given distribution D into classes y ∈ Y . We want a model with small test error on this distribution . In practice , we find such a classifier by minimizing the train error of a model on the train set . This procedure is justified when we expect a small generalization gap : the gap between the error on the train and test set . That is , the trained model f should have : ErrorTrainSet ( f ) ≈ ErrorTestSet ( f ) . We now re-write this classical notion of generalization in a form better suited for our extension . Classical Generalization : Let f be a trained classifier . Then f generalizes if : E x∼TrainSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ≈ E x∼TestSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ( 1 ) Above , y ( x ) is the true class of x and ŷ is the predicted class . The LHS of Equation 1 is the train error of f , and the RHS is the test error . Crucially , both sides of Equation 1 are expectations of the same function ( Terr ( x , ŷ ) : = 1 { ŷ 6= y ( x ) } ) under different distributions . The LHS of Equation 1 is the expectation of Terr under the “ Train Distribution ” Dtr , which is the distribution over ( x , ŷ ) given by sampling a train point x along with its classifier-label f ( x ) . Similarly , the RHS is under the “ Test Distribution ” Dte , which is this same construction over the test set . These two distributions are the central objects in our study , and are defined formally in Section 2.1 . We can now introduce Distributional Generalization , which is a property of trained classifiers . It is parameterized by a set of bounded functions ( “ tests ” ) : T ⊆ { T : X × Y → [ 0 , 1 ] } . Distributional Generalization : Let f be a trained classifier . Then f satisfies Distributional Generalization with respect to tests T if : ∀T ∈ T : E x∼TrainSet ŷ←f ( x ) [ T ( x , ŷ ) ] ≈ E x∼TestSet ŷ←f ( x ) [ T ( x , ŷ ) ] ( 2 ) We write this property as Dtr ≈T Dte . This states that the train and test distribution have similar expectations for all functions in the family T . For the singleton set T = { Terr } , this is equivalent to classical generalization , but it may hold for much larger sets T . For example in Experiment 1 , the train and test distributions match with respect to the test function “ Fraction of true cats labeled as object. ” In fact , it is best to think of Distributional Generalization as stating that the distributions Dtr and Dte are close as distributions . This property becomes especially interesting for interpolating classifiers , which fit their train sets exactly . Here , the Train Distribution ( xi , f ( xi ) ) is exactly equal1 to the original distribution ( x , y ) ∼ D , since f ( xi ) = yi on the train set . In this case , distributional generalization claims that the output distribution ( x , f ( x ) ) of the model on test samples is close to the true distribution ( x , y ) . The following conjecture specializes Distributional Generalization to interpolating classifiers , and will be the main focus of our work . Interpolating Indistinguishability Meta-Conjecture ( informal ) : For interpolating classifiers f , and a large family T of test functions , the distributions : ( x , f ( x ) ) x∈TestSet ≈T ( x , f ( x ) ) x∈TrainSet ≡ ( x , y ) x , y∼D 1The formal definition of Train Distribution , in Section 2.1 , includes the randomness of sampling the train set as well . We consider a fixed train set in the Introduction for sake of exposition . This is a “ meta-conjecture ” , which becomes a concrete conjecture once the family of tests T is specified . One of the main contributions of our work is formally stating two concrete instances of this conjecture— specifying exactly the family of tests T and their dependence on problem parameters ( the distribution , model family , training procedure , etc ) . It captures behaviors far more general than Experiment 1 , and applies to neural networks , kernels , and decision trees . We give empirical evidence for conjectures across a variety of natural settings in machine learning . 1.2 SUMMARY OF CONTRIBUTIONS . We extend the classical framework of generalization by introducing Distributional Generalization , in which the train and test behavior of models are close as distributions . Informally , for trained classifiers f , its outputs on the train set ( x , f ( x ) ) x∈TrainSet are close in distribution to its outputs on the test set ( x , f ( x ) ) x∈TestSet , where the form of this closeness depends on specifics of the model , training procedure , and distribution . This notion is more fine-grained than classical generalization , since it considers the entire distribution of model outputs instead of just the test error . We initiate the study of Distributional Generalization across various domains in machine learning . For interpolating classifiers , we state two formal conjectures which predict the form of distributional closeness that can be expected for a given model and task : 1 . Feature Calibration Conjecture ( Section 3 ) : Interpolating classifiers , when trained on samples from a distribution , will match this distribution up to all “ distinguishable features ” ( Definition 1 ) . 2 . Agreement Conjecture ( Section 4 ) : For two interpolating classifiers of the same type , trained independently on the same distribution , their agreement probability with each other on test samples roughly matches their test accuracy . We perform a number of experiments surrounding these conjectures , which reveal new behaviors of standard interpolating classifiers ( e.g . ResNets , MLPs , kernels , decision trees ) . We prove our conjectures for 1-Nearest-Neighbors ( Theorem 1 ) , which suggests some form of “ locality ” as the underlying mechanism . Finally , we discuss extending these results to non-interpolating methods in Section 5 . Our experiments and conjectures shed new light on the structure of interpolating classifiers , which are extensively studied in recent years yet still poorly understood . Related Work . Our work is inspired by the broader study of interpolating and overparameterized methods in machine learning ( e.g . Zhang et al . ( 2016 ) ; Belkin et al . ( 2018a ; b ; 2019 ) ; Liang and Rakhlin ( 2018 ) ; Nakkiran et al . ( 2020 ) ; Schapire et al . ( 1998 ) ; Breiman ( 1995 ) ) . In a similar vein to our work , Wyner et al . ( 2017 ) ; Olson and Wyner ( 2018 ) investigate decision trees , and show that random forests are equivalent to a Nadaraya–Watson smoother ( Nadaraya , 1964 ; Watson , 1964 ) with a certain smoothing kernel . Our conjectures also describe neural networks under label noise , which has been empirically and theoretically studied in the past ( Zhang et al. , 2016 ; Belkin et al. , 2018b ; Rolnick et al. , 2017 ; Natarajan et al. , 2013 ; Thulasidasan et al. , 2019 ; Ziyin et al. , 2020 ; Chatterji and Long , 2020 ) , though not formally characterized . The behaviors we consider are also similar to conditional density estimation ( e.g . Tsybakov ( 2008 ) ; Dutordoir et al . ( 2018 ) ) , though we consider samplers , not density estimators . We include a full discussion of related works in Appendix A . 2 PRELIMINARIES . Notation . We consider joint distributionsD on x ∈ X and discrete y ∈ Y = [ k ] . LetDn denote n iid samples from D and S = { ( xi , yi ) } denote a train set . Let F denote the classifier family ( including architecture and training algorithm for neural networks ) , and let f ← TrainF ( S ) denote training a classifier f ∈ F on train-set S. We consider classifiers which output hard decisions f : X → Y . Let NNS ( x ) = xi denote the nearest-neighbor to x in train-set S , with respect to a distance metric d. Our theorems will apply to any distance metric , and so we leave this unspecified . Let NN ( y ) S ( x ) denote the nearest-neighbor estimator itself , that is , NN ( y ) S ( x ) : = yi where xi = NNS ( x ) . Experimental Setup . Full experimental details are provided in Appendix B . Briefly , we train all classifiers to interpolation ( to 0 train error ) . Neural networks ( MLPs and ResNets ( He et al. , 2016 ) ) are trained with SGD . Interpolating decision trees are trained using the growth rule from Random Forests ( Breiman , 2001 ) . For kernel classification , we consider kernel regression on one-hot labels and kernel SVM , with small or 0 of regularization ( which is often optimal Shankar et al . ( 2020 ) ) . Distributional Closeness . We consider the following notion of closeness for two probability distributions : For two distributions P , Q over X × Y , let a “ test ” ( or “ distinguisher ” ) be a function T : X × Y → [ 0 , 1 ] which accepts a sample from either distribution , and is intended to classify the sample as either from distribution P or Q . For any set C ⊆ { T : X × Y → [ 0 , 1 ] } of tests , we say distributions P and Q are “ ε-indistinguishable up to C-tests ” if they are close with respect to all tests in class C. That is , P ≈Cε Q ⇐⇒ sup T∈C ∣∣∣∣ E ( x , y ) ∼P [ T ( x , y ) ] − E ( x , y ) ∼Q [ T ( x , y ) ] ∣∣∣∣ ≤ ε ( 3 ) Total-Variation distance is equivalent to closeness in all tests , i.e . C = { T : X × Y → [ 0 , 1 ] } , but we consider closeness for restricted families of tests C. P ≈ε Q denotes ε-closeness in TV-distance .
This paper proposes a new notion of generalization called distributional generalization which states that the outputs of the classifier for train and test are close as distributions not just their corresponding accuracy numbers. They propose conjectures about their the distributional closeness that they expect and how it depends on the model, number of data points and the algorithm. This paper gives experiments to support their conjectures for different model classes including neural networks, kernel methods and decision trees.
SP:88f994339e8969434de7fbc81b5b94f6991a636c
Distributional Generalization: A New Kind of Generalization
1 INTRODUCTION . We begin with an experiment motivating the need for a notion of generalization beyond test error . Experiment 1 . Consider a binary classification version of CIFAR-10 , where CIFAR-10 images x have binary labels Animal/Object . Take 50K samples from this distribution as a train set , but apply the following label noise : flip the label of cats to Object with probability 30 % . Now train a WideResNet f to 0 train error on this train set . How does the trained classifier behave on test samples ? Options below : 1 . The test error is low across all classes , since there is only 3 % label noise in the train set 2 . Test error is “ spread ” across the animal class , After all , the classifier is not explicitly told what a cat or a dog is , just that they are all animals . 3 . The classifier misclassifies roughly 30 % of test cats as “ objects ” , but all other types of animals are largely unaffected . In fact , reality is closest to option ( 3 ) . Figure 1 shows the results of this experiment with a WideResNet . The left panel shows the joint density of train inputs x with train labels Object/Animal . Since the classifier is interpolating , the classifier outputs on the train set are identical to the left panel . The right panel shows the classifier predictions f ( x ) on test inputs x . There are several notable things about this experiment . First , the error is localized to cats in test set as it was in the train set , even though no explicit cat labels were provided . Second , the amount of error on the cat class is close to the noise applied on the train set . Thus , the behavior of the classifier on the train set generalizes to the test set in a certain sense . This type of similarity in behavior would not be captured solely by average test error — it requires reasoning about the entire distribution of classifier outputs . In our work , we show that this experiment is just one instance of a different type of generalization , which we call “ Distributional Generalization ” . We now describe the mathematical form of this generalization . Then , through extensive experiments , we will show that this type of generalization occurs widely in existing machine learning methods : neural networks , kernel machines and decision trees . 1.1 DISTRIBUTIONAL GENERALIZATION . Supervised learning aims to learn a model that correctly classifies inputs x ∈ X from a given distribution D into classes y ∈ Y . We want a model with small test error on this distribution . In practice , we find such a classifier by minimizing the train error of a model on the train set . This procedure is justified when we expect a small generalization gap : the gap between the error on the train and test set . That is , the trained model f should have : ErrorTrainSet ( f ) ≈ ErrorTestSet ( f ) . We now re-write this classical notion of generalization in a form better suited for our extension . Classical Generalization : Let f be a trained classifier . Then f generalizes if : E x∼TrainSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ≈ E x∼TestSet ŷ←f ( x ) [ 1 { ŷ 6= y ( x ) } ] ( 1 ) Above , y ( x ) is the true class of x and ŷ is the predicted class . The LHS of Equation 1 is the train error of f , and the RHS is the test error . Crucially , both sides of Equation 1 are expectations of the same function ( Terr ( x , ŷ ) : = 1 { ŷ 6= y ( x ) } ) under different distributions . The LHS of Equation 1 is the expectation of Terr under the “ Train Distribution ” Dtr , which is the distribution over ( x , ŷ ) given by sampling a train point x along with its classifier-label f ( x ) . Similarly , the RHS is under the “ Test Distribution ” Dte , which is this same construction over the test set . These two distributions are the central objects in our study , and are defined formally in Section 2.1 . We can now introduce Distributional Generalization , which is a property of trained classifiers . It is parameterized by a set of bounded functions ( “ tests ” ) : T ⊆ { T : X × Y → [ 0 , 1 ] } . Distributional Generalization : Let f be a trained classifier . Then f satisfies Distributional Generalization with respect to tests T if : ∀T ∈ T : E x∼TrainSet ŷ←f ( x ) [ T ( x , ŷ ) ] ≈ E x∼TestSet ŷ←f ( x ) [ T ( x , ŷ ) ] ( 2 ) We write this property as Dtr ≈T Dte . This states that the train and test distribution have similar expectations for all functions in the family T . For the singleton set T = { Terr } , this is equivalent to classical generalization , but it may hold for much larger sets T . For example in Experiment 1 , the train and test distributions match with respect to the test function “ Fraction of true cats labeled as object. ” In fact , it is best to think of Distributional Generalization as stating that the distributions Dtr and Dte are close as distributions . This property becomes especially interesting for interpolating classifiers , which fit their train sets exactly . Here , the Train Distribution ( xi , f ( xi ) ) is exactly equal1 to the original distribution ( x , y ) ∼ D , since f ( xi ) = yi on the train set . In this case , distributional generalization claims that the output distribution ( x , f ( x ) ) of the model on test samples is close to the true distribution ( x , y ) . The following conjecture specializes Distributional Generalization to interpolating classifiers , and will be the main focus of our work . Interpolating Indistinguishability Meta-Conjecture ( informal ) : For interpolating classifiers f , and a large family T of test functions , the distributions : ( x , f ( x ) ) x∈TestSet ≈T ( x , f ( x ) ) x∈TrainSet ≡ ( x , y ) x , y∼D 1The formal definition of Train Distribution , in Section 2.1 , includes the randomness of sampling the train set as well . We consider a fixed train set in the Introduction for sake of exposition . This is a “ meta-conjecture ” , which becomes a concrete conjecture once the family of tests T is specified . One of the main contributions of our work is formally stating two concrete instances of this conjecture— specifying exactly the family of tests T and their dependence on problem parameters ( the distribution , model family , training procedure , etc ) . It captures behaviors far more general than Experiment 1 , and applies to neural networks , kernels , and decision trees . We give empirical evidence for conjectures across a variety of natural settings in machine learning . 1.2 SUMMARY OF CONTRIBUTIONS . We extend the classical framework of generalization by introducing Distributional Generalization , in which the train and test behavior of models are close as distributions . Informally , for trained classifiers f , its outputs on the train set ( x , f ( x ) ) x∈TrainSet are close in distribution to its outputs on the test set ( x , f ( x ) ) x∈TestSet , where the form of this closeness depends on specifics of the model , training procedure , and distribution . This notion is more fine-grained than classical generalization , since it considers the entire distribution of model outputs instead of just the test error . We initiate the study of Distributional Generalization across various domains in machine learning . For interpolating classifiers , we state two formal conjectures which predict the form of distributional closeness that can be expected for a given model and task : 1 . Feature Calibration Conjecture ( Section 3 ) : Interpolating classifiers , when trained on samples from a distribution , will match this distribution up to all “ distinguishable features ” ( Definition 1 ) . 2 . Agreement Conjecture ( Section 4 ) : For two interpolating classifiers of the same type , trained independently on the same distribution , their agreement probability with each other on test samples roughly matches their test accuracy . We perform a number of experiments surrounding these conjectures , which reveal new behaviors of standard interpolating classifiers ( e.g . ResNets , MLPs , kernels , decision trees ) . We prove our conjectures for 1-Nearest-Neighbors ( Theorem 1 ) , which suggests some form of “ locality ” as the underlying mechanism . Finally , we discuss extending these results to non-interpolating methods in Section 5 . Our experiments and conjectures shed new light on the structure of interpolating classifiers , which are extensively studied in recent years yet still poorly understood . Related Work . Our work is inspired by the broader study of interpolating and overparameterized methods in machine learning ( e.g . Zhang et al . ( 2016 ) ; Belkin et al . ( 2018a ; b ; 2019 ) ; Liang and Rakhlin ( 2018 ) ; Nakkiran et al . ( 2020 ) ; Schapire et al . ( 1998 ) ; Breiman ( 1995 ) ) . In a similar vein to our work , Wyner et al . ( 2017 ) ; Olson and Wyner ( 2018 ) investigate decision trees , and show that random forests are equivalent to a Nadaraya–Watson smoother ( Nadaraya , 1964 ; Watson , 1964 ) with a certain smoothing kernel . Our conjectures also describe neural networks under label noise , which has been empirically and theoretically studied in the past ( Zhang et al. , 2016 ; Belkin et al. , 2018b ; Rolnick et al. , 2017 ; Natarajan et al. , 2013 ; Thulasidasan et al. , 2019 ; Ziyin et al. , 2020 ; Chatterji and Long , 2020 ) , though not formally characterized . The behaviors we consider are also similar to conditional density estimation ( e.g . Tsybakov ( 2008 ) ; Dutordoir et al . ( 2018 ) ) , though we consider samplers , not density estimators . We include a full discussion of related works in Appendix A . 2 PRELIMINARIES . Notation . We consider joint distributionsD on x ∈ X and discrete y ∈ Y = [ k ] . LetDn denote n iid samples from D and S = { ( xi , yi ) } denote a train set . Let F denote the classifier family ( including architecture and training algorithm for neural networks ) , and let f ← TrainF ( S ) denote training a classifier f ∈ F on train-set S. We consider classifiers which output hard decisions f : X → Y . Let NNS ( x ) = xi denote the nearest-neighbor to x in train-set S , with respect to a distance metric d. Our theorems will apply to any distance metric , and so we leave this unspecified . Let NN ( y ) S ( x ) denote the nearest-neighbor estimator itself , that is , NN ( y ) S ( x ) : = yi where xi = NNS ( x ) . Experimental Setup . Full experimental details are provided in Appendix B . Briefly , we train all classifiers to interpolation ( to 0 train error ) . Neural networks ( MLPs and ResNets ( He et al. , 2016 ) ) are trained with SGD . Interpolating decision trees are trained using the growth rule from Random Forests ( Breiman , 2001 ) . For kernel classification , we consider kernel regression on one-hot labels and kernel SVM , with small or 0 of regularization ( which is often optimal Shankar et al . ( 2020 ) ) . Distributional Closeness . We consider the following notion of closeness for two probability distributions : For two distributions P , Q over X × Y , let a “ test ” ( or “ distinguisher ” ) be a function T : X × Y → [ 0 , 1 ] which accepts a sample from either distribution , and is intended to classify the sample as either from distribution P or Q . For any set C ⊆ { T : X × Y → [ 0 , 1 ] } of tests , we say distributions P and Q are “ ε-indistinguishable up to C-tests ” if they are close with respect to all tests in class C. That is , P ≈Cε Q ⇐⇒ sup T∈C ∣∣∣∣ E ( x , y ) ∼P [ T ( x , y ) ] − E ( x , y ) ∼Q [ T ( x , y ) ] ∣∣∣∣ ≤ ε ( 3 ) Total-Variation distance is equivalent to closeness in all tests , i.e . C = { T : X × Y → [ 0 , 1 ] } , but we consider closeness for restricted families of tests C. P ≈ε Q denotes ε-closeness in TV-distance .
This paper introduces a new notion of "distributional generalization" as a tool to quantify the difference between the outputs from training and testing data sets using a certain machine learning algorithm. The authors formulate two conjectures for the so-called "Interpolating classifiers": the Feature Calibration Conjecture and Agreement Conjecture. The conjectures are supported numerically by some real data experiments and are proven for the 1-nearest-neighbor classifier under some technical conditions.
SP:88f994339e8969434de7fbc81b5b94f6991a636c
On Disentangled Representations Extracted from Pretrained GANs
1 INTRODUCTION . Unsupervised learning of disentangled representations is currently one of the most important challenges in machine learning . Identifying and separating the factors of variation for the data at hand provides a deeper understanding of its internal structure and can bring new insights into the data generation process . Furthermore , disentangled representations are shown to benefit certain downstream tasks , e.g. , fairness ( Locatello et al. , 2019a ) and abstract reasoning ( van Steenkiste et al. , 2019 ) . Since the seminal papers on disentanglement learning , such as InfoGAN ( Chen et al. , 2016 ) and β-VAE ( Higgins et al. , 2017 ) , a large number of models were proposed , and this problem continues to attract much research attention ( Alemi et al. , 2016 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ; Nie et al. , 2020 ; Lin et al. , 2020 ) . The existing models achieve disentanglement in their latent spaces via specific regularization terms in their training objectives . Typically , these terms determine the trade-off between disentanglement and generation quality . For example , for β-VAE ( Higgins et al. , 2017 ) , one introduces the KLdivergence regularization term that constrains the VAE bottleneck ’ s capacity . This term is weighted by the β multiplier that enforces better disentanglement for β > 1 while resulting in worse reconstruction quality . Similarly , InfoGAN utilized a regularization term approximating the mutual information between the generated image and factor codes . As has been shown in the large scale study Locatello et al . ( 2019b ) , hyperparameter values can critically affect the obtained disentanglement . In the unsupervised setting , the values of ground truth latent factors utilized by disentanglement metrics are unknown , and thus selection of correct hyperparameters becomes a nontrivial task . In this paper , we investigate if disentangled representations can be extracted from the pretrained nondisentangled GAN models , which currently provide the state-of-the-art generation quality ( Karras et al. , 2020 ) . These GANs are trained without disentanglement terms in their objectives ; therefore , we do not need to tune the hyperparameters mentioned above . Our study is partially inspired by a very recent line of works on controllable generation ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; 1https : //bit.ly/3ipb6dW Härkönen et al. , 2020 ; Peebles et al. , 2020 ) , which explore the latent spaces of pretrained GANs and identify the latent directions useful for image editing . The mentioned methods operate without external supervision , therefore , are valid to use in the unsupervised disentanglement . As shown by the comparison on the common benchmarks , the proposed post hoc disentanglement is competitive to the current state-of-the-art in terms of existing metrics , becoming an important alternative to the established “ end-to-end ” disentanglement . Overall , our contributions are the following : • We investigate an alternative paradigm to construct disentangled representations by extracting them from non-disentangled models . In this setting , one does not need to tune hyperparameters for disentanglement regularizers . • We bridge the fields of unsupervised controllable generation and disentanglement learning by using the developments of the former to benefit the latter . As a separate technical contribution , we propose a new simple technique , which outperforms the existing prior methods of controllable generation . • We extensively evaluate all the methods on several popular benchmarks employing commonly used metrics . In most of the operating points , the proposed post hoc disentanglement successfully reaches competitive performance . 2 RELATED WORK . 2.1 DISENTANGLED REPRESENTATIONS . Learning disentangled representation is a long-standing goal in representation learning ( Bengio et al. , 2013 ) useful for a variety of downstream tasks ( LeCun et al. , 2004 ; Higgins et al. , 2018 ; Tschannen et al. , 2018 ; Locatello et al. , 2019a ; van Steenkiste et al. , 2019 ) . While there is no strict definition of disentangled representation , we follow the one considered in ( Bengio et al. , 2013 ) : disentangled representation is a representation where a change in one dimension corresponds to the change only in one factor of variation while leaving other factors invariant . Natural data is assumed to be generated from independent factors of variations , and well-learned disentangled representations should separate these explanatory sources . The most popular approaches so far were based on variational autoencoders ( VAEs ) . Usually , to make representations “ more disentangled ” , VAEs objectives are enriched with specific regularizers ( Alemi et al. , 2016 ; Higgins et al. , 2017 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ) . The general idea behind these approaches is to enforce an aggregated posterior to be factorized , thus providing disentanglement . Another line of research on disentangled representations is based on the InfoGAN model ( Chen et al. , 2016 ) . InfoGAN is an unsupervised model , which adds an extra regularizer to GAN loss to maximize the mutual information between the small subset of latent variables ( factor codes ) and observations . In practice , the mutual information loss is approximated using an encoder network via Variational Information Maximization . InfoGAN-CR ( Lin et al. , 2020 ) is a modification of InfoGAN that employs the so-called contrastive regularizer ( CR ) , which forces the elements of the latent code set to be visually perceptible and distinguishable between each other . A very recently proposed InfoStyleGAN model ( Nie et al. , 2020 ) incorporates similar ideas into the state-of-the-art StyleGAN architecture , allowing for producing both disentangled representations and achieving excellent visual quality of samples . In contrast to these approaches , we use no regularizers or additional loss functions and simply study state-of-the-art GANs trained in a conventional manner . 2.2 CONTROLLABLE GENERATION . Based on rich empirical evidence , it is believed that the latent space of GANs can encode meaningful semantic transformations , such as orientation , appearance , or presence of objects in scenes , of generated images via vector arithmetic ( Radford et al. , 2016 ; Zhu et al. , 2016 ; Bau et al. , 2019 ; Chen et al. , 2016 ) . This means that for an image produced by some latent code , such a transformation can be obtained by simply shifting this latent code in a certain carefully constructed direction , independent from the chosen latent code . E.g. , in the case of human faces , we may have separate directions for such factors as hair color , age , gender . The main applications of this property have been in the field of controllable generation , i.e. , building software to allow a user to manipulate an image to achieve a certain goal while keeping the result photorealistic . Powerful generative models are an appealing tool for this task since the generated images lie on the image manifold by construction . To manipulate a real image , the standard approach is to invert the generator , i.e. , to compute a latent code that approximately corresponds to the desired image , and then apply previously discovered directions ( Shen et al. , 2020 ) . The discovery of directions that allow for interesting image manipulations is a nontrivial task , which , however , can be performed in an unsupervised manner surprisingly efficiently ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; Härkönen et al. , 2020 ; Peebles et al. , 2020 ) . In the heart of these methods lies the idea that the deformations produced by these directions should be as distinguishable as much as possible , which is achieved via maximizing a certain generator–based loss function or by training a separate regressor network attempting to differentiate between them . We thoroughly discuss these approaches further in the text . An important common feature of these methods is that they do not depend on sensitive hyperparameters or even do not have them at all , which makes them appealing for usage in unsupervised settings . Contrary to previous applications of such interpretable directions , we attempt to show they allow us to solve a more fundamental task of building disentangled representations , useful in a variety of downstream tasks . 3 TWO-STAGE DISENTANGLEMENT USING PRETRAINED GANS . In this section , we discuss how disentangled representations of data can be learned with a two-step procedure . Briefly , it can be described as follows . First , we search for a set of k orthogonal interpretable directions in the latent space of the pretrained GAN in an unsupervised manner . This step is performed via one of the methods of controllable generation described below . These directions can be considered as the first k vectors of a new basis in the latent space . By ( virtually ) completing it to a full orthogonal set of vectors , we can obtain ( presumably , disentangled ) representations of synthetic points by a simple change of bases and truncating all but the first k coordinates ; this can be computed by single matrix multiplication . To obtain such representations for real data , we can now train an encoder on a synthetic dataset where targets are constructed using the procedure above . We stick to orthogonal directions for several reasons . Experimentally , it has been shown that this constraint does not significantly affect the quality of discovered directions and is imposed by construction in several further discussed methods . Additionally , it makes the formulas less cumbersome . Reminder on style–based architectures . Traditionally , the generator network in GANs transforms a latent code z ∈ N ( 0 , 1 ) to an image x ∈ RC×H×W . Contrary to this , style–based generators introduce a so-called style network , usually realized as a trainable MLP , which “ preprocesses ” random latent codes to the so-called “ style vectors ” ( elements of the style space ) . The obtained style vectors are , in turn , fed into the convolutional layers of the generator . It has been shown ( Karras et al. , 2019 ) that direct manipulations over the style vectors , rather than latent codes themselves , leads to visually plausible image interpolations and image mixing results . Intuitively , the style network performs a “ rectification ” of the latent space so that the new latent codes are more interpretable and disentangled . In this paper , we work with the style–based generators and perform image editing in the style space , denoted byW ; its elements are denoted as w. Let us now discuss the steps mentioned above in more detail . Recall , that we are interested in finding directions n such that G ( w′ ) with w′ = w + αn performs a certain interpretable deformation of the image G ( w ) . We now thoroughly describe the existing approaches to obtaining them in an unsupervised manner as well as various hyperparameters one needs to specify for each method . 3.1 DISCOVERING INTERPRETABLE DIRECTIONS . We consider several recently proposed methods : ClosedForm ( Shen & Zhou , 2020 ) , GANspace ( Härkönen et al. , 2020 ) , LatentDiscovery ( Voynov & Babenko , 2020 ) . Inspired by these methods , we also propose another family of methods termed DeepSpectral . ClosedForm ( CF ) . The authors of the ClosedForm method propose to move along the singular vectors of the first layer of generator . More specifically , for the transformation in the first layer given by the matrix A ( e.g. , this may be the weight in a fully-connected or a transposed convolutional layer ) , the direction n is found as n∗ = argmax { n∈RD : nTn=1 } ‖An‖22 . ( 1 ) All local maximas of Equation ( 1 ) form the set of singular vectors of the matrix A , and the authors propose to choose k singular vectors , associated with the corresponding k highest singular values . For the style–based GANs , the matrix A is obtained by concatenating the style mapping layers of each convolutional block . Hyperparameters : this method is hyperparameter–free and requires only a pretrained GAN model . GANspace ( GS ) . This method searches for important , meaningful directions by performing PCA in the style space of StyleGAN . Specifically , these directions are found in the following manner : first , randomly sampled noise vectors z1 : N ∈ N ( 0 , 1 ) are converted into style vectors w1 : N . The interpretable directions then correspond to principal axes of the set w1 : N ; in practice , we consider top k directions according to the corresponding singular values . Hyperparameters : for this approach , we only need to provide the number of sampled points which can be taken fixed and large , as well as a random seed for sampling . LatentDiscovery ( LD ) . LatentDiscovery is an unsupervised model-agnostic procedure for identifying interpretable directions in the GAN latent space . Informally speaking , this method searches for a set of directions that can be easily distinguished from one another . The resulting directions are meant to represent independent factors of generated images and include humaninterpretable representations . The trainable components are the following : a matrix N ∈ RD×k and a reconstructor network R , which evaluates the pair ( G ( w ) , G ( w+N ( ek ) ) . The reconstructor model aims to recover the shift in the latent space corresponding to the given image transformation . These two components are optimized jointly by minimizing the following objective function : N∗ , R∗ = argmin N , R Ew , k , L ( N , R ) = argmin N , R Ew , k , [ Lcl ( k , k̂ ) + λLr ( , ̂ ) ] . ( 2 ) Here , Lcl ( · , · ) is a reconstructor classification loss ( cross-entropy function ) , Lr ( · , · ) – regression term ( mean absolute error ) , which forces shifts along found directions to be more continuous . This method utilizes a number of hyperparameters ; however , as was shown in Voynov & Babenko ( 2020 ) , it is quite stable , and the default values provide good quality across various models and datasets . Hyperparameters : the hyperparameters include the number of latent directions k and the multiplier of the reconstructor term λ ; additionally , we can select different architectures for the regressor , as well as different training hyperparameters and random seed for initialization . DeepSpectral ( DS ) . We propose a novel approach to finding interpretable directions in the GAN latent space . Our motivation is as follows . While CF and GS both produce decent results , they effectively ignore all the layers in the generator but the first few ones . We hypothesize that by studying outputs of deeper intermediate layers of the generator , one can obtain a richer set of directions unavailable for these methods . Concretely , we propose the following simple approach . Let G ( i ) ( w ) denote the output of the i-th hidden layer of the generator . In order to obtain k directions in the latent space , we compute k singular vectors of JG ( i ) ( w ) with the highest singular values ( at some fixed point w ) . Here , JG ( i ) denotes the Jacobian matrix of a mapping . In a way , our approach generalizes CF since a linear map and its Jacobian coincide ( when bias is zero ) . By using automatic differentiation and an iterative approach to computing Singular Value Decomposition ( thus , we do not form the full Jacobian matrix ) , such directions can be found basically instantly ( Khrulkov & Oseledets , 2018 ) . The only hyperparameters in this approach are the choice of the layer and the choice of the base point w to compute the Jacobian . We experimentally verify the benefits of DS by considering various intermediate layers in Section 4 . Hyperparameters : we need to specify the layer and the base point w. Another recently proposed method ( Peebles et al. , 2020 ) searches for interpretable directions by utilizing the so-called Hessian penallty , penalizing the norm of the off-diagonal elements of the Hessian matrix of a network . However , in our implementation , we were not able to obtain convincing results ; we plan to analyze in the future with the authors ’ implementation when released .
This paper proposes a new approach to learn disentangled representations from Generative models that were trained without a loss that explicitly enforces disengagement. The motivation behind this work is to address the computational time cost regarding hyperparameter tuning that is typically required for VAEs trained with a disentangled loss. The proposed approach can be summarized in 3 steps: (1) Training a GAN (in an unsupervised way) (2) Find ‘k’ new basis vectors in ‘W’ space (3) Train a new encoder on the synthetic dataset {(z,G(z))} with loss that encourages the encodings to correspond to the subspace spanned by the basis vectors. Furthermore, the authors propose a new approach for identifying meaningful basis vectors which the authors claim that it is the generalized version of ClosedFrom. For evaluation, the authors then perform a set of experiments involving disentanglement, abstract reasoning, fairness on a variety of datasets such as 3Dshapes, MPI, and Cars3D.
SP:219fd05784a7cf93f1435a0e541e7b6937df31cd
On Disentangled Representations Extracted from Pretrained GANs
1 INTRODUCTION . Unsupervised learning of disentangled representations is currently one of the most important challenges in machine learning . Identifying and separating the factors of variation for the data at hand provides a deeper understanding of its internal structure and can bring new insights into the data generation process . Furthermore , disentangled representations are shown to benefit certain downstream tasks , e.g. , fairness ( Locatello et al. , 2019a ) and abstract reasoning ( van Steenkiste et al. , 2019 ) . Since the seminal papers on disentanglement learning , such as InfoGAN ( Chen et al. , 2016 ) and β-VAE ( Higgins et al. , 2017 ) , a large number of models were proposed , and this problem continues to attract much research attention ( Alemi et al. , 2016 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ; Nie et al. , 2020 ; Lin et al. , 2020 ) . The existing models achieve disentanglement in their latent spaces via specific regularization terms in their training objectives . Typically , these terms determine the trade-off between disentanglement and generation quality . For example , for β-VAE ( Higgins et al. , 2017 ) , one introduces the KLdivergence regularization term that constrains the VAE bottleneck ’ s capacity . This term is weighted by the β multiplier that enforces better disentanglement for β > 1 while resulting in worse reconstruction quality . Similarly , InfoGAN utilized a regularization term approximating the mutual information between the generated image and factor codes . As has been shown in the large scale study Locatello et al . ( 2019b ) , hyperparameter values can critically affect the obtained disentanglement . In the unsupervised setting , the values of ground truth latent factors utilized by disentanglement metrics are unknown , and thus selection of correct hyperparameters becomes a nontrivial task . In this paper , we investigate if disentangled representations can be extracted from the pretrained nondisentangled GAN models , which currently provide the state-of-the-art generation quality ( Karras et al. , 2020 ) . These GANs are trained without disentanglement terms in their objectives ; therefore , we do not need to tune the hyperparameters mentioned above . Our study is partially inspired by a very recent line of works on controllable generation ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; 1https : //bit.ly/3ipb6dW Härkönen et al. , 2020 ; Peebles et al. , 2020 ) , which explore the latent spaces of pretrained GANs and identify the latent directions useful for image editing . The mentioned methods operate without external supervision , therefore , are valid to use in the unsupervised disentanglement . As shown by the comparison on the common benchmarks , the proposed post hoc disentanglement is competitive to the current state-of-the-art in terms of existing metrics , becoming an important alternative to the established “ end-to-end ” disentanglement . Overall , our contributions are the following : • We investigate an alternative paradigm to construct disentangled representations by extracting them from non-disentangled models . In this setting , one does not need to tune hyperparameters for disentanglement regularizers . • We bridge the fields of unsupervised controllable generation and disentanglement learning by using the developments of the former to benefit the latter . As a separate technical contribution , we propose a new simple technique , which outperforms the existing prior methods of controllable generation . • We extensively evaluate all the methods on several popular benchmarks employing commonly used metrics . In most of the operating points , the proposed post hoc disentanglement successfully reaches competitive performance . 2 RELATED WORK . 2.1 DISENTANGLED REPRESENTATIONS . Learning disentangled representation is a long-standing goal in representation learning ( Bengio et al. , 2013 ) useful for a variety of downstream tasks ( LeCun et al. , 2004 ; Higgins et al. , 2018 ; Tschannen et al. , 2018 ; Locatello et al. , 2019a ; van Steenkiste et al. , 2019 ) . While there is no strict definition of disentangled representation , we follow the one considered in ( Bengio et al. , 2013 ) : disentangled representation is a representation where a change in one dimension corresponds to the change only in one factor of variation while leaving other factors invariant . Natural data is assumed to be generated from independent factors of variations , and well-learned disentangled representations should separate these explanatory sources . The most popular approaches so far were based on variational autoencoders ( VAEs ) . Usually , to make representations “ more disentangled ” , VAEs objectives are enriched with specific regularizers ( Alemi et al. , 2016 ; Higgins et al. , 2017 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ) . The general idea behind these approaches is to enforce an aggregated posterior to be factorized , thus providing disentanglement . Another line of research on disentangled representations is based on the InfoGAN model ( Chen et al. , 2016 ) . InfoGAN is an unsupervised model , which adds an extra regularizer to GAN loss to maximize the mutual information between the small subset of latent variables ( factor codes ) and observations . In practice , the mutual information loss is approximated using an encoder network via Variational Information Maximization . InfoGAN-CR ( Lin et al. , 2020 ) is a modification of InfoGAN that employs the so-called contrastive regularizer ( CR ) , which forces the elements of the latent code set to be visually perceptible and distinguishable between each other . A very recently proposed InfoStyleGAN model ( Nie et al. , 2020 ) incorporates similar ideas into the state-of-the-art StyleGAN architecture , allowing for producing both disentangled representations and achieving excellent visual quality of samples . In contrast to these approaches , we use no regularizers or additional loss functions and simply study state-of-the-art GANs trained in a conventional manner . 2.2 CONTROLLABLE GENERATION . Based on rich empirical evidence , it is believed that the latent space of GANs can encode meaningful semantic transformations , such as orientation , appearance , or presence of objects in scenes , of generated images via vector arithmetic ( Radford et al. , 2016 ; Zhu et al. , 2016 ; Bau et al. , 2019 ; Chen et al. , 2016 ) . This means that for an image produced by some latent code , such a transformation can be obtained by simply shifting this latent code in a certain carefully constructed direction , independent from the chosen latent code . E.g. , in the case of human faces , we may have separate directions for such factors as hair color , age , gender . The main applications of this property have been in the field of controllable generation , i.e. , building software to allow a user to manipulate an image to achieve a certain goal while keeping the result photorealistic . Powerful generative models are an appealing tool for this task since the generated images lie on the image manifold by construction . To manipulate a real image , the standard approach is to invert the generator , i.e. , to compute a latent code that approximately corresponds to the desired image , and then apply previously discovered directions ( Shen et al. , 2020 ) . The discovery of directions that allow for interesting image manipulations is a nontrivial task , which , however , can be performed in an unsupervised manner surprisingly efficiently ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; Härkönen et al. , 2020 ; Peebles et al. , 2020 ) . In the heart of these methods lies the idea that the deformations produced by these directions should be as distinguishable as much as possible , which is achieved via maximizing a certain generator–based loss function or by training a separate regressor network attempting to differentiate between them . We thoroughly discuss these approaches further in the text . An important common feature of these methods is that they do not depend on sensitive hyperparameters or even do not have them at all , which makes them appealing for usage in unsupervised settings . Contrary to previous applications of such interpretable directions , we attempt to show they allow us to solve a more fundamental task of building disentangled representations , useful in a variety of downstream tasks . 3 TWO-STAGE DISENTANGLEMENT USING PRETRAINED GANS . In this section , we discuss how disentangled representations of data can be learned with a two-step procedure . Briefly , it can be described as follows . First , we search for a set of k orthogonal interpretable directions in the latent space of the pretrained GAN in an unsupervised manner . This step is performed via one of the methods of controllable generation described below . These directions can be considered as the first k vectors of a new basis in the latent space . By ( virtually ) completing it to a full orthogonal set of vectors , we can obtain ( presumably , disentangled ) representations of synthetic points by a simple change of bases and truncating all but the first k coordinates ; this can be computed by single matrix multiplication . To obtain such representations for real data , we can now train an encoder on a synthetic dataset where targets are constructed using the procedure above . We stick to orthogonal directions for several reasons . Experimentally , it has been shown that this constraint does not significantly affect the quality of discovered directions and is imposed by construction in several further discussed methods . Additionally , it makes the formulas less cumbersome . Reminder on style–based architectures . Traditionally , the generator network in GANs transforms a latent code z ∈ N ( 0 , 1 ) to an image x ∈ RC×H×W . Contrary to this , style–based generators introduce a so-called style network , usually realized as a trainable MLP , which “ preprocesses ” random latent codes to the so-called “ style vectors ” ( elements of the style space ) . The obtained style vectors are , in turn , fed into the convolutional layers of the generator . It has been shown ( Karras et al. , 2019 ) that direct manipulations over the style vectors , rather than latent codes themselves , leads to visually plausible image interpolations and image mixing results . Intuitively , the style network performs a “ rectification ” of the latent space so that the new latent codes are more interpretable and disentangled . In this paper , we work with the style–based generators and perform image editing in the style space , denoted byW ; its elements are denoted as w. Let us now discuss the steps mentioned above in more detail . Recall , that we are interested in finding directions n such that G ( w′ ) with w′ = w + αn performs a certain interpretable deformation of the image G ( w ) . We now thoroughly describe the existing approaches to obtaining them in an unsupervised manner as well as various hyperparameters one needs to specify for each method . 3.1 DISCOVERING INTERPRETABLE DIRECTIONS . We consider several recently proposed methods : ClosedForm ( Shen & Zhou , 2020 ) , GANspace ( Härkönen et al. , 2020 ) , LatentDiscovery ( Voynov & Babenko , 2020 ) . Inspired by these methods , we also propose another family of methods termed DeepSpectral . ClosedForm ( CF ) . The authors of the ClosedForm method propose to move along the singular vectors of the first layer of generator . More specifically , for the transformation in the first layer given by the matrix A ( e.g. , this may be the weight in a fully-connected or a transposed convolutional layer ) , the direction n is found as n∗ = argmax { n∈RD : nTn=1 } ‖An‖22 . ( 1 ) All local maximas of Equation ( 1 ) form the set of singular vectors of the matrix A , and the authors propose to choose k singular vectors , associated with the corresponding k highest singular values . For the style–based GANs , the matrix A is obtained by concatenating the style mapping layers of each convolutional block . Hyperparameters : this method is hyperparameter–free and requires only a pretrained GAN model . GANspace ( GS ) . This method searches for important , meaningful directions by performing PCA in the style space of StyleGAN . Specifically , these directions are found in the following manner : first , randomly sampled noise vectors z1 : N ∈ N ( 0 , 1 ) are converted into style vectors w1 : N . The interpretable directions then correspond to principal axes of the set w1 : N ; in practice , we consider top k directions according to the corresponding singular values . Hyperparameters : for this approach , we only need to provide the number of sampled points which can be taken fixed and large , as well as a random seed for sampling . LatentDiscovery ( LD ) . LatentDiscovery is an unsupervised model-agnostic procedure for identifying interpretable directions in the GAN latent space . Informally speaking , this method searches for a set of directions that can be easily distinguished from one another . The resulting directions are meant to represent independent factors of generated images and include humaninterpretable representations . The trainable components are the following : a matrix N ∈ RD×k and a reconstructor network R , which evaluates the pair ( G ( w ) , G ( w+N ( ek ) ) . The reconstructor model aims to recover the shift in the latent space corresponding to the given image transformation . These two components are optimized jointly by minimizing the following objective function : N∗ , R∗ = argmin N , R Ew , k , L ( N , R ) = argmin N , R Ew , k , [ Lcl ( k , k̂ ) + λLr ( , ̂ ) ] . ( 2 ) Here , Lcl ( · , · ) is a reconstructor classification loss ( cross-entropy function ) , Lr ( · , · ) – regression term ( mean absolute error ) , which forces shifts along found directions to be more continuous . This method utilizes a number of hyperparameters ; however , as was shown in Voynov & Babenko ( 2020 ) , it is quite stable , and the default values provide good quality across various models and datasets . Hyperparameters : the hyperparameters include the number of latent directions k and the multiplier of the reconstructor term λ ; additionally , we can select different architectures for the regressor , as well as different training hyperparameters and random seed for initialization . DeepSpectral ( DS ) . We propose a novel approach to finding interpretable directions in the GAN latent space . Our motivation is as follows . While CF and GS both produce decent results , they effectively ignore all the layers in the generator but the first few ones . We hypothesize that by studying outputs of deeper intermediate layers of the generator , one can obtain a richer set of directions unavailable for these methods . Concretely , we propose the following simple approach . Let G ( i ) ( w ) denote the output of the i-th hidden layer of the generator . In order to obtain k directions in the latent space , we compute k singular vectors of JG ( i ) ( w ) with the highest singular values ( at some fixed point w ) . Here , JG ( i ) denotes the Jacobian matrix of a mapping . In a way , our approach generalizes CF since a linear map and its Jacobian coincide ( when bias is zero ) . By using automatic differentiation and an iterative approach to computing Singular Value Decomposition ( thus , we do not form the full Jacobian matrix ) , such directions can be found basically instantly ( Khrulkov & Oseledets , 2018 ) . The only hyperparameters in this approach are the choice of the layer and the choice of the base point w to compute the Jacobian . We experimentally verify the benefits of DS by considering various intermediate layers in Section 4 . Hyperparameters : we need to specify the layer and the base point w. Another recently proposed method ( Peebles et al. , 2020 ) searches for interpretable directions by utilizing the so-called Hessian penallty , penalizing the norm of the off-diagonal elements of the Hessian matrix of a network . However , in our implementation , we were not able to obtain convincing results ; we plan to analyze in the future with the authors ’ implementation when released .
This paper proposes a non-conventional approach to learning disentangled representations through finding interpretable directions in the latent space of a pre-trained Style-GAN (Karras et al., 2018). To find these directions, several existing techniques from the recent literature on controllable image generation are considered. To apply this technique to existing (real) images, an encoder network is trained on the generated images to learn a mapping from images to disentangled representations.
SP:219fd05784a7cf93f1435a0e541e7b6937df31cd
On Disentangled Representations Extracted from Pretrained GANs
1 INTRODUCTION . Unsupervised learning of disentangled representations is currently one of the most important challenges in machine learning . Identifying and separating the factors of variation for the data at hand provides a deeper understanding of its internal structure and can bring new insights into the data generation process . Furthermore , disentangled representations are shown to benefit certain downstream tasks , e.g. , fairness ( Locatello et al. , 2019a ) and abstract reasoning ( van Steenkiste et al. , 2019 ) . Since the seminal papers on disentanglement learning , such as InfoGAN ( Chen et al. , 2016 ) and β-VAE ( Higgins et al. , 2017 ) , a large number of models were proposed , and this problem continues to attract much research attention ( Alemi et al. , 2016 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ; Nie et al. , 2020 ; Lin et al. , 2020 ) . The existing models achieve disentanglement in their latent spaces via specific regularization terms in their training objectives . Typically , these terms determine the trade-off between disentanglement and generation quality . For example , for β-VAE ( Higgins et al. , 2017 ) , one introduces the KLdivergence regularization term that constrains the VAE bottleneck ’ s capacity . This term is weighted by the β multiplier that enforces better disentanglement for β > 1 while resulting in worse reconstruction quality . Similarly , InfoGAN utilized a regularization term approximating the mutual information between the generated image and factor codes . As has been shown in the large scale study Locatello et al . ( 2019b ) , hyperparameter values can critically affect the obtained disentanglement . In the unsupervised setting , the values of ground truth latent factors utilized by disentanglement metrics are unknown , and thus selection of correct hyperparameters becomes a nontrivial task . In this paper , we investigate if disentangled representations can be extracted from the pretrained nondisentangled GAN models , which currently provide the state-of-the-art generation quality ( Karras et al. , 2020 ) . These GANs are trained without disentanglement terms in their objectives ; therefore , we do not need to tune the hyperparameters mentioned above . Our study is partially inspired by a very recent line of works on controllable generation ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; 1https : //bit.ly/3ipb6dW Härkönen et al. , 2020 ; Peebles et al. , 2020 ) , which explore the latent spaces of pretrained GANs and identify the latent directions useful for image editing . The mentioned methods operate without external supervision , therefore , are valid to use in the unsupervised disentanglement . As shown by the comparison on the common benchmarks , the proposed post hoc disentanglement is competitive to the current state-of-the-art in terms of existing metrics , becoming an important alternative to the established “ end-to-end ” disentanglement . Overall , our contributions are the following : • We investigate an alternative paradigm to construct disentangled representations by extracting them from non-disentangled models . In this setting , one does not need to tune hyperparameters for disentanglement regularizers . • We bridge the fields of unsupervised controllable generation and disentanglement learning by using the developments of the former to benefit the latter . As a separate technical contribution , we propose a new simple technique , which outperforms the existing prior methods of controllable generation . • We extensively evaluate all the methods on several popular benchmarks employing commonly used metrics . In most of the operating points , the proposed post hoc disentanglement successfully reaches competitive performance . 2 RELATED WORK . 2.1 DISENTANGLED REPRESENTATIONS . Learning disentangled representation is a long-standing goal in representation learning ( Bengio et al. , 2013 ) useful for a variety of downstream tasks ( LeCun et al. , 2004 ; Higgins et al. , 2018 ; Tschannen et al. , 2018 ; Locatello et al. , 2019a ; van Steenkiste et al. , 2019 ) . While there is no strict definition of disentangled representation , we follow the one considered in ( Bengio et al. , 2013 ) : disentangled representation is a representation where a change in one dimension corresponds to the change only in one factor of variation while leaving other factors invariant . Natural data is assumed to be generated from independent factors of variations , and well-learned disentangled representations should separate these explanatory sources . The most popular approaches so far were based on variational autoencoders ( VAEs ) . Usually , to make representations “ more disentangled ” , VAEs objectives are enriched with specific regularizers ( Alemi et al. , 2016 ; Higgins et al. , 2017 ; Chen et al. , 2018 ; Burgess et al. , 2017 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Rubenstein et al. , 2018 ; Esmaeili et al. , 2019 ; Mathieu et al. , 2019 ; Rolinek et al. , 2019 ) . The general idea behind these approaches is to enforce an aggregated posterior to be factorized , thus providing disentanglement . Another line of research on disentangled representations is based on the InfoGAN model ( Chen et al. , 2016 ) . InfoGAN is an unsupervised model , which adds an extra regularizer to GAN loss to maximize the mutual information between the small subset of latent variables ( factor codes ) and observations . In practice , the mutual information loss is approximated using an encoder network via Variational Information Maximization . InfoGAN-CR ( Lin et al. , 2020 ) is a modification of InfoGAN that employs the so-called contrastive regularizer ( CR ) , which forces the elements of the latent code set to be visually perceptible and distinguishable between each other . A very recently proposed InfoStyleGAN model ( Nie et al. , 2020 ) incorporates similar ideas into the state-of-the-art StyleGAN architecture , allowing for producing both disentangled representations and achieving excellent visual quality of samples . In contrast to these approaches , we use no regularizers or additional loss functions and simply study state-of-the-art GANs trained in a conventional manner . 2.2 CONTROLLABLE GENERATION . Based on rich empirical evidence , it is believed that the latent space of GANs can encode meaningful semantic transformations , such as orientation , appearance , or presence of objects in scenes , of generated images via vector arithmetic ( Radford et al. , 2016 ; Zhu et al. , 2016 ; Bau et al. , 2019 ; Chen et al. , 2016 ) . This means that for an image produced by some latent code , such a transformation can be obtained by simply shifting this latent code in a certain carefully constructed direction , independent from the chosen latent code . E.g. , in the case of human faces , we may have separate directions for such factors as hair color , age , gender . The main applications of this property have been in the field of controllable generation , i.e. , building software to allow a user to manipulate an image to achieve a certain goal while keeping the result photorealistic . Powerful generative models are an appealing tool for this task since the generated images lie on the image manifold by construction . To manipulate a real image , the standard approach is to invert the generator , i.e. , to compute a latent code that approximately corresponds to the desired image , and then apply previously discovered directions ( Shen et al. , 2020 ) . The discovery of directions that allow for interesting image manipulations is a nontrivial task , which , however , can be performed in an unsupervised manner surprisingly efficiently ( Voynov & Babenko , 2020 ; Shen & Zhou , 2020 ; Härkönen et al. , 2020 ; Peebles et al. , 2020 ) . In the heart of these methods lies the idea that the deformations produced by these directions should be as distinguishable as much as possible , which is achieved via maximizing a certain generator–based loss function or by training a separate regressor network attempting to differentiate between them . We thoroughly discuss these approaches further in the text . An important common feature of these methods is that they do not depend on sensitive hyperparameters or even do not have them at all , which makes them appealing for usage in unsupervised settings . Contrary to previous applications of such interpretable directions , we attempt to show they allow us to solve a more fundamental task of building disentangled representations , useful in a variety of downstream tasks . 3 TWO-STAGE DISENTANGLEMENT USING PRETRAINED GANS . In this section , we discuss how disentangled representations of data can be learned with a two-step procedure . Briefly , it can be described as follows . First , we search for a set of k orthogonal interpretable directions in the latent space of the pretrained GAN in an unsupervised manner . This step is performed via one of the methods of controllable generation described below . These directions can be considered as the first k vectors of a new basis in the latent space . By ( virtually ) completing it to a full orthogonal set of vectors , we can obtain ( presumably , disentangled ) representations of synthetic points by a simple change of bases and truncating all but the first k coordinates ; this can be computed by single matrix multiplication . To obtain such representations for real data , we can now train an encoder on a synthetic dataset where targets are constructed using the procedure above . We stick to orthogonal directions for several reasons . Experimentally , it has been shown that this constraint does not significantly affect the quality of discovered directions and is imposed by construction in several further discussed methods . Additionally , it makes the formulas less cumbersome . Reminder on style–based architectures . Traditionally , the generator network in GANs transforms a latent code z ∈ N ( 0 , 1 ) to an image x ∈ RC×H×W . Contrary to this , style–based generators introduce a so-called style network , usually realized as a trainable MLP , which “ preprocesses ” random latent codes to the so-called “ style vectors ” ( elements of the style space ) . The obtained style vectors are , in turn , fed into the convolutional layers of the generator . It has been shown ( Karras et al. , 2019 ) that direct manipulations over the style vectors , rather than latent codes themselves , leads to visually plausible image interpolations and image mixing results . Intuitively , the style network performs a “ rectification ” of the latent space so that the new latent codes are more interpretable and disentangled . In this paper , we work with the style–based generators and perform image editing in the style space , denoted byW ; its elements are denoted as w. Let us now discuss the steps mentioned above in more detail . Recall , that we are interested in finding directions n such that G ( w′ ) with w′ = w + αn performs a certain interpretable deformation of the image G ( w ) . We now thoroughly describe the existing approaches to obtaining them in an unsupervised manner as well as various hyperparameters one needs to specify for each method . 3.1 DISCOVERING INTERPRETABLE DIRECTIONS . We consider several recently proposed methods : ClosedForm ( Shen & Zhou , 2020 ) , GANspace ( Härkönen et al. , 2020 ) , LatentDiscovery ( Voynov & Babenko , 2020 ) . Inspired by these methods , we also propose another family of methods termed DeepSpectral . ClosedForm ( CF ) . The authors of the ClosedForm method propose to move along the singular vectors of the first layer of generator . More specifically , for the transformation in the first layer given by the matrix A ( e.g. , this may be the weight in a fully-connected or a transposed convolutional layer ) , the direction n is found as n∗ = argmax { n∈RD : nTn=1 } ‖An‖22 . ( 1 ) All local maximas of Equation ( 1 ) form the set of singular vectors of the matrix A , and the authors propose to choose k singular vectors , associated with the corresponding k highest singular values . For the style–based GANs , the matrix A is obtained by concatenating the style mapping layers of each convolutional block . Hyperparameters : this method is hyperparameter–free and requires only a pretrained GAN model . GANspace ( GS ) . This method searches for important , meaningful directions by performing PCA in the style space of StyleGAN . Specifically , these directions are found in the following manner : first , randomly sampled noise vectors z1 : N ∈ N ( 0 , 1 ) are converted into style vectors w1 : N . The interpretable directions then correspond to principal axes of the set w1 : N ; in practice , we consider top k directions according to the corresponding singular values . Hyperparameters : for this approach , we only need to provide the number of sampled points which can be taken fixed and large , as well as a random seed for sampling . LatentDiscovery ( LD ) . LatentDiscovery is an unsupervised model-agnostic procedure for identifying interpretable directions in the GAN latent space . Informally speaking , this method searches for a set of directions that can be easily distinguished from one another . The resulting directions are meant to represent independent factors of generated images and include humaninterpretable representations . The trainable components are the following : a matrix N ∈ RD×k and a reconstructor network R , which evaluates the pair ( G ( w ) , G ( w+N ( ek ) ) . The reconstructor model aims to recover the shift in the latent space corresponding to the given image transformation . These two components are optimized jointly by minimizing the following objective function : N∗ , R∗ = argmin N , R Ew , k , L ( N , R ) = argmin N , R Ew , k , [ Lcl ( k , k̂ ) + λLr ( , ̂ ) ] . ( 2 ) Here , Lcl ( · , · ) is a reconstructor classification loss ( cross-entropy function ) , Lr ( · , · ) – regression term ( mean absolute error ) , which forces shifts along found directions to be more continuous . This method utilizes a number of hyperparameters ; however , as was shown in Voynov & Babenko ( 2020 ) , it is quite stable , and the default values provide good quality across various models and datasets . Hyperparameters : the hyperparameters include the number of latent directions k and the multiplier of the reconstructor term λ ; additionally , we can select different architectures for the regressor , as well as different training hyperparameters and random seed for initialization . DeepSpectral ( DS ) . We propose a novel approach to finding interpretable directions in the GAN latent space . Our motivation is as follows . While CF and GS both produce decent results , they effectively ignore all the layers in the generator but the first few ones . We hypothesize that by studying outputs of deeper intermediate layers of the generator , one can obtain a richer set of directions unavailable for these methods . Concretely , we propose the following simple approach . Let G ( i ) ( w ) denote the output of the i-th hidden layer of the generator . In order to obtain k directions in the latent space , we compute k singular vectors of JG ( i ) ( w ) with the highest singular values ( at some fixed point w ) . Here , JG ( i ) denotes the Jacobian matrix of a mapping . In a way , our approach generalizes CF since a linear map and its Jacobian coincide ( when bias is zero ) . By using automatic differentiation and an iterative approach to computing Singular Value Decomposition ( thus , we do not form the full Jacobian matrix ) , such directions can be found basically instantly ( Khrulkov & Oseledets , 2018 ) . The only hyperparameters in this approach are the choice of the layer and the choice of the base point w to compute the Jacobian . We experimentally verify the benefits of DS by considering various intermediate layers in Section 4 . Hyperparameters : we need to specify the layer and the base point w. Another recently proposed method ( Peebles et al. , 2020 ) searches for interpretable directions by utilizing the so-called Hessian penallty , penalizing the norm of the off-diagonal elements of the Hessian matrix of a network . However , in our implementation , we were not able to obtain convincing results ; we plan to analyze in the future with the authors ’ implementation when released .
This paper proposes a method to learn disentangled representations. The idea is to use an existing GAN generator and use an existing controllable generation algorithm (such as ClosedForm or GANspace) to find a set of “important” directions in the latent space. These subspaces spanned by these directions could already represent disentangled factors of variation. The main contribution of the paper is to propose learning a mapping from input to this subspace (that inverts the generator).
SP:219fd05784a7cf93f1435a0e541e7b6937df31cd
Optimistic Exploration with Backward Bootstrapped Bonus for Deep Reinforcement Learning
Optimism in the face of uncertainty is a principled approach for provably efficient exploration for reinforcement learning in tabular and linear settings . However , such an approach is challenging in developing practical exploration algorithms for Deep Reinforcement Learning ( DRL ) . To address this problem , we propose an Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL by following these two principles . OEB3 is built on bootstrapped deep Q-learning , a non-parametric posterior sampling method for temporally-extended exploration . Based on such a temporally-extended exploration , we construct an UCB-bonus indicating the uncertainty of Q-functions . The UCB-bonus is further utilized to estimate an optimistic Q-value , which encourages the agent to explore the scarcely visited states and actions to reduce uncertainty . In the estimation of Q-function , we adopt an episodic backward update strategy to propagate the future uncertainty to the estimated Q-function consistently . Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 1 INTRODUCTION . In Reinforcement learning ( RL ) ( Sutton & Barto , 2018 ) formalized by the Markov decision process ( MDP ) , an agent aims to maximize the long-term reward by interacting with the unknown environment . The agent takes actions according to the knowledge of experiences , which leads to the fundamental problem of the exploration-exploitation dilemma . An agent may choose the best decision given current information or acquire more information by exploring the poorly understood states and actions . Exploring the environment may sacrifice immediate rewards but potentially improves future performance . The exploration strategy is crucial for the RL agent to find the optimal policy . The theoretical RL offers various provably efficient exploration methods in tabular and linear MDPs with the basic value iteration algorithm : least-squares value iteration ( LSVI ) . Optimism in the face of uncertainty ( Auer & Ortner , 2007 ; Jin et al. , 2018 ) is a principled approach . In tabular cases , the optimism-based methods incorporate upper confidence bound ( UCB ) into the value functions as bonuses and attain the optimal worst-case regret ( Azar et al. , 2017 ; Jaksch et al. , 2010 ; Dann & Brunskill , 2015 ) . Randomized value function based on posterior sampling chooses actions according to the randomly sampled statistically plausible value functions and is known to achieve near-optimal worst-case and Bayesian regrets ( Osband & Van Roy , 2017 ; Russo , 2019 ) . Recently , the theoretical analyses in tabular cases are extended to linear MDP where the transition and the reward function are assumed to be linear . In linear cases , optimistic LSVI ( Jin et al. , 2020 ) attains a near-optimal worst-case regret by using a designed bonus , which is provably efficient . Randomized LSVI ( Zanette et al. , 2020 ) also attains a near-optimal worst-case regret . Although the analyses in tabular and linear cases provide attractive approaches for efficient exploration , these principles are still challenging in developing a practical exploration algorithm for Deep Reinforcement Learning ( DRL ) ( Mnih et al. , 2015 ) , which achieves human-level performance in large-scale tasks such as Atari games and robotic tasks . For example , in linear cases , the bonus in optimistic LSVI ( Jin et al. , 2020 ) and nontrivial noise in randomized LSVI ( Zanette et al. , 2020 ) are tailored to linear models ( Abbasi-Yadkori et al. , 2011 ) , and are incompatible with practically powerful function approximations such as neural networks . To address this problem , we propose the Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL . OEB3 is an instantiation of optimistic LSVI ( Jin et al. , 2020 ) in DRL by using a general-purpose UCB-bonus to provide an optimistic Q-value and a randomized value function to perform temporally-extended exploration . We propose an UCB-bonus that represents the disagreement of bootstrapped Q-functions ( Osband et al. , 2016 ) to measure the epistemic uncertainty of the unknown optimal value function . Q-value added by UCB-bonus becomes an optimistic Q+ function that is higher than Q for scarcely visited state-action pairs and remains close to Q for frequently visited ones . The optimistic Q+ function encourages the agent to explore the states and actions with high UCB-bonuses , signifying scarcely visited areas or meaningful events in completing a task . We propose an extension of episodic backward update ( Lee et al. , 2019 ) to propagate the future uncertainty to the estimated action-value function consistently within an episode . The backward update also enables OEB3 to perform highly sample-efficient training . Comparing to existing count-based and curiosity-driven exploration methods ( Taiga et al. , 2020 ) , OEB3 has several benefits . ( 1 ) We utilize intrinsic rewards to produce optimistic value function and also take advantage of bootstrapped Q-learning to perform temporally-consistent exploration while existing methods do not combine these two principles . ( 2 ) The UCB-bonus measures the disagreement of Q-values , which considers the long-term uncertainty in an episode rather than the single-step uncertainty used in most bonus-based methods ( Pathak et al. , 2019 ; Burda et al. , 2019b ) . Meanwhile , the UCB-bonus is computed without introducing additional modules compared to bootstrapped DQN . ( 3 ) We provide a theoretical analysis showing that OEB3 has theoretical consistency with optimistic LSVI in linear cases . ( 4 ) Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 2 BACKGROUND . In this section , we introduce bootstrapped DQN ( Osband et al. , 2016 ) , which we utilize in OEB3 for temporarily-extended exploration . We further introduce optimistic LSVI ( Jin et al. , 2020 ) , which we instantiate via DRL and propose OEB3 . 2.1 BOOTSTRAPPED DQN . We consider an episodic MDP represented as ( S , A , T , P , r ) , where T ∈ Z+ is the episode length , S is the state space , A is the action space , r is the reward function , and P is the unknown dynamics . In each timestep , the agent obtains the current state st , takes an action at , interacts with the environment , receives a reward rt , and updates to the next state st+1 . The action-value function Qπ ( st , at ) : = Eπ [ ∑T−1 i=t γ i−tri ] represents the expected cumulative reward starting from state st , taking action at , and thereafter following policy π ( at|st ) until the end of the episode . γ ∈ [ 0 , 1 ) is the discount factor . The optimal value function Q∗ = maxπ Qπ , and the optimal action a∗ = arg maxa∈AQ ∗ ( s , a ) . DeepQ-Network ( DQN ) uses a deep neural network with parameters θ to approximate theQ-function . The loss function takes the form of L ( θ ) = E [ ( yt − Q ( st , at ; θ ) ) 2 ∣∣ ( st , at , rt , st+1 ) ∼ D ] , where yt = rt + γmaxa′ Q ( st+1 , a ′ ; θ− ) is the target value , and θ− is the parameter of the target network . The agent accumulates experiences ( st , at , rt , st+1 ) in a replay buffer D and samples mini-batches in training . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) is a non-parametric posterior sampling method , which maintains K estimations of Q-values to represent the posterior distribution of the randomized value function . Bootstrapped DQN uses a multi-head network that contains a shared convolution network and K heads . Each head defines a Qk-function . Bootstrapped DQN diversifies different Qk by using different random initialization and individual target networks . The loss for training Qk is L ( θk ) = E [ ( rt + γmax a′ Qk ( st+1 , a ′ ; θk− ) −Qk ( st , at ; θk ) ) 2∣∣∣ ( st , at , rt , st+1 ) ∼ D ] . ( 1 ) The k-th head Qk ( s , a ; θk ) is trained with its own target network Qk ( s , a ; θk− ) . If k-th head is sampled at the start of an episode when interacting with the environment , the agent will follow Qk to choose actions in the whole episode , which provides temporally-consistent exploration for DRL . Algorithm 1 Optimistic LSVI in linear MDP 1 : Initialize : Λt ← λ · I and wh ← 0 2 : for episode m = 0 to M − 1 do 3 : Receive the initial state s0 4 : for step t = 0 to T − 1 do 5 : Take action at = arg maxa∈AQt ( st , a ) and observe st+1 . 6 : end for 7 : for step t = T − 1 to 0 do 8 : Λt ← ∑m τ=0 φ ( x τ t , a τ t ) φ ( x τ t , a τ t ) > + λ · I 9 : wt ← Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] 10 : Qt ( · , · ) = min { w > t φ ( · , · ) + α [ φ ( · , · ) > Λ−1t φ ( · , · ) ] 1/2 , T } 11 : end for 12 : end for 2.2 OPTIMISTIC LSVI . Optimistic LSVI ( Jin et al. , 2020 ) uses an optimistic Q-value with LSVI in linear MDP . We denote the feature map of the state-action pair as φ : S ×A → Rd . The transition kernel and reward function are assumed to be linear in φ . Optimistic LSVI shown in Algorithm 1 consists of two parts . In the first part ( line 3-6 ) , the agent executes the policy according to Qt for an episode . In the second part ( line 7-11 ) , the parameter wt of Q-function is updated in closed-form by following the regularized least-squares problem wt ← arg min w∈Rd ∑m τ=0 [ rt ( s τ t , a τ t ) + max a∈A Qt+1 ( s τ t+1 , a ) − w > φ ( sτt , aτt ) ] 2 + λ‖w‖2 , ( 2 ) where m is the number of episodes , and τ is the episodic index . The least-squares problem has the explicit solution wt = Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] ( line 9 ) , where Λt is the Gram matrix . Then the value function is estimated by Qt ( s , a ) ≈ w > t φ ( s , a ) . Optimistic LSVI uses a bonus α [ φ ( s , a ) > Λ−1t φ ( s , a ) ] 1/2 ( line 10 ) to measure the uncertainty of state-action pairs . We can intuitively consider u : = ( φ > Λ−1t φ ) −1 as a pseudo count of state-action pair by projecting the total features that have observed ( Λt ) to the direction of the curresponding feature φ . Thus , the bonus α/√u represents the uncertainty along the direction of φ . By adding the bonus to Q-value , we obtain an optimistic value function Q+ , which serves as an upper bound of Q to encourage exploration . The bonus in each step is propagated from the end of the episode by the backward update of Q-value ( line 7-11 ) , which follows the principle of dynamic programming . Theoretical analysis ( Jin et al. , 2020 ) shows that optimistic LSVI achieves a near-optimal worst-case regret of Õ ( √ d3T 3L3 ) with proper selections of α and λ , where L is the total number of steps .
This paper studies optimistic exploration for deep reinforcement learning. They propose an algorithm called OEB3, which utilizes the disagreement of bootstrapping Q-functions as the confidence bonus to guide exploration. They show that their confidence bonus matches the confidence bonus of optimistic LSVI in linear setting. After that, they evaluate their algorithm on plenty of benchmark problems including Mnist maze and 49 Atari games. Their algorithm outperforms other SOTA exploration approaches.
SP:72dc93c38fc6cc67f33a291f82dccaf69cc5bdda
Optimistic Exploration with Backward Bootstrapped Bonus for Deep Reinforcement Learning
Optimism in the face of uncertainty is a principled approach for provably efficient exploration for reinforcement learning in tabular and linear settings . However , such an approach is challenging in developing practical exploration algorithms for Deep Reinforcement Learning ( DRL ) . To address this problem , we propose an Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL by following these two principles . OEB3 is built on bootstrapped deep Q-learning , a non-parametric posterior sampling method for temporally-extended exploration . Based on such a temporally-extended exploration , we construct an UCB-bonus indicating the uncertainty of Q-functions . The UCB-bonus is further utilized to estimate an optimistic Q-value , which encourages the agent to explore the scarcely visited states and actions to reduce uncertainty . In the estimation of Q-function , we adopt an episodic backward update strategy to propagate the future uncertainty to the estimated Q-function consistently . Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 1 INTRODUCTION . In Reinforcement learning ( RL ) ( Sutton & Barto , 2018 ) formalized by the Markov decision process ( MDP ) , an agent aims to maximize the long-term reward by interacting with the unknown environment . The agent takes actions according to the knowledge of experiences , which leads to the fundamental problem of the exploration-exploitation dilemma . An agent may choose the best decision given current information or acquire more information by exploring the poorly understood states and actions . Exploring the environment may sacrifice immediate rewards but potentially improves future performance . The exploration strategy is crucial for the RL agent to find the optimal policy . The theoretical RL offers various provably efficient exploration methods in tabular and linear MDPs with the basic value iteration algorithm : least-squares value iteration ( LSVI ) . Optimism in the face of uncertainty ( Auer & Ortner , 2007 ; Jin et al. , 2018 ) is a principled approach . In tabular cases , the optimism-based methods incorporate upper confidence bound ( UCB ) into the value functions as bonuses and attain the optimal worst-case regret ( Azar et al. , 2017 ; Jaksch et al. , 2010 ; Dann & Brunskill , 2015 ) . Randomized value function based on posterior sampling chooses actions according to the randomly sampled statistically plausible value functions and is known to achieve near-optimal worst-case and Bayesian regrets ( Osband & Van Roy , 2017 ; Russo , 2019 ) . Recently , the theoretical analyses in tabular cases are extended to linear MDP where the transition and the reward function are assumed to be linear . In linear cases , optimistic LSVI ( Jin et al. , 2020 ) attains a near-optimal worst-case regret by using a designed bonus , which is provably efficient . Randomized LSVI ( Zanette et al. , 2020 ) also attains a near-optimal worst-case regret . Although the analyses in tabular and linear cases provide attractive approaches for efficient exploration , these principles are still challenging in developing a practical exploration algorithm for Deep Reinforcement Learning ( DRL ) ( Mnih et al. , 2015 ) , which achieves human-level performance in large-scale tasks such as Atari games and robotic tasks . For example , in linear cases , the bonus in optimistic LSVI ( Jin et al. , 2020 ) and nontrivial noise in randomized LSVI ( Zanette et al. , 2020 ) are tailored to linear models ( Abbasi-Yadkori et al. , 2011 ) , and are incompatible with practically powerful function approximations such as neural networks . To address this problem , we propose the Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL . OEB3 is an instantiation of optimistic LSVI ( Jin et al. , 2020 ) in DRL by using a general-purpose UCB-bonus to provide an optimistic Q-value and a randomized value function to perform temporally-extended exploration . We propose an UCB-bonus that represents the disagreement of bootstrapped Q-functions ( Osband et al. , 2016 ) to measure the epistemic uncertainty of the unknown optimal value function . Q-value added by UCB-bonus becomes an optimistic Q+ function that is higher than Q for scarcely visited state-action pairs and remains close to Q for frequently visited ones . The optimistic Q+ function encourages the agent to explore the states and actions with high UCB-bonuses , signifying scarcely visited areas or meaningful events in completing a task . We propose an extension of episodic backward update ( Lee et al. , 2019 ) to propagate the future uncertainty to the estimated action-value function consistently within an episode . The backward update also enables OEB3 to perform highly sample-efficient training . Comparing to existing count-based and curiosity-driven exploration methods ( Taiga et al. , 2020 ) , OEB3 has several benefits . ( 1 ) We utilize intrinsic rewards to produce optimistic value function and also take advantage of bootstrapped Q-learning to perform temporally-consistent exploration while existing methods do not combine these two principles . ( 2 ) The UCB-bonus measures the disagreement of Q-values , which considers the long-term uncertainty in an episode rather than the single-step uncertainty used in most bonus-based methods ( Pathak et al. , 2019 ; Burda et al. , 2019b ) . Meanwhile , the UCB-bonus is computed without introducing additional modules compared to bootstrapped DQN . ( 3 ) We provide a theoretical analysis showing that OEB3 has theoretical consistency with optimistic LSVI in linear cases . ( 4 ) Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 2 BACKGROUND . In this section , we introduce bootstrapped DQN ( Osband et al. , 2016 ) , which we utilize in OEB3 for temporarily-extended exploration . We further introduce optimistic LSVI ( Jin et al. , 2020 ) , which we instantiate via DRL and propose OEB3 . 2.1 BOOTSTRAPPED DQN . We consider an episodic MDP represented as ( S , A , T , P , r ) , where T ∈ Z+ is the episode length , S is the state space , A is the action space , r is the reward function , and P is the unknown dynamics . In each timestep , the agent obtains the current state st , takes an action at , interacts with the environment , receives a reward rt , and updates to the next state st+1 . The action-value function Qπ ( st , at ) : = Eπ [ ∑T−1 i=t γ i−tri ] represents the expected cumulative reward starting from state st , taking action at , and thereafter following policy π ( at|st ) until the end of the episode . γ ∈ [ 0 , 1 ) is the discount factor . The optimal value function Q∗ = maxπ Qπ , and the optimal action a∗ = arg maxa∈AQ ∗ ( s , a ) . DeepQ-Network ( DQN ) uses a deep neural network with parameters θ to approximate theQ-function . The loss function takes the form of L ( θ ) = E [ ( yt − Q ( st , at ; θ ) ) 2 ∣∣ ( st , at , rt , st+1 ) ∼ D ] , where yt = rt + γmaxa′ Q ( st+1 , a ′ ; θ− ) is the target value , and θ− is the parameter of the target network . The agent accumulates experiences ( st , at , rt , st+1 ) in a replay buffer D and samples mini-batches in training . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) is a non-parametric posterior sampling method , which maintains K estimations of Q-values to represent the posterior distribution of the randomized value function . Bootstrapped DQN uses a multi-head network that contains a shared convolution network and K heads . Each head defines a Qk-function . Bootstrapped DQN diversifies different Qk by using different random initialization and individual target networks . The loss for training Qk is L ( θk ) = E [ ( rt + γmax a′ Qk ( st+1 , a ′ ; θk− ) −Qk ( st , at ; θk ) ) 2∣∣∣ ( st , at , rt , st+1 ) ∼ D ] . ( 1 ) The k-th head Qk ( s , a ; θk ) is trained with its own target network Qk ( s , a ; θk− ) . If k-th head is sampled at the start of an episode when interacting with the environment , the agent will follow Qk to choose actions in the whole episode , which provides temporally-consistent exploration for DRL . Algorithm 1 Optimistic LSVI in linear MDP 1 : Initialize : Λt ← λ · I and wh ← 0 2 : for episode m = 0 to M − 1 do 3 : Receive the initial state s0 4 : for step t = 0 to T − 1 do 5 : Take action at = arg maxa∈AQt ( st , a ) and observe st+1 . 6 : end for 7 : for step t = T − 1 to 0 do 8 : Λt ← ∑m τ=0 φ ( x τ t , a τ t ) φ ( x τ t , a τ t ) > + λ · I 9 : wt ← Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] 10 : Qt ( · , · ) = min { w > t φ ( · , · ) + α [ φ ( · , · ) > Λ−1t φ ( · , · ) ] 1/2 , T } 11 : end for 12 : end for 2.2 OPTIMISTIC LSVI . Optimistic LSVI ( Jin et al. , 2020 ) uses an optimistic Q-value with LSVI in linear MDP . We denote the feature map of the state-action pair as φ : S ×A → Rd . The transition kernel and reward function are assumed to be linear in φ . Optimistic LSVI shown in Algorithm 1 consists of two parts . In the first part ( line 3-6 ) , the agent executes the policy according to Qt for an episode . In the second part ( line 7-11 ) , the parameter wt of Q-function is updated in closed-form by following the regularized least-squares problem wt ← arg min w∈Rd ∑m τ=0 [ rt ( s τ t , a τ t ) + max a∈A Qt+1 ( s τ t+1 , a ) − w > φ ( sτt , aτt ) ] 2 + λ‖w‖2 , ( 2 ) where m is the number of episodes , and τ is the episodic index . The least-squares problem has the explicit solution wt = Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] ( line 9 ) , where Λt is the Gram matrix . Then the value function is estimated by Qt ( s , a ) ≈ w > t φ ( s , a ) . Optimistic LSVI uses a bonus α [ φ ( s , a ) > Λ−1t φ ( s , a ) ] 1/2 ( line 10 ) to measure the uncertainty of state-action pairs . We can intuitively consider u : = ( φ > Λ−1t φ ) −1 as a pseudo count of state-action pair by projecting the total features that have observed ( Λt ) to the direction of the curresponding feature φ . Thus , the bonus α/√u represents the uncertainty along the direction of φ . By adding the bonus to Q-value , we obtain an optimistic value function Q+ , which serves as an upper bound of Q to encourage exploration . The bonus in each step is propagated from the end of the episode by the backward update of Q-value ( line 7-11 ) , which follows the principle of dynamic programming . Theoretical analysis ( Jin et al. , 2020 ) shows that optimistic LSVI achieves a near-optimal worst-case regret of Õ ( √ d3T 3L3 ) with proper selections of α and λ , where L is the total number of steps .
This paper focuses on deep reinforcement learning and proposes a practical exploration algorithm called Optimistic Exploration algorithm with Backward Bootstrapped Bonus. Based on the Optimistic LSVI algorithm, the authors propose a new optimistic exploration bonus for general cases, similar to the optimistic exploration bonus in the LSVI algorithm under the linear MDP setting. Experiment results show that the QWR algorithm has better performance than previous algorithms.
SP:72dc93c38fc6cc67f33a291f82dccaf69cc5bdda
Optimistic Exploration with Backward Bootstrapped Bonus for Deep Reinforcement Learning
Optimism in the face of uncertainty is a principled approach for provably efficient exploration for reinforcement learning in tabular and linear settings . However , such an approach is challenging in developing practical exploration algorithms for Deep Reinforcement Learning ( DRL ) . To address this problem , we propose an Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL by following these two principles . OEB3 is built on bootstrapped deep Q-learning , a non-parametric posterior sampling method for temporally-extended exploration . Based on such a temporally-extended exploration , we construct an UCB-bonus indicating the uncertainty of Q-functions . The UCB-bonus is further utilized to estimate an optimistic Q-value , which encourages the agent to explore the scarcely visited states and actions to reduce uncertainty . In the estimation of Q-function , we adopt an episodic backward update strategy to propagate the future uncertainty to the estimated Q-function consistently . Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 1 INTRODUCTION . In Reinforcement learning ( RL ) ( Sutton & Barto , 2018 ) formalized by the Markov decision process ( MDP ) , an agent aims to maximize the long-term reward by interacting with the unknown environment . The agent takes actions according to the knowledge of experiences , which leads to the fundamental problem of the exploration-exploitation dilemma . An agent may choose the best decision given current information or acquire more information by exploring the poorly understood states and actions . Exploring the environment may sacrifice immediate rewards but potentially improves future performance . The exploration strategy is crucial for the RL agent to find the optimal policy . The theoretical RL offers various provably efficient exploration methods in tabular and linear MDPs with the basic value iteration algorithm : least-squares value iteration ( LSVI ) . Optimism in the face of uncertainty ( Auer & Ortner , 2007 ; Jin et al. , 2018 ) is a principled approach . In tabular cases , the optimism-based methods incorporate upper confidence bound ( UCB ) into the value functions as bonuses and attain the optimal worst-case regret ( Azar et al. , 2017 ; Jaksch et al. , 2010 ; Dann & Brunskill , 2015 ) . Randomized value function based on posterior sampling chooses actions according to the randomly sampled statistically plausible value functions and is known to achieve near-optimal worst-case and Bayesian regrets ( Osband & Van Roy , 2017 ; Russo , 2019 ) . Recently , the theoretical analyses in tabular cases are extended to linear MDP where the transition and the reward function are assumed to be linear . In linear cases , optimistic LSVI ( Jin et al. , 2020 ) attains a near-optimal worst-case regret by using a designed bonus , which is provably efficient . Randomized LSVI ( Zanette et al. , 2020 ) also attains a near-optimal worst-case regret . Although the analyses in tabular and linear cases provide attractive approaches for efficient exploration , these principles are still challenging in developing a practical exploration algorithm for Deep Reinforcement Learning ( DRL ) ( Mnih et al. , 2015 ) , which achieves human-level performance in large-scale tasks such as Atari games and robotic tasks . For example , in linear cases , the bonus in optimistic LSVI ( Jin et al. , 2020 ) and nontrivial noise in randomized LSVI ( Zanette et al. , 2020 ) are tailored to linear models ( Abbasi-Yadkori et al. , 2011 ) , and are incompatible with practically powerful function approximations such as neural networks . To address this problem , we propose the Optimistic Exploration algorithm with Backward Bootstrapped Bonus ( OEB3 ) for DRL . OEB3 is an instantiation of optimistic LSVI ( Jin et al. , 2020 ) in DRL by using a general-purpose UCB-bonus to provide an optimistic Q-value and a randomized value function to perform temporally-extended exploration . We propose an UCB-bonus that represents the disagreement of bootstrapped Q-functions ( Osband et al. , 2016 ) to measure the epistemic uncertainty of the unknown optimal value function . Q-value added by UCB-bonus becomes an optimistic Q+ function that is higher than Q for scarcely visited state-action pairs and remains close to Q for frequently visited ones . The optimistic Q+ function encourages the agent to explore the states and actions with high UCB-bonuses , signifying scarcely visited areas or meaningful events in completing a task . We propose an extension of episodic backward update ( Lee et al. , 2019 ) to propagate the future uncertainty to the estimated action-value function consistently within an episode . The backward update also enables OEB3 to perform highly sample-efficient training . Comparing to existing count-based and curiosity-driven exploration methods ( Taiga et al. , 2020 ) , OEB3 has several benefits . ( 1 ) We utilize intrinsic rewards to produce optimistic value function and also take advantage of bootstrapped Q-learning to perform temporally-consistent exploration while existing methods do not combine these two principles . ( 2 ) The UCB-bonus measures the disagreement of Q-values , which considers the long-term uncertainty in an episode rather than the single-step uncertainty used in most bonus-based methods ( Pathak et al. , 2019 ; Burda et al. , 2019b ) . Meanwhile , the UCB-bonus is computed without introducing additional modules compared to bootstrapped DQN . ( 3 ) We provide a theoretical analysis showing that OEB3 has theoretical consistency with optimistic LSVI in linear cases . ( 4 ) Extensive evaluations show that OEB3 outperforms several state-of-the-art exploration approaches in MNIST maze and 49 Atari games . 2 BACKGROUND . In this section , we introduce bootstrapped DQN ( Osband et al. , 2016 ) , which we utilize in OEB3 for temporarily-extended exploration . We further introduce optimistic LSVI ( Jin et al. , 2020 ) , which we instantiate via DRL and propose OEB3 . 2.1 BOOTSTRAPPED DQN . We consider an episodic MDP represented as ( S , A , T , P , r ) , where T ∈ Z+ is the episode length , S is the state space , A is the action space , r is the reward function , and P is the unknown dynamics . In each timestep , the agent obtains the current state st , takes an action at , interacts with the environment , receives a reward rt , and updates to the next state st+1 . The action-value function Qπ ( st , at ) : = Eπ [ ∑T−1 i=t γ i−tri ] represents the expected cumulative reward starting from state st , taking action at , and thereafter following policy π ( at|st ) until the end of the episode . γ ∈ [ 0 , 1 ) is the discount factor . The optimal value function Q∗ = maxπ Qπ , and the optimal action a∗ = arg maxa∈AQ ∗ ( s , a ) . DeepQ-Network ( DQN ) uses a deep neural network with parameters θ to approximate theQ-function . The loss function takes the form of L ( θ ) = E [ ( yt − Q ( st , at ; θ ) ) 2 ∣∣ ( st , at , rt , st+1 ) ∼ D ] , where yt = rt + γmaxa′ Q ( st+1 , a ′ ; θ− ) is the target value , and θ− is the parameter of the target network . The agent accumulates experiences ( st , at , rt , st+1 ) in a replay buffer D and samples mini-batches in training . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) is a non-parametric posterior sampling method , which maintains K estimations of Q-values to represent the posterior distribution of the randomized value function . Bootstrapped DQN uses a multi-head network that contains a shared convolution network and K heads . Each head defines a Qk-function . Bootstrapped DQN diversifies different Qk by using different random initialization and individual target networks . The loss for training Qk is L ( θk ) = E [ ( rt + γmax a′ Qk ( st+1 , a ′ ; θk− ) −Qk ( st , at ; θk ) ) 2∣∣∣ ( st , at , rt , st+1 ) ∼ D ] . ( 1 ) The k-th head Qk ( s , a ; θk ) is trained with its own target network Qk ( s , a ; θk− ) . If k-th head is sampled at the start of an episode when interacting with the environment , the agent will follow Qk to choose actions in the whole episode , which provides temporally-consistent exploration for DRL . Algorithm 1 Optimistic LSVI in linear MDP 1 : Initialize : Λt ← λ · I and wh ← 0 2 : for episode m = 0 to M − 1 do 3 : Receive the initial state s0 4 : for step t = 0 to T − 1 do 5 : Take action at = arg maxa∈AQt ( st , a ) and observe st+1 . 6 : end for 7 : for step t = T − 1 to 0 do 8 : Λt ← ∑m τ=0 φ ( x τ t , a τ t ) φ ( x τ t , a τ t ) > + λ · I 9 : wt ← Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] 10 : Qt ( · , · ) = min { w > t φ ( · , · ) + α [ φ ( · , · ) > Λ−1t φ ( · , · ) ] 1/2 , T } 11 : end for 12 : end for 2.2 OPTIMISTIC LSVI . Optimistic LSVI ( Jin et al. , 2020 ) uses an optimistic Q-value with LSVI in linear MDP . We denote the feature map of the state-action pair as φ : S ×A → Rd . The transition kernel and reward function are assumed to be linear in φ . Optimistic LSVI shown in Algorithm 1 consists of two parts . In the first part ( line 3-6 ) , the agent executes the policy according to Qt for an episode . In the second part ( line 7-11 ) , the parameter wt of Q-function is updated in closed-form by following the regularized least-squares problem wt ← arg min w∈Rd ∑m τ=0 [ rt ( s τ t , a τ t ) + max a∈A Qt+1 ( s τ t+1 , a ) − w > φ ( sτt , aτt ) ] 2 + λ‖w‖2 , ( 2 ) where m is the number of episodes , and τ is the episodic index . The least-squares problem has the explicit solution wt = Λ−1t ∑m τ=0 φ ( x τ t , a τ t ) [ rt ( x τ t , a τ t ) + maxaQt+1 ( x τ t+1 , a ) ] ( line 9 ) , where Λt is the Gram matrix . Then the value function is estimated by Qt ( s , a ) ≈ w > t φ ( s , a ) . Optimistic LSVI uses a bonus α [ φ ( s , a ) > Λ−1t φ ( s , a ) ] 1/2 ( line 10 ) to measure the uncertainty of state-action pairs . We can intuitively consider u : = ( φ > Λ−1t φ ) −1 as a pseudo count of state-action pair by projecting the total features that have observed ( Λt ) to the direction of the curresponding feature φ . Thus , the bonus α/√u represents the uncertainty along the direction of φ . By adding the bonus to Q-value , we obtain an optimistic value function Q+ , which serves as an upper bound of Q to encourage exploration . The bonus in each step is propagated from the end of the episode by the backward update of Q-value ( line 7-11 ) , which follows the principle of dynamic programming . Theoretical analysis ( Jin et al. , 2020 ) shows that optimistic LSVI achieves a near-optimal worst-case regret of Õ ( √ d3T 3L3 ) with proper selections of α and λ , where L is the total number of steps .
The paper proposes a UCB-based optimistic exploration method for DRL, called Optimistic Exploration algorithm with Backward Bootstrapped Bonus (OEB3). The algorithm builds on the idea of optimistic exploration developed in the theoretical optimistic LSVI algorithm for linear MDP. In optimistic LSVI, the optimistic Q-value is backward updated for each episode with an UCB bonus at each step. OEB3 extends this backward update of UCB bonus to DRL by estimating the UCB bonus using bootstrapped Q-learning. OEB3 learns an ensemble of bootstrapped Q-values and estimates the UCB bonus as the variance of the Q-values. Another important part of OEB3 is to adapt episodic backward update to bootstrapped Q-learning. This is done by procedure called Bootstrapped Episodic Backward Update (BEBU) which extends previous episodic update idea to the ensemble of bootstrapped Q-values.
SP:72dc93c38fc6cc67f33a291f82dccaf69cc5bdda
Class2Simi: A New Perspective on Learning with Label Noise
1 INTRODUCTION . It is expensive to label large-scale data accurately . Therefore , cheap datasets with label noise are ubiquitous in the era of big data . However , label noise will degenerate the performance of trained deep models , because deep networks will easily overfit label noise ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; 2018 ; Xia et al. , 2019 ; 2020 ) . In this paper , we propose a new perspective on handling label noise called “ Class2Simi ” , i.e. , transforming training examples with noisy class labels into pairs of examples with noisy similarity labels . A class label shows the class that an instance belongs to , while a similarity label indicates whether or not two instances belong to the same class . This transformation is motivated by the observation that the noise rate becomes lower , e.g. , even if two instances have incorrect class labels , their similarity label could be correct . In the label-noise learning community , a lower noise rate usually results in higher classification performance ( Han et al. , 2018b ; Patrini et al. , 2017 ) . Specifically , we illustrate the transformation and the robustness of similarity labels in Figure 1 . Assume we have eight noisy examples { ( x1 , ȳ1 ) , . . . , ( x8 , ȳ8 ) } as shown in the upper part of the middle column . Their labels are of four classes , i.e. , { 1 , 2 , 3 , 4 } . The labels marked in red are incorrect labels . We transform the 8 examples into 8× 8 example-pairs with noisy similarity labels as shown in the bottom part of the middle column , where the similarity label 1 means the two instances have the same class label and 0 means the two instances have different class labels . We present the latent clean class labels and similarity labels in the left column . In the middle column , we can see that although the instances x2 and x4 both have incorrect class labels , the similarity label of the example-pair ( x2 , x4 ) is correct . Similarity labels are robust because they further consider the information on the pairwise relationship . We prove that the noise rate in the noisy similarity labels is lower than that of the noisy class labels . For example , if we assume that the noisy class labels in Figure 1 are generated according to the latent clean labels and the transition matrix shown in the upper part of the right column ( the ij-th entry of the matrix denotes the probability that the clean class label i flips into the noisy class label j ) , the noise rate for the noisy class labels is 0.5 while the rate for the corresponding noisy similarity labels is 0.25 . Note that the noise rate is the ratio of the number of incorrect labels to the number of total examples , which can be calculated from the noise transition matrix combined with the proportion of each class , i.e. , 1/6× 3/4 + 1/2× 1/4 = 0.25 . It is obvious that Class2Simi suffers information loss because we can not recover the class labels from similarity labels . However , since the similarity labels are more robust to noise than the class labels , the advantage of the reduction of noise rate overweighs the disadvantage of the loss of information . Intuitively , in the learning process , it is the signal in the information that enhances the performance of the model , while the noise in the information is harmful to the model . Through Class2Simi , although the total amount of information is reduced , the signal to noise ratio is increased , and so would be the total amount of signals . Thus , we can benefit from the transformation and achieve better performances . Theorem 2 and the experimental results will verify the effectiveness of this transformation . It remains unsolved how to learn a robust classifier from the data with transformed noisy similarity labels . To solve this problem , we first estimate the similarity noise transition matrix , a 2 × 2 matrix whose entries denote the flip rates of similarity labels . Note that the transition matrix bridges the noisy similarity posterior and the clean similarity posterior . The noisy similarity posterior can be learned from the data with noisy similarity labels . Then , given the similarity noise transition matrix , we can infer the clean similarity posterior from the noisy similarity posterior . Since the clean similarity posterior is approximated by the inner product of the clean class posterior ( Hsu et al. , 2019 ) , the clean class posterior ( and thus the robust classifier ) can thereby be learned . We will empirically show that Class2Simi with the estimated similarity noise transition matrix will remarkably outperform the baselines even given with the ground-truth class noise transition matrix . The contributions of this paper are summarized as follows : • We propose a new perspective on learning with label noise , which transforms class labels into similarity labels . Such a transformation reduces the noise level . • We provide a way to estimate the similarity noise transition matrix by theoretically establishing its relation to the class noise transition matrix . We show that even if the class noise transition matrix is inaccurately estimated , the induced similarity noise transition matrix still works well . • We design a deep learning method to learn robust classifiers from data with noisy similarity labels and theoretically analyze its generalization ability . • We empirically demonstrate that the proposed method remarkably surpasses the baselines on many datasets with both synthetic noise and real-world noise . The rest of this paper is organized as follows . In Section 2 , we formalize the noisy multi-class classification problem , and in Section 3 , we propose the Class2Simi strategy and practical implementation . Experimental results are discussed in Section 4 . We conclude our paper in Section 5 . 2 PROBLEM SETUP AND RELATED WORK . Let ( X , Y ) ∈ X × { 1 , . . . , C } be the random variables for instances and clean labels , where X represents the instance space and C is the number of classes . However , in many real-world applications ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; Tanno et al. , 2019 ; Zhang et al. , 2018 ) , the clean labels can not be observed . The observed labels are noisy . Let Ȳ be the random variable for the noisy labels . What we have is a sample { ( x1 , ȳ1 ) , . . . , ( xn , ȳn ) } drawn from the noisy distribution Dρ of the random variables ( X , Ȳ ) . Our aim is to learn a robust classifier that could assign clean labels to test data by exploiting the sample with noisy labels . Existing methods for learning with noisy labels can be divided into two categories : algorithms that result in statistically inconsistent or consistent classifiers . Methods in the first category usually employ heuristics to reduce the side-effect of noisy labels , e.g. , selecting reliable examples ( Yu et al. , 2019 ; Han et al. , 2018b ; Malach & Shalev-Shwartz , 2017 ) , reweighting examples ( Ren et al. , 2018 ; Jiang et al. , 2018 ; Ma et al. , 2018 ; Kremer et al. , 2018 ; Tanaka et al. , 2018 ; Reed et al. , 2015 ) , employing side information ( Vahdat , 2017 ; Li et al. , 2017 ; Berthon et al. , 2020 ) , and adding regularization ( Han et al. , 2018a ; Guo et al. , 2018 ; Veit et al. , 2017 ; Vahdat , 2017 ; Li et al. , 2017 ) . Those methods empirically work well in many settings . Methods in the second category aim to learn robust classifiers that could converge to the optimal ones defined by using clean data . They utilize the noise transition matrix , which denotes the probabilities that the clean labels flip into noisy labels , to build consistent algorithms ( Goldberger & Ben-Reuven , 2017 ; Patrini et al. , 2017 ; Thekumparampil et al. , 2018 ; Yu et al. , 2018 ; Liu & Guo , 2020 ; Zhang & Sabuncu , 2018 ; Kremer et al. , 2018 ; Liu & Tao , 2016 ; Northcutt et al. , 2017 ; Scott , 2015 ; Natarajan et al. , 2013 ; Yao et al. , 2020b ) . The idea is that given the noisy class posterior probability and the noise transition matrix , the clean class posterior probability can be inferred . Note that the noisy class posterior and the noise transition matrix can be estimated by exploiting the noisy data , where the noise transition matrix additionally needs anchor points ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . Some methods assume anchor points have already been given ( Yu et al. , 2018 ) . There are also methods showing how to identify anchor points from the noisy training data ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . 3 CLASS2SIMI MEETS NOISY SUPERVISION . In this section , we propose a new strategy for learning from noisy data . Our core idea is to transform class labels to similarity labels first , and then handle the noise manifested on similarity labels . 3.1 TRANSFORMATION ON LABELS AND THE TRANSITION MATRIX . As in Figure 1 , we combine every 2 instances in pairs , and if the two instances have the same class label , we assign this pair a similarity label 1 , otherwise 0 . If the class labels are corrupted , the generated similarity labels also contain noise . We denote the clean and noisy similarity labels of the example-pair ( xi , xj ) by Hij and H̄ij respectively . The definition of the similarity noise transition matrix is similar to the class one , denoting the probabilities that clean similarity labels flip into noisy similarity labels , i.e. , Ts , mn = P ( H̄ij = n|Hij = m ) . The dimension of the similarity noise transition matrix is always 2× 2 . Since the similarity labels are generated from class labels , the similarity noise is also determined and , thus can be calculated , by the class noise transition matrix . Theorem 1 . Assume that the dataset is balanced ( each class has the same amount of samples , and c classes in total ) , and the noise is class-dependent . Given a class noise transition matrix Tc , such that Tc , ij = P ( Ȳ = j|Y = i ) . The elements of the corresponding similarity noise transition matrix Ts can be calculated as Ts,00 = c2 − c− ( ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro ) c2 − c , Ts,01 = ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro c2 − c , Ts,10 = c− ||Tc||2Fro c , Ts,11 = ||Tc||2Fro c . A detailed proof is provided in Appendix A . Remark 1 . Theorem 1 can easily extend to the setting where the dataset is unbalanced in classes by multiplying each Tc , ij by a coefficient ni . ni is the number of examples from the i-th class . Note that the similarity labels are only dependent on class labels . If the class noise is class-dependent , the similarity noise is also “ class-dependent ” ( class means similar and dissimilar ) . Under classdependent label noise , a binary classification is learnable as long as T00 + T11 > 1 ( Menon et al. , 2015 ) , where T is the corresponding binary transition matrix ; a multi-class classification is learnable if the corresponding transition matrix Tc is invertible . For Class2Simi , in the most general sense , i.e. , Tc is invertible , Ts,00 + Ts,11 > 1 holds . Namely , the learnability of the pointwise classification implies the learnability of the reduced pairwise classification . However , the latter can not imply the former . A proof and a counterexample are provided in Appendix F. Theorem 2 . Assume that the dataset is balanced ( each class has the same amount of samples ) , and the noise is class-dependent . When the number of classes c ≥ 81 , the noise rate for the noisy similarity labels is lower than that of the noisy class labels . A detailed proof is provided in Appendix B . When dealing with label noise , a low noise rate has many benefits . The most important one is that the noise-robust algorithms will consistently achieve higher performance when the noise rate is lower ( Bao et al. , 2018 ; Han et al. , 2018b ; Xia et al. , 2019 ; Patrini et al. , 2017 ) . Another benefit is that , when the noise rate is low , the complex instance-dependent label noise can be well approximated by class-dependent label noise ( Cheng et al. , 2020 ) , which is easier to handle . After the Class2Simi transformation , the number of dissimilar pairs is ( c − 1 ) times as much as that of similar pairs . Meanwhile , compared with the original noise rate of class labels , the noise rate of similar pairs ( the ratio of the number of mislabeled similar pairs to the number of total real similar pairs ) is higher and the noise rate of dissimilar pairs is lower , while the overall noise rate of pairwise examples is lower , which partially reflects that the impact of the label noise is less bad . Moreover , the flip from dissimilar to similar should be more adversarial and thus more important . In practice , it is common that one class has more than one clusters , while it is rare that two or more classes are in the same cluster . If there is a flip from similar to dissimilar and based on it we split a ( latent ) cluster into two ( latent ) clusters , we still have a high chance to label these two clusters correctly later . If there is a flip from dissimilar to similar and based on it we join two clusters belonging to two classes into a single cluster , we nearly have zero chance to label this cluster correctly later . As a consequence , the flip from dissimilar to similar is more adversarial , and thus more important . To sum up , considering the reduction of the overall noise rate is meaningful .
The paper addresses the problem of learning with noisy labels by transforming the original category classification task into a semantic-similarity prediction task. The new task takes pairs of samples as input and predicts if the two samples are coming from the same category or not. It is theoretically shown that the similarity pairs have lower noise rates compared to the original categorization. It is then argued that this lower noise rate makes the learning more robust in the presence of class label noise.
SP:38c530428ad4a8b4bc956998fc9c53a09e1beddf
Class2Simi: A New Perspective on Learning with Label Noise
1 INTRODUCTION . It is expensive to label large-scale data accurately . Therefore , cheap datasets with label noise are ubiquitous in the era of big data . However , label noise will degenerate the performance of trained deep models , because deep networks will easily overfit label noise ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; 2018 ; Xia et al. , 2019 ; 2020 ) . In this paper , we propose a new perspective on handling label noise called “ Class2Simi ” , i.e. , transforming training examples with noisy class labels into pairs of examples with noisy similarity labels . A class label shows the class that an instance belongs to , while a similarity label indicates whether or not two instances belong to the same class . This transformation is motivated by the observation that the noise rate becomes lower , e.g. , even if two instances have incorrect class labels , their similarity label could be correct . In the label-noise learning community , a lower noise rate usually results in higher classification performance ( Han et al. , 2018b ; Patrini et al. , 2017 ) . Specifically , we illustrate the transformation and the robustness of similarity labels in Figure 1 . Assume we have eight noisy examples { ( x1 , ȳ1 ) , . . . , ( x8 , ȳ8 ) } as shown in the upper part of the middle column . Their labels are of four classes , i.e. , { 1 , 2 , 3 , 4 } . The labels marked in red are incorrect labels . We transform the 8 examples into 8× 8 example-pairs with noisy similarity labels as shown in the bottom part of the middle column , where the similarity label 1 means the two instances have the same class label and 0 means the two instances have different class labels . We present the latent clean class labels and similarity labels in the left column . In the middle column , we can see that although the instances x2 and x4 both have incorrect class labels , the similarity label of the example-pair ( x2 , x4 ) is correct . Similarity labels are robust because they further consider the information on the pairwise relationship . We prove that the noise rate in the noisy similarity labels is lower than that of the noisy class labels . For example , if we assume that the noisy class labels in Figure 1 are generated according to the latent clean labels and the transition matrix shown in the upper part of the right column ( the ij-th entry of the matrix denotes the probability that the clean class label i flips into the noisy class label j ) , the noise rate for the noisy class labels is 0.5 while the rate for the corresponding noisy similarity labels is 0.25 . Note that the noise rate is the ratio of the number of incorrect labels to the number of total examples , which can be calculated from the noise transition matrix combined with the proportion of each class , i.e. , 1/6× 3/4 + 1/2× 1/4 = 0.25 . It is obvious that Class2Simi suffers information loss because we can not recover the class labels from similarity labels . However , since the similarity labels are more robust to noise than the class labels , the advantage of the reduction of noise rate overweighs the disadvantage of the loss of information . Intuitively , in the learning process , it is the signal in the information that enhances the performance of the model , while the noise in the information is harmful to the model . Through Class2Simi , although the total amount of information is reduced , the signal to noise ratio is increased , and so would be the total amount of signals . Thus , we can benefit from the transformation and achieve better performances . Theorem 2 and the experimental results will verify the effectiveness of this transformation . It remains unsolved how to learn a robust classifier from the data with transformed noisy similarity labels . To solve this problem , we first estimate the similarity noise transition matrix , a 2 × 2 matrix whose entries denote the flip rates of similarity labels . Note that the transition matrix bridges the noisy similarity posterior and the clean similarity posterior . The noisy similarity posterior can be learned from the data with noisy similarity labels . Then , given the similarity noise transition matrix , we can infer the clean similarity posterior from the noisy similarity posterior . Since the clean similarity posterior is approximated by the inner product of the clean class posterior ( Hsu et al. , 2019 ) , the clean class posterior ( and thus the robust classifier ) can thereby be learned . We will empirically show that Class2Simi with the estimated similarity noise transition matrix will remarkably outperform the baselines even given with the ground-truth class noise transition matrix . The contributions of this paper are summarized as follows : • We propose a new perspective on learning with label noise , which transforms class labels into similarity labels . Such a transformation reduces the noise level . • We provide a way to estimate the similarity noise transition matrix by theoretically establishing its relation to the class noise transition matrix . We show that even if the class noise transition matrix is inaccurately estimated , the induced similarity noise transition matrix still works well . • We design a deep learning method to learn robust classifiers from data with noisy similarity labels and theoretically analyze its generalization ability . • We empirically demonstrate that the proposed method remarkably surpasses the baselines on many datasets with both synthetic noise and real-world noise . The rest of this paper is organized as follows . In Section 2 , we formalize the noisy multi-class classification problem , and in Section 3 , we propose the Class2Simi strategy and practical implementation . Experimental results are discussed in Section 4 . We conclude our paper in Section 5 . 2 PROBLEM SETUP AND RELATED WORK . Let ( X , Y ) ∈ X × { 1 , . . . , C } be the random variables for instances and clean labels , where X represents the instance space and C is the number of classes . However , in many real-world applications ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; Tanno et al. , 2019 ; Zhang et al. , 2018 ) , the clean labels can not be observed . The observed labels are noisy . Let Ȳ be the random variable for the noisy labels . What we have is a sample { ( x1 , ȳ1 ) , . . . , ( xn , ȳn ) } drawn from the noisy distribution Dρ of the random variables ( X , Ȳ ) . Our aim is to learn a robust classifier that could assign clean labels to test data by exploiting the sample with noisy labels . Existing methods for learning with noisy labels can be divided into two categories : algorithms that result in statistically inconsistent or consistent classifiers . Methods in the first category usually employ heuristics to reduce the side-effect of noisy labels , e.g. , selecting reliable examples ( Yu et al. , 2019 ; Han et al. , 2018b ; Malach & Shalev-Shwartz , 2017 ) , reweighting examples ( Ren et al. , 2018 ; Jiang et al. , 2018 ; Ma et al. , 2018 ; Kremer et al. , 2018 ; Tanaka et al. , 2018 ; Reed et al. , 2015 ) , employing side information ( Vahdat , 2017 ; Li et al. , 2017 ; Berthon et al. , 2020 ) , and adding regularization ( Han et al. , 2018a ; Guo et al. , 2018 ; Veit et al. , 2017 ; Vahdat , 2017 ; Li et al. , 2017 ) . Those methods empirically work well in many settings . Methods in the second category aim to learn robust classifiers that could converge to the optimal ones defined by using clean data . They utilize the noise transition matrix , which denotes the probabilities that the clean labels flip into noisy labels , to build consistent algorithms ( Goldberger & Ben-Reuven , 2017 ; Patrini et al. , 2017 ; Thekumparampil et al. , 2018 ; Yu et al. , 2018 ; Liu & Guo , 2020 ; Zhang & Sabuncu , 2018 ; Kremer et al. , 2018 ; Liu & Tao , 2016 ; Northcutt et al. , 2017 ; Scott , 2015 ; Natarajan et al. , 2013 ; Yao et al. , 2020b ) . The idea is that given the noisy class posterior probability and the noise transition matrix , the clean class posterior probability can be inferred . Note that the noisy class posterior and the noise transition matrix can be estimated by exploiting the noisy data , where the noise transition matrix additionally needs anchor points ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . Some methods assume anchor points have already been given ( Yu et al. , 2018 ) . There are also methods showing how to identify anchor points from the noisy training data ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . 3 CLASS2SIMI MEETS NOISY SUPERVISION . In this section , we propose a new strategy for learning from noisy data . Our core idea is to transform class labels to similarity labels first , and then handle the noise manifested on similarity labels . 3.1 TRANSFORMATION ON LABELS AND THE TRANSITION MATRIX . As in Figure 1 , we combine every 2 instances in pairs , and if the two instances have the same class label , we assign this pair a similarity label 1 , otherwise 0 . If the class labels are corrupted , the generated similarity labels also contain noise . We denote the clean and noisy similarity labels of the example-pair ( xi , xj ) by Hij and H̄ij respectively . The definition of the similarity noise transition matrix is similar to the class one , denoting the probabilities that clean similarity labels flip into noisy similarity labels , i.e. , Ts , mn = P ( H̄ij = n|Hij = m ) . The dimension of the similarity noise transition matrix is always 2× 2 . Since the similarity labels are generated from class labels , the similarity noise is also determined and , thus can be calculated , by the class noise transition matrix . Theorem 1 . Assume that the dataset is balanced ( each class has the same amount of samples , and c classes in total ) , and the noise is class-dependent . Given a class noise transition matrix Tc , such that Tc , ij = P ( Ȳ = j|Y = i ) . The elements of the corresponding similarity noise transition matrix Ts can be calculated as Ts,00 = c2 − c− ( ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro ) c2 − c , Ts,01 = ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro c2 − c , Ts,10 = c− ||Tc||2Fro c , Ts,11 = ||Tc||2Fro c . A detailed proof is provided in Appendix A . Remark 1 . Theorem 1 can easily extend to the setting where the dataset is unbalanced in classes by multiplying each Tc , ij by a coefficient ni . ni is the number of examples from the i-th class . Note that the similarity labels are only dependent on class labels . If the class noise is class-dependent , the similarity noise is also “ class-dependent ” ( class means similar and dissimilar ) . Under classdependent label noise , a binary classification is learnable as long as T00 + T11 > 1 ( Menon et al. , 2015 ) , where T is the corresponding binary transition matrix ; a multi-class classification is learnable if the corresponding transition matrix Tc is invertible . For Class2Simi , in the most general sense , i.e. , Tc is invertible , Ts,00 + Ts,11 > 1 holds . Namely , the learnability of the pointwise classification implies the learnability of the reduced pairwise classification . However , the latter can not imply the former . A proof and a counterexample are provided in Appendix F. Theorem 2 . Assume that the dataset is balanced ( each class has the same amount of samples ) , and the noise is class-dependent . When the number of classes c ≥ 81 , the noise rate for the noisy similarity labels is lower than that of the noisy class labels . A detailed proof is provided in Appendix B . When dealing with label noise , a low noise rate has many benefits . The most important one is that the noise-robust algorithms will consistently achieve higher performance when the noise rate is lower ( Bao et al. , 2018 ; Han et al. , 2018b ; Xia et al. , 2019 ; Patrini et al. , 2017 ) . Another benefit is that , when the noise rate is low , the complex instance-dependent label noise can be well approximated by class-dependent label noise ( Cheng et al. , 2020 ) , which is easier to handle . After the Class2Simi transformation , the number of dissimilar pairs is ( c − 1 ) times as much as that of similar pairs . Meanwhile , compared with the original noise rate of class labels , the noise rate of similar pairs ( the ratio of the number of mislabeled similar pairs to the number of total real similar pairs ) is higher and the noise rate of dissimilar pairs is lower , while the overall noise rate of pairwise examples is lower , which partially reflects that the impact of the label noise is less bad . Moreover , the flip from dissimilar to similar should be more adversarial and thus more important . In practice , it is common that one class has more than one clusters , while it is rare that two or more classes are in the same cluster . If there is a flip from similar to dissimilar and based on it we split a ( latent ) cluster into two ( latent ) clusters , we still have a high chance to label these two clusters correctly later . If there is a flip from dissimilar to similar and based on it we join two clusters belonging to two classes into a single cluster , we nearly have zero chance to label this cluster correctly later . As a consequence , the flip from dissimilar to similar is more adversarial , and thus more important . To sum up , considering the reduction of the overall noise rate is meaningful .
This paper proposes a new algorithm on learning noisy datasets by transforming class labels into pairwise similarity labels. It also gives some theoretical analysis on the fact that the induced similarity noise transition matrix works better than the class noise transition matrix. The paper empirically demonstrates that the proposed method works well on several synthetic datasets and a large-scale real-world dataset.
SP:38c530428ad4a8b4bc956998fc9c53a09e1beddf
Class2Simi: A New Perspective on Learning with Label Noise
1 INTRODUCTION . It is expensive to label large-scale data accurately . Therefore , cheap datasets with label noise are ubiquitous in the era of big data . However , label noise will degenerate the performance of trained deep models , because deep networks will easily overfit label noise ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; 2018 ; Xia et al. , 2019 ; 2020 ) . In this paper , we propose a new perspective on handling label noise called “ Class2Simi ” , i.e. , transforming training examples with noisy class labels into pairs of examples with noisy similarity labels . A class label shows the class that an instance belongs to , while a similarity label indicates whether or not two instances belong to the same class . This transformation is motivated by the observation that the noise rate becomes lower , e.g. , even if two instances have incorrect class labels , their similarity label could be correct . In the label-noise learning community , a lower noise rate usually results in higher classification performance ( Han et al. , 2018b ; Patrini et al. , 2017 ) . Specifically , we illustrate the transformation and the robustness of similarity labels in Figure 1 . Assume we have eight noisy examples { ( x1 , ȳ1 ) , . . . , ( x8 , ȳ8 ) } as shown in the upper part of the middle column . Their labels are of four classes , i.e. , { 1 , 2 , 3 , 4 } . The labels marked in red are incorrect labels . We transform the 8 examples into 8× 8 example-pairs with noisy similarity labels as shown in the bottom part of the middle column , where the similarity label 1 means the two instances have the same class label and 0 means the two instances have different class labels . We present the latent clean class labels and similarity labels in the left column . In the middle column , we can see that although the instances x2 and x4 both have incorrect class labels , the similarity label of the example-pair ( x2 , x4 ) is correct . Similarity labels are robust because they further consider the information on the pairwise relationship . We prove that the noise rate in the noisy similarity labels is lower than that of the noisy class labels . For example , if we assume that the noisy class labels in Figure 1 are generated according to the latent clean labels and the transition matrix shown in the upper part of the right column ( the ij-th entry of the matrix denotes the probability that the clean class label i flips into the noisy class label j ) , the noise rate for the noisy class labels is 0.5 while the rate for the corresponding noisy similarity labels is 0.25 . Note that the noise rate is the ratio of the number of incorrect labels to the number of total examples , which can be calculated from the noise transition matrix combined with the proportion of each class , i.e. , 1/6× 3/4 + 1/2× 1/4 = 0.25 . It is obvious that Class2Simi suffers information loss because we can not recover the class labels from similarity labels . However , since the similarity labels are more robust to noise than the class labels , the advantage of the reduction of noise rate overweighs the disadvantage of the loss of information . Intuitively , in the learning process , it is the signal in the information that enhances the performance of the model , while the noise in the information is harmful to the model . Through Class2Simi , although the total amount of information is reduced , the signal to noise ratio is increased , and so would be the total amount of signals . Thus , we can benefit from the transformation and achieve better performances . Theorem 2 and the experimental results will verify the effectiveness of this transformation . It remains unsolved how to learn a robust classifier from the data with transformed noisy similarity labels . To solve this problem , we first estimate the similarity noise transition matrix , a 2 × 2 matrix whose entries denote the flip rates of similarity labels . Note that the transition matrix bridges the noisy similarity posterior and the clean similarity posterior . The noisy similarity posterior can be learned from the data with noisy similarity labels . Then , given the similarity noise transition matrix , we can infer the clean similarity posterior from the noisy similarity posterior . Since the clean similarity posterior is approximated by the inner product of the clean class posterior ( Hsu et al. , 2019 ) , the clean class posterior ( and thus the robust classifier ) can thereby be learned . We will empirically show that Class2Simi with the estimated similarity noise transition matrix will remarkably outperform the baselines even given with the ground-truth class noise transition matrix . The contributions of this paper are summarized as follows : • We propose a new perspective on learning with label noise , which transforms class labels into similarity labels . Such a transformation reduces the noise level . • We provide a way to estimate the similarity noise transition matrix by theoretically establishing its relation to the class noise transition matrix . We show that even if the class noise transition matrix is inaccurately estimated , the induced similarity noise transition matrix still works well . • We design a deep learning method to learn robust classifiers from data with noisy similarity labels and theoretically analyze its generalization ability . • We empirically demonstrate that the proposed method remarkably surpasses the baselines on many datasets with both synthetic noise and real-world noise . The rest of this paper is organized as follows . In Section 2 , we formalize the noisy multi-class classification problem , and in Section 3 , we propose the Class2Simi strategy and practical implementation . Experimental results are discussed in Section 4 . We conclude our paper in Section 5 . 2 PROBLEM SETUP AND RELATED WORK . Let ( X , Y ) ∈ X × { 1 , . . . , C } be the random variables for instances and clean labels , where X represents the instance space and C is the number of classes . However , in many real-world applications ( Zhang et al. , 2017 ; Zhong et al. , 2019 ; Li et al. , 2019 ; Yi & Wu , 2019 ; Zhang et al. , 2019 ; Tanno et al. , 2019 ; Zhang et al. , 2018 ) , the clean labels can not be observed . The observed labels are noisy . Let Ȳ be the random variable for the noisy labels . What we have is a sample { ( x1 , ȳ1 ) , . . . , ( xn , ȳn ) } drawn from the noisy distribution Dρ of the random variables ( X , Ȳ ) . Our aim is to learn a robust classifier that could assign clean labels to test data by exploiting the sample with noisy labels . Existing methods for learning with noisy labels can be divided into two categories : algorithms that result in statistically inconsistent or consistent classifiers . Methods in the first category usually employ heuristics to reduce the side-effect of noisy labels , e.g. , selecting reliable examples ( Yu et al. , 2019 ; Han et al. , 2018b ; Malach & Shalev-Shwartz , 2017 ) , reweighting examples ( Ren et al. , 2018 ; Jiang et al. , 2018 ; Ma et al. , 2018 ; Kremer et al. , 2018 ; Tanaka et al. , 2018 ; Reed et al. , 2015 ) , employing side information ( Vahdat , 2017 ; Li et al. , 2017 ; Berthon et al. , 2020 ) , and adding regularization ( Han et al. , 2018a ; Guo et al. , 2018 ; Veit et al. , 2017 ; Vahdat , 2017 ; Li et al. , 2017 ) . Those methods empirically work well in many settings . Methods in the second category aim to learn robust classifiers that could converge to the optimal ones defined by using clean data . They utilize the noise transition matrix , which denotes the probabilities that the clean labels flip into noisy labels , to build consistent algorithms ( Goldberger & Ben-Reuven , 2017 ; Patrini et al. , 2017 ; Thekumparampil et al. , 2018 ; Yu et al. , 2018 ; Liu & Guo , 2020 ; Zhang & Sabuncu , 2018 ; Kremer et al. , 2018 ; Liu & Tao , 2016 ; Northcutt et al. , 2017 ; Scott , 2015 ; Natarajan et al. , 2013 ; Yao et al. , 2020b ) . The idea is that given the noisy class posterior probability and the noise transition matrix , the clean class posterior probability can be inferred . Note that the noisy class posterior and the noise transition matrix can be estimated by exploiting the noisy data , where the noise transition matrix additionally needs anchor points ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . Some methods assume anchor points have already been given ( Yu et al. , 2018 ) . There are also methods showing how to identify anchor points from the noisy training data ( Liu & Tao , 2016 ; Patrini et al. , 2017 ) . 3 CLASS2SIMI MEETS NOISY SUPERVISION . In this section , we propose a new strategy for learning from noisy data . Our core idea is to transform class labels to similarity labels first , and then handle the noise manifested on similarity labels . 3.1 TRANSFORMATION ON LABELS AND THE TRANSITION MATRIX . As in Figure 1 , we combine every 2 instances in pairs , and if the two instances have the same class label , we assign this pair a similarity label 1 , otherwise 0 . If the class labels are corrupted , the generated similarity labels also contain noise . We denote the clean and noisy similarity labels of the example-pair ( xi , xj ) by Hij and H̄ij respectively . The definition of the similarity noise transition matrix is similar to the class one , denoting the probabilities that clean similarity labels flip into noisy similarity labels , i.e. , Ts , mn = P ( H̄ij = n|Hij = m ) . The dimension of the similarity noise transition matrix is always 2× 2 . Since the similarity labels are generated from class labels , the similarity noise is also determined and , thus can be calculated , by the class noise transition matrix . Theorem 1 . Assume that the dataset is balanced ( each class has the same amount of samples , and c classes in total ) , and the noise is class-dependent . Given a class noise transition matrix Tc , such that Tc , ij = P ( Ȳ = j|Y = i ) . The elements of the corresponding similarity noise transition matrix Ts can be calculated as Ts,00 = c2 − c− ( ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro ) c2 − c , Ts,01 = ∑ j ( ∑ i Tc , ij ) 2 − ||Tc||2Fro c2 − c , Ts,10 = c− ||Tc||2Fro c , Ts,11 = ||Tc||2Fro c . A detailed proof is provided in Appendix A . Remark 1 . Theorem 1 can easily extend to the setting where the dataset is unbalanced in classes by multiplying each Tc , ij by a coefficient ni . ni is the number of examples from the i-th class . Note that the similarity labels are only dependent on class labels . If the class noise is class-dependent , the similarity noise is also “ class-dependent ” ( class means similar and dissimilar ) . Under classdependent label noise , a binary classification is learnable as long as T00 + T11 > 1 ( Menon et al. , 2015 ) , where T is the corresponding binary transition matrix ; a multi-class classification is learnable if the corresponding transition matrix Tc is invertible . For Class2Simi , in the most general sense , i.e. , Tc is invertible , Ts,00 + Ts,11 > 1 holds . Namely , the learnability of the pointwise classification implies the learnability of the reduced pairwise classification . However , the latter can not imply the former . A proof and a counterexample are provided in Appendix F. Theorem 2 . Assume that the dataset is balanced ( each class has the same amount of samples ) , and the noise is class-dependent . When the number of classes c ≥ 81 , the noise rate for the noisy similarity labels is lower than that of the noisy class labels . A detailed proof is provided in Appendix B . When dealing with label noise , a low noise rate has many benefits . The most important one is that the noise-robust algorithms will consistently achieve higher performance when the noise rate is lower ( Bao et al. , 2018 ; Han et al. , 2018b ; Xia et al. , 2019 ; Patrini et al. , 2017 ) . Another benefit is that , when the noise rate is low , the complex instance-dependent label noise can be well approximated by class-dependent label noise ( Cheng et al. , 2020 ) , which is easier to handle . After the Class2Simi transformation , the number of dissimilar pairs is ( c − 1 ) times as much as that of similar pairs . Meanwhile , compared with the original noise rate of class labels , the noise rate of similar pairs ( the ratio of the number of mislabeled similar pairs to the number of total real similar pairs ) is higher and the noise rate of dissimilar pairs is lower , while the overall noise rate of pairwise examples is lower , which partially reflects that the impact of the label noise is less bad . Moreover , the flip from dissimilar to similar should be more adversarial and thus more important . In practice , it is common that one class has more than one clusters , while it is rare that two or more classes are in the same cluster . If there is a flip from similar to dissimilar and based on it we split a ( latent ) cluster into two ( latent ) clusters , we still have a high chance to label these two clusters correctly later . If there is a flip from dissimilar to similar and based on it we join two clusters belonging to two classes into a single cluster , we nearly have zero chance to label this cluster correctly later . As a consequence , the flip from dissimilar to similar is more adversarial , and thus more important . To sum up , considering the reduction of the overall noise rate is meaningful .
This paper presented a working framework for learning a robust classifier with noisy labels. It proves that if the number of the classes is more than 8 then the noise rate in the similarity matrix is less than that in the noise rate in labels. Hence after learning classifiers from noisy labels, it updates the classifier using entropy loss between predicted similarity matrix and actual similarity matrix calculated from similarity matrix from data multiplied with noisy transition matrix derived using existing techniques(Xia et al., 2019; Patrini et al., 2017).
SP:38c530428ad4a8b4bc956998fc9c53a09e1beddf
Overcoming barriers to the training of effective learned optimizers
1 INTRODUCTION . Much of the success of modern deep learning has been driven by a shift from hand-designed features carefully curated by human experts , to domain-agnostic methods that can learn features from large amounts of data . By leveraging large-scale datasets with flexible models , we are now able to rapidly learn powerful features for new problem settings that often generalize to novel tasks . While learned features outperform hand-designed features on numerous tasks ( Krizhevsky et al. , 2012 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Piech et al. , 2015 ) , we continue to use hand-designed optimization algorithms ( such as gradient descent , momentum , and so on ) for training models . These hand-designed update rules benefit from decades of optimization research but still require extensive expert supervision in order to be used effectively in machine learning . For example , they fail to flexibly adapt to new problem settings and require careful tuning of learning rate schedules and momentum timescales for different model architectures and datasets ( Choi et al. , 2019 ) . In addition , most do not leverage alternative sources of information beyond the gradient , such as the validation loss . By separating the optimization target ( training loss ) from the broader goal ( generalization ) , classic methods require more careful tuning of regularization and/or data augmentation strategies by the practitioner . To address these drawbacks , recent work on learned optimizers aims to replace hand-designed optimizers with a parametric optimizer , trained on a set of tasks , that can then be applied more generally . Recent work in this area has focused on either augmenting existing optimizers to adapt their own hyperparameters ( Daniel et al. , 2016 ; Xu et al. , 2017 ; 2019 ) , or developing more expressive learned optimizers to replace existing optimizers entirely ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Lv et al. , 2017 ; Metz et al. , 2018 ; 2019a ; b ; Gu et al. , 2019 ) . These latter models take in problem information ( such as the current gradient of the training loss ) and iteratively update parameters . However , to date , learned optimizers have proven to be brittle and ineffective at generalizing across diverse sets of problems . Our work identifies fundamental barriers that have limited progress in learned optimizer research and addresses several of these barriers to train effective optimizers : 1 . Computational scale : Training a learned optimizer is costly . When training the optimizer , a single training step requires applying the optimizer to a training task for some number of unrolled steps . This work utilizes massive parallel computing infrastructure to scale the number of unrolled steps an order of magnitude larger than in previous work . 2 . Training tasks : Deep learning requires large training datasets . For learned optimizers to be effective , we similarly need a large dataset of optimization tasks on which to train . We build off of the TaskSet dataset ( Metz et al. , 2020 ) and construct a dataset of more than a six thousand diverse optimization tasks commonly found in machine learning . We show how this large and diverse task distribution is critical for training optimizers that generalize . 3 . Inductive bias of optimizer architecture : The parameterization of the learned optimizer and the task information fed to it both strongly affect performance . We propose a new hierarchical learned optimizer architecture that incorporates additional task information ( such as validation loss ) , and show that it outperforms previous learned optimizer architectures . By addressing these barriers , we develop learned optimizers that exceed prior work in scale , robustness , and out of distribution generalization . As a final test , we show that the learned optimizer can be used to train new learned optimizers from scratch ( analogous to “ self-hosting ” compilers ( Hart and Levin , 1962 ) ) . 2 PRELIMINARIES . Training a learned optimizer is a bilevel optimization problem that contains two loops : an inner loop that applies the optimizer to solve a task , and an outer loop that iteratively updates the parameters of the learned optimizer ( Franceschi et al. , 2018 ) . We use the inner- and outer- prefixes throughout to be explicit about which optimization loop we are referring to . That is , the inner-loss refers to a target task ’ s loss function that we wish to optimize , and the outer-loss refers to a measure of the optimizer ’ s performance training the target task ( inner-task ) . Correspondingly , we refer to the optimizer parameters as outer-parameters , and the parameters that the optimizer is updating as inner-parameters . Outer-optimization refers to the act of finding outer-parameters that perform well under some outer-loss . For a given inner-task , we apply the learned optimizer for some number of steps ( unrolling the optimizer ) . Ideally , we would unroll each target task until some stopping criterion is reached , but this is computationally infeasible for even moderate scale machine learning tasks . Each outer-iteration requires unrolling the optimizer on a target task . Short ( truncated ) unrolls are more computationally efficient , but suffer from truncation bias Wu et al . ( 2016 ) ; Metz et al . ( 2019b ) in that the outer-loss surface computed using truncated unrolls is different ( and may have different minima ) than the fully unrolled outer-loss . 3 METHODS : ADDRESSING THE THREE BARRIERS TO LEARNED OPTIMIZERS . 3.1 OUTER-OPTIMIZATION . To train the optimizer , we minimize an outer-loss that quantifies the performance of the optimizer . This is defined as the mean of the inner-loss computed on the inner-validation set for some number of unrolled steps , averaged over inner-tasks in the outer-training taskset . Although this outer-loss is differentiable , it is costly to compute the outer-gradient ( which involves backpropagating through the unrolled optimization ) . In addition , the outer-loss surface is badly conditioned and extremely non-smooth Metz et al . ( 2019b ) , making it difficult to optimize . We deal with these issues by using derivative-free optimization–specifically , evolutionary strategies ( ES ) Rechenberg ( 1973 ) –to minimize the outer-loss , obviating the need to compute derivatives through the unrolled optimization process . Previous work has used unrolled derivatives ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Metz et al. , 2019b ) , and was thus limited to short numbers of unrolled steps ( e.g . 20 in Andrychowicz et al . ( 2016 ) and starting at 50 in Metz et al . ( 2019b ) ) . Without ES , the gradient estimates we obtain are extreamly high variance to the point that no training occurs . Using ES , we are able to use considerably longer unrolls . Initial unroll lengths were chosen to balance communication cost between parallel workers ( updating optimizer parameters ) with the computational cost of unrolling on individual workers ( estimating the local gradient with ES ) . We start outer-training by sampling unroll steps uniformly from 240-360 . When performance saturates with these biased gradients , continue training with an unbiased , but more expensive , gradient estimator ( see Appendix B ) . ES and PES have an additional benefit , in that optimizing with ES smooths the underlying loss function . This smoothing helps stabilize outer-training ( Metz et al. , 2019b ) . We set the standard deviation of the Gaussian distribution used by the ES algorithm ( which also controls how much the outer-loss is smoothed ) to 0.01 . To deal with the high variance of the ES estimate of the gradient , we use antithetic sampling and train in in parallel using 1024 multi-core CPU workers . While using more workers increases training speed , we find 1024 to be the point where performance gains become sub-linear . For more details see Appendix B . 3.2 TASK DISTRIBUTIONS . To train the optimizer , we need to define a set of inner-tasks to use for training . The choice of training tasks is critically important for two reasons : it determines the ability of the optimizer to outer-generalize ( i.e . the learned optimizer ’ s performance on new tasks ) , and it determines the computational complexity of outer-training . For improved outer-generalization , we would like our inner-problems to be representative of tasks we care about . In this work , these are state-of-the-art machine learning models such as ResNets ( He et al. , 2016a ) or Transformers ( Vaswani et al. , 2017 ) . Unfortunately , directly utilizing these large scale models is computationally infeasible , therefore we outer-train on proxy tasks for speed ( Zoph et al. , 2018 ) . In order to outer-train a learned optimizer capable of generalizing to new optimization tasks , we utilize an outer-training task set consisting of around 6,000 tasks designed after Metz et al . ( 2020 ) . These tasks include RNNs ( Hochreiter and Schmidhuber , 1997 ; Chung et al. , 2014 ) , CNNs ( LeCun , 1998 ) , masked auto regressive flows ( Papamakarios et al. , 2017 ) , fully connected networks , language modeling , variational autoencoders ( Kingma and Welling , 2013 ) , simple 2D test functions , quadratic bowls , and more . For tasks that require them , we additionally sample a dataset , batch size , network architecture , and initialization scheme . To keep outer-training efficient , we ensure that all tasks take less than 100 milliseconds per-training step . For each task that makes use of a dataset , we create four splits of the data to prevent leakage : training data , which we compute gradients on and use to update the inner-parameters ; inner-validation data , which is used to compute validation losses used by the learned optimizer ; outer-validation data , which is used to update the weights of the learned optimizer ; and test data , which is used to test an already trained learned optimizer . Because loss values vary in magnitude , when outer-training we normalize these outer-loss values by the best loss achieved by a baseline optimizer and the initial loss value . Note this normalization is not used during inner-training . 3.3 OPTIMIZER ARCHITECTURE . Designing a learned optimizer architecture requires balancing computational efficiency and expressivity . Past work in learned optimizers has shown that incorporating inductive biases based on existing optimization techniques such as momentum or second moment accumulation leads to better performance ( Wichrowska et al. , 2017 ; Metz et al. , 2019b ) . The optimizer we use in this work consists of a hierarchical optimizer similar to ( Wichrowska et al. , 2017 ) ( Figure 1 ) . A per-tensor LSTM is run on features computed over each parameter tensor . This LSTM then forwards information to the other tensors ’ LSTMs as well as to a per-parameter feedforward neural network . The per-parameter feedforward network additionally takes in information about gradients and parameter value , and outputs parameter updates . Additional outputs are aggregated and fed back into the per-tensor network . This information routing allows for communication across all components . For per-parameter features we leverage effective inductive biases from hand-designed optimizers , and use a variety of features including the gradient , the parameter value , and momentum-like running averages of both . All features are normalized , in a fashion similar to that in RMSProp ( Tieleman and Hinton , 2012 ) , or relative to the norm across the full tensor . For per-tensor features we use a variety of features built from summary statistics computed from the current tensor , the tensor ’ s gradient , and running average features such as momentum and second moments . We also include information about the tensor ’ s rank and shape . We also feed global features into the per-tensor LSTM , such as training loss and validation loss , normalized so as to have a relatively consistent scale across tasks . To compute a weight update , the per-parameter MLP outputs two values , ( a , b ) , which are used to update inner-parameters : wt+1 = wt + exp ( a ) b . See Appendix C for many more details .
The goal of a learned optimizer is to replace a human-designed optimizer with a parametric optimizer. However, prior learned optimizers were ineffective at generalizing to a diverse set of tasks. This paper investigates how to learn a useful optimizer by increasing computational scale, building a large, diverse training dataset, and designing the learned optimizer's architecture.
SP:cc0f8de167292fb0c4030746628536907cb3913a