paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
Distribution Matching in Deep Generative Models with Kernel Transfer Operators | 1 Introduction . Generative modeling , in its unconditional form , refers to the problem of estimating the data generating distribution : given i.i.d . samples X with an unknown distribution PX , a generative model seeks to find a parametric distribution that closely resembles PX . In modern deep generative models , we often approach this problem via a latent variable – i.e. , we assume that there is some variable Z ∈ Z associated with the observed data X ∈ X that follows a known distribution PZ ( also referred to as the prior in generative models ) . Thus , we can learn a mapping f : Z → X such that the distribution after transformation , denoted by Pf ( Z ) , aligns well with the data generating distribution PX . Therefore , sampling from PX becomes convenient since PZ can be efficiently sampled . Frequently , f is parameterized by deep neural networks and optimized with stochastic gradient descent ( SGD ) . Existing generative modeling methods variously optimize the transformation f , most commonly modeling it as a Maximum Likelihood Estimation ( MLE ) or distribution matching problem . For instance , given data X = { x1 , . . . , xn } , a variational autoencoder ( VAE ) ( Kingma & Welling , 2013 ) first constructs Z through the approximate posterior qZ|X and maximizes a lower bound of likelihood pf ( Z ) ( X ) . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) relies on a simultaneously learned discriminator such that samples of Pf ( Z ) are indistinguishable from X . Results in ( Arjovsky et al. , 2017 ; Li et al. , 2017 ) suggest that GANs minimize the distributional discrepancies between Pf ( Z ) and PX . Flow-based generative models optimize pf ( Z ) ( X ) explicitly through the change of variable rule and efficiently calculating the Jacobian determinant of the inverse mapping f−1 . In all examples above , the architecture or objective notwithstanding , the common goal is to find a suitable function f that reduces the difference between Pf ( Z ) and PX . Thus , a key component in many deep generative models is to learn a forward operator as defined below . Definition 1.1 ( Forward operator ) . A forward operator f ? ∈ C : Z → X is defined to be a mapping associated with some latent variable Z ∼ PZ such that f ? = arg minf∈C d ( Pf ( Z ) , PX ) for some function class C and a distance measure d ( · , · ) . Motivation : The specifics of the forward operator may differ from case to case . But its properties and how it is estimated numerically greatly influences the empirical performance of the model . For instance , mode collapse issues in GANs are well known and solutions continue to emerge ( Srivastava et al. , 2017 ) . To learn the forward operator , VAEs use an approximate posterior qZ|X that may sometimes fail to align with the prior ( Kingma et al. , 2016 ; Dai & Wipf , 2019 ) . Flow-based generative models enable direct access to the posterior likelihood , yet in order to tractably evaluate the Jacobian of the transformation during training , one must either restrict the expressiveness at each layer ( Dinh et al. , 2017 ; Kingma & Dhariwal , 2018 ) or use more involved solutions ( Chen et al. , 2018 ) . Of course , solutions to mitigate these weaknesses ( Ho et al. , 2019 ) remains an active area of research . The starting point of our work is to evaluate the extent to which we can radically simplify the forward operator in deep generative models . Consider some desirable properties of a hypothetical forward operator ( in Def . ( 1.1 ) ) : ( a ) Upon convergence , the learned operator f ? minimizes the distance between PX and Pf ( Z ) over all possible operators of a certain class . ( b ) The training directly learns the mapping from the prior distribution PZ , rather than a variational approximation . ( c ) The forward operator f ? can be efficiently learned and sample generation is also efficient . It would appear that these criteria violate the “ no free lunch rule ” , and some compromise must be involved . Our goal is to investigate this trade-off : which design choices can make this approach work ? Specifically , a well studied construct in dynamical systems , namely the Perron-Frobenius operator ( Lemmens & Nussbaum , 2012 ) , suggests an alternative linear route to model the forward operator . Here , we show that if we are willing to give up on a few features in existing models – this may be acceptable depending on the downstream use case – then , the forward operator in generative models can be efficiently approximated as the estimation of a closed-form linear operator in the reproducing kernel Hilbert space ( RKHS ) . With simple adjustments of existing results , we identify a novel way to replace the expensive training for generative tasks with a simple principled kernel approach . Contributions . Our results are largely based on results in kernel methods and dynamical systems , but we demonstrate their relevance in generative modeling and complement recent ideas that emphasize links between deep generative models and dynamical systems . Our contributions are ( a ) We propose a non-parametric method for transferring a known prior density linearly in RKHS to an unknown data density – equivalent to learning a nonlinear forward operator in the input space . When compared to its functionally-analogous module used in other deep generative methods , our method avoids multiple expensive training steps yielding significant efficiency gains ; ( b ) We evaluate this idea in multiple scenarios and show competitive generation performance and efficiency benefits with pre-trained autoencoders on popular image datasets including MNIST , CIFAR-10 , CelebA and FFHQ ; ( c ) As a special use case , we demonstrate the advantages over other methods in limited data settings . 2 Preliminaries We briefly introduce reproducing kernel Hilbert space ( RKHS ) and kernel embedding of probability distributions , concepts we will use frequently . Definition 2.1 ( RKHS ( Aronszajn , 1950 ) ) . For a set X , let H be a set of functions g : X → R. Then , H is a reproducing kernel Hilbert space ( RKHS ) with a product 〈· , ·〉H if there exists a function k : X × X → R ( called a reproducing kernel ) such that ( i ) ∀x ∈ X , g ∈ H , g ( x ) = 〈g , k ( x , · ) 〉H ; ( ii ) H = cl ( span ( { k ( x , · ) , x ∈ X } ) ) , where cl ( · ) is the set closure . The function φ ( x ) = k ( x , · ) : X → H is referred to as the feature mapping of the induced RKHS H. A useful identity derived from feature mappings is the kernel mean embedding : it defines a mapping from a probablity measure in X to an element in the RKHS . Definition 2.2 ( Kernel Mean Embedding ( Smola et al. , 2007 ) ) . Given a probability measure p on X with an associated RKHS H equipped with a reproducing kernel k such that supx∈X k ( x , x ) < ∞ , the kernel mean embedding of p in RKHS H , denoted by µp ∈ H , is defined as µp = Ep [ φ ( x ) ] = ∫ k ( x , · ) p ( x ) dx , and the mean embedding operator E : L1 ( X ) → H is defined as µp = Ep . Remark 1 . For characteristic kernels , the operator E is injective . Thus , two distributions ( p , q ) in X are identical iff Ep = Eq . This property allows using of Maximum Mean Discrepancy ( MMD ) for distribution matching ( Gretton et al. , 2012 ; Li et al. , 2017 ) and is common , see ( Muandet et al. , 2017 ; Zhou et al. , 2018 ) . For a finite number of samples { xi } ni=1 drawn from the probability measure p , an unbiased empirical estimate of µH is µ̂H = 1 n ∑n i=1 k ( xi , · ) such that limn→∞ 1 n ∑n i=1 k ( xi , · ) = µH . Next , we review the covariance/cross covariance operators , two widely-used identities in kernel methods ( Fukumizu et al. , 2013 ; Song et al. , 2013 ) and building blocks of our approach . Definition 2.3 ( Covariance/Cross-covariance Operator ) . Let X , Z be random variables defined on X × Z with joint distribution PX , Z and marginal distributions PX , PZ . Let ( l , φ , H ) and ( k , ψ , G ) be two sets of ( a ) bounded kernel , ( b ) their corresponding feature map , and ( c ) their induced RKHS , respectively . The ( uncentered ) covariance operator CZZ : H → H and cross-covariance operator CXZ : H → G are defined as CZZ , Ez∼PZ [ φ ( z ) ⊗ φ ( z ) ] CXZ , E ( x , z ) ∼PX , Z [ ψ ( x ) ⊗ φ ( z ) ] ( 1 ) where ⊗ is the outer product operator . 3 Simplifying the estimation of the forward operator . Forward operator as a dynamical system : The dynamical system view of generative models has been described by others ( Chen et al. , 2018 ; Grathwohl et al. , 2019 ; Behrmann et al. , 2019 ) . These strategies model the evolution of latent variables in a residual neural network in terms of its dynamics over continuous or discrete time t , and consider the output function f as the evaluation function at a predetermined boundary condition t = t1 . Specifically , given an input ( i.e. , initial condition ) z ( t0 ) , f is defined as f ( z ( t0 ) ) = z ( t0 ) + ∫ t1 t0 ∆t ( z ( t ) ) dt ( 2 ) where ∆t is a time-dependent neural network function and z ( t ) is the intermediate solution at t. This view of generative models is not limited to specific methods or model archetypes , but generally useful , for example , by viewing the outputs of each hidden layer as evaluations in discrete-time dynamics . After applying f on a random variable Z ∈ Z , the marginal density of the output over any subspace Λ ⊆ X can be expressed as∫ Λ pf ( Z ) ( x ) dx = ∫ z∈f−1 ( Λ ) pZ ( z ) dz ( 3 ) If there exists some neural network instance ∆ ? t such that the corresponding output function f ? satisfies PX = Pf ? ( Z ) , by Def . 1.1 , f ? is a forward operator . Let X be a set of i.i.d . samples drawn from PX . In typical generative learning , either maximizing the likelihood 1|X| ∑ x∈X pf ( Z ) ( x ) or minimizing the distributional divergence d ( Pf ( Z ) , PX ) requires evaluating and differentiating through f or f−1 many times . Towards a one-step estimation of forward operator : Since f and f−1 in ( 3 ) will be highly nonlinear in practice , evaluating and computing the gradients can be expensive . Nevertheless , the dynamical systems literature suggests a linear extension of f∗ , namely the Perron-Frobenius operator or transfer operator , that conveniently transfers pZ to pX . Definition 3.1 ( Perron-Frobenius operator ( Mayer , 1980 ) ) . Given a dynamical system f : X → X , the Perron-Frobenius ( PF ) operator P : L1 ( X ) → L1 ( X ) is an infinitedimensional linear operator defined as ∫ Λ ( PpZ ) ( x ) dx = ∫ z∈f−1 ( Λ ) pZ ( z ) dz for all Λ ⊆ X . Although in Def . 3.1 , the PF operator P is defined for self-maps , it is trivial to extend P to mappings f : Z → X by restricting the RHS integral ∫ z∈f−1 ( Λ ) pZ ( z ) dz to Z . It can be seen that , for the forward operator f∗ , the corresponding PF operator P satisfies pX = PpZ . ( 4 ) If P can be efficiently computed , transferring the tractable density pZ to the target density pX can be accomplished simply by applying P. However , since P is an infinite-dimensional operator on L1 ( X ) , it is impractical to instantiate it explicitly and exactly . Nonetheless , there exist several methods for estimating the Perron-Frobenius operator , including Ulam ’ s method ( Ulam , 1960 ) and the Extended Dynamical Mode Decomposition ( EDMD ) ( Williams et al. , 2015a ) . Both strategies project P onto a finite number of hand-crafted basis functions – this may suffice in many settings but may fall short in modeling highly complex dynamics . Kernel-embedded form of PF operator : A natural extension of PF operator is to represent P by an infinite set of functions ( Klus et al. , 2020 ) , e.g. , projecting it onto the bases of an RKHS via the kernel trick . There , for a characteristic kernel l , the kernel mean embedding uniquely identifies an element µX = ElpX ∈ G for any pX ∈ L1 ( X ) . Thus , to approximate P , we may alternatively solve for the dynamics from pZ to pX in their embedded form . Using Tab . 1 notations , we have the following linear operator that defines the dynamics between two embedded densities . Definition 3.2 ( Kernel-embedded Perron-Frobenius operator ( Klus et al. , 2020 ) ) . Given pZ ∈ L1 ( X ) and pX ∈ L1 ( X ) . Denote k as the input kernel and l as the output kernel . Let µX = ElpX and µZ = EkpZ be their corresponding mean kernel embeddings . The kernel-embedded Perron-Frobenius ( kPF ) operator , denoted by PE : H → G , is defined as PE = CXZC−1ZZ ( 5 ) Proposition 3.1 ( Song et al . ( 2013 ) ) . With the above definition , PE satisfies µX = PEµZ ( 6 ) under the conditions : ( i ) CZZ is injective ( ii ) µt ∈ range ( CZZ ) ( iii ) E [ g ( X ) |Z = · ] ∈ H for any g ∈ G. The last two assumptions can sometimes be difficult to satisfy for certain RKHS ( see Theorem 2 of Fukumizu et al . ( 2013 ) ) . In such cases , a relaxed solution can be constructed by replacing C−1ZZ by a regularized inverse ( CZZ + λI ) −1 or a Moore-Penrose pseudoinverse C † ZZ . The following proposition shows commutativity between the ( kernel-embedded ) PF operator and the mean embedding operator , showing its equivalence to P when l is characteristic . Proposition 3.2 ( ( Klus et al. , 2020 ) ) . With the above notations , El ◦ P = PE ◦ Ek . Transferring embedded densities with the kPF operator : The kPF operator is a powerful tool that allows transferring embedded densities in RKHS . The main steps are : ( 1 ) Use mean embedding operator El on pZ . Let us denote it by µZ . ( 2 ) Transfer µZ using kPF operator PE to get the mean embedded pX , given by µX . Of course , in practice with finite data , { xi } i∈ [ n ] ∼ PX and { zi } i∈ [ n ] ∼ PX , PE must be estimated empirically ( see Klus et al . ( 2020 ) for an error analysis ) . P̂E = ĈXZ ( ĈZZ ) −1 ≈ Ψ ( ΦTΦ + λnI ) −1ΦT ≈ Ψ ( ΦTΦ ) †ΦT where Φ = [ k ( z1 , · ) , · · · , k ( zn , · ) ] , Ψ = [ l ( x1 , · ) , · · · , l ( xn , · ) ] are simply the corresponding feature matrices for samples of PX and PZ , and λ is a small penalty term . Learning kPF for unconditional generative modeling : Some generative modeling methods such as VAEs and flow-based formulations explicitly model the latent variable Z as conditionally dependent on the data variable X . This allows deriving/optimizing the likelihood pf ( Z ) ( X ) . This is desirable but may not be essential in all applications . To learn a kPF , however , X and Z can be independent RVs . While it may not be immediately obvious why we could assume this independence , we can observe the following property for the empirical kPF operator , assuming that the empirical covariance operator ĈZZ is non-singular : P̂E µ̂Z = ĈXZ Ĉ−1ZZ µ̂Z = ΨΦ > ︸ ︷︷ ︸ ĈXZ ( ΦΦ > ︸ ︷︷ ︸ ĈZZ ) −1Φ1n = Ψ ( Φ > Φ ) −1Φ > Φ1n = Ψ1n = µ̂X ( 7 ) Suppose that { xi } i∈ [ n ] and { zj } i∈ [ n ] are independently sampled from the marginals PX and PZ . It is easy to verify that ( 7 ) holds for any pairing { ( xi , zj ) } ( i , j ) ∈ [ n ] × [ n ] . However , instantiating the RVs in this way rules out the use of kPF for certain downstream tasks such as controlled generation or mode detection , since Z does not contain information regarding X . Nevertheless , if sampling is our only goal , then this instantiation of kPF will suffice . Mapping Z to G : Now , since PE is a deterministic linear operator , we can easily set up a scheme to map samples of Z to elements of G where the expectation of the mapped samples equals µX Define φ ( z ) = k ( z , · ) and ψ ( x ) = l ( x , · ) as feature maps of kernels k and l. We can rewrite µX as µX = PEEkpZ = PEEZ [ φ ( Z ) ] = EZ [ PE ( φ ( Z ) ) ] = EZ [ ψ ( ψ−1 ( PEφ ( Z ) ) ) ] ( 8 ) Here ψ−1 is the inverse or the preimage map of ψ . Such an inverse , in general , may not exist ( Kwok & Tsang , 2004 ; Honeine & Richard , 2011 ) . We will discuss a procedure to approximate ψ−1 in §4.1 . In what follows , we will temporarily assume that an exact preimage map exists and is tractable to compute . Define Ψ∗ = P̂Eφ ( Z ) as the transferred sample in G using the empirical embedded PF operator P̂E . Then the next result shows that asymptotically the transferred samples converge in distribution to the target distribution . Proposition 3.3 . As n → ∞ , ψ−1 ( Ψ∗ ) D→ PX . That is , the preimage of the transferred sample approximately conforms to PX under previous assumptions when n is large . Proof . Since P̂E asymp.→ P , the proof immediately follows from ( 8 ) . | The paper proposes to leverage the Perron-Frobenius operator to simplify the mapping from Z -> X in latent variable generative models. Specifically, this “forward operator” can be approximated by a closed-form linear operator in the RKHS. They evaluate their method on both synthetic settings and high-dimensional image datasets such as MNIST, CIFAR-10, CelebA, and FFHQ. | SP:25694c2c1a190114854a49d57a3abdd336c88b2f |
Embedding models through the lens of Stable Coloring | 1 INTRODUCTION . Embedding models are ubiquitous in wide range of real-world applications such as information retrieval ( Zuccon et al. , 2015 ) , natural language processing ( NLP ) ( Mikolov et al. , 2013a ; b ) , graph classification ( Grover & Leskovec , 2016 ; Hamilton et al. , 2017 ) and many more . These models map categorical entities to continuous dense representations ( typically in Rd ) which provide a continuous measure of semantic similarity across categorical entities . Nowadays , there is a heavy dependence on unsupervised pre-trained embedding models across domains like Transformers in NLP ( Devlin et al. , 2019 ) , Visual Transformers ( ViT ) in Computer Vision ( Dosovitskiy et al. , 2020 ) , Graph Neural Networks ( Hamilton et al. , 2017 ; Xu et al. , 2019b ) since they learn rich semantic representations of entities from massive amounts of unlabelled data . With little finetuning , these models achieve stateof-the-art results on most of the supervised downstream tasks like sentiment analysis ( Xu et al. , 2019a ) , object detection ( Beal et al. , 2020 ) , and graph classification ( Xu et al. , 2019b ) . Historically , embedding models were developed almost independently across structured domains such as NLP , graphs , images , and so on . These algorithms use the neighborhood structure around an entity to obtain the embedding for the entity . Interestingly , a popular hypothesis in NLP - Distributional Hypothesis states that the “ meaning ” of the word is determined by its context ( neighbors ) ( Harris , 1954 ; Sahlgren , 2008 ) . This hypothesis forms the basis of most unsupervised embedding learning models in NLP ( Mikolov et al. , 2013a ; b ; Pennington et al. , 2014b ; Bojanowski et al. , 2017 ; Sonkar et al. , 2020 ) . Similarly , non-local-means , a denoising algorithm in signal processing , tries to find pixels that should be the same based on the similarity of its neighborhood structure ( patch of the image around the pixel in this case ) ( Awate & Whitaker , 2006 ; Buades et al. , 2005 ) . Even Graph neural network ( GNN ) architectures ensure that information of the surrounding neighbors is systematically incorporated in the embedding of a node , even in supervised settings ( Hamilton et al. , 2017 ; Maron et al. , 2019 ; Xu et al. , 2019b ) . Thus somehow various communities working across diverse domains have narrowed down on an entity ’ s neighborhood structure to define the entity ’ s meaning . In this paper , we try to establish this common principle on mathematically robust grounds . Structured domains can be easily represented as graphs with relations between entities as edges in the graphs . For example in NLP words can be treated as nodes of some graph , and co-occurrence relation between words can be represented as an edge . As mentioned before that graph embedding architectures capture the topological structure around the node in the node embeddings , and if structured domains can be represented as graphs , this raises the question do embedding models from structured domains like NLP and Vision also operate on some domain induced graph and capture neighborhood structural properties in their entity embeddings since we have seen that embedding models across these domains tend to capture “ neighborhood ” information ? To answer this question , we dive into combinatorial graph theory to understand how to define the notion of structural equivalence a.k.a . isomorphic structures . Weisfeiler-Lehman ( 1-WL ) algorithm ( or color refinement algorithm ) is the most popular heuristic used to identify graph isomorphism ( Weisfeiler & Leman , 1968 ) and can distinguish a broad class of graphs ( Babai & Kucera , 1979 ) . The fixed point solution of 1-WL is called a stable-coloring and has the property that any two nodes with the same color have the same multi-set of colors in their neighborhood . In essence it means if two nodes have the same color , the graph looks structurally identical from these nodes . Finally to answer the question if embedding models from structured domains capture the domain induced graph ’ s topological properties in their entity embeddings , one can find links between the mechanics of these models and stable coloring / 1-WL algorithm . In this paper , we establish this connection by providing a general framework linking existing algorithms to stable coloring . We propose a more flexible version of stable coloring ( SC ) called continuous stable coloring ( CSC ) — a strict generalization of SC . CSC states that the similarity of their neighborhoods determines the similarity of two nodes . Based on this notion , we define a series of optimization problems to solve the problem of CSC . We show that various algorithms in NLP like word2vec , AWE , BERT ( Devlin et al. , 2019 ) , images processing like Visual Transformer ( Dosovitskiy et al. , 2020 ) , graphs like Node2Vec ( Grover & Leskovec , 2016 ) , etc . are essentially solving different instantiations of this common optimization problem . Current research already establishes the link between the 1-WL algorithm ( Grohe , 2020 ; Morris et al. , 2021 ; Shervashidze et al. , 2011 ; Morris et al. , 2017 ) and GNN architectures , which has sparked a new line of research in improving GNN architectures ( Hamilton et al. , 2017 ; Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020a ; b ) . We hope that the new link we establish between stable coloring and unsupervised embedding algorithms will also stimulate new exciting research in embeddings for other structured domains of NLP and Vision . 2 BACKGROUND . In this section , we define a stable colored graph , provide an outline for 1-WL ( Weisfeiler-Lehman ) graph isomorphism test and General Aggregate and Update ( GAU ) for Graph Neural Networks ( GNNs ) . We also discuss how domains of NLP and images can be seen as graphs . 2.1 STABLE COLORING . Let a coloring function C be an overloaded function defined on the vertices as well on set of vertices of G = ( V , E ) , i.e. , C : V → N and C : 2V → { { N } } where N is a set of natural numbers representing colors , and { { . } } is a multiset with overloading defined as C ( A ) = { { C ( v ) |v ∈ A ⊂ V } } . We denote neighborhood of a node u ∈ V as N ( v ) = { u| ( v , u ) ∈ E } . Definition 2.1 ( Stable Coloring ) . An undirected graph G = ( V , E ) is stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if and only if C ( N ( u ) ) = C ( N ( v ) ) . We can extend the above definition to directed graphs and graphs with labels . A directed graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if C ( Nin ( u ) ) = C ( Nin ( v ) ) and C ( Nout ( u ) ) = C ( Nout ( v ) ) where Nin ( u ) = { w| ( w , u ) ∈ E } and Nout ( u ) = { w| ( u , w ) ∈ E } . Likewise , an edge-labelled undirected graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if ∀l , C ( Nl ( u ) ) = C ( Nl ( v ) ) where Nl ( u ) = { w| ( u , w ) ∈ El } where El ⊂ E for an edge label l. We also define a weak-stable coloring for a graph G = ( V , E ) . An undirected graph G = ( V , E ) is weak-stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if C ( N ( u ) ) = C ( N ( v ) ) where N ( u ) = { w| ( u , w ) ∈ E } . 2.2 1-WL ALGORITHM AND GENERAL AGGREGATE AND UPDATE FRAMEWORK ( GAU ) . 1-WL algorithm : 1-WL is an iterative algorithm to achieve a stable coloring C for G = ( V , E ) . Let Ci denote the coloring at iteration i . It starts with a coloring scheme C0 such that C0 ( v ) is same for all v ∈ V . In each iteration , it assigns a different color to u and v if Ci ( N ( u ) ) 6= Ci ( N ( u ) ) until a stable coloring C is reached . General Aggregate and Update Framework ( GAU ) For a general multi-layer GNN , the General Aggregate and Update framework to compute node/vertex embeddings ( corresponding to colors ) of G = ( V , E ) is given iteratively by : Ek ( u ) = f ( k ) update ( Ek−1 ( u ) , f ( k ) agg ( Ek−1 ( v ) : v ∈ { { N ( u ) } } ) ) , ( 1 ) where f ( k ) agg ( . ) and f ( k ) update ( . ) map vertex multiset embeddings to a metric space such as R d. In GraphSage ( Hamilton et al. , 2017 ) , authors showed that the iterative procedure in 1-WL algorithm is analogous to General Aggregate and Update procedure in GNNs . This connection has lead to the research direction where 1-WL is being used as a standard to which GNN architectures are being compared to ( Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020b ) . Xu et al . ( 2019b ) prove that GAU is as powerful as 1-WL if the functions fupdate and fagg are injective . Various domains such as NLP , Images and Graphs can be viewed as a graph on their elementary tokens . How we construct graphs is explained in section 6.1 and examples are given in appendix B . 3 RELATED WORK . Word embeddings have been popular in NLP since decades ( Deerwester et al. , 1989 ; Morin & Bengio , 2005 ; Mikolov et al. , 2013b ; Bojanowski et al. , 2017 ) . A lot of work has been done to understand the mathematical underpinning of these models , for instance , relation of embedding models to co-occurrence statistics ( Levy & Goldberg , 2014 ; Hashimoto et al. , 2016 ; Allen et al. , 2019 ) . Study of empirical properties of these embedding models ( e.g . analogies ) has also attracted theoretical research ( Allen & Hospedales , 2019 ; Ethayarajh et al. , 2019 ) . Recently , graph community has also seen a surge in learning node and graph embeddings . The notion of capturing the structural neighborhood around a node inside the node embedding has been the driving principle of these semi-supervised node embedding algorithms like node2vec ( Grover & Leskovec , 2016 ) , and GraphSAGE ( Hamilton et al. , 2017 ) . Hamilton et al . ( 2017 ) pointed out that their GraphSAGE node embedding algorithm mimics the aggregate and update procedure of 1-WL algorithm . Subsequently , these neighborhood informative node embeddings found their applications in constructing graph embeddings , and thereby used for classification of structurally equivalent or isomorphic graphs ( Chen et al. , 2019 ) . Xu et al . ( 2019b ) in their GIN ( Graph Isomorphism Network ) model modified the aggregate procedure of GraphSAGE to construct graph embedders which were provably as powerful as 1-WL algorithm in distinguishing non-isomorphic graphs . This redirected the research into designing more powerful variants of graph embedders like PPGN ( Maron et al. , 2019 ) and k-GNN ( Morris et al. , 2019 ) which were provably as powerful as 3-WL and k-WL test respectively . Grohe ( 2020 ) discusses about these phenomenal works in increasing the expressivity of graph embeddings for supervised graph classification and regression tasks . While this line of research focuses on improving expressivity and generalizability of Graph networks based on its connection to 1-WL , we explore and formalize the unsupervised algorithms under the light of stable coloring / 1-WL algorithm and show that all the current models stem from the common principle that a tokens meaning is derived from its neighbours . The rest of the paper is organised as follows . We begin with a discussion of connections between discrete stable coloring and non-local means algorithm in Image processing and distributional hypothesis in NLP . We then define a continuous version of SC and develop optimization problems to solve for CSC in section 5 . In section 6 we show how current state-of-the art embedding models are solving the CSC problem in disguise . | In this paper the authors proposed continuous stable coloring (CSC) as a new framework to unify the understanding of several existing unsupervised learning algorithms, including Word2Vec, BERT, and Node2Vec. The authors show how the original stable coloring algorithm can be understood as optimizing the CSC objective function. The authors also show how to reduce the existing approaches to CSC. | SP:c1ca0c45155b79906fed99ebbbdf0ea25047b2b9 |
Embedding models through the lens of Stable Coloring | 1 INTRODUCTION . Embedding models are ubiquitous in wide range of real-world applications such as information retrieval ( Zuccon et al. , 2015 ) , natural language processing ( NLP ) ( Mikolov et al. , 2013a ; b ) , graph classification ( Grover & Leskovec , 2016 ; Hamilton et al. , 2017 ) and many more . These models map categorical entities to continuous dense representations ( typically in Rd ) which provide a continuous measure of semantic similarity across categorical entities . Nowadays , there is a heavy dependence on unsupervised pre-trained embedding models across domains like Transformers in NLP ( Devlin et al. , 2019 ) , Visual Transformers ( ViT ) in Computer Vision ( Dosovitskiy et al. , 2020 ) , Graph Neural Networks ( Hamilton et al. , 2017 ; Xu et al. , 2019b ) since they learn rich semantic representations of entities from massive amounts of unlabelled data . With little finetuning , these models achieve stateof-the-art results on most of the supervised downstream tasks like sentiment analysis ( Xu et al. , 2019a ) , object detection ( Beal et al. , 2020 ) , and graph classification ( Xu et al. , 2019b ) . Historically , embedding models were developed almost independently across structured domains such as NLP , graphs , images , and so on . These algorithms use the neighborhood structure around an entity to obtain the embedding for the entity . Interestingly , a popular hypothesis in NLP - Distributional Hypothesis states that the “ meaning ” of the word is determined by its context ( neighbors ) ( Harris , 1954 ; Sahlgren , 2008 ) . This hypothesis forms the basis of most unsupervised embedding learning models in NLP ( Mikolov et al. , 2013a ; b ; Pennington et al. , 2014b ; Bojanowski et al. , 2017 ; Sonkar et al. , 2020 ) . Similarly , non-local-means , a denoising algorithm in signal processing , tries to find pixels that should be the same based on the similarity of its neighborhood structure ( patch of the image around the pixel in this case ) ( Awate & Whitaker , 2006 ; Buades et al. , 2005 ) . Even Graph neural network ( GNN ) architectures ensure that information of the surrounding neighbors is systematically incorporated in the embedding of a node , even in supervised settings ( Hamilton et al. , 2017 ; Maron et al. , 2019 ; Xu et al. , 2019b ) . Thus somehow various communities working across diverse domains have narrowed down on an entity ’ s neighborhood structure to define the entity ’ s meaning . In this paper , we try to establish this common principle on mathematically robust grounds . Structured domains can be easily represented as graphs with relations between entities as edges in the graphs . For example in NLP words can be treated as nodes of some graph , and co-occurrence relation between words can be represented as an edge . As mentioned before that graph embedding architectures capture the topological structure around the node in the node embeddings , and if structured domains can be represented as graphs , this raises the question do embedding models from structured domains like NLP and Vision also operate on some domain induced graph and capture neighborhood structural properties in their entity embeddings since we have seen that embedding models across these domains tend to capture “ neighborhood ” information ? To answer this question , we dive into combinatorial graph theory to understand how to define the notion of structural equivalence a.k.a . isomorphic structures . Weisfeiler-Lehman ( 1-WL ) algorithm ( or color refinement algorithm ) is the most popular heuristic used to identify graph isomorphism ( Weisfeiler & Leman , 1968 ) and can distinguish a broad class of graphs ( Babai & Kucera , 1979 ) . The fixed point solution of 1-WL is called a stable-coloring and has the property that any two nodes with the same color have the same multi-set of colors in their neighborhood . In essence it means if two nodes have the same color , the graph looks structurally identical from these nodes . Finally to answer the question if embedding models from structured domains capture the domain induced graph ’ s topological properties in their entity embeddings , one can find links between the mechanics of these models and stable coloring / 1-WL algorithm . In this paper , we establish this connection by providing a general framework linking existing algorithms to stable coloring . We propose a more flexible version of stable coloring ( SC ) called continuous stable coloring ( CSC ) — a strict generalization of SC . CSC states that the similarity of their neighborhoods determines the similarity of two nodes . Based on this notion , we define a series of optimization problems to solve the problem of CSC . We show that various algorithms in NLP like word2vec , AWE , BERT ( Devlin et al. , 2019 ) , images processing like Visual Transformer ( Dosovitskiy et al. , 2020 ) , graphs like Node2Vec ( Grover & Leskovec , 2016 ) , etc . are essentially solving different instantiations of this common optimization problem . Current research already establishes the link between the 1-WL algorithm ( Grohe , 2020 ; Morris et al. , 2021 ; Shervashidze et al. , 2011 ; Morris et al. , 2017 ) and GNN architectures , which has sparked a new line of research in improving GNN architectures ( Hamilton et al. , 2017 ; Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020a ; b ) . We hope that the new link we establish between stable coloring and unsupervised embedding algorithms will also stimulate new exciting research in embeddings for other structured domains of NLP and Vision . 2 BACKGROUND . In this section , we define a stable colored graph , provide an outline for 1-WL ( Weisfeiler-Lehman ) graph isomorphism test and General Aggregate and Update ( GAU ) for Graph Neural Networks ( GNNs ) . We also discuss how domains of NLP and images can be seen as graphs . 2.1 STABLE COLORING . Let a coloring function C be an overloaded function defined on the vertices as well on set of vertices of G = ( V , E ) , i.e. , C : V → N and C : 2V → { { N } } where N is a set of natural numbers representing colors , and { { . } } is a multiset with overloading defined as C ( A ) = { { C ( v ) |v ∈ A ⊂ V } } . We denote neighborhood of a node u ∈ V as N ( v ) = { u| ( v , u ) ∈ E } . Definition 2.1 ( Stable Coloring ) . An undirected graph G = ( V , E ) is stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if and only if C ( N ( u ) ) = C ( N ( v ) ) . We can extend the above definition to directed graphs and graphs with labels . A directed graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if C ( Nin ( u ) ) = C ( Nin ( v ) ) and C ( Nout ( u ) ) = C ( Nout ( v ) ) where Nin ( u ) = { w| ( w , u ) ∈ E } and Nout ( u ) = { w| ( u , w ) ∈ E } . Likewise , an edge-labelled undirected graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if ∀l , C ( Nl ( u ) ) = C ( Nl ( v ) ) where Nl ( u ) = { w| ( u , w ) ∈ El } where El ⊂ E for an edge label l. We also define a weak-stable coloring for a graph G = ( V , E ) . An undirected graph G = ( V , E ) is weak-stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if C ( N ( u ) ) = C ( N ( v ) ) where N ( u ) = { w| ( u , w ) ∈ E } . 2.2 1-WL ALGORITHM AND GENERAL AGGREGATE AND UPDATE FRAMEWORK ( GAU ) . 1-WL algorithm : 1-WL is an iterative algorithm to achieve a stable coloring C for G = ( V , E ) . Let Ci denote the coloring at iteration i . It starts with a coloring scheme C0 such that C0 ( v ) is same for all v ∈ V . In each iteration , it assigns a different color to u and v if Ci ( N ( u ) ) 6= Ci ( N ( u ) ) until a stable coloring C is reached . General Aggregate and Update Framework ( GAU ) For a general multi-layer GNN , the General Aggregate and Update framework to compute node/vertex embeddings ( corresponding to colors ) of G = ( V , E ) is given iteratively by : Ek ( u ) = f ( k ) update ( Ek−1 ( u ) , f ( k ) agg ( Ek−1 ( v ) : v ∈ { { N ( u ) } } ) ) , ( 1 ) where f ( k ) agg ( . ) and f ( k ) update ( . ) map vertex multiset embeddings to a metric space such as R d. In GraphSage ( Hamilton et al. , 2017 ) , authors showed that the iterative procedure in 1-WL algorithm is analogous to General Aggregate and Update procedure in GNNs . This connection has lead to the research direction where 1-WL is being used as a standard to which GNN architectures are being compared to ( Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020b ) . Xu et al . ( 2019b ) prove that GAU is as powerful as 1-WL if the functions fupdate and fagg are injective . Various domains such as NLP , Images and Graphs can be viewed as a graph on their elementary tokens . How we construct graphs is explained in section 6.1 and examples are given in appendix B . 3 RELATED WORK . Word embeddings have been popular in NLP since decades ( Deerwester et al. , 1989 ; Morin & Bengio , 2005 ; Mikolov et al. , 2013b ; Bojanowski et al. , 2017 ) . A lot of work has been done to understand the mathematical underpinning of these models , for instance , relation of embedding models to co-occurrence statistics ( Levy & Goldberg , 2014 ; Hashimoto et al. , 2016 ; Allen et al. , 2019 ) . Study of empirical properties of these embedding models ( e.g . analogies ) has also attracted theoretical research ( Allen & Hospedales , 2019 ; Ethayarajh et al. , 2019 ) . Recently , graph community has also seen a surge in learning node and graph embeddings . The notion of capturing the structural neighborhood around a node inside the node embedding has been the driving principle of these semi-supervised node embedding algorithms like node2vec ( Grover & Leskovec , 2016 ) , and GraphSAGE ( Hamilton et al. , 2017 ) . Hamilton et al . ( 2017 ) pointed out that their GraphSAGE node embedding algorithm mimics the aggregate and update procedure of 1-WL algorithm . Subsequently , these neighborhood informative node embeddings found their applications in constructing graph embeddings , and thereby used for classification of structurally equivalent or isomorphic graphs ( Chen et al. , 2019 ) . Xu et al . ( 2019b ) in their GIN ( Graph Isomorphism Network ) model modified the aggregate procedure of GraphSAGE to construct graph embedders which were provably as powerful as 1-WL algorithm in distinguishing non-isomorphic graphs . This redirected the research into designing more powerful variants of graph embedders like PPGN ( Maron et al. , 2019 ) and k-GNN ( Morris et al. , 2019 ) which were provably as powerful as 3-WL and k-WL test respectively . Grohe ( 2020 ) discusses about these phenomenal works in increasing the expressivity of graph embeddings for supervised graph classification and regression tasks . While this line of research focuses on improving expressivity and generalizability of Graph networks based on its connection to 1-WL , we explore and formalize the unsupervised algorithms under the light of stable coloring / 1-WL algorithm and show that all the current models stem from the common principle that a tokens meaning is derived from its neighbours . The rest of the paper is organised as follows . We begin with a discussion of connections between discrete stable coloring and non-local means algorithm in Image processing and distributional hypothesis in NLP . We then define a continuous version of SC and develop optimization problems to solve for CSC in section 5 . In section 6 we show how current state-of-the art embedding models are solving the CSC problem in disguise . | In the paper the authors define a new problem called the continuous stable coloring (CSC). This is an extension of the traditional stable coloring problem, however, instead of having discrete color labels, you have continuous color labels. The authors then provide an objective function that could be minimized to obtain a CSC. They then show that if you tweak the similarity measure $S$ and the aggregator function $f_{agg}$, then the CSC problems various word embedding techniques such as word2vec, AWE, Bert (without non-linearity). | SP:c1ca0c45155b79906fed99ebbbdf0ea25047b2b9 |
Embedding models through the lens of Stable Coloring | 1 INTRODUCTION . Embedding models are ubiquitous in wide range of real-world applications such as information retrieval ( Zuccon et al. , 2015 ) , natural language processing ( NLP ) ( Mikolov et al. , 2013a ; b ) , graph classification ( Grover & Leskovec , 2016 ; Hamilton et al. , 2017 ) and many more . These models map categorical entities to continuous dense representations ( typically in Rd ) which provide a continuous measure of semantic similarity across categorical entities . Nowadays , there is a heavy dependence on unsupervised pre-trained embedding models across domains like Transformers in NLP ( Devlin et al. , 2019 ) , Visual Transformers ( ViT ) in Computer Vision ( Dosovitskiy et al. , 2020 ) , Graph Neural Networks ( Hamilton et al. , 2017 ; Xu et al. , 2019b ) since they learn rich semantic representations of entities from massive amounts of unlabelled data . With little finetuning , these models achieve stateof-the-art results on most of the supervised downstream tasks like sentiment analysis ( Xu et al. , 2019a ) , object detection ( Beal et al. , 2020 ) , and graph classification ( Xu et al. , 2019b ) . Historically , embedding models were developed almost independently across structured domains such as NLP , graphs , images , and so on . These algorithms use the neighborhood structure around an entity to obtain the embedding for the entity . Interestingly , a popular hypothesis in NLP - Distributional Hypothesis states that the “ meaning ” of the word is determined by its context ( neighbors ) ( Harris , 1954 ; Sahlgren , 2008 ) . This hypothesis forms the basis of most unsupervised embedding learning models in NLP ( Mikolov et al. , 2013a ; b ; Pennington et al. , 2014b ; Bojanowski et al. , 2017 ; Sonkar et al. , 2020 ) . Similarly , non-local-means , a denoising algorithm in signal processing , tries to find pixels that should be the same based on the similarity of its neighborhood structure ( patch of the image around the pixel in this case ) ( Awate & Whitaker , 2006 ; Buades et al. , 2005 ) . Even Graph neural network ( GNN ) architectures ensure that information of the surrounding neighbors is systematically incorporated in the embedding of a node , even in supervised settings ( Hamilton et al. , 2017 ; Maron et al. , 2019 ; Xu et al. , 2019b ) . Thus somehow various communities working across diverse domains have narrowed down on an entity ’ s neighborhood structure to define the entity ’ s meaning . In this paper , we try to establish this common principle on mathematically robust grounds . Structured domains can be easily represented as graphs with relations between entities as edges in the graphs . For example in NLP words can be treated as nodes of some graph , and co-occurrence relation between words can be represented as an edge . As mentioned before that graph embedding architectures capture the topological structure around the node in the node embeddings , and if structured domains can be represented as graphs , this raises the question do embedding models from structured domains like NLP and Vision also operate on some domain induced graph and capture neighborhood structural properties in their entity embeddings since we have seen that embedding models across these domains tend to capture “ neighborhood ” information ? To answer this question , we dive into combinatorial graph theory to understand how to define the notion of structural equivalence a.k.a . isomorphic structures . Weisfeiler-Lehman ( 1-WL ) algorithm ( or color refinement algorithm ) is the most popular heuristic used to identify graph isomorphism ( Weisfeiler & Leman , 1968 ) and can distinguish a broad class of graphs ( Babai & Kucera , 1979 ) . The fixed point solution of 1-WL is called a stable-coloring and has the property that any two nodes with the same color have the same multi-set of colors in their neighborhood . In essence it means if two nodes have the same color , the graph looks structurally identical from these nodes . Finally to answer the question if embedding models from structured domains capture the domain induced graph ’ s topological properties in their entity embeddings , one can find links between the mechanics of these models and stable coloring / 1-WL algorithm . In this paper , we establish this connection by providing a general framework linking existing algorithms to stable coloring . We propose a more flexible version of stable coloring ( SC ) called continuous stable coloring ( CSC ) — a strict generalization of SC . CSC states that the similarity of their neighborhoods determines the similarity of two nodes . Based on this notion , we define a series of optimization problems to solve the problem of CSC . We show that various algorithms in NLP like word2vec , AWE , BERT ( Devlin et al. , 2019 ) , images processing like Visual Transformer ( Dosovitskiy et al. , 2020 ) , graphs like Node2Vec ( Grover & Leskovec , 2016 ) , etc . are essentially solving different instantiations of this common optimization problem . Current research already establishes the link between the 1-WL algorithm ( Grohe , 2020 ; Morris et al. , 2021 ; Shervashidze et al. , 2011 ; Morris et al. , 2017 ) and GNN architectures , which has sparked a new line of research in improving GNN architectures ( Hamilton et al. , 2017 ; Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020a ; b ) . We hope that the new link we establish between stable coloring and unsupervised embedding algorithms will also stimulate new exciting research in embeddings for other structured domains of NLP and Vision . 2 BACKGROUND . In this section , we define a stable colored graph , provide an outline for 1-WL ( Weisfeiler-Lehman ) graph isomorphism test and General Aggregate and Update ( GAU ) for Graph Neural Networks ( GNNs ) . We also discuss how domains of NLP and images can be seen as graphs . 2.1 STABLE COLORING . Let a coloring function C be an overloaded function defined on the vertices as well on set of vertices of G = ( V , E ) , i.e. , C : V → N and C : 2V → { { N } } where N is a set of natural numbers representing colors , and { { . } } is a multiset with overloading defined as C ( A ) = { { C ( v ) |v ∈ A ⊂ V } } . We denote neighborhood of a node u ∈ V as N ( v ) = { u| ( v , u ) ∈ E } . Definition 2.1 ( Stable Coloring ) . An undirected graph G = ( V , E ) is stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if and only if C ( N ( u ) ) = C ( N ( v ) ) . We can extend the above definition to directed graphs and graphs with labels . A directed graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if C ( Nin ( u ) ) = C ( Nin ( v ) ) and C ( Nout ( u ) ) = C ( Nout ( v ) ) where Nin ( u ) = { w| ( w , u ) ∈ E } and Nout ( u ) = { w| ( u , w ) ∈ E } . Likewise , an edge-labelled undirected graph G = ( V , E ) is stable colored w.r.t a coloring function C : V → N if it holds that C ( u ) = C ( v ) if and only if ∀l , C ( Nl ( u ) ) = C ( Nl ( v ) ) where Nl ( u ) = { w| ( u , w ) ∈ El } where El ⊂ E for an edge label l. We also define a weak-stable coloring for a graph G = ( V , E ) . An undirected graph G = ( V , E ) is weak-stable colored w.r.t coloring function C if it holds that C ( u ) = C ( v ) if C ( N ( u ) ) = C ( N ( v ) ) where N ( u ) = { w| ( u , w ) ∈ E } . 2.2 1-WL ALGORITHM AND GENERAL AGGREGATE AND UPDATE FRAMEWORK ( GAU ) . 1-WL algorithm : 1-WL is an iterative algorithm to achieve a stable coloring C for G = ( V , E ) . Let Ci denote the coloring at iteration i . It starts with a coloring scheme C0 such that C0 ( v ) is same for all v ∈ V . In each iteration , it assigns a different color to u and v if Ci ( N ( u ) ) 6= Ci ( N ( u ) ) until a stable coloring C is reached . General Aggregate and Update Framework ( GAU ) For a general multi-layer GNN , the General Aggregate and Update framework to compute node/vertex embeddings ( corresponding to colors ) of G = ( V , E ) is given iteratively by : Ek ( u ) = f ( k ) update ( Ek−1 ( u ) , f ( k ) agg ( Ek−1 ( v ) : v ∈ { { N ( u ) } } ) ) , ( 1 ) where f ( k ) agg ( . ) and f ( k ) update ( . ) map vertex multiset embeddings to a metric space such as R d. In GraphSage ( Hamilton et al. , 2017 ) , authors showed that the iterative procedure in 1-WL algorithm is analogous to General Aggregate and Update procedure in GNNs . This connection has lead to the research direction where 1-WL is being used as a standard to which GNN architectures are being compared to ( Xu et al. , 2019b ; Maron et al. , 2019 ; Morris et al. , 2020b ) . Xu et al . ( 2019b ) prove that GAU is as powerful as 1-WL if the functions fupdate and fagg are injective . Various domains such as NLP , Images and Graphs can be viewed as a graph on their elementary tokens . How we construct graphs is explained in section 6.1 and examples are given in appendix B . 3 RELATED WORK . Word embeddings have been popular in NLP since decades ( Deerwester et al. , 1989 ; Morin & Bengio , 2005 ; Mikolov et al. , 2013b ; Bojanowski et al. , 2017 ) . A lot of work has been done to understand the mathematical underpinning of these models , for instance , relation of embedding models to co-occurrence statistics ( Levy & Goldberg , 2014 ; Hashimoto et al. , 2016 ; Allen et al. , 2019 ) . Study of empirical properties of these embedding models ( e.g . analogies ) has also attracted theoretical research ( Allen & Hospedales , 2019 ; Ethayarajh et al. , 2019 ) . Recently , graph community has also seen a surge in learning node and graph embeddings . The notion of capturing the structural neighborhood around a node inside the node embedding has been the driving principle of these semi-supervised node embedding algorithms like node2vec ( Grover & Leskovec , 2016 ) , and GraphSAGE ( Hamilton et al. , 2017 ) . Hamilton et al . ( 2017 ) pointed out that their GraphSAGE node embedding algorithm mimics the aggregate and update procedure of 1-WL algorithm . Subsequently , these neighborhood informative node embeddings found their applications in constructing graph embeddings , and thereby used for classification of structurally equivalent or isomorphic graphs ( Chen et al. , 2019 ) . Xu et al . ( 2019b ) in their GIN ( Graph Isomorphism Network ) model modified the aggregate procedure of GraphSAGE to construct graph embedders which were provably as powerful as 1-WL algorithm in distinguishing non-isomorphic graphs . This redirected the research into designing more powerful variants of graph embedders like PPGN ( Maron et al. , 2019 ) and k-GNN ( Morris et al. , 2019 ) which were provably as powerful as 3-WL and k-WL test respectively . Grohe ( 2020 ) discusses about these phenomenal works in increasing the expressivity of graph embeddings for supervised graph classification and regression tasks . While this line of research focuses on improving expressivity and generalizability of Graph networks based on its connection to 1-WL , we explore and formalize the unsupervised algorithms under the light of stable coloring / 1-WL algorithm and show that all the current models stem from the common principle that a tokens meaning is derived from its neighbours . The rest of the paper is organised as follows . We begin with a discussion of connections between discrete stable coloring and non-local means algorithm in Image processing and distributional hypothesis in NLP . We then define a continuous version of SC and develop optimization problems to solve for CSC in section 5 . In section 6 we show how current state-of-the art embedding models are solving the CSC problem in disguise . | In this paper, the authors investigate how the solution of the Weisfeiler-Lehman test of isomorphism (WL) is related to embedding algorithms from structured domains. The authors generalize the WL algorithm to the case where the colors assigned to the nodes correspond to feature vectors, and propose a series of optimization problems to solve this problem. Finally, they show that widely used algorithms in natural language processing, computer vision and graph representation learning such as word2vec, BERT, Visual Transformer and node2vec actually solve different instantiations of this common optimization problem. | SP:c1ca0c45155b79906fed99ebbbdf0ea25047b2b9 |
RISP: Rendering-Invariant State Predictor with Differentiable Simulation and Rendering for Cross-Domain Parameter Estimation | 1 INTRODUCTION . Reconstructing dynamic information about a physical system directly from a video has received considerable attention in the robotics , machine learning , computer vision , and graphics communities . This problem is fundamentally challenging because of its deep coupling among physics , geometry , and perception of a system . Traditional solutions like motion capture systems ( Vicon ; OptiTrack ; Qualisys ) can provide high-quality results but require prohibitively expensive external hardware platforms . More recent development in differentiable simulation and rendering provides an inexpensive and attractive alternative to the motion capture systems and has shown promising proof-of-concept results ( Jatavallabhula et al. , 2021 ) . However , existing methods in this direction typically assume the videos come from a known renderer . Such an assumption limits their usefulness in inferring dynamic information from an unknown rendering domain , which is common in real-world applications due to the discrepancy between rendering and real-world videos . Existing techniques for aligning different rendering domains , e.g. , CycleGAN ( Zhu et al. , 2017 ) , may help alleviate this issue . However , they typically require access to the target domain with massive data , which is not always available . To our best knowledge , inferring dynamic parameters of a physical system directly from videos under unknown rendering conditions remains far from being solved , and our work aims to fill this gap . Our work proposes a novel approach by combining three key ideas to address this challenging problem : domain randomization , state estimation , and rendering gradients . Domain randomization is a classic technique for transferring knowledge between domains , e.g. , deploying control policy trained in simulation to hardware platforms . The key idea is to let the algorithm in the source domain see massive samples under varying rendering configurations so that it is robust to discrepancies between source and target domains . We borrow this classic idea but upgrade it with two key innovations that substantially improve its effectiveness in our problem . First , we notice that image differences 1Project page : https : //sites.google.com/view/risp-iclr-2022/home . are sensitive to changes in rendering configurations . Therefore , they hardly reflect those renderinginvariant , dynamics-related parameters that we genuinely aim to match . This observation motivates us to propose a rendering-invariant state predictor ( RISP ) that extracts state information of a physical system from videos . By comparing in the state space instead of the image space , we rule out the interference of varying rendering configurations in videos from different rendering domains . The second innovation in our approach is to leverage rendering gradients from a differentiable renderer . Traditionally , domain randomization exploits data in the source domain without using their first-order information . Now that we have access to a differentiable renderer , their rendering gradients provide rich information that we should make full use of to train RISP . Essentially , requiring the output of RISP to be agnostic to rendering configurations equals enforcing its gradients for rendering parameters to be zero . Based on this idea , we propose a new loss function using rendering gradients and show an efficient method for integrating it into modern deep learning frameworks . Putting all these ideas together , we provide a powerful pipeline that effectively infers parameters of a physical system directly from video input under random rendering configurations . We demonstrate the efficacy of our approach on a variety of challenging tasks , including state estimation , system identification , imitation learning , and visuomotor control , with input videos generated from unknown rendering conditions . We evaluate these tasks on rigid-body systems with and without contact , an articulated body system , and a deformable-body system ( Fig . 1 ) , including a challenging dexterous hand ( Xu et al. , 2021 ) . The experimental results show that our approach outperforms the state-of-theart technique ( Jatavallabhula et al. , 2021 ) by a large margin in most of these tasks , which is primarily due to the inclusion of rendering gradients in the training process . In summary , our work makes the following contributions . First , we investigate and identify the bottleneck in inferring state , system , and control parameters of physical systems from videos under various rendering configurations ( Sec . 3.1 ) . Second , we propose a novel solution that combines domain randomization , state estimation , and differentiable rendering gradients to achieve generalizability across multiple rendering domains ( Sec . 3.2 ) . Third , we demonstrate the efficacy of our approach on several challenging tasks in rigid-body and deformable-body environments , including state estimation , system identification , imitation learning , and visuomotor control ( Sec . 4 ) . We will release our code and data along with the paper upon publication for readers to reproduce our results . 2 RELATED WORK . Differentiable simulation Differentiable simulation is a family of simulation methodology that equips traditional simulation with gradient information for simulation inputs . This additional gradient information connects simulation tasks with classic numerical optimization techniques . Previous works have demonstrated the power of gradients from a differentiable simulator in rigid-body dynamics ( Geilinger et al. , 2020 ; Degrave et al. , 2019 ; de Avila Belbute-Peres et al. , 2018 ; Xu et al. , 2021 ) , deformable-body dynamics ( Du et al. , 2021b ; a ; Hu et al. , 2019 ; Hahn et al. , 2019 ) , fluids ( Du et al. , 2020 ; McNamara et al. , 2004 ; Hu et al. , 2020 ) , and co-dimensional objects ( Qiao et al. , 2020 ; Liang et al. , 2019 ) , many of which show successful applications in system identification ( Hahn et al. , 2019 ) , trajectory optimization ( Hu et al. , 2019 ) , and closed-loop control ( Du et al. , 2021b ) . Our work is closely related to the progress in this field as we make heavy use of differentiable simulators in our pipeline . However , our contribution is orthogonal to them : we treat differentiable simulation as a black box , and our proposed approach is agnostic to the choice of simulators , as demonstrated by our environments involving rigid bodies , articulated bodies , and deformable bodies . Differentiable rendering Differentiable rendering methods offer gradient information for rendering inputs , e.g. , lighting , materials , cameras , or shapes ( Ramamoorthi et al. , 2007 ; Li et al. , 2015 ; Jarosz et al. , 2012 ) . The state-of-the-art differentiable renderers ( Li et al. , 2018 ; Nimier-David et al. , 2019 ) are very powerful in handling gradients even with discontinuities from occlusion or advanced global illumination effects . Our work leverages these differentiable renderers but with a quite different focus : our work instead uses rendering gradients as guidance to optimize parameters external to the renderer , which we hope can broaden the potential applications for differentiable rendering in the future . Domain randomization Our approach is closely related to domain randomization in the learning and robotics communities for transferring knowledge between domains having discrepancies ( Tobin et al. , 2017 ; Peng et al. , 2018 ; Andrychowicz et al. , 2020 ; Sadeghi & Levine , 2017 ; Tan et al. , 2018 ) . The intuition is that a model can hopefully cross the domain discrepancy by seeing a large amount of random data in the source domain . This often requires tedious data generation and leads to robust but conservative performances in the target domain . Our core idea in this work is distinctive from this line of research in that the generalizability of our method comes from a more accurate model that aims to match first-order gradient information , while the generalizability of domain randomization comes from a more robust model that attempts to absorb domain discrepancies by behaving conservatively . 3 METHOD . Given a video showing the dynamic motion of a physical system , our goal is to infer the unknown state , system , or control parameters directly from the video , with partial knowledge about the physics model and rendering conditions . Specifically , we assume we know the governing equations of the physical system ( e.g. , Newton ’ s law for rigid-body systems ) and the camera position in the video , but the exact system , control , or rendering parameters are not exposed . To solve this problem , we propose a pipeline that consists of two components : 1 ) a differentiable simulation and rendering engine ; 2 ) a novel rendering-invariant state-prediction network ( RISP ) . Our differentiable simulation and rendering engine simulates and renders the state of a physical system into an image output , and RISP learns to reconstruct state information of the physical system from images generated under varying rendering configurations . Putting these two components together , we have a pipeline that can faithfully recover dynamic information of a physical system from a new video with unseen rendering configurations . We give an overview of our approach in Fig . 2 . 3.1 DIFFERENTIABLE SIMULATION AND RENDERING ENGINE . Given a physical system with known dynamic modelM , we first use a differentiable simulator to simulate its states based on action inputs at each time step after time discretization : si+1 =Mφ ( si , ai ) , ∀i = 0 , 1 , · · · , N − 1 , ( 1 ) where N is the number of time steps in a rollout of physics simulation , and si , si+1 and ai represent the state and action vectors at the corresponding time steps , respectively . The φ vector encodes the system parameters in the model , e.g. , mass , inertia , and elasticity . Next , we apply a differentiable rendererR to generate an image Ii for each state si : Ii = Rψ ( si ) , ∀i = 0 , 1 , · · · , N. ( 2 ) Here , ψ is a vector encoding rendering parameters whose gradients are available in the renderer R. Examples of ψ include light intensity , material reflectence , or background color . By abuse of notation , we re-write the workflow of our simulation and rendering engine to a compact form : { Ii } = Rψ [ Mφ ( s0 , { ai } ) ︸ ︷︷ ︸ { si } ] . ( 3 ) In other words , given an initial state s0 and a sequence of actions { ai } , we generate a sequence of states { si } from simulation and renders the corresponding image sequence { Ii } . The task of recovering unknown information from a reference video { Irefi } can be formulated as follows : min s0 , { ai } , φ , ψ L ( { Irefi } , { Ii } ) , ( 4 ) s.t . { Ii } = Rψ [ Mφ ( s0 , { ai } ) ] , ( 5 ) where L is a loss function penalizing the difference between the generated images and their references . Assuming that the simulatorM and the renderer R are differentiable with respect to their inputs , we can run gradient-based optimization algorithms to solve Eqn . ( 4 ) . This is essentially the idea proposed in∇Sim , the state-of-the-art method for identifying parameters directly from video inputs ( Jatavallabhula et al. , 2021 ) . Specifically , ∇Sim defines L as a norm on pixelwise differences . One major limitation in Eqn . ( 4 ) is that it expects reasonably similar initial images { Ii } and references { Irefi } to successfully solve the optimization problem . Indeed , since the optimization problem is highly nonlinear due to its coupling between simulation and rendering , local optimization techniques like gradient-descent can be trapped into local minima easily if { Ii } and { Irefi } are not close enough . While ∇Sim has reported promising results when { Ii } and { Irefi } are rendered with moderately different ψ , we found in our experiments that directly optimizing L defined on the image space rarely works when the two rendering domains are vastly different ( Fig . 1 ) . Therefore , we believe it requires a fundamentally different solution , motivating us to propose RISP in our method . | This paper proposes a general approach to leveraging differentiable simulator for the downstream tasks of system identification and visuomotor control WITHOUT requiring access to the true underlying states. They do so by predicting a "rendering-invariant state" that results in a much stabler loss landscape and reduces domain gap / mismatch. Experiments over 4 environments indicate the merits of this approach over current state-of-the-art. | SP:ceb791bceee485601b5d8b33c92901c297c29d6a |
RISP: Rendering-Invariant State Predictor with Differentiable Simulation and Rendering for Cross-Domain Parameter Estimation | 1 INTRODUCTION . Reconstructing dynamic information about a physical system directly from a video has received considerable attention in the robotics , machine learning , computer vision , and graphics communities . This problem is fundamentally challenging because of its deep coupling among physics , geometry , and perception of a system . Traditional solutions like motion capture systems ( Vicon ; OptiTrack ; Qualisys ) can provide high-quality results but require prohibitively expensive external hardware platforms . More recent development in differentiable simulation and rendering provides an inexpensive and attractive alternative to the motion capture systems and has shown promising proof-of-concept results ( Jatavallabhula et al. , 2021 ) . However , existing methods in this direction typically assume the videos come from a known renderer . Such an assumption limits their usefulness in inferring dynamic information from an unknown rendering domain , which is common in real-world applications due to the discrepancy between rendering and real-world videos . Existing techniques for aligning different rendering domains , e.g. , CycleGAN ( Zhu et al. , 2017 ) , may help alleviate this issue . However , they typically require access to the target domain with massive data , which is not always available . To our best knowledge , inferring dynamic parameters of a physical system directly from videos under unknown rendering conditions remains far from being solved , and our work aims to fill this gap . Our work proposes a novel approach by combining three key ideas to address this challenging problem : domain randomization , state estimation , and rendering gradients . Domain randomization is a classic technique for transferring knowledge between domains , e.g. , deploying control policy trained in simulation to hardware platforms . The key idea is to let the algorithm in the source domain see massive samples under varying rendering configurations so that it is robust to discrepancies between source and target domains . We borrow this classic idea but upgrade it with two key innovations that substantially improve its effectiveness in our problem . First , we notice that image differences 1Project page : https : //sites.google.com/view/risp-iclr-2022/home . are sensitive to changes in rendering configurations . Therefore , they hardly reflect those renderinginvariant , dynamics-related parameters that we genuinely aim to match . This observation motivates us to propose a rendering-invariant state predictor ( RISP ) that extracts state information of a physical system from videos . By comparing in the state space instead of the image space , we rule out the interference of varying rendering configurations in videos from different rendering domains . The second innovation in our approach is to leverage rendering gradients from a differentiable renderer . Traditionally , domain randomization exploits data in the source domain without using their first-order information . Now that we have access to a differentiable renderer , their rendering gradients provide rich information that we should make full use of to train RISP . Essentially , requiring the output of RISP to be agnostic to rendering configurations equals enforcing its gradients for rendering parameters to be zero . Based on this idea , we propose a new loss function using rendering gradients and show an efficient method for integrating it into modern deep learning frameworks . Putting all these ideas together , we provide a powerful pipeline that effectively infers parameters of a physical system directly from video input under random rendering configurations . We demonstrate the efficacy of our approach on a variety of challenging tasks , including state estimation , system identification , imitation learning , and visuomotor control , with input videos generated from unknown rendering conditions . We evaluate these tasks on rigid-body systems with and without contact , an articulated body system , and a deformable-body system ( Fig . 1 ) , including a challenging dexterous hand ( Xu et al. , 2021 ) . The experimental results show that our approach outperforms the state-of-theart technique ( Jatavallabhula et al. , 2021 ) by a large margin in most of these tasks , which is primarily due to the inclusion of rendering gradients in the training process . In summary , our work makes the following contributions . First , we investigate and identify the bottleneck in inferring state , system , and control parameters of physical systems from videos under various rendering configurations ( Sec . 3.1 ) . Second , we propose a novel solution that combines domain randomization , state estimation , and differentiable rendering gradients to achieve generalizability across multiple rendering domains ( Sec . 3.2 ) . Third , we demonstrate the efficacy of our approach on several challenging tasks in rigid-body and deformable-body environments , including state estimation , system identification , imitation learning , and visuomotor control ( Sec . 4 ) . We will release our code and data along with the paper upon publication for readers to reproduce our results . 2 RELATED WORK . Differentiable simulation Differentiable simulation is a family of simulation methodology that equips traditional simulation with gradient information for simulation inputs . This additional gradient information connects simulation tasks with classic numerical optimization techniques . Previous works have demonstrated the power of gradients from a differentiable simulator in rigid-body dynamics ( Geilinger et al. , 2020 ; Degrave et al. , 2019 ; de Avila Belbute-Peres et al. , 2018 ; Xu et al. , 2021 ) , deformable-body dynamics ( Du et al. , 2021b ; a ; Hu et al. , 2019 ; Hahn et al. , 2019 ) , fluids ( Du et al. , 2020 ; McNamara et al. , 2004 ; Hu et al. , 2020 ) , and co-dimensional objects ( Qiao et al. , 2020 ; Liang et al. , 2019 ) , many of which show successful applications in system identification ( Hahn et al. , 2019 ) , trajectory optimization ( Hu et al. , 2019 ) , and closed-loop control ( Du et al. , 2021b ) . Our work is closely related to the progress in this field as we make heavy use of differentiable simulators in our pipeline . However , our contribution is orthogonal to them : we treat differentiable simulation as a black box , and our proposed approach is agnostic to the choice of simulators , as demonstrated by our environments involving rigid bodies , articulated bodies , and deformable bodies . Differentiable rendering Differentiable rendering methods offer gradient information for rendering inputs , e.g. , lighting , materials , cameras , or shapes ( Ramamoorthi et al. , 2007 ; Li et al. , 2015 ; Jarosz et al. , 2012 ) . The state-of-the-art differentiable renderers ( Li et al. , 2018 ; Nimier-David et al. , 2019 ) are very powerful in handling gradients even with discontinuities from occlusion or advanced global illumination effects . Our work leverages these differentiable renderers but with a quite different focus : our work instead uses rendering gradients as guidance to optimize parameters external to the renderer , which we hope can broaden the potential applications for differentiable rendering in the future . Domain randomization Our approach is closely related to domain randomization in the learning and robotics communities for transferring knowledge between domains having discrepancies ( Tobin et al. , 2017 ; Peng et al. , 2018 ; Andrychowicz et al. , 2020 ; Sadeghi & Levine , 2017 ; Tan et al. , 2018 ) . The intuition is that a model can hopefully cross the domain discrepancy by seeing a large amount of random data in the source domain . This often requires tedious data generation and leads to robust but conservative performances in the target domain . Our core idea in this work is distinctive from this line of research in that the generalizability of our method comes from a more accurate model that aims to match first-order gradient information , while the generalizability of domain randomization comes from a more robust model that attempts to absorb domain discrepancies by behaving conservatively . 3 METHOD . Given a video showing the dynamic motion of a physical system , our goal is to infer the unknown state , system , or control parameters directly from the video , with partial knowledge about the physics model and rendering conditions . Specifically , we assume we know the governing equations of the physical system ( e.g. , Newton ’ s law for rigid-body systems ) and the camera position in the video , but the exact system , control , or rendering parameters are not exposed . To solve this problem , we propose a pipeline that consists of two components : 1 ) a differentiable simulation and rendering engine ; 2 ) a novel rendering-invariant state-prediction network ( RISP ) . Our differentiable simulation and rendering engine simulates and renders the state of a physical system into an image output , and RISP learns to reconstruct state information of the physical system from images generated under varying rendering configurations . Putting these two components together , we have a pipeline that can faithfully recover dynamic information of a physical system from a new video with unseen rendering configurations . We give an overview of our approach in Fig . 2 . 3.1 DIFFERENTIABLE SIMULATION AND RENDERING ENGINE . Given a physical system with known dynamic modelM , we first use a differentiable simulator to simulate its states based on action inputs at each time step after time discretization : si+1 =Mφ ( si , ai ) , ∀i = 0 , 1 , · · · , N − 1 , ( 1 ) where N is the number of time steps in a rollout of physics simulation , and si , si+1 and ai represent the state and action vectors at the corresponding time steps , respectively . The φ vector encodes the system parameters in the model , e.g. , mass , inertia , and elasticity . Next , we apply a differentiable rendererR to generate an image Ii for each state si : Ii = Rψ ( si ) , ∀i = 0 , 1 , · · · , N. ( 2 ) Here , ψ is a vector encoding rendering parameters whose gradients are available in the renderer R. Examples of ψ include light intensity , material reflectence , or background color . By abuse of notation , we re-write the workflow of our simulation and rendering engine to a compact form : { Ii } = Rψ [ Mφ ( s0 , { ai } ) ︸ ︷︷ ︸ { si } ] . ( 3 ) In other words , given an initial state s0 and a sequence of actions { ai } , we generate a sequence of states { si } from simulation and renders the corresponding image sequence { Ii } . The task of recovering unknown information from a reference video { Irefi } can be formulated as follows : min s0 , { ai } , φ , ψ L ( { Irefi } , { Ii } ) , ( 4 ) s.t . { Ii } = Rψ [ Mφ ( s0 , { ai } ) ] , ( 5 ) where L is a loss function penalizing the difference between the generated images and their references . Assuming that the simulatorM and the renderer R are differentiable with respect to their inputs , we can run gradient-based optimization algorithms to solve Eqn . ( 4 ) . This is essentially the idea proposed in∇Sim , the state-of-the-art method for identifying parameters directly from video inputs ( Jatavallabhula et al. , 2021 ) . Specifically , ∇Sim defines L as a norm on pixelwise differences . One major limitation in Eqn . ( 4 ) is that it expects reasonably similar initial images { Ii } and references { Irefi } to successfully solve the optimization problem . Indeed , since the optimization problem is highly nonlinear due to its coupling between simulation and rendering , local optimization techniques like gradient-descent can be trapped into local minima easily if { Ii } and { Irefi } are not close enough . While ∇Sim has reported promising results when { Ii } and { Irefi } are rendered with moderately different ψ , we found in our experiments that directly optimizing L defined on the image space rarely works when the two rendering domains are vastly different ( Fig . 1 ) . Therefore , we believe it requires a fundamentally different solution , motivating us to propose RISP in our method . | This paper presents a new method of predicting physics simulation parameters and rendering configurations from an RGB video. Unlike previous methods that calculate the loss function in image space, this work proposes to calculate in the simulation state space to avoid the issues (e.g. being stuck in a local minimum) when the reference video is very different from the generated video. Specifically, a rendering-invariant state-prediction (RISP) network is pretrained with the generated data from a differentiable renderer under various rendering conditions. The RIST network is then appended to the output of a differentiable renderer to make the pipeline from simulation and rendering parameters to states predicted from images fully differentiable. Besides a state prediction loss term for training this pipeline, a novel regularization term is used to enforce the RISP network rendering invariant. In addition, a new training strategy to efficiently calculate the gradient for the loss function is proposed. The experiments have shown that the proposed method significantly outperforms the state-of-the-arts and the proposed components contribute to the final results with big improvements. | SP:ceb791bceee485601b5d8b33c92901c297c29d6a |
RISP: Rendering-Invariant State Predictor with Differentiable Simulation and Rendering for Cross-Domain Parameter Estimation | 1 INTRODUCTION . Reconstructing dynamic information about a physical system directly from a video has received considerable attention in the robotics , machine learning , computer vision , and graphics communities . This problem is fundamentally challenging because of its deep coupling among physics , geometry , and perception of a system . Traditional solutions like motion capture systems ( Vicon ; OptiTrack ; Qualisys ) can provide high-quality results but require prohibitively expensive external hardware platforms . More recent development in differentiable simulation and rendering provides an inexpensive and attractive alternative to the motion capture systems and has shown promising proof-of-concept results ( Jatavallabhula et al. , 2021 ) . However , existing methods in this direction typically assume the videos come from a known renderer . Such an assumption limits their usefulness in inferring dynamic information from an unknown rendering domain , which is common in real-world applications due to the discrepancy between rendering and real-world videos . Existing techniques for aligning different rendering domains , e.g. , CycleGAN ( Zhu et al. , 2017 ) , may help alleviate this issue . However , they typically require access to the target domain with massive data , which is not always available . To our best knowledge , inferring dynamic parameters of a physical system directly from videos under unknown rendering conditions remains far from being solved , and our work aims to fill this gap . Our work proposes a novel approach by combining three key ideas to address this challenging problem : domain randomization , state estimation , and rendering gradients . Domain randomization is a classic technique for transferring knowledge between domains , e.g. , deploying control policy trained in simulation to hardware platforms . The key idea is to let the algorithm in the source domain see massive samples under varying rendering configurations so that it is robust to discrepancies between source and target domains . We borrow this classic idea but upgrade it with two key innovations that substantially improve its effectiveness in our problem . First , we notice that image differences 1Project page : https : //sites.google.com/view/risp-iclr-2022/home . are sensitive to changes in rendering configurations . Therefore , they hardly reflect those renderinginvariant , dynamics-related parameters that we genuinely aim to match . This observation motivates us to propose a rendering-invariant state predictor ( RISP ) that extracts state information of a physical system from videos . By comparing in the state space instead of the image space , we rule out the interference of varying rendering configurations in videos from different rendering domains . The second innovation in our approach is to leverage rendering gradients from a differentiable renderer . Traditionally , domain randomization exploits data in the source domain without using their first-order information . Now that we have access to a differentiable renderer , their rendering gradients provide rich information that we should make full use of to train RISP . Essentially , requiring the output of RISP to be agnostic to rendering configurations equals enforcing its gradients for rendering parameters to be zero . Based on this idea , we propose a new loss function using rendering gradients and show an efficient method for integrating it into modern deep learning frameworks . Putting all these ideas together , we provide a powerful pipeline that effectively infers parameters of a physical system directly from video input under random rendering configurations . We demonstrate the efficacy of our approach on a variety of challenging tasks , including state estimation , system identification , imitation learning , and visuomotor control , with input videos generated from unknown rendering conditions . We evaluate these tasks on rigid-body systems with and without contact , an articulated body system , and a deformable-body system ( Fig . 1 ) , including a challenging dexterous hand ( Xu et al. , 2021 ) . The experimental results show that our approach outperforms the state-of-theart technique ( Jatavallabhula et al. , 2021 ) by a large margin in most of these tasks , which is primarily due to the inclusion of rendering gradients in the training process . In summary , our work makes the following contributions . First , we investigate and identify the bottleneck in inferring state , system , and control parameters of physical systems from videos under various rendering configurations ( Sec . 3.1 ) . Second , we propose a novel solution that combines domain randomization , state estimation , and differentiable rendering gradients to achieve generalizability across multiple rendering domains ( Sec . 3.2 ) . Third , we demonstrate the efficacy of our approach on several challenging tasks in rigid-body and deformable-body environments , including state estimation , system identification , imitation learning , and visuomotor control ( Sec . 4 ) . We will release our code and data along with the paper upon publication for readers to reproduce our results . 2 RELATED WORK . Differentiable simulation Differentiable simulation is a family of simulation methodology that equips traditional simulation with gradient information for simulation inputs . This additional gradient information connects simulation tasks with classic numerical optimization techniques . Previous works have demonstrated the power of gradients from a differentiable simulator in rigid-body dynamics ( Geilinger et al. , 2020 ; Degrave et al. , 2019 ; de Avila Belbute-Peres et al. , 2018 ; Xu et al. , 2021 ) , deformable-body dynamics ( Du et al. , 2021b ; a ; Hu et al. , 2019 ; Hahn et al. , 2019 ) , fluids ( Du et al. , 2020 ; McNamara et al. , 2004 ; Hu et al. , 2020 ) , and co-dimensional objects ( Qiao et al. , 2020 ; Liang et al. , 2019 ) , many of which show successful applications in system identification ( Hahn et al. , 2019 ) , trajectory optimization ( Hu et al. , 2019 ) , and closed-loop control ( Du et al. , 2021b ) . Our work is closely related to the progress in this field as we make heavy use of differentiable simulators in our pipeline . However , our contribution is orthogonal to them : we treat differentiable simulation as a black box , and our proposed approach is agnostic to the choice of simulators , as demonstrated by our environments involving rigid bodies , articulated bodies , and deformable bodies . Differentiable rendering Differentiable rendering methods offer gradient information for rendering inputs , e.g. , lighting , materials , cameras , or shapes ( Ramamoorthi et al. , 2007 ; Li et al. , 2015 ; Jarosz et al. , 2012 ) . The state-of-the-art differentiable renderers ( Li et al. , 2018 ; Nimier-David et al. , 2019 ) are very powerful in handling gradients even with discontinuities from occlusion or advanced global illumination effects . Our work leverages these differentiable renderers but with a quite different focus : our work instead uses rendering gradients as guidance to optimize parameters external to the renderer , which we hope can broaden the potential applications for differentiable rendering in the future . Domain randomization Our approach is closely related to domain randomization in the learning and robotics communities for transferring knowledge between domains having discrepancies ( Tobin et al. , 2017 ; Peng et al. , 2018 ; Andrychowicz et al. , 2020 ; Sadeghi & Levine , 2017 ; Tan et al. , 2018 ) . The intuition is that a model can hopefully cross the domain discrepancy by seeing a large amount of random data in the source domain . This often requires tedious data generation and leads to robust but conservative performances in the target domain . Our core idea in this work is distinctive from this line of research in that the generalizability of our method comes from a more accurate model that aims to match first-order gradient information , while the generalizability of domain randomization comes from a more robust model that attempts to absorb domain discrepancies by behaving conservatively . 3 METHOD . Given a video showing the dynamic motion of a physical system , our goal is to infer the unknown state , system , or control parameters directly from the video , with partial knowledge about the physics model and rendering conditions . Specifically , we assume we know the governing equations of the physical system ( e.g. , Newton ’ s law for rigid-body systems ) and the camera position in the video , but the exact system , control , or rendering parameters are not exposed . To solve this problem , we propose a pipeline that consists of two components : 1 ) a differentiable simulation and rendering engine ; 2 ) a novel rendering-invariant state-prediction network ( RISP ) . Our differentiable simulation and rendering engine simulates and renders the state of a physical system into an image output , and RISP learns to reconstruct state information of the physical system from images generated under varying rendering configurations . Putting these two components together , we have a pipeline that can faithfully recover dynamic information of a physical system from a new video with unseen rendering configurations . We give an overview of our approach in Fig . 2 . 3.1 DIFFERENTIABLE SIMULATION AND RENDERING ENGINE . Given a physical system with known dynamic modelM , we first use a differentiable simulator to simulate its states based on action inputs at each time step after time discretization : si+1 =Mφ ( si , ai ) , ∀i = 0 , 1 , · · · , N − 1 , ( 1 ) where N is the number of time steps in a rollout of physics simulation , and si , si+1 and ai represent the state and action vectors at the corresponding time steps , respectively . The φ vector encodes the system parameters in the model , e.g. , mass , inertia , and elasticity . Next , we apply a differentiable rendererR to generate an image Ii for each state si : Ii = Rψ ( si ) , ∀i = 0 , 1 , · · · , N. ( 2 ) Here , ψ is a vector encoding rendering parameters whose gradients are available in the renderer R. Examples of ψ include light intensity , material reflectence , or background color . By abuse of notation , we re-write the workflow of our simulation and rendering engine to a compact form : { Ii } = Rψ [ Mφ ( s0 , { ai } ) ︸ ︷︷ ︸ { si } ] . ( 3 ) In other words , given an initial state s0 and a sequence of actions { ai } , we generate a sequence of states { si } from simulation and renders the corresponding image sequence { Ii } . The task of recovering unknown information from a reference video { Irefi } can be formulated as follows : min s0 , { ai } , φ , ψ L ( { Irefi } , { Ii } ) , ( 4 ) s.t . { Ii } = Rψ [ Mφ ( s0 , { ai } ) ] , ( 5 ) where L is a loss function penalizing the difference between the generated images and their references . Assuming that the simulatorM and the renderer R are differentiable with respect to their inputs , we can run gradient-based optimization algorithms to solve Eqn . ( 4 ) . This is essentially the idea proposed in∇Sim , the state-of-the-art method for identifying parameters directly from video inputs ( Jatavallabhula et al. , 2021 ) . Specifically , ∇Sim defines L as a norm on pixelwise differences . One major limitation in Eqn . ( 4 ) is that it expects reasonably similar initial images { Ii } and references { Irefi } to successfully solve the optimization problem . Indeed , since the optimization problem is highly nonlinear due to its coupling between simulation and rendering , local optimization techniques like gradient-descent can be trapped into local minima easily if { Ii } and { Irefi } are not close enough . While ∇Sim has reported promising results when { Ii } and { Irefi } are rendered with moderately different ψ , we found in our experiments that directly optimizing L defined on the image space rarely works when the two rendering domains are vastly different ( Fig . 1 ) . Therefore , we believe it requires a fundamentally different solution , motivating us to propose RISP in our method . | The paper focuses on the problem of estimating dynamic parameters of a physical system from videos under unknown rendering conditions. It presents a novel idea of using a rendering-invariant state-prediction (RISP) network that predicts the state from a rendered image and can be integrated into a framework with a differentiable simulation and rendering engine for parameter estimation. Training this network is done using domain randomization technique with synthetic data. Additionally, the paper introduces a novel gradient loss that further pushes the network to be invariant to rendering parameters. | SP:ceb791bceee485601b5d8b33c92901c297c29d6a |
Picking up the pieces: separately evaluating supernet training and architecture selection | 1 INTRODUCTION . Neural architecture search ( NAS ) describes the problem of automatically selecting an effective neural network architecture for given data . In their survey of work on NAS , Elsken et . al . establish three necessary components to achieve this goal : a search space to define the set possible architectures , a search strategy to traverse over potential solutions , and a performance estimation strategy to rate the quality of potential solutions considered by the search strategy ( Elsken et al. , 2019 ) . In recent years a variety of search spaces and benchmark problems have been proposed in NAS ( Elsken et al. , 2019 ) . Exploring the space of search strategies has similarly generated vast interest , with approaches spanning evolutionary algorithms ( Real et al. , 2018 ) , Bayesian optimization ( Zela et al. , 2018 ) , reinforcement learning ( Pham et al. , 2018 ) , and , most recently , direct gradient descent ( Liu et al. , 2019 ) . Various methods for performance estimation have also been proposed , including weight inheritance ( Real et al. , 2017 ) , predictive models ( Liu et al. , 2018 ) , shortened training ( Zoph et al. , 2018 ) , and weight-sharing ( Pham et al. , 2018 ) . However , the search space , search strategy , and performance estimation components of a NAS algorithm do not operate in a vacuum , and the interactions and relationships between them may dramatically affect the behavior and performance of the overall algorithm . For example , performance estimates that extrapolate from previously seen models are biased by the search strategy ’ s method for traversing the search space and differentially sampling different models . Here , we suggest that the overwhelmingly trend in the current literature is to focus a study on innovations within a single one of these aspects ( e.g . shared-weight model training for performance estimation ) without a broader and systematic consideration , analysis , or even toolset for exploring the effects that this innovation may have on other components of the NAS algorithm ( e.g . search strategy for selecting architecture topologies ) . While we do claim to provide a perfect solution for the analysis an algorithmic innovation ’ s impact on each of the different components , here we provide one example of a systematic strategy and open-source toolset for performing such an investigation – and demonstrate a specific example of how such a perspective modifies the way that we interpret the theoretical impact of an important recent algorithmic and innovation . This paper focuses specifically on the class of algorithms which combine a weight-sharing performance estimation strategy and a gradient-based search strategy into the training of a single model . This approach trains a neural network representing a superposition of every architecture in the search space instead of training individual architectures and obtains performance estimates from this shared-weight model . This technique , which we will refer to as the supernet or supergraph method , was originally demonstrated by Pham et al . ( 2018 ) , however the gradient-based training method contributed by DARTS ( Liu et al. , 2019 ) eliminated the need to train a second reinforcement learning model to select architectures , leading to the development of the series of NAS algorithms combining performance estimating and search in a single model considered here . Note that following Bender et al . ( 2018 ) , the term “ One-shot NAS ” has been used to refer to supernet methods as they train a single model rather then iteratively training candidate architectures . However , as we will discuss iterative search algorithms implemented on top the supernet , we adopt the supernet terminology used by Wang et al . ( 2021 ) . Differentiable supernet NAS algorithms have gained popularity due to their speed attained through weight-sharing – especially relative to employing the “ gold standard ” performance measure of training a neural network from multiple different random initializations and measuring the accuracy on a held-out set of validation data that often requires thousands of GPU hours for a single run ( Zoph et al. , 2018 ) . They also benefit from and their ease of implementation within popular deep learning frameworks as a result of their reliance on gradient based optimization . Importantly for this paper ’ s perspective , these algorithms establish a special relationship between the search strategy and the performance estimation strategy – collapsing both components to the training of a single neural network . This presents a particular example of the cross-component interaction phenomenon described above during the supernet training , where the shared weights are trained to maximize the performance of the previously explored architectures , and are then employed to estimate the performance of new potential architectures . The feedback loop between these two processes thus creates an opportunity to bias search towards familiar solutions , possibly at the expense of undervaluing architectures which have high train-from-scratch performance , but may not perform well with the weights learned on previously explored architectures . This interaction is seen again post-supernet training , when the shared-weight model ( itself embodying the chosen performance estimation strategy ) is often critical in the process to select the single best architecture from the search space . With both architecture performance estimation and search strategy represented by the training of a single sueprnet model , it is perhaps not surprising that the distinct contributions of these two are not easily measured or conceptualized . We might further expect the degree to which this may be an issue to vary with the convexity of the search space , and the search strategy used to traverse that landscape . In order to facilitate a greater understanding of , and more robust comparisons between , differentiable supernet NAS algorithms , here we present two statistics designed to separately evaluate ( 1 ) the architecture search and ( 2 ) the performance estimation components of the supernet training process . We also demonstrate the value of separately evaluating performance estimation and search during supernet training by presenting a two-stage framing of differentiable stochastic NAS , delinking the process of training the supernet from the process of selecting an architecture using the supernet . Using our statistics of the Stage-1 supernet training , we present a method for approximating the reliance of the Stage-2 architecture selection methods on the performance estimation capabilities of the supernet versus the discovery of quality architectures through supernet training . We offer empirical results demonstrating the capabilities of using the presented statistics to design NAS algorithms through the composition of separate supernet training and architecture selection methods , as well as highlighting a case-study demonstrating the importance of considering the interactions of Stage-1 supernet training and Stage-2 architecture selection on the analysis of a recent algorithmic innovation . 2 RELATED WORK . 2.1 DIFFERENTIABLE SUPERNET NAS . DARTS was the first published differentiable NAS algorithm , utilizing a “ continuous relaxation ” method to parametrize the set of possible architectures , by placing trainable weights on each possible operation ( Liu et al. , 2019 ) . The final model is selected from these trained architecture weights by simply keeping only the operations with the largest weight . This method is general enough to support the discovery of a broad range of neural network topologies through the use of a “ zero ” operation , representing the lack of an edge between nodes . Numerous works since the publication of DARTS have attempted to demonstrate simple improvements on DARTS to stabilize training , avoid the hard prune at the end of training , or improve scalability . For example , PC-DARTS ( Xu et al. , 2020 ) has demonstrated partial channel training , allowing the use of larger supernet model . This work addresses the final hard prune by removing the magnitude based prune and substituting a perturbation-based pruning algorithm . While Chu et al . ( 2021 ) stabilizes the training process using an auxiliary skip connection , in contrast to prior work which relied on the Hessian eigenvalue regularizer . In motivating SNAS , Xie et al . comment on the performance estimation aspect of DARTS , demonstrating the disparity in the validation accuracy obtained from the shared weight model of DARTS using the whole shared-weight model and the pruned final architecture ( Xie et al. , 2019 ) . Stochastic differentiable NAS algorithms , like SNAS , offer one answer to this question of performance estimation in differentiable NAS through the use of sampling . These methods preserve the gradient-based approach of DARTS , while proposing a specific ( and increasingly discrete ) architecture at each step . Motivating the performances estimation abilities of shared weight models more generally , Bender et al . ( 2018 ) implement a path-based form of dropout , randomly masking portions of the shared weight model during training and demonstrated a strong correlation between performance estimates from shortened training and the shared weight model , suggesting that the two methods of performance estimation are comparable . 2.2 ZERO-SHOT NAS . Recently , methods have been proposed to select an architecture without training even a single architecture model . Much of these methods are based on proxies , like EcoNAS ( Zhou et al. , 2020 ) , while TE-NAS ( Chen et al. , 2021a ) recently demonstrated a zero-shot search based on measures emerging from deep learning theory . Abdelfattah et al . ( 2021 ) demonstrate a range of measures which have been used to compute saliency in other deep learning problems as possible measures to be useful in NAS . In this work we modify the adapted synflow measure demonstrate by Abdelfattah et al . ( 2021 ) as well their implementation Jacobian covariance measure developed by Mellor et al . ( 2021 ) to function as architecture selection techniques on a supernet . 2.3 SUPERNET NAS EVALUATION . Research on the evaluation of NAS methods has developed as a result of difficulties in comparing the performance NAS algorithms demonstrated in different architecture search spaces , as the selection of search space can have a greater effect on the final performance than the selection of NAS algorithm , which can be made clear through performing a random search ( Li & Talwalkar , 2019 ) . Yu et al . ( 2020 ) initiated the critical inquiry into the use of weight-sharing for performance estimation by evaluating popular weight-sharing NAS algorithms in a reduced search space of 32 architectures . They demonstrated a lack of correlation in ranking between the performance estimates obtained from the shared-weight model and the trained from scratch test accuracy for and an improvement in performance of the final model achieved by not using weight-sharing . Further research evaluating the rankings of small samples ( Yang et al. , 2020 ) or small search spaces ( Zhang et al. , 2020 ) showed high variance in rankings across random seeds after training the shared weight model through random sampling . Like these prior works , we also suggest the the accuracy of the top model alone can be a misleading evaluation technique for NAS algorithms . However , our basis for this assertion is not the design of the search space , but that the reported accuracy value may be due to the unintended interactions between algorithmic innovation presented and other components of the NAS algorithm ( e.g . performance estimation or search strategy ) , and not necessarily well represent the merits of the proposed methodology itself . This motivates our proposal here for additional metrics which evaluate separately the performance estimation or architecture sampling aspects of a given algorithm . This work is most aligned with direction of NAS evaluation research demonstrated by Zela et al . ( 2020 ) . In this work they propose the dominant eigenvalue of the Hessian of the validation loss w.r.t . the architecture parameters as a statistic which helps to explain the failure modes of DARTS . Specifically , they associate a large eigenvalue with a significant drop in performance resulting from pruning . We are also attempt to establish statistics which indicate the potential outcome of archi- tecture selection for a given trained supernet , however we are not focused on the pruning-based architecture selection used by DARTS . Instead of formulating our statistic to account for the failure modes of a specific NAS algorithm , we propose statistics based on the broad theory of the NAS process . | The authors study the question of evaluating differentiable methods for neural architecture search (NAS). Differentiable techniques are popular in the NAS community, and many recent papers have given criticisms or improvements to various parts of the DARTS algorithm and related algorithms. The authors propose a new way of evaluating differentiable techniques, and new metrics, by separately evaluating architecture training and architecture selection, and evaluating the combinations of the two. The authors run experiments on NAS-Bench-201 and use their evaluation technique to identify the best combination of architecture training and selection. | SP:0856c81319cd9dbbefc91f8357a04c664bd084b5 |
Picking up the pieces: separately evaluating supernet training and architecture selection | 1 INTRODUCTION . Neural architecture search ( NAS ) describes the problem of automatically selecting an effective neural network architecture for given data . In their survey of work on NAS , Elsken et . al . establish three necessary components to achieve this goal : a search space to define the set possible architectures , a search strategy to traverse over potential solutions , and a performance estimation strategy to rate the quality of potential solutions considered by the search strategy ( Elsken et al. , 2019 ) . In recent years a variety of search spaces and benchmark problems have been proposed in NAS ( Elsken et al. , 2019 ) . Exploring the space of search strategies has similarly generated vast interest , with approaches spanning evolutionary algorithms ( Real et al. , 2018 ) , Bayesian optimization ( Zela et al. , 2018 ) , reinforcement learning ( Pham et al. , 2018 ) , and , most recently , direct gradient descent ( Liu et al. , 2019 ) . Various methods for performance estimation have also been proposed , including weight inheritance ( Real et al. , 2017 ) , predictive models ( Liu et al. , 2018 ) , shortened training ( Zoph et al. , 2018 ) , and weight-sharing ( Pham et al. , 2018 ) . However , the search space , search strategy , and performance estimation components of a NAS algorithm do not operate in a vacuum , and the interactions and relationships between them may dramatically affect the behavior and performance of the overall algorithm . For example , performance estimates that extrapolate from previously seen models are biased by the search strategy ’ s method for traversing the search space and differentially sampling different models . Here , we suggest that the overwhelmingly trend in the current literature is to focus a study on innovations within a single one of these aspects ( e.g . shared-weight model training for performance estimation ) without a broader and systematic consideration , analysis , or even toolset for exploring the effects that this innovation may have on other components of the NAS algorithm ( e.g . search strategy for selecting architecture topologies ) . While we do claim to provide a perfect solution for the analysis an algorithmic innovation ’ s impact on each of the different components , here we provide one example of a systematic strategy and open-source toolset for performing such an investigation – and demonstrate a specific example of how such a perspective modifies the way that we interpret the theoretical impact of an important recent algorithmic and innovation . This paper focuses specifically on the class of algorithms which combine a weight-sharing performance estimation strategy and a gradient-based search strategy into the training of a single model . This approach trains a neural network representing a superposition of every architecture in the search space instead of training individual architectures and obtains performance estimates from this shared-weight model . This technique , which we will refer to as the supernet or supergraph method , was originally demonstrated by Pham et al . ( 2018 ) , however the gradient-based training method contributed by DARTS ( Liu et al. , 2019 ) eliminated the need to train a second reinforcement learning model to select architectures , leading to the development of the series of NAS algorithms combining performance estimating and search in a single model considered here . Note that following Bender et al . ( 2018 ) , the term “ One-shot NAS ” has been used to refer to supernet methods as they train a single model rather then iteratively training candidate architectures . However , as we will discuss iterative search algorithms implemented on top the supernet , we adopt the supernet terminology used by Wang et al . ( 2021 ) . Differentiable supernet NAS algorithms have gained popularity due to their speed attained through weight-sharing – especially relative to employing the “ gold standard ” performance measure of training a neural network from multiple different random initializations and measuring the accuracy on a held-out set of validation data that often requires thousands of GPU hours for a single run ( Zoph et al. , 2018 ) . They also benefit from and their ease of implementation within popular deep learning frameworks as a result of their reliance on gradient based optimization . Importantly for this paper ’ s perspective , these algorithms establish a special relationship between the search strategy and the performance estimation strategy – collapsing both components to the training of a single neural network . This presents a particular example of the cross-component interaction phenomenon described above during the supernet training , where the shared weights are trained to maximize the performance of the previously explored architectures , and are then employed to estimate the performance of new potential architectures . The feedback loop between these two processes thus creates an opportunity to bias search towards familiar solutions , possibly at the expense of undervaluing architectures which have high train-from-scratch performance , but may not perform well with the weights learned on previously explored architectures . This interaction is seen again post-supernet training , when the shared-weight model ( itself embodying the chosen performance estimation strategy ) is often critical in the process to select the single best architecture from the search space . With both architecture performance estimation and search strategy represented by the training of a single sueprnet model , it is perhaps not surprising that the distinct contributions of these two are not easily measured or conceptualized . We might further expect the degree to which this may be an issue to vary with the convexity of the search space , and the search strategy used to traverse that landscape . In order to facilitate a greater understanding of , and more robust comparisons between , differentiable supernet NAS algorithms , here we present two statistics designed to separately evaluate ( 1 ) the architecture search and ( 2 ) the performance estimation components of the supernet training process . We also demonstrate the value of separately evaluating performance estimation and search during supernet training by presenting a two-stage framing of differentiable stochastic NAS , delinking the process of training the supernet from the process of selecting an architecture using the supernet . Using our statistics of the Stage-1 supernet training , we present a method for approximating the reliance of the Stage-2 architecture selection methods on the performance estimation capabilities of the supernet versus the discovery of quality architectures through supernet training . We offer empirical results demonstrating the capabilities of using the presented statistics to design NAS algorithms through the composition of separate supernet training and architecture selection methods , as well as highlighting a case-study demonstrating the importance of considering the interactions of Stage-1 supernet training and Stage-2 architecture selection on the analysis of a recent algorithmic innovation . 2 RELATED WORK . 2.1 DIFFERENTIABLE SUPERNET NAS . DARTS was the first published differentiable NAS algorithm , utilizing a “ continuous relaxation ” method to parametrize the set of possible architectures , by placing trainable weights on each possible operation ( Liu et al. , 2019 ) . The final model is selected from these trained architecture weights by simply keeping only the operations with the largest weight . This method is general enough to support the discovery of a broad range of neural network topologies through the use of a “ zero ” operation , representing the lack of an edge between nodes . Numerous works since the publication of DARTS have attempted to demonstrate simple improvements on DARTS to stabilize training , avoid the hard prune at the end of training , or improve scalability . For example , PC-DARTS ( Xu et al. , 2020 ) has demonstrated partial channel training , allowing the use of larger supernet model . This work addresses the final hard prune by removing the magnitude based prune and substituting a perturbation-based pruning algorithm . While Chu et al . ( 2021 ) stabilizes the training process using an auxiliary skip connection , in contrast to prior work which relied on the Hessian eigenvalue regularizer . In motivating SNAS , Xie et al . comment on the performance estimation aspect of DARTS , demonstrating the disparity in the validation accuracy obtained from the shared weight model of DARTS using the whole shared-weight model and the pruned final architecture ( Xie et al. , 2019 ) . Stochastic differentiable NAS algorithms , like SNAS , offer one answer to this question of performance estimation in differentiable NAS through the use of sampling . These methods preserve the gradient-based approach of DARTS , while proposing a specific ( and increasingly discrete ) architecture at each step . Motivating the performances estimation abilities of shared weight models more generally , Bender et al . ( 2018 ) implement a path-based form of dropout , randomly masking portions of the shared weight model during training and demonstrated a strong correlation between performance estimates from shortened training and the shared weight model , suggesting that the two methods of performance estimation are comparable . 2.2 ZERO-SHOT NAS . Recently , methods have been proposed to select an architecture without training even a single architecture model . Much of these methods are based on proxies , like EcoNAS ( Zhou et al. , 2020 ) , while TE-NAS ( Chen et al. , 2021a ) recently demonstrated a zero-shot search based on measures emerging from deep learning theory . Abdelfattah et al . ( 2021 ) demonstrate a range of measures which have been used to compute saliency in other deep learning problems as possible measures to be useful in NAS . In this work we modify the adapted synflow measure demonstrate by Abdelfattah et al . ( 2021 ) as well their implementation Jacobian covariance measure developed by Mellor et al . ( 2021 ) to function as architecture selection techniques on a supernet . 2.3 SUPERNET NAS EVALUATION . Research on the evaluation of NAS methods has developed as a result of difficulties in comparing the performance NAS algorithms demonstrated in different architecture search spaces , as the selection of search space can have a greater effect on the final performance than the selection of NAS algorithm , which can be made clear through performing a random search ( Li & Talwalkar , 2019 ) . Yu et al . ( 2020 ) initiated the critical inquiry into the use of weight-sharing for performance estimation by evaluating popular weight-sharing NAS algorithms in a reduced search space of 32 architectures . They demonstrated a lack of correlation in ranking between the performance estimates obtained from the shared-weight model and the trained from scratch test accuracy for and an improvement in performance of the final model achieved by not using weight-sharing . Further research evaluating the rankings of small samples ( Yang et al. , 2020 ) or small search spaces ( Zhang et al. , 2020 ) showed high variance in rankings across random seeds after training the shared weight model through random sampling . Like these prior works , we also suggest the the accuracy of the top model alone can be a misleading evaluation technique for NAS algorithms . However , our basis for this assertion is not the design of the search space , but that the reported accuracy value may be due to the unintended interactions between algorithmic innovation presented and other components of the NAS algorithm ( e.g . performance estimation or search strategy ) , and not necessarily well represent the merits of the proposed methodology itself . This motivates our proposal here for additional metrics which evaluate separately the performance estimation or architecture sampling aspects of a given algorithm . This work is most aligned with direction of NAS evaluation research demonstrated by Zela et al . ( 2020 ) . In this work they propose the dominant eigenvalue of the Hessian of the validation loss w.r.t . the architecture parameters as a statistic which helps to explain the failure modes of DARTS . Specifically , they associate a large eigenvalue with a significant drop in performance resulting from pruning . We are also attempt to establish statistics which indicate the potential outcome of archi- tecture selection for a given trained supernet , however we are not focused on the pruning-based architecture selection used by DARTS . Instead of formulating our statistic to account for the failure modes of a specific NAS algorithm , we propose statistics based on the broad theory of the NAS process . | This paper studies the statistics of weight-sharing based neural architecture search (NAS) algorithms. In particular, it separates the training process into two stages: one is for supernet weight training and the other for architecture selection, and then it investigates the Spearman correlation and other statistics. All experiments are based on NAS-Bench201. | SP:0856c81319cd9dbbefc91f8357a04c664bd084b5 |
Picking up the pieces: separately evaluating supernet training and architecture selection | 1 INTRODUCTION . Neural architecture search ( NAS ) describes the problem of automatically selecting an effective neural network architecture for given data . In their survey of work on NAS , Elsken et . al . establish three necessary components to achieve this goal : a search space to define the set possible architectures , a search strategy to traverse over potential solutions , and a performance estimation strategy to rate the quality of potential solutions considered by the search strategy ( Elsken et al. , 2019 ) . In recent years a variety of search spaces and benchmark problems have been proposed in NAS ( Elsken et al. , 2019 ) . Exploring the space of search strategies has similarly generated vast interest , with approaches spanning evolutionary algorithms ( Real et al. , 2018 ) , Bayesian optimization ( Zela et al. , 2018 ) , reinforcement learning ( Pham et al. , 2018 ) , and , most recently , direct gradient descent ( Liu et al. , 2019 ) . Various methods for performance estimation have also been proposed , including weight inheritance ( Real et al. , 2017 ) , predictive models ( Liu et al. , 2018 ) , shortened training ( Zoph et al. , 2018 ) , and weight-sharing ( Pham et al. , 2018 ) . However , the search space , search strategy , and performance estimation components of a NAS algorithm do not operate in a vacuum , and the interactions and relationships between them may dramatically affect the behavior and performance of the overall algorithm . For example , performance estimates that extrapolate from previously seen models are biased by the search strategy ’ s method for traversing the search space and differentially sampling different models . Here , we suggest that the overwhelmingly trend in the current literature is to focus a study on innovations within a single one of these aspects ( e.g . shared-weight model training for performance estimation ) without a broader and systematic consideration , analysis , or even toolset for exploring the effects that this innovation may have on other components of the NAS algorithm ( e.g . search strategy for selecting architecture topologies ) . While we do claim to provide a perfect solution for the analysis an algorithmic innovation ’ s impact on each of the different components , here we provide one example of a systematic strategy and open-source toolset for performing such an investigation – and demonstrate a specific example of how such a perspective modifies the way that we interpret the theoretical impact of an important recent algorithmic and innovation . This paper focuses specifically on the class of algorithms which combine a weight-sharing performance estimation strategy and a gradient-based search strategy into the training of a single model . This approach trains a neural network representing a superposition of every architecture in the search space instead of training individual architectures and obtains performance estimates from this shared-weight model . This technique , which we will refer to as the supernet or supergraph method , was originally demonstrated by Pham et al . ( 2018 ) , however the gradient-based training method contributed by DARTS ( Liu et al. , 2019 ) eliminated the need to train a second reinforcement learning model to select architectures , leading to the development of the series of NAS algorithms combining performance estimating and search in a single model considered here . Note that following Bender et al . ( 2018 ) , the term “ One-shot NAS ” has been used to refer to supernet methods as they train a single model rather then iteratively training candidate architectures . However , as we will discuss iterative search algorithms implemented on top the supernet , we adopt the supernet terminology used by Wang et al . ( 2021 ) . Differentiable supernet NAS algorithms have gained popularity due to their speed attained through weight-sharing – especially relative to employing the “ gold standard ” performance measure of training a neural network from multiple different random initializations and measuring the accuracy on a held-out set of validation data that often requires thousands of GPU hours for a single run ( Zoph et al. , 2018 ) . They also benefit from and their ease of implementation within popular deep learning frameworks as a result of their reliance on gradient based optimization . Importantly for this paper ’ s perspective , these algorithms establish a special relationship between the search strategy and the performance estimation strategy – collapsing both components to the training of a single neural network . This presents a particular example of the cross-component interaction phenomenon described above during the supernet training , where the shared weights are trained to maximize the performance of the previously explored architectures , and are then employed to estimate the performance of new potential architectures . The feedback loop between these two processes thus creates an opportunity to bias search towards familiar solutions , possibly at the expense of undervaluing architectures which have high train-from-scratch performance , but may not perform well with the weights learned on previously explored architectures . This interaction is seen again post-supernet training , when the shared-weight model ( itself embodying the chosen performance estimation strategy ) is often critical in the process to select the single best architecture from the search space . With both architecture performance estimation and search strategy represented by the training of a single sueprnet model , it is perhaps not surprising that the distinct contributions of these two are not easily measured or conceptualized . We might further expect the degree to which this may be an issue to vary with the convexity of the search space , and the search strategy used to traverse that landscape . In order to facilitate a greater understanding of , and more robust comparisons between , differentiable supernet NAS algorithms , here we present two statistics designed to separately evaluate ( 1 ) the architecture search and ( 2 ) the performance estimation components of the supernet training process . We also demonstrate the value of separately evaluating performance estimation and search during supernet training by presenting a two-stage framing of differentiable stochastic NAS , delinking the process of training the supernet from the process of selecting an architecture using the supernet . Using our statistics of the Stage-1 supernet training , we present a method for approximating the reliance of the Stage-2 architecture selection methods on the performance estimation capabilities of the supernet versus the discovery of quality architectures through supernet training . We offer empirical results demonstrating the capabilities of using the presented statistics to design NAS algorithms through the composition of separate supernet training and architecture selection methods , as well as highlighting a case-study demonstrating the importance of considering the interactions of Stage-1 supernet training and Stage-2 architecture selection on the analysis of a recent algorithmic innovation . 2 RELATED WORK . 2.1 DIFFERENTIABLE SUPERNET NAS . DARTS was the first published differentiable NAS algorithm , utilizing a “ continuous relaxation ” method to parametrize the set of possible architectures , by placing trainable weights on each possible operation ( Liu et al. , 2019 ) . The final model is selected from these trained architecture weights by simply keeping only the operations with the largest weight . This method is general enough to support the discovery of a broad range of neural network topologies through the use of a “ zero ” operation , representing the lack of an edge between nodes . Numerous works since the publication of DARTS have attempted to demonstrate simple improvements on DARTS to stabilize training , avoid the hard prune at the end of training , or improve scalability . For example , PC-DARTS ( Xu et al. , 2020 ) has demonstrated partial channel training , allowing the use of larger supernet model . This work addresses the final hard prune by removing the magnitude based prune and substituting a perturbation-based pruning algorithm . While Chu et al . ( 2021 ) stabilizes the training process using an auxiliary skip connection , in contrast to prior work which relied on the Hessian eigenvalue regularizer . In motivating SNAS , Xie et al . comment on the performance estimation aspect of DARTS , demonstrating the disparity in the validation accuracy obtained from the shared weight model of DARTS using the whole shared-weight model and the pruned final architecture ( Xie et al. , 2019 ) . Stochastic differentiable NAS algorithms , like SNAS , offer one answer to this question of performance estimation in differentiable NAS through the use of sampling . These methods preserve the gradient-based approach of DARTS , while proposing a specific ( and increasingly discrete ) architecture at each step . Motivating the performances estimation abilities of shared weight models more generally , Bender et al . ( 2018 ) implement a path-based form of dropout , randomly masking portions of the shared weight model during training and demonstrated a strong correlation between performance estimates from shortened training and the shared weight model , suggesting that the two methods of performance estimation are comparable . 2.2 ZERO-SHOT NAS . Recently , methods have been proposed to select an architecture without training even a single architecture model . Much of these methods are based on proxies , like EcoNAS ( Zhou et al. , 2020 ) , while TE-NAS ( Chen et al. , 2021a ) recently demonstrated a zero-shot search based on measures emerging from deep learning theory . Abdelfattah et al . ( 2021 ) demonstrate a range of measures which have been used to compute saliency in other deep learning problems as possible measures to be useful in NAS . In this work we modify the adapted synflow measure demonstrate by Abdelfattah et al . ( 2021 ) as well their implementation Jacobian covariance measure developed by Mellor et al . ( 2021 ) to function as architecture selection techniques on a supernet . 2.3 SUPERNET NAS EVALUATION . Research on the evaluation of NAS methods has developed as a result of difficulties in comparing the performance NAS algorithms demonstrated in different architecture search spaces , as the selection of search space can have a greater effect on the final performance than the selection of NAS algorithm , which can be made clear through performing a random search ( Li & Talwalkar , 2019 ) . Yu et al . ( 2020 ) initiated the critical inquiry into the use of weight-sharing for performance estimation by evaluating popular weight-sharing NAS algorithms in a reduced search space of 32 architectures . They demonstrated a lack of correlation in ranking between the performance estimates obtained from the shared-weight model and the trained from scratch test accuracy for and an improvement in performance of the final model achieved by not using weight-sharing . Further research evaluating the rankings of small samples ( Yang et al. , 2020 ) or small search spaces ( Zhang et al. , 2020 ) showed high variance in rankings across random seeds after training the shared weight model through random sampling . Like these prior works , we also suggest the the accuracy of the top model alone can be a misleading evaluation technique for NAS algorithms . However , our basis for this assertion is not the design of the search space , but that the reported accuracy value may be due to the unintended interactions between algorithmic innovation presented and other components of the NAS algorithm ( e.g . performance estimation or search strategy ) , and not necessarily well represent the merits of the proposed methodology itself . This motivates our proposal here for additional metrics which evaluate separately the performance estimation or architecture sampling aspects of a given algorithm . This work is most aligned with direction of NAS evaluation research demonstrated by Zela et al . ( 2020 ) . In this work they propose the dominant eigenvalue of the Hessian of the validation loss w.r.t . the architecture parameters as a statistic which helps to explain the failure modes of DARTS . Specifically , they associate a large eigenvalue with a significant drop in performance resulting from pruning . We are also attempt to establish statistics which indicate the potential outcome of archi- tecture selection for a given trained supernet , however we are not focused on the pruning-based architecture selection used by DARTS . Instead of formulating our statistic to account for the failure modes of a specific NAS algorithm , we propose statistics based on the broad theory of the NAS process . | This paper introduces an evaluation methodology for differentiable NAS methods. Specifically, it separates the search of these methods into two stages: Stage 1, which consists of training the supernet, and Stage 2, whose goal is to select an architecture. These two stages are evaluated independently, and the results of these evaluations are combined into a score whose goal is to provide information about how well any combination of one Stage 1 strategy with one Stage 2 strategy would perform. | SP:0856c81319cd9dbbefc91f8357a04c664bd084b5 |
The Connection between Out-of-Distribution Generalization and Privacy of ML Models | 1 INTRODUCTION . Generalization of machine learning ( ML ) models to out-of-distribution data ( domains ) is important for the success of their deployment in practice . To address this challenge , several domain generalization ( DG ) learning techniques are proposed that achieve improved out-of-distribution ( OOD ) accuracy ( Dou et al. , 2019 ; Piratla et al. , 2020 ; Asadi et al. , 2019 ; Ilse et al. , 2020 ) . Among them , state-of-the-art solutions rely on the idea of learning stable feature representations whose effect on the output remains invariant across domains ( Arjovsky et al. , 2019 ; Mahajan et al. , 2021 ) . Since these stable features correspond to the causal mechanism by which real world data is generated , stable features-based learning methods reduce the OOD generalization gap ( Peters et al. , 2016 ) . Concurrently , there is a growing literature on ensuring privacy guarantees for ML models since privacy is an important requirement for deploying ML models , especially in sensitive domains . Privacy attacks such as membership inference can leak information about the data used to train models ( Shokri et al. , 2017 ) . Existing defenses such as differentially-private training prevent the leakage but hurt the model accuracy significantly ( Truex et al. , 2018 ; Zanella-Béguelin et al. , 2020 ; Carlini et al. , 2019 ) . Theoretically , failure to generalize ( i.e. , overfitting ) has been shown to be a sufficient condition for membership inference attacks when evaluated on the same distribution as training data ( Yeom et al. , 2018 ) . When evaluated on a different distribution , as is often the case in real-world domain generalization tasks , the membership attack risk is expected to worsen for standard algorithms ( e.g. , empirical risk minimization ) since generalization is harder . From the mitigation perspective under multiple data distributions , Tople et al . ( 2020 ) has theoretically shown that causal models that learn stable features are robust to membership inference attacks as compared to standard neural networks training . However , their result holds in the limited setting where all true stable features are known apriori ( causal sufficiency ) , which is unrealistic for most applications . With the empirical advances in DG algorithms that learn stable features , we ask whether better OOD generalization can provide a viable route to membership inference robustness . Specifically , we ask two questions : Would state-of-the-art domain generalization techniques that provide better out-ofdistribution generalization lead to membership privacy benefits ? And is learning stable features necessary for membership privacy benefits ? To answer these questions , we conduct an extensive empirical study using recent DG algorithms trained over multiple datasets : simulated datasets , semisimulated DG benchmarks , and a real-world Xrays dataset . Based on our experiments , we do not find a direct relationship between better OOD generalization and privacy . Our work provides the first empirical evidence that a higher generalization gap is not necessary to perform MI attacks in out-of-distribution deployment scenarios . Prior work has only confirmed the sufficiency argument from Yeom et al . ( 2018 ) for practical ML algorithms under indistribution deployment setting ( Shokri et al. , 2017 ; Salem et al. , 2019 ) . Specifically , we find that an algorithm with lower OOD generalization gap may have worse membership privacy compared to another with higher generalization gap . Instead , our results indicate that the ability of a model to learn stable features is a consistent indicator of its privacy guarantees in practice . This finding is true irrespective of whether the algorithm in theory relies on capturing stable features or not , thus distinguishing our findings from those of Tople et al . ( 2020 ) . When an ideal stable feature learner can be constructed , as in our synthetic datasets , the resultant model has the best privacy across all our experiments ( and also best OOD generalization ) , Moreover , with the same provable differential privacy guarantee , a stable feature learning algorithm obtains better accuracy than ERM , showing the privacy benefits of learning stable features . For the DG literature , our results point to a viable metric for measuring stability of learnt features , a fundamentally difficult task . Rather than OOD generalization , we find that MI robustness is better correlated with amount of stable features learnt and can be used to evaluate quality of DG algorithms . To summarize , our contributions are : • Through extensive experiments , we show that better out-of-distribution generalization does not always imply better privacy . We explain the result through a simple counter-example . • We provide the first empirical evidence that models that learn stable features are robust to membership inference attacks irrespective of the learning objective , thereby extending the theoretical results from Tople et al . ( 2020 ) . Further , for the same added noise for differential privacy , an algorithm with stable features provides better utility . • Current DG methods aimed to learn stable features do not do so even when they exhibit good OOD generalization . Therefore , we propose MI attack metric to evaluate quality of the learnt features , since it measures stable features better than OOD accuracy . 2 BACKGROUND & PROBLEM STATEMENT . We investigate connections between two streams of work : machine learning algorithms for generalization to unseen distributions and membership privacy risks of machine learning models . Out-of-Distribution/Domain Generalization . As standard training algorithms often fail at generalizing to data from a different distribution than the training data , there is increased attention on domain generalization algorithms that perform well on unseen distributions ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ; Peters et al. , 2016 ; Hendrycks & Dietterich , 2019 ; Hendrycks et al. , 2020 ; Piratla et al. , 2020 ; Gulrajani & Lopez-Paz , 2020 ; Mahajan et al. , 2021 ) . In a typical domain generalization ( DG ) task , a learning algorithm is given access to data from multiple domains at the training time . The goal is to train a model that has high accuracy on data from both the training domains as well as new unseen domains that the model may encounter once it is deployed in the wild . Formally , different domains correspond to different feature distributions P ( X ) ( covariate shift ) and/or different conditional distributionsP ( Y|X ) ( concept drift ) . To emulate realistic scenarios , the unseen domains are constrained in a reasonable way , for example , domains might be different locations or regions , different views or lighting conditions for photos , etc . Hence , prior work assumes that all domains share some stable features XC that cause the output label Y , for which the ideal function P ( Y|XC ) remains invariant across all the domains ( Arjovsky et al. , 2019 ) . Stable Features or Stable Representation . Given ( x , y ) |dk|i=1 data over k training domains { d1 , d2 .. dk } , a learnt representation Φ ( x ) is called stable if the prediction mechanism conditioned on them , Pd ( y|Φ ( x ) remains invariant for all the domains d ∈ { d1 , d2 , .. dk } . Additionally , we aim to learn stable representations such that classifier learnt upon them is optimal for generalization to unseen domains . Therefore , it is not surprising that state-of-the-art DG algorithms are designed to learn these stable or causal XC features . One class of methods learn causal representation by aiming that any pair of inputs that share the same causal features have the same representation . They use matching-based regularizer such as MatchDG ( Mahajan et al. , 2021 ) , or Perfect-Match that assumes knowledge of ground-truth matched pairs . Other methods like Invariant Risk Minimization ( IRM ) build a representation that is simultaneously optimal across all training domains ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ) , a property that is satisfied by the causal features . Another recent approach ( CSD ) aims to separate out input features into two parts such that one of them has common feature weights across domains , and uses only those common ( stable ) features for prediction ( Piratla et al. , 2020 ) . We use all these DG algorithms for our experiments ( Perfect-Match , MatchDG , IRM , CSD ) , in addition to non-stable learning algorithms , Random-Match ( that matches same-class inputs from different domains ( Motiian et al. , 2017 ) ) and ERM . Details of these algorithms are in Supp . B.1 . Membership Privacy . Ensuring membership privacy of ML models means hiding the knowledge of whether a particular record ( or user providing the record ) participated in the training of the model . Leakage of such membership information poses a serious privacy concern in sensitive applications such as healthcare . Remarkably , with only black-box access to the ML model ( and no access to the training data or the model parameters ) , attacks have been created that can guess the membership of an input with high accuracy ( Shokri et al. , 2017 ) . Overfitting to training dataset has been shown as one of the main reasons for membership leakage , both theoretically and empirically ( Yeom et al. , 2018 ; Shokri et al. , 2017 ) . Under bad generalization properties , the confidence in the prediction values and the resultant accuracy will be lower on a non-training point than a training point , and this difference has been exploited to design different variants of the membership inference attack ( Salem et al. , 2019 ; Song & Mittal , 2020 ; Nasr et al. , 2019 ) . For mitigating these attacks , training using differential privacy is the most widely used approach although it incurs substantial degradation in model utility ( Dwork et al. , 2014 ; Abadi et al. , 2016 ) . Research Questions . While prior work has studied the relationship of generalization and membership privacy of ML models for in-distribution setting , it is not well-established how this relationship transfers when we consider out-of-distribution evaluation data . This forms our first research question RQ1 . Does better out-of-distribution generalization always lead to better membership privacy ? As we shall see , the answer to the above question is negative . Given recent theoretical work ( Tople et al. , 2020 ) that shows models learning stable features are more differentially private and robust to membership privacy under certain conditions ( such as causal sufficiency ) , we ask a more nuanced question : RQ2 . Do methods that learn more stable features achieve better membership privacy ? Evaluation Metrics . To answer these questions , we compare DG models on three metrics , a ) Utility : Out-of-Distribution ( OOD ) accuracy on unseen domains ; b ) Privacy : attack accuracy using the loss-based membership inference attack ( Yeom et al. , 2018 ) ; and c ) Stable Features : The amount of stable features learnt . The first is the standard metric used to evaluate DG algorithms ( Gulrajani & Lopez-Paz , 2020 ) and the second is the simplest membership privacy attack metric that distinguishes members ( train domains ) from non-members ( test domains ) with only access to the loss values . The third , measuring stability of learnt features , is a fundamentally difficult question for DG models since stable features may correspond to unobserved high-level latent features . Therefore , we only measure it on the synthetic and semi-synthetic datasets where reliable metrics can be constructed . Further details regarding the evaluation metrics are provided in Supp . A . | The paper evaluates the connection between out of distribution (OOD) accuracy of a learning model and its privacy protection. They use Membership inference (MI) success rate as a metric to evaluate how much privacy some model provides. The setting they evaluate is when a model is train data and test data are drawn from different distributions. The main idea is that models trained on data from some distribution should be robust to distribution shift. The key insight from the literature is that models that generalize to out-of-distribution data are able to learn stable features of the data (features that are invariant to modest distribution shifts). The paper empirically evaluates the connection between the generalization ability of a model and its privacy (using the MI metric). | SP:421b9c2d581bda94684eb67972fa0b99d5388494 |
The Connection between Out-of-Distribution Generalization and Privacy of ML Models | 1 INTRODUCTION . Generalization of machine learning ( ML ) models to out-of-distribution data ( domains ) is important for the success of their deployment in practice . To address this challenge , several domain generalization ( DG ) learning techniques are proposed that achieve improved out-of-distribution ( OOD ) accuracy ( Dou et al. , 2019 ; Piratla et al. , 2020 ; Asadi et al. , 2019 ; Ilse et al. , 2020 ) . Among them , state-of-the-art solutions rely on the idea of learning stable feature representations whose effect on the output remains invariant across domains ( Arjovsky et al. , 2019 ; Mahajan et al. , 2021 ) . Since these stable features correspond to the causal mechanism by which real world data is generated , stable features-based learning methods reduce the OOD generalization gap ( Peters et al. , 2016 ) . Concurrently , there is a growing literature on ensuring privacy guarantees for ML models since privacy is an important requirement for deploying ML models , especially in sensitive domains . Privacy attacks such as membership inference can leak information about the data used to train models ( Shokri et al. , 2017 ) . Existing defenses such as differentially-private training prevent the leakage but hurt the model accuracy significantly ( Truex et al. , 2018 ; Zanella-Béguelin et al. , 2020 ; Carlini et al. , 2019 ) . Theoretically , failure to generalize ( i.e. , overfitting ) has been shown to be a sufficient condition for membership inference attacks when evaluated on the same distribution as training data ( Yeom et al. , 2018 ) . When evaluated on a different distribution , as is often the case in real-world domain generalization tasks , the membership attack risk is expected to worsen for standard algorithms ( e.g. , empirical risk minimization ) since generalization is harder . From the mitigation perspective under multiple data distributions , Tople et al . ( 2020 ) has theoretically shown that causal models that learn stable features are robust to membership inference attacks as compared to standard neural networks training . However , their result holds in the limited setting where all true stable features are known apriori ( causal sufficiency ) , which is unrealistic for most applications . With the empirical advances in DG algorithms that learn stable features , we ask whether better OOD generalization can provide a viable route to membership inference robustness . Specifically , we ask two questions : Would state-of-the-art domain generalization techniques that provide better out-ofdistribution generalization lead to membership privacy benefits ? And is learning stable features necessary for membership privacy benefits ? To answer these questions , we conduct an extensive empirical study using recent DG algorithms trained over multiple datasets : simulated datasets , semisimulated DG benchmarks , and a real-world Xrays dataset . Based on our experiments , we do not find a direct relationship between better OOD generalization and privacy . Our work provides the first empirical evidence that a higher generalization gap is not necessary to perform MI attacks in out-of-distribution deployment scenarios . Prior work has only confirmed the sufficiency argument from Yeom et al . ( 2018 ) for practical ML algorithms under indistribution deployment setting ( Shokri et al. , 2017 ; Salem et al. , 2019 ) . Specifically , we find that an algorithm with lower OOD generalization gap may have worse membership privacy compared to another with higher generalization gap . Instead , our results indicate that the ability of a model to learn stable features is a consistent indicator of its privacy guarantees in practice . This finding is true irrespective of whether the algorithm in theory relies on capturing stable features or not , thus distinguishing our findings from those of Tople et al . ( 2020 ) . When an ideal stable feature learner can be constructed , as in our synthetic datasets , the resultant model has the best privacy across all our experiments ( and also best OOD generalization ) , Moreover , with the same provable differential privacy guarantee , a stable feature learning algorithm obtains better accuracy than ERM , showing the privacy benefits of learning stable features . For the DG literature , our results point to a viable metric for measuring stability of learnt features , a fundamentally difficult task . Rather than OOD generalization , we find that MI robustness is better correlated with amount of stable features learnt and can be used to evaluate quality of DG algorithms . To summarize , our contributions are : • Through extensive experiments , we show that better out-of-distribution generalization does not always imply better privacy . We explain the result through a simple counter-example . • We provide the first empirical evidence that models that learn stable features are robust to membership inference attacks irrespective of the learning objective , thereby extending the theoretical results from Tople et al . ( 2020 ) . Further , for the same added noise for differential privacy , an algorithm with stable features provides better utility . • Current DG methods aimed to learn stable features do not do so even when they exhibit good OOD generalization . Therefore , we propose MI attack metric to evaluate quality of the learnt features , since it measures stable features better than OOD accuracy . 2 BACKGROUND & PROBLEM STATEMENT . We investigate connections between two streams of work : machine learning algorithms for generalization to unseen distributions and membership privacy risks of machine learning models . Out-of-Distribution/Domain Generalization . As standard training algorithms often fail at generalizing to data from a different distribution than the training data , there is increased attention on domain generalization algorithms that perform well on unseen distributions ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ; Peters et al. , 2016 ; Hendrycks & Dietterich , 2019 ; Hendrycks et al. , 2020 ; Piratla et al. , 2020 ; Gulrajani & Lopez-Paz , 2020 ; Mahajan et al. , 2021 ) . In a typical domain generalization ( DG ) task , a learning algorithm is given access to data from multiple domains at the training time . The goal is to train a model that has high accuracy on data from both the training domains as well as new unseen domains that the model may encounter once it is deployed in the wild . Formally , different domains correspond to different feature distributions P ( X ) ( covariate shift ) and/or different conditional distributionsP ( Y|X ) ( concept drift ) . To emulate realistic scenarios , the unseen domains are constrained in a reasonable way , for example , domains might be different locations or regions , different views or lighting conditions for photos , etc . Hence , prior work assumes that all domains share some stable features XC that cause the output label Y , for which the ideal function P ( Y|XC ) remains invariant across all the domains ( Arjovsky et al. , 2019 ) . Stable Features or Stable Representation . Given ( x , y ) |dk|i=1 data over k training domains { d1 , d2 .. dk } , a learnt representation Φ ( x ) is called stable if the prediction mechanism conditioned on them , Pd ( y|Φ ( x ) remains invariant for all the domains d ∈ { d1 , d2 , .. dk } . Additionally , we aim to learn stable representations such that classifier learnt upon them is optimal for generalization to unseen domains . Therefore , it is not surprising that state-of-the-art DG algorithms are designed to learn these stable or causal XC features . One class of methods learn causal representation by aiming that any pair of inputs that share the same causal features have the same representation . They use matching-based regularizer such as MatchDG ( Mahajan et al. , 2021 ) , or Perfect-Match that assumes knowledge of ground-truth matched pairs . Other methods like Invariant Risk Minimization ( IRM ) build a representation that is simultaneously optimal across all training domains ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ) , a property that is satisfied by the causal features . Another recent approach ( CSD ) aims to separate out input features into two parts such that one of them has common feature weights across domains , and uses only those common ( stable ) features for prediction ( Piratla et al. , 2020 ) . We use all these DG algorithms for our experiments ( Perfect-Match , MatchDG , IRM , CSD ) , in addition to non-stable learning algorithms , Random-Match ( that matches same-class inputs from different domains ( Motiian et al. , 2017 ) ) and ERM . Details of these algorithms are in Supp . B.1 . Membership Privacy . Ensuring membership privacy of ML models means hiding the knowledge of whether a particular record ( or user providing the record ) participated in the training of the model . Leakage of such membership information poses a serious privacy concern in sensitive applications such as healthcare . Remarkably , with only black-box access to the ML model ( and no access to the training data or the model parameters ) , attacks have been created that can guess the membership of an input with high accuracy ( Shokri et al. , 2017 ) . Overfitting to training dataset has been shown as one of the main reasons for membership leakage , both theoretically and empirically ( Yeom et al. , 2018 ; Shokri et al. , 2017 ) . Under bad generalization properties , the confidence in the prediction values and the resultant accuracy will be lower on a non-training point than a training point , and this difference has been exploited to design different variants of the membership inference attack ( Salem et al. , 2019 ; Song & Mittal , 2020 ; Nasr et al. , 2019 ) . For mitigating these attacks , training using differential privacy is the most widely used approach although it incurs substantial degradation in model utility ( Dwork et al. , 2014 ; Abadi et al. , 2016 ) . Research Questions . While prior work has studied the relationship of generalization and membership privacy of ML models for in-distribution setting , it is not well-established how this relationship transfers when we consider out-of-distribution evaluation data . This forms our first research question RQ1 . Does better out-of-distribution generalization always lead to better membership privacy ? As we shall see , the answer to the above question is negative . Given recent theoretical work ( Tople et al. , 2020 ) that shows models learning stable features are more differentially private and robust to membership privacy under certain conditions ( such as causal sufficiency ) , we ask a more nuanced question : RQ2 . Do methods that learn more stable features achieve better membership privacy ? Evaluation Metrics . To answer these questions , we compare DG models on three metrics , a ) Utility : Out-of-Distribution ( OOD ) accuracy on unseen domains ; b ) Privacy : attack accuracy using the loss-based membership inference attack ( Yeom et al. , 2018 ) ; and c ) Stable Features : The amount of stable features learnt . The first is the standard metric used to evaluate DG algorithms ( Gulrajani & Lopez-Paz , 2020 ) and the second is the simplest membership privacy attack metric that distinguishes members ( train domains ) from non-members ( test domains ) with only access to the loss values . The third , measuring stability of learnt features , is a fundamentally difficult question for DG models since stable features may correspond to unobserved high-level latent features . Therefore , we only measure it on the synthetic and semi-synthetic datasets where reliable metrics can be constructed . Further details regarding the evaluation metrics are provided in Supp . A . | This paper presents an extensive empirical study to show the connection between out-of-distribution (OOD) generalization, privacy and stable features using SOTA domain generalization methods. They propose to use MI attack metric, which requires no labeled data Pr(Y, X) but only the test data Pr(X), to evaluate quality of the learnt features, because they find out that it measures stable features better than OOD accuracy. The results shows that there is no direct relationship between better OOD generalization and privacy. They empirically prove that a higher generalization gap is not necessary to perform membership inference (MI) attacks in OOD deployment scenarios. They also show that for the same added noise for DP, an algorithm with stable features provides better utility. | SP:421b9c2d581bda94684eb67972fa0b99d5388494 |
The Connection between Out-of-Distribution Generalization and Privacy of ML Models | 1 INTRODUCTION . Generalization of machine learning ( ML ) models to out-of-distribution data ( domains ) is important for the success of their deployment in practice . To address this challenge , several domain generalization ( DG ) learning techniques are proposed that achieve improved out-of-distribution ( OOD ) accuracy ( Dou et al. , 2019 ; Piratla et al. , 2020 ; Asadi et al. , 2019 ; Ilse et al. , 2020 ) . Among them , state-of-the-art solutions rely on the idea of learning stable feature representations whose effect on the output remains invariant across domains ( Arjovsky et al. , 2019 ; Mahajan et al. , 2021 ) . Since these stable features correspond to the causal mechanism by which real world data is generated , stable features-based learning methods reduce the OOD generalization gap ( Peters et al. , 2016 ) . Concurrently , there is a growing literature on ensuring privacy guarantees for ML models since privacy is an important requirement for deploying ML models , especially in sensitive domains . Privacy attacks such as membership inference can leak information about the data used to train models ( Shokri et al. , 2017 ) . Existing defenses such as differentially-private training prevent the leakage but hurt the model accuracy significantly ( Truex et al. , 2018 ; Zanella-Béguelin et al. , 2020 ; Carlini et al. , 2019 ) . Theoretically , failure to generalize ( i.e. , overfitting ) has been shown to be a sufficient condition for membership inference attacks when evaluated on the same distribution as training data ( Yeom et al. , 2018 ) . When evaluated on a different distribution , as is often the case in real-world domain generalization tasks , the membership attack risk is expected to worsen for standard algorithms ( e.g. , empirical risk minimization ) since generalization is harder . From the mitigation perspective under multiple data distributions , Tople et al . ( 2020 ) has theoretically shown that causal models that learn stable features are robust to membership inference attacks as compared to standard neural networks training . However , their result holds in the limited setting where all true stable features are known apriori ( causal sufficiency ) , which is unrealistic for most applications . With the empirical advances in DG algorithms that learn stable features , we ask whether better OOD generalization can provide a viable route to membership inference robustness . Specifically , we ask two questions : Would state-of-the-art domain generalization techniques that provide better out-ofdistribution generalization lead to membership privacy benefits ? And is learning stable features necessary for membership privacy benefits ? To answer these questions , we conduct an extensive empirical study using recent DG algorithms trained over multiple datasets : simulated datasets , semisimulated DG benchmarks , and a real-world Xrays dataset . Based on our experiments , we do not find a direct relationship between better OOD generalization and privacy . Our work provides the first empirical evidence that a higher generalization gap is not necessary to perform MI attacks in out-of-distribution deployment scenarios . Prior work has only confirmed the sufficiency argument from Yeom et al . ( 2018 ) for practical ML algorithms under indistribution deployment setting ( Shokri et al. , 2017 ; Salem et al. , 2019 ) . Specifically , we find that an algorithm with lower OOD generalization gap may have worse membership privacy compared to another with higher generalization gap . Instead , our results indicate that the ability of a model to learn stable features is a consistent indicator of its privacy guarantees in practice . This finding is true irrespective of whether the algorithm in theory relies on capturing stable features or not , thus distinguishing our findings from those of Tople et al . ( 2020 ) . When an ideal stable feature learner can be constructed , as in our synthetic datasets , the resultant model has the best privacy across all our experiments ( and also best OOD generalization ) , Moreover , with the same provable differential privacy guarantee , a stable feature learning algorithm obtains better accuracy than ERM , showing the privacy benefits of learning stable features . For the DG literature , our results point to a viable metric for measuring stability of learnt features , a fundamentally difficult task . Rather than OOD generalization , we find that MI robustness is better correlated with amount of stable features learnt and can be used to evaluate quality of DG algorithms . To summarize , our contributions are : • Through extensive experiments , we show that better out-of-distribution generalization does not always imply better privacy . We explain the result through a simple counter-example . • We provide the first empirical evidence that models that learn stable features are robust to membership inference attacks irrespective of the learning objective , thereby extending the theoretical results from Tople et al . ( 2020 ) . Further , for the same added noise for differential privacy , an algorithm with stable features provides better utility . • Current DG methods aimed to learn stable features do not do so even when they exhibit good OOD generalization . Therefore , we propose MI attack metric to evaluate quality of the learnt features , since it measures stable features better than OOD accuracy . 2 BACKGROUND & PROBLEM STATEMENT . We investigate connections between two streams of work : machine learning algorithms for generalization to unseen distributions and membership privacy risks of machine learning models . Out-of-Distribution/Domain Generalization . As standard training algorithms often fail at generalizing to data from a different distribution than the training data , there is increased attention on domain generalization algorithms that perform well on unseen distributions ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ; Peters et al. , 2016 ; Hendrycks & Dietterich , 2019 ; Hendrycks et al. , 2020 ; Piratla et al. , 2020 ; Gulrajani & Lopez-Paz , 2020 ; Mahajan et al. , 2021 ) . In a typical domain generalization ( DG ) task , a learning algorithm is given access to data from multiple domains at the training time . The goal is to train a model that has high accuracy on data from both the training domains as well as new unseen domains that the model may encounter once it is deployed in the wild . Formally , different domains correspond to different feature distributions P ( X ) ( covariate shift ) and/or different conditional distributionsP ( Y|X ) ( concept drift ) . To emulate realistic scenarios , the unseen domains are constrained in a reasonable way , for example , domains might be different locations or regions , different views or lighting conditions for photos , etc . Hence , prior work assumes that all domains share some stable features XC that cause the output label Y , for which the ideal function P ( Y|XC ) remains invariant across all the domains ( Arjovsky et al. , 2019 ) . Stable Features or Stable Representation . Given ( x , y ) |dk|i=1 data over k training domains { d1 , d2 .. dk } , a learnt representation Φ ( x ) is called stable if the prediction mechanism conditioned on them , Pd ( y|Φ ( x ) remains invariant for all the domains d ∈ { d1 , d2 , .. dk } . Additionally , we aim to learn stable representations such that classifier learnt upon them is optimal for generalization to unseen domains . Therefore , it is not surprising that state-of-the-art DG algorithms are designed to learn these stable or causal XC features . One class of methods learn causal representation by aiming that any pair of inputs that share the same causal features have the same representation . They use matching-based regularizer such as MatchDG ( Mahajan et al. , 2021 ) , or Perfect-Match that assumes knowledge of ground-truth matched pairs . Other methods like Invariant Risk Minimization ( IRM ) build a representation that is simultaneously optimal across all training domains ( Arjovsky et al. , 2019 ; Ahuja et al. , 2020 ) , a property that is satisfied by the causal features . Another recent approach ( CSD ) aims to separate out input features into two parts such that one of them has common feature weights across domains , and uses only those common ( stable ) features for prediction ( Piratla et al. , 2020 ) . We use all these DG algorithms for our experiments ( Perfect-Match , MatchDG , IRM , CSD ) , in addition to non-stable learning algorithms , Random-Match ( that matches same-class inputs from different domains ( Motiian et al. , 2017 ) ) and ERM . Details of these algorithms are in Supp . B.1 . Membership Privacy . Ensuring membership privacy of ML models means hiding the knowledge of whether a particular record ( or user providing the record ) participated in the training of the model . Leakage of such membership information poses a serious privacy concern in sensitive applications such as healthcare . Remarkably , with only black-box access to the ML model ( and no access to the training data or the model parameters ) , attacks have been created that can guess the membership of an input with high accuracy ( Shokri et al. , 2017 ) . Overfitting to training dataset has been shown as one of the main reasons for membership leakage , both theoretically and empirically ( Yeom et al. , 2018 ; Shokri et al. , 2017 ) . Under bad generalization properties , the confidence in the prediction values and the resultant accuracy will be lower on a non-training point than a training point , and this difference has been exploited to design different variants of the membership inference attack ( Salem et al. , 2019 ; Song & Mittal , 2020 ; Nasr et al. , 2019 ) . For mitigating these attacks , training using differential privacy is the most widely used approach although it incurs substantial degradation in model utility ( Dwork et al. , 2014 ; Abadi et al. , 2016 ) . Research Questions . While prior work has studied the relationship of generalization and membership privacy of ML models for in-distribution setting , it is not well-established how this relationship transfers when we consider out-of-distribution evaluation data . This forms our first research question RQ1 . Does better out-of-distribution generalization always lead to better membership privacy ? As we shall see , the answer to the above question is negative . Given recent theoretical work ( Tople et al. , 2020 ) that shows models learning stable features are more differentially private and robust to membership privacy under certain conditions ( such as causal sufficiency ) , we ask a more nuanced question : RQ2 . Do methods that learn more stable features achieve better membership privacy ? Evaluation Metrics . To answer these questions , we compare DG models on three metrics , a ) Utility : Out-of-Distribution ( OOD ) accuracy on unseen domains ; b ) Privacy : attack accuracy using the loss-based membership inference attack ( Yeom et al. , 2018 ) ; and c ) Stable Features : The amount of stable features learnt . The first is the standard metric used to evaluate DG algorithms ( Gulrajani & Lopez-Paz , 2020 ) and the second is the simplest membership privacy attack metric that distinguishes members ( train domains ) from non-members ( test domains ) with only access to the loss values . The third , measuring stability of learnt features , is a fundamentally difficult question for DG models since stable features may correspond to unobserved high-level latent features . Therefore , we only measure it on the synthetic and semi-synthetic datasets where reliable metrics can be constructed . Further details regarding the evaluation metrics are provided in Supp . A . | The paper proposes to use the metric called "membership inference (MI) attack accuracy" as an indicator to determine the OOD generalization accuracy. The benefit of using such a metric is that no labeled data Pr(Y, X) is needed from the test data but only the test data Pr(X). The paper studies the correlation between MI attack accuracy and OOD accuracy on synthetic and real-world datasets. There is no theoretical treatment of the relationship but prior work Yeom et al. (2018) and Tople et al. (2020) was cited as the motivation. | SP:421b9c2d581bda94684eb67972fa0b99d5388494 |
Variational autoencoders in the presence of low-dimensional data: landscape and implicit bias | 1 INTRODUCTION . Variational autoencoders ( VAEs ) have recently enjoyed a revived interest , both due to architectural choices that have led to improvements in sample quality ( Oord et al. , 2017 ; Razavi et al. , 2019b ; Vahdat & Kautz , 2020 ) and due to algorithmic insights ( Dai et al. , 2017 ; Dai & Wipf , 2019 ) . Nevertheless , fine-grained understanding of the behavior of VAEs is lacking , both on the theoretical and empirical level . In our paper , we study a common setting of interest where the data is supported on a low-dimensional manifold — often argued to be the setting relevant to real-world image and text data due to the manifold hypothesis ( see e.g . Goodfellow et al . ( 2016 ) ) . In this setting , Dai & Wipf ( 2019 ) proposed a two-stage training process for VAEs , based on a combination of empirical and theoretical arguments suggesting that for standard VAE training with such data distributions : ( 1 ) the generator ’ s covariance will converge to 0 , ( 2 ) the generator will learn the correct manifold , but not the correct density on the manifold ( 3 ) the number of approximately 0 eigenvalues in the encoder covariance will equal the intrinsic dimensionality of the manifold ( see also Dai et al . ( 2017 ) ) . In this paper , we revisit this setting and explore the behaviour of both the VAE loss , and the training dynamics . Through a combination of theory and experiments we show that : • In the case of the data manifold being linear ( i.e . the data is Gaussian , supported on a linear subspace—equivalently , it is produced as the pushforward of a Gaussian through a linear map ) , and the encoder/decoder being parametrized as linear maps , we show that : a ) the set of optima includes parameters for which the generator ’ s support is a strict superset of the data manifold ; b ) the gradient descent dynamics are such that they converge to generators with support equal to the support of the data manifold . This provides a full proof of the conjecture in Dai & Wipf ( 2019 ) , albeit we show the phenomenon is a combination of both the location of the minima of the loss as well as an implicit bias of the training dynamics . • In the case of the data manifold being nonlinear ( i.e . the data distribution is the pushforward of the Gaussian through a nonlinear map f : Rr → Rd , r ≤ d ) , the gradient descent dynamics from a random start often converges to generators G whose support strictly contains the support of the underlying data distribution , while driving reconstruction error to 0 and driving the VAE loss to −∞ . This shows that the conjecture in Dai & Wipf ( 2019 ) does not hold for general nonlinear data manifolds and architectures for the generator/encoder . Organization : We will provide an informal overview of our findings in Section 3 . The rigorous discussion on the VAE landscape are in Section 4 and on the implicit bias of gradient descent in Section 5 . 2 SETUP . We will study the behavior of VAE learning when data lies on a low-dimensional manifold—more precisely , we study when the generator can recover the support of the underlying data distribution . In order to have a well-defined “ ground truth ” , both for our theoretical and empirical results , we will consider synthetic dataset that are generated by a “ ground truth ” generator as follows . Data distribution : To generate a sample point x for the data distribution , we will sample z ∼ N ( 0 , Ir ) , and output x = f ( z ) , for a suitably chosen f . In the linear case , f ( z ) = Az , for some matrix A ∈ Rd×r . In the nonlinear case , f ( z ) will be a nonlinear function f : Rr → Rd . We will consider several choices for f . Parameterization of the trained model : For the model we are training , the generator will sample z ∼ N ( 0 , Ir ) and output x ∼ N ( f ( z ) , I ) , for trainable f , ; the encoder given input x will output z ∼ N ( g ( x ) , D ) , where D ∈ Rr×r is a diagonal matrix , and g , D are trainable . In the linear case , f , g will be parameterized as matrices à , B̃ ; in the nonlinear case , several different parameterizations will be considered . In either case the VAE Loss will be denoted by L ( · ) , see ( 3 ) . 3 OUR RESULTS . Linear VAEs : the correct distribution is not recovered . Recall in the linear case , we train a linear encoder and decoder to learn a Gaussian distribution consisting of data points x ∼ N ( 0 , Σ ) — equivalently , the data distribution is the pushforward of a standard Gaussian z ∼ N ( 0 , Ir ) through a linear generator x = Az with AAT = Σ ; see also Section 2 above . In Theorem 1 of Lucas et al . ( 2019 ) , the authors proved that in a certain probabilistic PCA setting where Σ is full-rank , the landscape of the VAE loss has no spurious local minima : at any global minima of the loss , the VAE decoder exactly matches the ground truth distribution , i.e . ÃÃT + 2I = Σ . We revisit this problem in the setting where Σ has rank less than d so that the data lies on the lowerdimensional manifold/subspace spanned by the columns of A or equivalently Σ , denoted span ( A ) . We show empirically ( i.e . via simulations ) in Section 6 that when Σ is rank-degenerate the VAE actually fails to recover the correct distribution . More precisely , the recovered à has the correct column span but fails to recover the correct density — confirming predictions made in Dai & Wipf ( 2019 ) . We then explain theoretically why this happens , where it turns out we find some surprises . Landscape Analysis : Linear and Nonlinear VAE . Dai & Wipf ( 2019 ) made their predictions on the basis of the following observation about the loss landscape : there can exist sequences of VAE solutions whose objective value approaches −∞ ( i.e . are asymptotic global minima ) , for which the generator has the correct column span , but does not recover the correct density on the subspace . They also informally argued that these are all of the asymptotic global minima of loss landscape ( Pg 7 and Appendix I in Dai & Wipf ( 2019 ) ) , but did not give a formal theorem or proof of this claim . We settle the question by showing this is not the case:1 namely , there exist many convergent sequences of VAE solutions which still go to objective value −∞ but also do not recover the correct column span — instead , the span of such à is a strictly larger subspace . More precisely , we obtain a tight characterization of all asymptotic global minima of the loss landscape : Theorem 1 ( Optima of Linear VAE Loss , Informal Version of Theorem 3 ) . Suppose that à , B̃ are fixed matrices such that A = ÃB̃A and suppose that # { i : Ãi = 0 } > r − d , i.e . the number 1They also argued this would hold in the nonlinear case , but our simulations show this is generally false in that setting , even for the solutions chosen by gradient descent with a standard initialization — see Section 6. of zero columns of à is strictly larger than r − d. Then there exists ̃t → 0 and positive diagonal matrices D̃t such that limt→∞ L ( à , B̃ , D̃t , ̃t ) = −∞ . Also , these are all of the asymptotic global minima : any convergent sequence of points ( Ãt , B̃t , D̃t , ̃t ) along which the loss L goes to −∞ satisfies Ãt → à , B̃t → B̃ with A = ÃB̃A such that # { i : Ãi = 0 } > r − d. To interpret the constraint # { i : Ãi = 0 } > r − d , observe that if the data lies on a lowerdimensional subspace of dimension r∗ < d ( i.e . r∗ is the rank of Σ ) , then there exists a generator which generates the distribution with r − r∗ > r − d zero columns by taking an arbitrary lowrank factorization LLT = Σ with L : d × r∗ and defining A : d × r by A = [ L 0d×r−r∗ ] . The larger the gap is between the manifold/intrinsic dimension r∗ and the ambient dimension d , the more flexibility we have in constructing asymptotic global minima of the landscape . Also , we note there is no constraint in the Theorem that r − d ≥ 0 : the assumption is automatically satisfied if r < d. To summarize , the asymptotic global minima satisfy A = ÃB̃A , so the column span of à contains that of A , but in general it can be a higher dimensional space . For example , if d , r ≥ r∗ + 2 and and the ground truth generator is A = [ Ir∗ 0 0 0 ] , then à = [ Ir∗+1 0 0 0 ] and B̃ = [ Ir∗+1 0 0 0 ] is a perfectly valid asymptotic global optima of the landscape , even though decoder à generates a different higher-dimensional Gaussian distribution N ( 0 , [ Ir∗+1 0 0 0 ] ) than the ground truth . In the above result we showed that there are asymptotic global minima with higher dimensional spans even with the common restriction that the encoder variance is diagonal ; if we considered the case where the encoder variance is unconstrained , as done in Dai & Wipf ( 2019 ) , and/or can depend on its input x , this can only increase the number of ways to drive the objective value to −∞ . We also consider the analogous question in the nonlinear VAE setting where the data lies on a lowdimensional manifold . We prove in Theorem 6 that even in a very simple example where we fit a VAE to generate data produced by a 1-layer ground truth generator , there exists a bad solution with strictly larger manifold dimension which drives the reconstruction error to zero ( and VAE loss to −∞ ) . The proof of this result does not depend strongly on the details of this setup and it can be adapted to construct bad solutions for other nonlinear VAE settings . We note that the nature both of these result is asymptotic : that is , they consider sequences of solutions whose loss converges to −∞— but not the rate at which they do so . In the next section , we will consider the trajectories the optimization algorithm takes , when the loss is minimized through gradient descent . Linear VAE : implicit regularization of gradient flow . The above theorem indicates that studying the minima of the loss landscape alone can not explain the empirical phenomenon of linear VAE training recovering the support of the ground truth manifold in experiments ; the only prediction that can be made is that the VAE will recover a possibly larger manifold containing the data . We resolve this tension by proving that gradient flow , the continuous time version of gradient descent , has an implicit bias towards the low-rank global optima . Precisely , we measure the effective rank quantitatively in terms of the singular values : namely , if σk ( à ) denotes the k-th largest singular value of matrix à , we show that all but the largest dim ( spanA ) singular values of à decay at an exponential rate , as long as : ( 1 ) the gradient flow continues to exist2 , and ( 2 ) the gradient flow does not go off to infinity , i.e . neither à or ̃ go to infinity ( in simulations , the decoder à converges to a bounded point and ̃ → 0 so the latter assumption is true ) . To simplify the proof , we work with a slightly modified loss which “ eliminates ” the encoder variance by setting it to its optimal value : L1 ( à , B̃ , ̃ ) : = minD̃ L ( à , B̃ , ̃ , D̃ ) ; this loss has a simpler closed form , and we believe the theorems should hold for the standard loss as well . ( Generally , gradient descent on the original loss L will try to optimize D̃ in terms of the other parameters , and if it succeeds to keep D̃ well-tuned in terms of à , B̃ , ̃ then L will behave like the simplified loss L1 . ) 2We remind the reader that the gradient flow on loss L ( x ) is a differential equation dx/dt = −∇L ( x ) . Unlike discrete-time gradient descent , gradient flow in some cases ( e.g . dx/dt = x2 ) has solutions which exist only for a finite time ( e.g . x = 1/ ( 1 − t ) ) , which “ blows up ” at t = 1 ) , so we need to explicitly assume the solution exists up to time T . Theorem 2 ( Implicit Bias of Gradient Flow , Informal version of Theorem 5 ) . Let A : d × r be arbitrary and define W to be the span of the rows of A , let Θ̃ ( 0 ) = ( à ( 0 ) , B̃ ( 0 ) , ̃ ( 0 ) ) be an arbitrary initialization and define the gradient flow Θ̃ ( t ) = ( à ( t ) , B̃ ( t ) , ̃ ( t ) ) by the ordinary differential equation ( ODE ) dΘ̃ ( t ) dt = −∇L1 ( Θ̃ ( t ) ) ( 1 ) with initial condition Θ0 . If the solution to this equation exists on the time interval [ 0 , T ] and satisfies maxt∈ [ 0 , T ] maxj [ ‖ ( Ãt ) j‖2 + ̃2t ] ≤ K , then for all t ∈ [ 0 , T ] we have d∑ k=dim ( W ) +1 σ2k ( à ( t ) ) ≤ C ( A , à ) e−t/K ( 2 ) where C ( A , à ) : = ‖PW⊥ÃT ( 0 ) ‖2F and PW⊥ is the orthogonal projection onto the orthogonal complement of W . Together , our Theorem 1 and Theorem 2 show that if gradient descent converges to a point while driving the loss to −∞ , then it successfully recovers the ground truth subspace/manifold spanA . This shows that , in the linear case , the conjecture of Dai & Wipf ( 2019 ) can indeed be validated provided we incorporate training dynamics into the picture . The prediction of theirs we do not prove is that the number of zero entries of the encoder covariance D converges to the intrinsic dimension ; as shown in Table 1 , in a few experimental runs this does not occur — in contrast , Theorem 2 implies that à should have the right number of nonzero singular values and our experiments agree with this . Nonlinear VAE : Dynamics and Simulations . In the linear case , we showed that the implicit bias of gradient descent leads the VAE training to converge to a distribution with the correct support . In the nonlinear case , we show that this does not happen—even in simple cases . Precisely , in the setup of the one-layer ground truth generator , where we proved ( Theorem 6 ) there exist bad global optima of the landscape , we verify experimentally ( see Figure 1 ) that gradient descent from a random start does indeed converge to such bad asymptotic minima . In particular , this shows that whether or not gradient descent has a favorable implicit bias strongly depends on the data distribution and VAE architecture . More generally , by performing experiments with synthetic data of known manifold dimension , we make the following conclusions : ( 1 ) gradient descent training recovers manifolds approximately containing the data , ( 2 ) these manifolds are generally not the same dimension as the ground truth manifold , but larger ( this is in contrast to the conjecture in Dai & Wipf ( 2019 ) that they should be equal ) even when the decoder and encoder are large enough to represent the ground truth and the reconstruction error is driven to 0 ( VAE loss is driven to −∞ ) , and ( 3 ) of all manifolds containing the data , gradient descent still seems to favor those with relatively low ( but not always minimal ) dimension . Further investigating the precise role of VAE architecture and optimization algorithm , as well as the interplay with the data distribution is an exciting direction for future work . | This paper builds on a recent theoretical work by Dai & Wipf [1]. Dai & Wipf analyze the *optimal* behavior of VAEs, when applied to manifold-valued data. This work analyzes the *training* behavior of VAEs, when applied to manifold-valued data. Both consider the non-trivial case where the manifold’s intrinsic dimension is lower than the ambient dimension. Dai & Wipf considers VAEs with arbitrarily complex encoders and decoders. The present work considers VAEs with linear encoders and linear/single-hidden layer nonlinear decoders. [1] Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019. | SP:7bd1696a9e3413c43f5ef996a0d1e43d13847847 |
Variational autoencoders in the presence of low-dimensional data: landscape and implicit bias | 1 INTRODUCTION . Variational autoencoders ( VAEs ) have recently enjoyed a revived interest , both due to architectural choices that have led to improvements in sample quality ( Oord et al. , 2017 ; Razavi et al. , 2019b ; Vahdat & Kautz , 2020 ) and due to algorithmic insights ( Dai et al. , 2017 ; Dai & Wipf , 2019 ) . Nevertheless , fine-grained understanding of the behavior of VAEs is lacking , both on the theoretical and empirical level . In our paper , we study a common setting of interest where the data is supported on a low-dimensional manifold — often argued to be the setting relevant to real-world image and text data due to the manifold hypothesis ( see e.g . Goodfellow et al . ( 2016 ) ) . In this setting , Dai & Wipf ( 2019 ) proposed a two-stage training process for VAEs , based on a combination of empirical and theoretical arguments suggesting that for standard VAE training with such data distributions : ( 1 ) the generator ’ s covariance will converge to 0 , ( 2 ) the generator will learn the correct manifold , but not the correct density on the manifold ( 3 ) the number of approximately 0 eigenvalues in the encoder covariance will equal the intrinsic dimensionality of the manifold ( see also Dai et al . ( 2017 ) ) . In this paper , we revisit this setting and explore the behaviour of both the VAE loss , and the training dynamics . Through a combination of theory and experiments we show that : • In the case of the data manifold being linear ( i.e . the data is Gaussian , supported on a linear subspace—equivalently , it is produced as the pushforward of a Gaussian through a linear map ) , and the encoder/decoder being parametrized as linear maps , we show that : a ) the set of optima includes parameters for which the generator ’ s support is a strict superset of the data manifold ; b ) the gradient descent dynamics are such that they converge to generators with support equal to the support of the data manifold . This provides a full proof of the conjecture in Dai & Wipf ( 2019 ) , albeit we show the phenomenon is a combination of both the location of the minima of the loss as well as an implicit bias of the training dynamics . • In the case of the data manifold being nonlinear ( i.e . the data distribution is the pushforward of the Gaussian through a nonlinear map f : Rr → Rd , r ≤ d ) , the gradient descent dynamics from a random start often converges to generators G whose support strictly contains the support of the underlying data distribution , while driving reconstruction error to 0 and driving the VAE loss to −∞ . This shows that the conjecture in Dai & Wipf ( 2019 ) does not hold for general nonlinear data manifolds and architectures for the generator/encoder . Organization : We will provide an informal overview of our findings in Section 3 . The rigorous discussion on the VAE landscape are in Section 4 and on the implicit bias of gradient descent in Section 5 . 2 SETUP . We will study the behavior of VAE learning when data lies on a low-dimensional manifold—more precisely , we study when the generator can recover the support of the underlying data distribution . In order to have a well-defined “ ground truth ” , both for our theoretical and empirical results , we will consider synthetic dataset that are generated by a “ ground truth ” generator as follows . Data distribution : To generate a sample point x for the data distribution , we will sample z ∼ N ( 0 , Ir ) , and output x = f ( z ) , for a suitably chosen f . In the linear case , f ( z ) = Az , for some matrix A ∈ Rd×r . In the nonlinear case , f ( z ) will be a nonlinear function f : Rr → Rd . We will consider several choices for f . Parameterization of the trained model : For the model we are training , the generator will sample z ∼ N ( 0 , Ir ) and output x ∼ N ( f ( z ) , I ) , for trainable f , ; the encoder given input x will output z ∼ N ( g ( x ) , D ) , where D ∈ Rr×r is a diagonal matrix , and g , D are trainable . In the linear case , f , g will be parameterized as matrices à , B̃ ; in the nonlinear case , several different parameterizations will be considered . In either case the VAE Loss will be denoted by L ( · ) , see ( 3 ) . 3 OUR RESULTS . Linear VAEs : the correct distribution is not recovered . Recall in the linear case , we train a linear encoder and decoder to learn a Gaussian distribution consisting of data points x ∼ N ( 0 , Σ ) — equivalently , the data distribution is the pushforward of a standard Gaussian z ∼ N ( 0 , Ir ) through a linear generator x = Az with AAT = Σ ; see also Section 2 above . In Theorem 1 of Lucas et al . ( 2019 ) , the authors proved that in a certain probabilistic PCA setting where Σ is full-rank , the landscape of the VAE loss has no spurious local minima : at any global minima of the loss , the VAE decoder exactly matches the ground truth distribution , i.e . ÃÃT + 2I = Σ . We revisit this problem in the setting where Σ has rank less than d so that the data lies on the lowerdimensional manifold/subspace spanned by the columns of A or equivalently Σ , denoted span ( A ) . We show empirically ( i.e . via simulations ) in Section 6 that when Σ is rank-degenerate the VAE actually fails to recover the correct distribution . More precisely , the recovered à has the correct column span but fails to recover the correct density — confirming predictions made in Dai & Wipf ( 2019 ) . We then explain theoretically why this happens , where it turns out we find some surprises . Landscape Analysis : Linear and Nonlinear VAE . Dai & Wipf ( 2019 ) made their predictions on the basis of the following observation about the loss landscape : there can exist sequences of VAE solutions whose objective value approaches −∞ ( i.e . are asymptotic global minima ) , for which the generator has the correct column span , but does not recover the correct density on the subspace . They also informally argued that these are all of the asymptotic global minima of loss landscape ( Pg 7 and Appendix I in Dai & Wipf ( 2019 ) ) , but did not give a formal theorem or proof of this claim . We settle the question by showing this is not the case:1 namely , there exist many convergent sequences of VAE solutions which still go to objective value −∞ but also do not recover the correct column span — instead , the span of such à is a strictly larger subspace . More precisely , we obtain a tight characterization of all asymptotic global minima of the loss landscape : Theorem 1 ( Optima of Linear VAE Loss , Informal Version of Theorem 3 ) . Suppose that à , B̃ are fixed matrices such that A = ÃB̃A and suppose that # { i : Ãi = 0 } > r − d , i.e . the number 1They also argued this would hold in the nonlinear case , but our simulations show this is generally false in that setting , even for the solutions chosen by gradient descent with a standard initialization — see Section 6. of zero columns of à is strictly larger than r − d. Then there exists ̃t → 0 and positive diagonal matrices D̃t such that limt→∞ L ( à , B̃ , D̃t , ̃t ) = −∞ . Also , these are all of the asymptotic global minima : any convergent sequence of points ( Ãt , B̃t , D̃t , ̃t ) along which the loss L goes to −∞ satisfies Ãt → à , B̃t → B̃ with A = ÃB̃A such that # { i : Ãi = 0 } > r − d. To interpret the constraint # { i : Ãi = 0 } > r − d , observe that if the data lies on a lowerdimensional subspace of dimension r∗ < d ( i.e . r∗ is the rank of Σ ) , then there exists a generator which generates the distribution with r − r∗ > r − d zero columns by taking an arbitrary lowrank factorization LLT = Σ with L : d × r∗ and defining A : d × r by A = [ L 0d×r−r∗ ] . The larger the gap is between the manifold/intrinsic dimension r∗ and the ambient dimension d , the more flexibility we have in constructing asymptotic global minima of the landscape . Also , we note there is no constraint in the Theorem that r − d ≥ 0 : the assumption is automatically satisfied if r < d. To summarize , the asymptotic global minima satisfy A = ÃB̃A , so the column span of à contains that of A , but in general it can be a higher dimensional space . For example , if d , r ≥ r∗ + 2 and and the ground truth generator is A = [ Ir∗ 0 0 0 ] , then à = [ Ir∗+1 0 0 0 ] and B̃ = [ Ir∗+1 0 0 0 ] is a perfectly valid asymptotic global optima of the landscape , even though decoder à generates a different higher-dimensional Gaussian distribution N ( 0 , [ Ir∗+1 0 0 0 ] ) than the ground truth . In the above result we showed that there are asymptotic global minima with higher dimensional spans even with the common restriction that the encoder variance is diagonal ; if we considered the case where the encoder variance is unconstrained , as done in Dai & Wipf ( 2019 ) , and/or can depend on its input x , this can only increase the number of ways to drive the objective value to −∞ . We also consider the analogous question in the nonlinear VAE setting where the data lies on a lowdimensional manifold . We prove in Theorem 6 that even in a very simple example where we fit a VAE to generate data produced by a 1-layer ground truth generator , there exists a bad solution with strictly larger manifold dimension which drives the reconstruction error to zero ( and VAE loss to −∞ ) . The proof of this result does not depend strongly on the details of this setup and it can be adapted to construct bad solutions for other nonlinear VAE settings . We note that the nature both of these result is asymptotic : that is , they consider sequences of solutions whose loss converges to −∞— but not the rate at which they do so . In the next section , we will consider the trajectories the optimization algorithm takes , when the loss is minimized through gradient descent . Linear VAE : implicit regularization of gradient flow . The above theorem indicates that studying the minima of the loss landscape alone can not explain the empirical phenomenon of linear VAE training recovering the support of the ground truth manifold in experiments ; the only prediction that can be made is that the VAE will recover a possibly larger manifold containing the data . We resolve this tension by proving that gradient flow , the continuous time version of gradient descent , has an implicit bias towards the low-rank global optima . Precisely , we measure the effective rank quantitatively in terms of the singular values : namely , if σk ( à ) denotes the k-th largest singular value of matrix à , we show that all but the largest dim ( spanA ) singular values of à decay at an exponential rate , as long as : ( 1 ) the gradient flow continues to exist2 , and ( 2 ) the gradient flow does not go off to infinity , i.e . neither à or ̃ go to infinity ( in simulations , the decoder à converges to a bounded point and ̃ → 0 so the latter assumption is true ) . To simplify the proof , we work with a slightly modified loss which “ eliminates ” the encoder variance by setting it to its optimal value : L1 ( à , B̃ , ̃ ) : = minD̃ L ( à , B̃ , ̃ , D̃ ) ; this loss has a simpler closed form , and we believe the theorems should hold for the standard loss as well . ( Generally , gradient descent on the original loss L will try to optimize D̃ in terms of the other parameters , and if it succeeds to keep D̃ well-tuned in terms of à , B̃ , ̃ then L will behave like the simplified loss L1 . ) 2We remind the reader that the gradient flow on loss L ( x ) is a differential equation dx/dt = −∇L ( x ) . Unlike discrete-time gradient descent , gradient flow in some cases ( e.g . dx/dt = x2 ) has solutions which exist only for a finite time ( e.g . x = 1/ ( 1 − t ) ) , which “ blows up ” at t = 1 ) , so we need to explicitly assume the solution exists up to time T . Theorem 2 ( Implicit Bias of Gradient Flow , Informal version of Theorem 5 ) . Let A : d × r be arbitrary and define W to be the span of the rows of A , let Θ̃ ( 0 ) = ( à ( 0 ) , B̃ ( 0 ) , ̃ ( 0 ) ) be an arbitrary initialization and define the gradient flow Θ̃ ( t ) = ( à ( t ) , B̃ ( t ) , ̃ ( t ) ) by the ordinary differential equation ( ODE ) dΘ̃ ( t ) dt = −∇L1 ( Θ̃ ( t ) ) ( 1 ) with initial condition Θ0 . If the solution to this equation exists on the time interval [ 0 , T ] and satisfies maxt∈ [ 0 , T ] maxj [ ‖ ( Ãt ) j‖2 + ̃2t ] ≤ K , then for all t ∈ [ 0 , T ] we have d∑ k=dim ( W ) +1 σ2k ( à ( t ) ) ≤ C ( A , à ) e−t/K ( 2 ) where C ( A , à ) : = ‖PW⊥ÃT ( 0 ) ‖2F and PW⊥ is the orthogonal projection onto the orthogonal complement of W . Together , our Theorem 1 and Theorem 2 show that if gradient descent converges to a point while driving the loss to −∞ , then it successfully recovers the ground truth subspace/manifold spanA . This shows that , in the linear case , the conjecture of Dai & Wipf ( 2019 ) can indeed be validated provided we incorporate training dynamics into the picture . The prediction of theirs we do not prove is that the number of zero entries of the encoder covariance D converges to the intrinsic dimension ; as shown in Table 1 , in a few experimental runs this does not occur — in contrast , Theorem 2 implies that à should have the right number of nonzero singular values and our experiments agree with this . Nonlinear VAE : Dynamics and Simulations . In the linear case , we showed that the implicit bias of gradient descent leads the VAE training to converge to a distribution with the correct support . In the nonlinear case , we show that this does not happen—even in simple cases . Precisely , in the setup of the one-layer ground truth generator , where we proved ( Theorem 6 ) there exist bad global optima of the landscape , we verify experimentally ( see Figure 1 ) that gradient descent from a random start does indeed converge to such bad asymptotic minima . In particular , this shows that whether or not gradient descent has a favorable implicit bias strongly depends on the data distribution and VAE architecture . More generally , by performing experiments with synthetic data of known manifold dimension , we make the following conclusions : ( 1 ) gradient descent training recovers manifolds approximately containing the data , ( 2 ) these manifolds are generally not the same dimension as the ground truth manifold , but larger ( this is in contrast to the conjecture in Dai & Wipf ( 2019 ) that they should be equal ) even when the decoder and encoder are large enough to represent the ground truth and the reconstruction error is driven to 0 ( VAE loss is driven to −∞ ) , and ( 3 ) of all manifolds containing the data , gradient descent still seems to favor those with relatively low ( but not always minimal ) dimension . Further investigating the precise role of VAE architecture and optimization algorithm , as well as the interplay with the data distribution is an exciting direction for future work . | The authors study further on the conjectures of Dai & Wipf (2019). For the linear case, they provide the proof that the conjecture is true. For the non-linear case, the paper disagrees with the conjecture, and they argue that the VAE training frequently learns a higher-dimensional manifold which is a superset of the ground truth manifold. | SP:7bd1696a9e3413c43f5ef996a0d1e43d13847847 |
Variational autoencoders in the presence of low-dimensional data: landscape and implicit bias | 1 INTRODUCTION . Variational autoencoders ( VAEs ) have recently enjoyed a revived interest , both due to architectural choices that have led to improvements in sample quality ( Oord et al. , 2017 ; Razavi et al. , 2019b ; Vahdat & Kautz , 2020 ) and due to algorithmic insights ( Dai et al. , 2017 ; Dai & Wipf , 2019 ) . Nevertheless , fine-grained understanding of the behavior of VAEs is lacking , both on the theoretical and empirical level . In our paper , we study a common setting of interest where the data is supported on a low-dimensional manifold — often argued to be the setting relevant to real-world image and text data due to the manifold hypothesis ( see e.g . Goodfellow et al . ( 2016 ) ) . In this setting , Dai & Wipf ( 2019 ) proposed a two-stage training process for VAEs , based on a combination of empirical and theoretical arguments suggesting that for standard VAE training with such data distributions : ( 1 ) the generator ’ s covariance will converge to 0 , ( 2 ) the generator will learn the correct manifold , but not the correct density on the manifold ( 3 ) the number of approximately 0 eigenvalues in the encoder covariance will equal the intrinsic dimensionality of the manifold ( see also Dai et al . ( 2017 ) ) . In this paper , we revisit this setting and explore the behaviour of both the VAE loss , and the training dynamics . Through a combination of theory and experiments we show that : • In the case of the data manifold being linear ( i.e . the data is Gaussian , supported on a linear subspace—equivalently , it is produced as the pushforward of a Gaussian through a linear map ) , and the encoder/decoder being parametrized as linear maps , we show that : a ) the set of optima includes parameters for which the generator ’ s support is a strict superset of the data manifold ; b ) the gradient descent dynamics are such that they converge to generators with support equal to the support of the data manifold . This provides a full proof of the conjecture in Dai & Wipf ( 2019 ) , albeit we show the phenomenon is a combination of both the location of the minima of the loss as well as an implicit bias of the training dynamics . • In the case of the data manifold being nonlinear ( i.e . the data distribution is the pushforward of the Gaussian through a nonlinear map f : Rr → Rd , r ≤ d ) , the gradient descent dynamics from a random start often converges to generators G whose support strictly contains the support of the underlying data distribution , while driving reconstruction error to 0 and driving the VAE loss to −∞ . This shows that the conjecture in Dai & Wipf ( 2019 ) does not hold for general nonlinear data manifolds and architectures for the generator/encoder . Organization : We will provide an informal overview of our findings in Section 3 . The rigorous discussion on the VAE landscape are in Section 4 and on the implicit bias of gradient descent in Section 5 . 2 SETUP . We will study the behavior of VAE learning when data lies on a low-dimensional manifold—more precisely , we study when the generator can recover the support of the underlying data distribution . In order to have a well-defined “ ground truth ” , both for our theoretical and empirical results , we will consider synthetic dataset that are generated by a “ ground truth ” generator as follows . Data distribution : To generate a sample point x for the data distribution , we will sample z ∼ N ( 0 , Ir ) , and output x = f ( z ) , for a suitably chosen f . In the linear case , f ( z ) = Az , for some matrix A ∈ Rd×r . In the nonlinear case , f ( z ) will be a nonlinear function f : Rr → Rd . We will consider several choices for f . Parameterization of the trained model : For the model we are training , the generator will sample z ∼ N ( 0 , Ir ) and output x ∼ N ( f ( z ) , I ) , for trainable f , ; the encoder given input x will output z ∼ N ( g ( x ) , D ) , where D ∈ Rr×r is a diagonal matrix , and g , D are trainable . In the linear case , f , g will be parameterized as matrices à , B̃ ; in the nonlinear case , several different parameterizations will be considered . In either case the VAE Loss will be denoted by L ( · ) , see ( 3 ) . 3 OUR RESULTS . Linear VAEs : the correct distribution is not recovered . Recall in the linear case , we train a linear encoder and decoder to learn a Gaussian distribution consisting of data points x ∼ N ( 0 , Σ ) — equivalently , the data distribution is the pushforward of a standard Gaussian z ∼ N ( 0 , Ir ) through a linear generator x = Az with AAT = Σ ; see also Section 2 above . In Theorem 1 of Lucas et al . ( 2019 ) , the authors proved that in a certain probabilistic PCA setting where Σ is full-rank , the landscape of the VAE loss has no spurious local minima : at any global minima of the loss , the VAE decoder exactly matches the ground truth distribution , i.e . ÃÃT + 2I = Σ . We revisit this problem in the setting where Σ has rank less than d so that the data lies on the lowerdimensional manifold/subspace spanned by the columns of A or equivalently Σ , denoted span ( A ) . We show empirically ( i.e . via simulations ) in Section 6 that when Σ is rank-degenerate the VAE actually fails to recover the correct distribution . More precisely , the recovered à has the correct column span but fails to recover the correct density — confirming predictions made in Dai & Wipf ( 2019 ) . We then explain theoretically why this happens , where it turns out we find some surprises . Landscape Analysis : Linear and Nonlinear VAE . Dai & Wipf ( 2019 ) made their predictions on the basis of the following observation about the loss landscape : there can exist sequences of VAE solutions whose objective value approaches −∞ ( i.e . are asymptotic global minima ) , for which the generator has the correct column span , but does not recover the correct density on the subspace . They also informally argued that these are all of the asymptotic global minima of loss landscape ( Pg 7 and Appendix I in Dai & Wipf ( 2019 ) ) , but did not give a formal theorem or proof of this claim . We settle the question by showing this is not the case:1 namely , there exist many convergent sequences of VAE solutions which still go to objective value −∞ but also do not recover the correct column span — instead , the span of such à is a strictly larger subspace . More precisely , we obtain a tight characterization of all asymptotic global minima of the loss landscape : Theorem 1 ( Optima of Linear VAE Loss , Informal Version of Theorem 3 ) . Suppose that à , B̃ are fixed matrices such that A = ÃB̃A and suppose that # { i : Ãi = 0 } > r − d , i.e . the number 1They also argued this would hold in the nonlinear case , but our simulations show this is generally false in that setting , even for the solutions chosen by gradient descent with a standard initialization — see Section 6. of zero columns of à is strictly larger than r − d. Then there exists ̃t → 0 and positive diagonal matrices D̃t such that limt→∞ L ( à , B̃ , D̃t , ̃t ) = −∞ . Also , these are all of the asymptotic global minima : any convergent sequence of points ( Ãt , B̃t , D̃t , ̃t ) along which the loss L goes to −∞ satisfies Ãt → à , B̃t → B̃ with A = ÃB̃A such that # { i : Ãi = 0 } > r − d. To interpret the constraint # { i : Ãi = 0 } > r − d , observe that if the data lies on a lowerdimensional subspace of dimension r∗ < d ( i.e . r∗ is the rank of Σ ) , then there exists a generator which generates the distribution with r − r∗ > r − d zero columns by taking an arbitrary lowrank factorization LLT = Σ with L : d × r∗ and defining A : d × r by A = [ L 0d×r−r∗ ] . The larger the gap is between the manifold/intrinsic dimension r∗ and the ambient dimension d , the more flexibility we have in constructing asymptotic global minima of the landscape . Also , we note there is no constraint in the Theorem that r − d ≥ 0 : the assumption is automatically satisfied if r < d. To summarize , the asymptotic global minima satisfy A = ÃB̃A , so the column span of à contains that of A , but in general it can be a higher dimensional space . For example , if d , r ≥ r∗ + 2 and and the ground truth generator is A = [ Ir∗ 0 0 0 ] , then à = [ Ir∗+1 0 0 0 ] and B̃ = [ Ir∗+1 0 0 0 ] is a perfectly valid asymptotic global optima of the landscape , even though decoder à generates a different higher-dimensional Gaussian distribution N ( 0 , [ Ir∗+1 0 0 0 ] ) than the ground truth . In the above result we showed that there are asymptotic global minima with higher dimensional spans even with the common restriction that the encoder variance is diagonal ; if we considered the case where the encoder variance is unconstrained , as done in Dai & Wipf ( 2019 ) , and/or can depend on its input x , this can only increase the number of ways to drive the objective value to −∞ . We also consider the analogous question in the nonlinear VAE setting where the data lies on a lowdimensional manifold . We prove in Theorem 6 that even in a very simple example where we fit a VAE to generate data produced by a 1-layer ground truth generator , there exists a bad solution with strictly larger manifold dimension which drives the reconstruction error to zero ( and VAE loss to −∞ ) . The proof of this result does not depend strongly on the details of this setup and it can be adapted to construct bad solutions for other nonlinear VAE settings . We note that the nature both of these result is asymptotic : that is , they consider sequences of solutions whose loss converges to −∞— but not the rate at which they do so . In the next section , we will consider the trajectories the optimization algorithm takes , when the loss is minimized through gradient descent . Linear VAE : implicit regularization of gradient flow . The above theorem indicates that studying the minima of the loss landscape alone can not explain the empirical phenomenon of linear VAE training recovering the support of the ground truth manifold in experiments ; the only prediction that can be made is that the VAE will recover a possibly larger manifold containing the data . We resolve this tension by proving that gradient flow , the continuous time version of gradient descent , has an implicit bias towards the low-rank global optima . Precisely , we measure the effective rank quantitatively in terms of the singular values : namely , if σk ( à ) denotes the k-th largest singular value of matrix à , we show that all but the largest dim ( spanA ) singular values of à decay at an exponential rate , as long as : ( 1 ) the gradient flow continues to exist2 , and ( 2 ) the gradient flow does not go off to infinity , i.e . neither à or ̃ go to infinity ( in simulations , the decoder à converges to a bounded point and ̃ → 0 so the latter assumption is true ) . To simplify the proof , we work with a slightly modified loss which “ eliminates ” the encoder variance by setting it to its optimal value : L1 ( à , B̃ , ̃ ) : = minD̃ L ( à , B̃ , ̃ , D̃ ) ; this loss has a simpler closed form , and we believe the theorems should hold for the standard loss as well . ( Generally , gradient descent on the original loss L will try to optimize D̃ in terms of the other parameters , and if it succeeds to keep D̃ well-tuned in terms of à , B̃ , ̃ then L will behave like the simplified loss L1 . ) 2We remind the reader that the gradient flow on loss L ( x ) is a differential equation dx/dt = −∇L ( x ) . Unlike discrete-time gradient descent , gradient flow in some cases ( e.g . dx/dt = x2 ) has solutions which exist only for a finite time ( e.g . x = 1/ ( 1 − t ) ) , which “ blows up ” at t = 1 ) , so we need to explicitly assume the solution exists up to time T . Theorem 2 ( Implicit Bias of Gradient Flow , Informal version of Theorem 5 ) . Let A : d × r be arbitrary and define W to be the span of the rows of A , let Θ̃ ( 0 ) = ( à ( 0 ) , B̃ ( 0 ) , ̃ ( 0 ) ) be an arbitrary initialization and define the gradient flow Θ̃ ( t ) = ( à ( t ) , B̃ ( t ) , ̃ ( t ) ) by the ordinary differential equation ( ODE ) dΘ̃ ( t ) dt = −∇L1 ( Θ̃ ( t ) ) ( 1 ) with initial condition Θ0 . If the solution to this equation exists on the time interval [ 0 , T ] and satisfies maxt∈ [ 0 , T ] maxj [ ‖ ( Ãt ) j‖2 + ̃2t ] ≤ K , then for all t ∈ [ 0 , T ] we have d∑ k=dim ( W ) +1 σ2k ( à ( t ) ) ≤ C ( A , à ) e−t/K ( 2 ) where C ( A , à ) : = ‖PW⊥ÃT ( 0 ) ‖2F and PW⊥ is the orthogonal projection onto the orthogonal complement of W . Together , our Theorem 1 and Theorem 2 show that if gradient descent converges to a point while driving the loss to −∞ , then it successfully recovers the ground truth subspace/manifold spanA . This shows that , in the linear case , the conjecture of Dai & Wipf ( 2019 ) can indeed be validated provided we incorporate training dynamics into the picture . The prediction of theirs we do not prove is that the number of zero entries of the encoder covariance D converges to the intrinsic dimension ; as shown in Table 1 , in a few experimental runs this does not occur — in contrast , Theorem 2 implies that à should have the right number of nonzero singular values and our experiments agree with this . Nonlinear VAE : Dynamics and Simulations . In the linear case , we showed that the implicit bias of gradient descent leads the VAE training to converge to a distribution with the correct support . In the nonlinear case , we show that this does not happen—even in simple cases . Precisely , in the setup of the one-layer ground truth generator , where we proved ( Theorem 6 ) there exist bad global optima of the landscape , we verify experimentally ( see Figure 1 ) that gradient descent from a random start does indeed converge to such bad asymptotic minima . In particular , this shows that whether or not gradient descent has a favorable implicit bias strongly depends on the data distribution and VAE architecture . More generally , by performing experiments with synthetic data of known manifold dimension , we make the following conclusions : ( 1 ) gradient descent training recovers manifolds approximately containing the data , ( 2 ) these manifolds are generally not the same dimension as the ground truth manifold , but larger ( this is in contrast to the conjecture in Dai & Wipf ( 2019 ) that they should be equal ) even when the decoder and encoder are large enough to represent the ground truth and the reconstruction error is driven to 0 ( VAE loss is driven to −∞ ) , and ( 3 ) of all manifolds containing the data , gradient descent still seems to favor those with relatively low ( but not always minimal ) dimension . Further investigating the precise role of VAE architecture and optimization algorithm , as well as the interplay with the data distribution is an exciting direction for future work . | This paper examines the conjecture given in (Dai & Wipf; 2019) on the support of distribution that VAE learns. The contributions are listed as follows: - For the linear case where the data is Gaussian with rank-degenerate covariance, and encoder/decoder are both linear, this paper proves that VAE captures the intrinsic dimension of data distribution correctly by analyzing the objective and its gradient-flow dynamics. - For nonlinear cases, the paper shows a counterexample to the conjecture in (Dai & Wipf; 2019) where the support of VAE generators is a superset of that of data distribution. - Numerical experiments are presented to support the theory. | SP:7bd1696a9e3413c43f5ef996a0d1e43d13847847 |
DFSSATTEN: Dynamic Fine-grained Structured Sparse Attention Mechanism | 1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have achieved competitive performance across various domains like NLP ( Ott et al. , 2018 ) and Computer Vision ( Dosovitskiy et al. , 2021 ) . The key feature that sets them apart from traditional neural network architectures is the attention mechanism ( Vaswani et al. , 2017 ) , which allows the transformers to gather information from the embeddings of elements in the input sequence in an adaptive and learnable manner . Nevertheless , the high computation cost and memory footprint brought by the attention mechanism make it difficult to apply transformers to latency-sensitive tasks . Many efficient attention mechanisms ( Tay et al. , 2020b ; Zaheer et al. , 2020 ; Beltagy et al. , 2020 ; Tay et al. , 2020a ; Roy et al. , 2021 ; Kitaev et al. , 2020 ) have been proposed to address this issue . However , most of them drastically modify the original full attention mechanism and introduce a handful of hyper-parameters to tune . Therefore , they require tremendous engineering effort to deploy and optimize . Besides , they usually need to be trained from scratch instead of exploiting pretrained models like BERT ( Devlin et al. , 2019 ) . Some of them rely on fixed sparse patterns or extremely high sparsity to achieve wall-clock time speedup . Therefore , these methods usually require thousands of pretraining or fine-tuning steps on specific tasks and toilsome tuning of several hyper-parameters to reach good accuracy . Last but not least , previous methods usually introduce additional operators like top-k , sort that cause large overheads and offset their benefits at moderate sequence length . In this paper , we present DFSSATTEN , a simple and effective sparse attention mechanism that address the limitations mentioned above . DFSSATTEN dynamically prunes the full attention score matrix using 50 % fine-grained structured sparse patterns ( NVIDIA , 2020 ) . This pattern is GPU friendly and can leverage the new sparse tensor core on NVIDIA A100 GPU ( Mishra et al. , 2021 ) . Our DFSSATTEN offers several advantages over existing studies : • It requires minimal changes to the original full-attention with no hyper-parameters to tune . This makes it a drop-in replacement of the full attention that only requires to change a few lines of code . Moreover , it can directly exploit existing pretrained models like BERT ( Devlin et al. , 2019 ) and RoBERTa ( Liu et al. , 2020 ) . • We dynamically prune the attention scores based on their magnitude under only 50 % sparsity . This allows the pruned attention matrix to reserve the important entries , achieving on par model accuracy with full attention even without fine-tuning . • Our method introduces zero overhead on existing GPU hardware . As a result , we are able to achieve wall-clock time speedup and memory footprint reduction over the full attention in arbitrary sequence length . To conclude , our main contributions are summarized below : • We propose DFSSATTEN , a dynamic sparse attention mechanism that is a drop-in proxy of the full attention mechanism . Its effectiveness is justified by both empirical and theoretical evidence . • We present a dedicated CUDA kernel design to completely remove the pruning overhead . The pruning is implemented as an epilogue of the dense matrix multiplication which produces the attention score matrix . • We evaluate DFSSATTEN on tasks cross various domains and sequence lengths . It achieves 1.27 ∼ 1.89× speedup over the full attention with no accuracy loss . 2 BACKGROUND AND MOTIVATION . We first introduce the preliminaries , notations , and background of our paper . 2.1 FULL ATTENTION MECHANISM . Given an input sequence X= ( x1 , .. , xn ) ∈ Rn×d , the full attention mechanism can be defined as O = Softmax ( QKT / √ d ) V , ( 1 ) where Q = XWq , K = XWk , and V = XWv are query , key , and value matrices . QKT forms a full-quadratic adjacency matrix , whose edge weights are the dot-product similarity between all the elements in the sequence . This adjacency matrix is standardized with 1/ √ d to keep the unit second moment and then normalized with softmax . At last , the row feature vectors in V are aggregated according to the normalized adjacency matrix by multiplying them together . In the rest of this paper , we denote A = Softmax ( QKT / √ d ) for simplicity . We refer QKT as the attention score matrix and A as the attention weight matrix . 2.2 EFFICIENT ATTENTION MECHANISM . The high computation cost and memory footprint in the full attention mechanism come from A , whose size grows quadratically with the sequence length n. To address this issue , various efficient attention mechanisms have been proposed ( Tay et al. , 2020b ) . Fixed Sparse Patterns . Zaheer et al . ( 2020 ) ; Beltagy et al . ( 2020 ) apply a set of fixed sparse attention patterns on A , like global attention and sliding window attention . These patterns are constructed from empirical observations and designed GPU-friendly to achieve wall-time speedup . However , as these patterns are designed empirically and fixed during inference , there is no guarantee that they can always capture the important entries in A or transfer easily across different tasks . Dynamic Sparse Patterns . Ham et al . ( 2021 ) dynamically generate fine-grained sparse attention patterns on A with low-cost binary hashing . However , this technique requires specialized hardware to achieve speedup , so it is not available on general-purpose hardware like GPU . Tay et al . ( 2020a ) ; Roy et al . ( 2021 ) ; Kitaev et al . ( 2020 ) apply various clustering methods and only compute the attention within each cluster . Although computing full attention in each cluster is more friendly to GPU compared with fine-grained sparsity , the clustering methods contain several GPU-unfriendly operators like top-k and sorting that offsets their benefits under moderate sequence length . Low Rank / Kernel . Wang et al . ( 2020 ) project A from n × n to n × k with linear projection . Choromanski et al . ( 2021 ) introduce the FAVOR+ which approximates the softmax with kernel method . This allows them to change the computation order and reduce the asymptotic complexity to linear . However , the low-rank projection and kernel construction also introduce considerable overhead . This makes these methods only effective under long sequence length . Besides , the previous studies drastically change the attention mechanisms , tens of thousands pretraining or finetuning steps are required to reach a comparable performance with the origin full attention mechanism . So they require tremendous engineering effort to deploy . 2.3 FINE-GRAINED STRUCTURED SPARSITY IN NVIDIA A100 GPU . NVIDIA introduces the fine-grained structured sparsity in the A100 GPU . As shown in Figure 1 , the dense input matrix is pruned with fine-grained structured pruning . If the data type is float , 1:2 sparsity is used which selects the larger one in two consecutive entries . If the data type is bfloat16 or float16 , the 2:4 sparsity is used which selects two larger ones among four consecutive elements . After the pruning , the result is compressed to nonzeros and metadata . The nonzeros contain the value of reserved data that is 50 % smaller than the original one . The metadata records the index of the nonzeros in the origins matrix . It takes 4 bit metadata to record the decision of each 1:2 or 2:4 selection . Therefore , the metadata is only 1/16 of the original dense matrix in terms of bits . This compressed sparse matrix can be multiplied with a dense matrix under the support of the sparse tensor core to achieve significant speedup . This fine-grained structured sparsity has been applied to the static weight matrices in various neural network models including transformer ( Mishra et al. , 2021 ) . It can effectively accelerate the feedforward part of the transformer up to 1.9× . However , to the best of our knowledge , no previous studies use it in the attention mechanism where the attention weight matrix is dynamically generated for each sequence . One plausible explanation is that during pruning , GPU must read the whole dense matrix to be pruned from the memory . Then , after selecting the elements to be reserved under the 1:2 and 2:4 pattern , it must also generate the metadata encoded in a special format such that the metadata can be used efficiently later . All these overheads will offset the benefit brought by the pruning if we do it on the fly . 3 DYNAMIC FINE-GRAINED STRUCTURED SPARSE ATTENTION MECHANISM . In this section , we first give an overview of our DFSSATTEN method . Then , we discuss the design considerations of exploring sparsity in attention and the choice of sparse granularity in our method for GPU-friendly implementation and effectiveness . Finally , we briefly introduce our GPU kernel design to remove pruning overhead . Our proposed DFSSATTEN mechanism is simple and effective , as illustrated in Figure 2 . Compared with the full-quadratic attention mechanism , our method dynamically prunes attention scores without incurring storage or computation overhead , while maintaining the effectiveness of attention . More importantly , our method can achieve practical speedups of attention on existing GPU hardware with customized CUDA kernels . Listing 1 shows all the modifications to be made to use DFSSATTEN . # Full attention mechanism def full_attention ( q , k , v ) : attn_weight = torch.bmm ( q , k.transpose ( 1 , 2 ) ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return torch.bmm ( attn_weight , v ) # DFSS attention mechanism import dspattn def dfss_attention ( q , k , v ) : attn_weight , metadata = dspattn.bmm ( q , k ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return dspattn.spmm ( attn_weight , metadata , v ) Listing 1 : Example of using DFSSATTEN . The “ dspattn ” is the package we developed . 3.1 DESIGN CONSIDERATIONS FOR EXPLOITING ATTENTION SPARSITY As illustrated in Figure 3 , the attention mechanism can be considered as three stages : QKT , Softmax , and AV . To design a sparse attention mechanism , the first decision to make is where should we induce pruning to sparsify the attention . If we start from 0 , all the three stages will be benefited from the sparsity given effective implementation on GPU : the dense matrix multiplication between Q and K will be replaced with the sampled dense-dense matrix multiplication ( SDDMM ) which only computes the entries identified by the sparse pattern . The Softmax only operates on the nonzero values in each row . The original dense matrix multiplication between A and V will be replaced with a sparse matrix-matrix multiplication ( SpMM ) which multiplies a sparse matrix with a dense matrix . However , as it is not possible to exactly know which entry in QKT has higher magnitude before computing QKT , starting from 0 usually requires some additional components to predict the location of important entries . Starting from 1 requires us to compute a dense matrix multiplication between Q and K. The benefit is that we can explicitly select important entries from QKT without prediction . As the softmax is a monotonically increasing function , starting from 2 does not offer any benefits over 1 but throws away the opportunity to accelerate Softmax . In this paper , we choose to start from 1 based on two considerations . First , replacing the dense matrix multiplication with SDDMM at QKT offers limited speedup even at high sparsity . Chen et al . ( 2021b ) show that it is difficult for SDDMM to achieve speedup over its dense counterpart under 80 % sparsity even with some structured design . Second , starting from 1 allows us to keep our design simple such that it does not introduce additional overhead or hyper-parameters to tune . | This paper focus on the dynamic N:M fine-grained structured sparse attention implementation on transformers. Firstly, the authors analyze the theoretical efficiency of Top-K Sparsity, Fixed sparsity and dynamic 1:2/2:4 sparsity, which demonstrates the dynamic N:M sparse attention can achieve considerable speedup and high-quality approximation. Then, the authors evaluate the accuracy and the practical speed of the transformer model from the Huggingface model Zoo using the DFSSATTEN module and explain the detailed implementation using the cutlass library. | SP:f42b05ab64a980f64199dd423605d64d966819b2 |
DFSSATTEN: Dynamic Fine-grained Structured Sparse Attention Mechanism | 1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have achieved competitive performance across various domains like NLP ( Ott et al. , 2018 ) and Computer Vision ( Dosovitskiy et al. , 2021 ) . The key feature that sets them apart from traditional neural network architectures is the attention mechanism ( Vaswani et al. , 2017 ) , which allows the transformers to gather information from the embeddings of elements in the input sequence in an adaptive and learnable manner . Nevertheless , the high computation cost and memory footprint brought by the attention mechanism make it difficult to apply transformers to latency-sensitive tasks . Many efficient attention mechanisms ( Tay et al. , 2020b ; Zaheer et al. , 2020 ; Beltagy et al. , 2020 ; Tay et al. , 2020a ; Roy et al. , 2021 ; Kitaev et al. , 2020 ) have been proposed to address this issue . However , most of them drastically modify the original full attention mechanism and introduce a handful of hyper-parameters to tune . Therefore , they require tremendous engineering effort to deploy and optimize . Besides , they usually need to be trained from scratch instead of exploiting pretrained models like BERT ( Devlin et al. , 2019 ) . Some of them rely on fixed sparse patterns or extremely high sparsity to achieve wall-clock time speedup . Therefore , these methods usually require thousands of pretraining or fine-tuning steps on specific tasks and toilsome tuning of several hyper-parameters to reach good accuracy . Last but not least , previous methods usually introduce additional operators like top-k , sort that cause large overheads and offset their benefits at moderate sequence length . In this paper , we present DFSSATTEN , a simple and effective sparse attention mechanism that address the limitations mentioned above . DFSSATTEN dynamically prunes the full attention score matrix using 50 % fine-grained structured sparse patterns ( NVIDIA , 2020 ) . This pattern is GPU friendly and can leverage the new sparse tensor core on NVIDIA A100 GPU ( Mishra et al. , 2021 ) . Our DFSSATTEN offers several advantages over existing studies : • It requires minimal changes to the original full-attention with no hyper-parameters to tune . This makes it a drop-in replacement of the full attention that only requires to change a few lines of code . Moreover , it can directly exploit existing pretrained models like BERT ( Devlin et al. , 2019 ) and RoBERTa ( Liu et al. , 2020 ) . • We dynamically prune the attention scores based on their magnitude under only 50 % sparsity . This allows the pruned attention matrix to reserve the important entries , achieving on par model accuracy with full attention even without fine-tuning . • Our method introduces zero overhead on existing GPU hardware . As a result , we are able to achieve wall-clock time speedup and memory footprint reduction over the full attention in arbitrary sequence length . To conclude , our main contributions are summarized below : • We propose DFSSATTEN , a dynamic sparse attention mechanism that is a drop-in proxy of the full attention mechanism . Its effectiveness is justified by both empirical and theoretical evidence . • We present a dedicated CUDA kernel design to completely remove the pruning overhead . The pruning is implemented as an epilogue of the dense matrix multiplication which produces the attention score matrix . • We evaluate DFSSATTEN on tasks cross various domains and sequence lengths . It achieves 1.27 ∼ 1.89× speedup over the full attention with no accuracy loss . 2 BACKGROUND AND MOTIVATION . We first introduce the preliminaries , notations , and background of our paper . 2.1 FULL ATTENTION MECHANISM . Given an input sequence X= ( x1 , .. , xn ) ∈ Rn×d , the full attention mechanism can be defined as O = Softmax ( QKT / √ d ) V , ( 1 ) where Q = XWq , K = XWk , and V = XWv are query , key , and value matrices . QKT forms a full-quadratic adjacency matrix , whose edge weights are the dot-product similarity between all the elements in the sequence . This adjacency matrix is standardized with 1/ √ d to keep the unit second moment and then normalized with softmax . At last , the row feature vectors in V are aggregated according to the normalized adjacency matrix by multiplying them together . In the rest of this paper , we denote A = Softmax ( QKT / √ d ) for simplicity . We refer QKT as the attention score matrix and A as the attention weight matrix . 2.2 EFFICIENT ATTENTION MECHANISM . The high computation cost and memory footprint in the full attention mechanism come from A , whose size grows quadratically with the sequence length n. To address this issue , various efficient attention mechanisms have been proposed ( Tay et al. , 2020b ) . Fixed Sparse Patterns . Zaheer et al . ( 2020 ) ; Beltagy et al . ( 2020 ) apply a set of fixed sparse attention patterns on A , like global attention and sliding window attention . These patterns are constructed from empirical observations and designed GPU-friendly to achieve wall-time speedup . However , as these patterns are designed empirically and fixed during inference , there is no guarantee that they can always capture the important entries in A or transfer easily across different tasks . Dynamic Sparse Patterns . Ham et al . ( 2021 ) dynamically generate fine-grained sparse attention patterns on A with low-cost binary hashing . However , this technique requires specialized hardware to achieve speedup , so it is not available on general-purpose hardware like GPU . Tay et al . ( 2020a ) ; Roy et al . ( 2021 ) ; Kitaev et al . ( 2020 ) apply various clustering methods and only compute the attention within each cluster . Although computing full attention in each cluster is more friendly to GPU compared with fine-grained sparsity , the clustering methods contain several GPU-unfriendly operators like top-k and sorting that offsets their benefits under moderate sequence length . Low Rank / Kernel . Wang et al . ( 2020 ) project A from n × n to n × k with linear projection . Choromanski et al . ( 2021 ) introduce the FAVOR+ which approximates the softmax with kernel method . This allows them to change the computation order and reduce the asymptotic complexity to linear . However , the low-rank projection and kernel construction also introduce considerable overhead . This makes these methods only effective under long sequence length . Besides , the previous studies drastically change the attention mechanisms , tens of thousands pretraining or finetuning steps are required to reach a comparable performance with the origin full attention mechanism . So they require tremendous engineering effort to deploy . 2.3 FINE-GRAINED STRUCTURED SPARSITY IN NVIDIA A100 GPU . NVIDIA introduces the fine-grained structured sparsity in the A100 GPU . As shown in Figure 1 , the dense input matrix is pruned with fine-grained structured pruning . If the data type is float , 1:2 sparsity is used which selects the larger one in two consecutive entries . If the data type is bfloat16 or float16 , the 2:4 sparsity is used which selects two larger ones among four consecutive elements . After the pruning , the result is compressed to nonzeros and metadata . The nonzeros contain the value of reserved data that is 50 % smaller than the original one . The metadata records the index of the nonzeros in the origins matrix . It takes 4 bit metadata to record the decision of each 1:2 or 2:4 selection . Therefore , the metadata is only 1/16 of the original dense matrix in terms of bits . This compressed sparse matrix can be multiplied with a dense matrix under the support of the sparse tensor core to achieve significant speedup . This fine-grained structured sparsity has been applied to the static weight matrices in various neural network models including transformer ( Mishra et al. , 2021 ) . It can effectively accelerate the feedforward part of the transformer up to 1.9× . However , to the best of our knowledge , no previous studies use it in the attention mechanism where the attention weight matrix is dynamically generated for each sequence . One plausible explanation is that during pruning , GPU must read the whole dense matrix to be pruned from the memory . Then , after selecting the elements to be reserved under the 1:2 and 2:4 pattern , it must also generate the metadata encoded in a special format such that the metadata can be used efficiently later . All these overheads will offset the benefit brought by the pruning if we do it on the fly . 3 DYNAMIC FINE-GRAINED STRUCTURED SPARSE ATTENTION MECHANISM . In this section , we first give an overview of our DFSSATTEN method . Then , we discuss the design considerations of exploring sparsity in attention and the choice of sparse granularity in our method for GPU-friendly implementation and effectiveness . Finally , we briefly introduce our GPU kernel design to remove pruning overhead . Our proposed DFSSATTEN mechanism is simple and effective , as illustrated in Figure 2 . Compared with the full-quadratic attention mechanism , our method dynamically prunes attention scores without incurring storage or computation overhead , while maintaining the effectiveness of attention . More importantly , our method can achieve practical speedups of attention on existing GPU hardware with customized CUDA kernels . Listing 1 shows all the modifications to be made to use DFSSATTEN . # Full attention mechanism def full_attention ( q , k , v ) : attn_weight = torch.bmm ( q , k.transpose ( 1 , 2 ) ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return torch.bmm ( attn_weight , v ) # DFSS attention mechanism import dspattn def dfss_attention ( q , k , v ) : attn_weight , metadata = dspattn.bmm ( q , k ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return dspattn.spmm ( attn_weight , metadata , v ) Listing 1 : Example of using DFSSATTEN . The “ dspattn ” is the package we developed . 3.1 DESIGN CONSIDERATIONS FOR EXPLOITING ATTENTION SPARSITY As illustrated in Figure 3 , the attention mechanism can be considered as three stages : QKT , Softmax , and AV . To design a sparse attention mechanism , the first decision to make is where should we induce pruning to sparsify the attention . If we start from 0 , all the three stages will be benefited from the sparsity given effective implementation on GPU : the dense matrix multiplication between Q and K will be replaced with the sampled dense-dense matrix multiplication ( SDDMM ) which only computes the entries identified by the sparse pattern . The Softmax only operates on the nonzero values in each row . The original dense matrix multiplication between A and V will be replaced with a sparse matrix-matrix multiplication ( SpMM ) which multiplies a sparse matrix with a dense matrix . However , as it is not possible to exactly know which entry in QKT has higher magnitude before computing QKT , starting from 0 usually requires some additional components to predict the location of important entries . Starting from 1 requires us to compute a dense matrix multiplication between Q and K. The benefit is that we can explicitly select important entries from QKT without prediction . As the softmax is a monotonically increasing function , starting from 2 does not offer any benefits over 1 but throws away the opportunity to accelerate Softmax . In this paper , we choose to start from 1 based on two considerations . First , replacing the dense matrix multiplication with SDDMM at QKT offers limited speedup even at high sparsity . Chen et al . ( 2021b ) show that it is difficult for SDDMM to achieve speedup over its dense counterpart under 80 % sparsity even with some structured design . Second , starting from 1 allows us to keep our design simple such that it does not introduce additional overhead or hyper-parameters to tune . | This paper aims at improving the computational efficiency of the attention mechanism by leveraging the specific sparse pattern supported by sparse tensor cores of NVIDIA A100, with a particular focus on delivering practical running speedup. To achieve this, the authors proposed DFSSATTEN, which shows both theoretical and empirical advantage in terms of performance and speedup compared to various baselines. In particular, DFSSATTEN yields 1.27~1.89x speedup over the vanilla attention network across different sequence lengths. | SP:f42b05ab64a980f64199dd423605d64d966819b2 |
DFSSATTEN: Dynamic Fine-grained Structured Sparse Attention Mechanism | 1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have achieved competitive performance across various domains like NLP ( Ott et al. , 2018 ) and Computer Vision ( Dosovitskiy et al. , 2021 ) . The key feature that sets them apart from traditional neural network architectures is the attention mechanism ( Vaswani et al. , 2017 ) , which allows the transformers to gather information from the embeddings of elements in the input sequence in an adaptive and learnable manner . Nevertheless , the high computation cost and memory footprint brought by the attention mechanism make it difficult to apply transformers to latency-sensitive tasks . Many efficient attention mechanisms ( Tay et al. , 2020b ; Zaheer et al. , 2020 ; Beltagy et al. , 2020 ; Tay et al. , 2020a ; Roy et al. , 2021 ; Kitaev et al. , 2020 ) have been proposed to address this issue . However , most of them drastically modify the original full attention mechanism and introduce a handful of hyper-parameters to tune . Therefore , they require tremendous engineering effort to deploy and optimize . Besides , they usually need to be trained from scratch instead of exploiting pretrained models like BERT ( Devlin et al. , 2019 ) . Some of them rely on fixed sparse patterns or extremely high sparsity to achieve wall-clock time speedup . Therefore , these methods usually require thousands of pretraining or fine-tuning steps on specific tasks and toilsome tuning of several hyper-parameters to reach good accuracy . Last but not least , previous methods usually introduce additional operators like top-k , sort that cause large overheads and offset their benefits at moderate sequence length . In this paper , we present DFSSATTEN , a simple and effective sparse attention mechanism that address the limitations mentioned above . DFSSATTEN dynamically prunes the full attention score matrix using 50 % fine-grained structured sparse patterns ( NVIDIA , 2020 ) . This pattern is GPU friendly and can leverage the new sparse tensor core on NVIDIA A100 GPU ( Mishra et al. , 2021 ) . Our DFSSATTEN offers several advantages over existing studies : • It requires minimal changes to the original full-attention with no hyper-parameters to tune . This makes it a drop-in replacement of the full attention that only requires to change a few lines of code . Moreover , it can directly exploit existing pretrained models like BERT ( Devlin et al. , 2019 ) and RoBERTa ( Liu et al. , 2020 ) . • We dynamically prune the attention scores based on their magnitude under only 50 % sparsity . This allows the pruned attention matrix to reserve the important entries , achieving on par model accuracy with full attention even without fine-tuning . • Our method introduces zero overhead on existing GPU hardware . As a result , we are able to achieve wall-clock time speedup and memory footprint reduction over the full attention in arbitrary sequence length . To conclude , our main contributions are summarized below : • We propose DFSSATTEN , a dynamic sparse attention mechanism that is a drop-in proxy of the full attention mechanism . Its effectiveness is justified by both empirical and theoretical evidence . • We present a dedicated CUDA kernel design to completely remove the pruning overhead . The pruning is implemented as an epilogue of the dense matrix multiplication which produces the attention score matrix . • We evaluate DFSSATTEN on tasks cross various domains and sequence lengths . It achieves 1.27 ∼ 1.89× speedup over the full attention with no accuracy loss . 2 BACKGROUND AND MOTIVATION . We first introduce the preliminaries , notations , and background of our paper . 2.1 FULL ATTENTION MECHANISM . Given an input sequence X= ( x1 , .. , xn ) ∈ Rn×d , the full attention mechanism can be defined as O = Softmax ( QKT / √ d ) V , ( 1 ) where Q = XWq , K = XWk , and V = XWv are query , key , and value matrices . QKT forms a full-quadratic adjacency matrix , whose edge weights are the dot-product similarity between all the elements in the sequence . This adjacency matrix is standardized with 1/ √ d to keep the unit second moment and then normalized with softmax . At last , the row feature vectors in V are aggregated according to the normalized adjacency matrix by multiplying them together . In the rest of this paper , we denote A = Softmax ( QKT / √ d ) for simplicity . We refer QKT as the attention score matrix and A as the attention weight matrix . 2.2 EFFICIENT ATTENTION MECHANISM . The high computation cost and memory footprint in the full attention mechanism come from A , whose size grows quadratically with the sequence length n. To address this issue , various efficient attention mechanisms have been proposed ( Tay et al. , 2020b ) . Fixed Sparse Patterns . Zaheer et al . ( 2020 ) ; Beltagy et al . ( 2020 ) apply a set of fixed sparse attention patterns on A , like global attention and sliding window attention . These patterns are constructed from empirical observations and designed GPU-friendly to achieve wall-time speedup . However , as these patterns are designed empirically and fixed during inference , there is no guarantee that they can always capture the important entries in A or transfer easily across different tasks . Dynamic Sparse Patterns . Ham et al . ( 2021 ) dynamically generate fine-grained sparse attention patterns on A with low-cost binary hashing . However , this technique requires specialized hardware to achieve speedup , so it is not available on general-purpose hardware like GPU . Tay et al . ( 2020a ) ; Roy et al . ( 2021 ) ; Kitaev et al . ( 2020 ) apply various clustering methods and only compute the attention within each cluster . Although computing full attention in each cluster is more friendly to GPU compared with fine-grained sparsity , the clustering methods contain several GPU-unfriendly operators like top-k and sorting that offsets their benefits under moderate sequence length . Low Rank / Kernel . Wang et al . ( 2020 ) project A from n × n to n × k with linear projection . Choromanski et al . ( 2021 ) introduce the FAVOR+ which approximates the softmax with kernel method . This allows them to change the computation order and reduce the asymptotic complexity to linear . However , the low-rank projection and kernel construction also introduce considerable overhead . This makes these methods only effective under long sequence length . Besides , the previous studies drastically change the attention mechanisms , tens of thousands pretraining or finetuning steps are required to reach a comparable performance with the origin full attention mechanism . So they require tremendous engineering effort to deploy . 2.3 FINE-GRAINED STRUCTURED SPARSITY IN NVIDIA A100 GPU . NVIDIA introduces the fine-grained structured sparsity in the A100 GPU . As shown in Figure 1 , the dense input matrix is pruned with fine-grained structured pruning . If the data type is float , 1:2 sparsity is used which selects the larger one in two consecutive entries . If the data type is bfloat16 or float16 , the 2:4 sparsity is used which selects two larger ones among four consecutive elements . After the pruning , the result is compressed to nonzeros and metadata . The nonzeros contain the value of reserved data that is 50 % smaller than the original one . The metadata records the index of the nonzeros in the origins matrix . It takes 4 bit metadata to record the decision of each 1:2 or 2:4 selection . Therefore , the metadata is only 1/16 of the original dense matrix in terms of bits . This compressed sparse matrix can be multiplied with a dense matrix under the support of the sparse tensor core to achieve significant speedup . This fine-grained structured sparsity has been applied to the static weight matrices in various neural network models including transformer ( Mishra et al. , 2021 ) . It can effectively accelerate the feedforward part of the transformer up to 1.9× . However , to the best of our knowledge , no previous studies use it in the attention mechanism where the attention weight matrix is dynamically generated for each sequence . One plausible explanation is that during pruning , GPU must read the whole dense matrix to be pruned from the memory . Then , after selecting the elements to be reserved under the 1:2 and 2:4 pattern , it must also generate the metadata encoded in a special format such that the metadata can be used efficiently later . All these overheads will offset the benefit brought by the pruning if we do it on the fly . 3 DYNAMIC FINE-GRAINED STRUCTURED SPARSE ATTENTION MECHANISM . In this section , we first give an overview of our DFSSATTEN method . Then , we discuss the design considerations of exploring sparsity in attention and the choice of sparse granularity in our method for GPU-friendly implementation and effectiveness . Finally , we briefly introduce our GPU kernel design to remove pruning overhead . Our proposed DFSSATTEN mechanism is simple and effective , as illustrated in Figure 2 . Compared with the full-quadratic attention mechanism , our method dynamically prunes attention scores without incurring storage or computation overhead , while maintaining the effectiveness of attention . More importantly , our method can achieve practical speedups of attention on existing GPU hardware with customized CUDA kernels . Listing 1 shows all the modifications to be made to use DFSSATTEN . # Full attention mechanism def full_attention ( q , k , v ) : attn_weight = torch.bmm ( q , k.transpose ( 1 , 2 ) ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return torch.bmm ( attn_weight , v ) # DFSS attention mechanism import dspattn def dfss_attention ( q , k , v ) : attn_weight , metadata = dspattn.bmm ( q , k ) attn_weight = torch.nn.functional.softmax ( attn_weight , -1 ) return dspattn.spmm ( attn_weight , metadata , v ) Listing 1 : Example of using DFSSATTEN . The “ dspattn ” is the package we developed . 3.1 DESIGN CONSIDERATIONS FOR EXPLOITING ATTENTION SPARSITY As illustrated in Figure 3 , the attention mechanism can be considered as three stages : QKT , Softmax , and AV . To design a sparse attention mechanism , the first decision to make is where should we induce pruning to sparsify the attention . If we start from 0 , all the three stages will be benefited from the sparsity given effective implementation on GPU : the dense matrix multiplication between Q and K will be replaced with the sampled dense-dense matrix multiplication ( SDDMM ) which only computes the entries identified by the sparse pattern . The Softmax only operates on the nonzero values in each row . The original dense matrix multiplication between A and V will be replaced with a sparse matrix-matrix multiplication ( SpMM ) which multiplies a sparse matrix with a dense matrix . However , as it is not possible to exactly know which entry in QKT has higher magnitude before computing QKT , starting from 0 usually requires some additional components to predict the location of important entries . Starting from 1 requires us to compute a dense matrix multiplication between Q and K. The benefit is that we can explicitly select important entries from QKT without prediction . As the softmax is a monotonically increasing function , starting from 2 does not offer any benefits over 1 but throws away the opportunity to accelerate Softmax . In this paper , we choose to start from 1 based on two considerations . First , replacing the dense matrix multiplication with SDDMM at QKT offers limited speedup even at high sparsity . Chen et al . ( 2021b ) show that it is difficult for SDDMM to achieve speedup over its dense counterpart under 80 % sparsity even with some structured design . Second , starting from 1 allows us to keep our design simple such that it does not introduce additional overhead or hyper-parameters to tune . | The paper proposes a method that exploits the 50% structured sparsity supported by tensor cores on modern GPUs. To do so attention scores ($QK^T$) are dynamically pruned such that only 50% attention scores are kept. This improves the computation required for softmax as well as matrix multiplication between pruned attention weight $A$ and value matrix $V$. The authors evaluate the proposed method on LRA and MLM tasks to show that the method can provide practical speed-ups especially for moderately long sequence lengths where other proposed efficient attention mechanisms struggle due to overheads. | SP:f42b05ab64a980f64199dd423605d64d966819b2 |
Design in the Dark: Learning Deep Generative Models for De Novo Protein Design | 1 INTRODUCTION . Generative modelling is beginning to be used for the task of designing protein molecules , a problem which offers potential solutions to a vast number of medical ( Chevalier et al. , 2017 ; Silva et al. , 2019 ) and industrial challenges ( King et al. , 2012 ; Wang et al. , 2021 ) . Computational protein design methods look to efficiently generate large numbers of candidate sequences , prior to laboratory validation , that are confidently predicted to have stable and ordered structures together with prespecified structural and functional attributes . Recent generative modelling studies have looked to improve on the high time and computational cost of contemporary design methods , which rely on Monte Carlo sampling and energy function-based physics simulations ( Huang et al. , 2016 ) . Here , our aim is to develop a tool , based on a deep generative model , that can rapidly generate sequences with stable and ordered structures . Furthermore , we build this tool for the important task of de novo protein design . Computational de novo protein design is arguably the most promising and general approach to protein design , but also the most difficult ( Huang et al. , 2016 ; Korendovych & DeGrado , 2020 ) . As an approach , it looks to design proteins unlike those seen in nature , with desired structural or functional attributes . Crucially , this is done without using any information from a preexisting protein as a starting point , scaffold , or guide.1 Instead , the designer must rely on general design methods with little , if any , provided information to design suitable sequences with suitable predicted structures ( Woolfson , 2021 ; Marcos et al. , 2018 ; Vorobieva et al. , 2021 ) . This presents a remarkably challenging design setting , evident in that de novo designs have yet to be successfully generated for a number of common but biotechnologically important folds , like immunoglobins . A tool that quickly generates sequences , unlike those seen in nature , with a diverse range of ordered structures is of great value as it can be used to both rapidly generate candidates directly for design tasks as well as provide a basis for developing further novel design methods . In this work , we develop deep generative sequence models that we show as satisfying this specification . Unlike previous generative protein design approaches that typically rely on natural sequences and structurebased conditioning information , we build an approach for de novo design by developing a framework for training unconditional autoregressive language models on synthetic sequences . We call 1The opposite of such an approach is protein engineering , an important but distinctly different field we do not cover here . However , for clarity , an example of protein engineering in a machine learning context would be fine-tuning a pre-trained language model on existing proteins with the desired attributes . this framework Design in Areas of Restricted Knowledge ( DARK ) 2 . DARK iteratively generates large datasets of synthetic sequences that are optimized in an unsupervised way to have unspecified ordered structures that are highly likely under a supervised protein structure predictor ( Figure 1 ) . We build this tool as an unconditional model to avoid limiting its potential applications and also to show that it is possible to learn general relationships between sequence and structure without the aid of conditioning information . We evaluate our approach by first demonstrating that DARK models satisfy our criteria for a de novo design tool . In particular , we show that the final model , DARK3 , generates novel sequences with ordered structures as judged by state-of-the-art structure predictor AlphaFold ( V2 ; Jumper et al . ( 2021 ) ) . We also test the structural generalization of our approach using a stringent unseen structure-based test set and find DARK models performs well . We demonstrate the applications of DARK3 as our tool with an example of designing a sequence with fold commonly used as a de novo scaffold for grafting functional sites . Finally , we show that DARK models enable the development of new methods by developing AlphaFold refinement , a novel and efficient approach for producing high confidence design candidates with AlphaFold . We also use it to de novo design a sequence with a high confidence immunoglobin fold . In summary , we make the following contributions : ( 1 ) We show that unconditional generative models of protein sequences can learn distributions that capture general structure information by learning from synthetic sequences . ( 2 ) We propose a novel framework , DARK , for efficiently training deep generative models on synthetic protein sequences . ( 3 ) We provide the final DARK3 model as a flexible and fast tool for de novo design that generates novel sequences with diverse ordered structures . ( 4 ) We demonstrate AlphaFold refinement , a novel way to efficiently de novo design high confidence sequence candidates using AlphaFold and DARK . 2 RELATED WORK . Here , we discuss related work applying generative models to protein design as well as those that have focused on de novo design , and broader contemporary protein design methods . Generative sequence modelling in protein design There have been a variety of machine learning approaches ( Killoran et al. , 2017 ; Wang et al. , 2018 ; Norn et al. , 2021 ) including generative modelling ( Anand & Huang , 2018 ; Sabban & Markovsky , 2020 ; Linder et al. , 2020 ) in protein design and protein engineering ( Yang et al. , 2018 ; Sinai & Kelsic , 2020 ) . Unconditional and conditional generative models have been explored in a variety of problems adjacent to protein design , such as variant prediction ( Riesselman et al. , 2018 ; Shin et al. , 2021 ) . Other examples are recent work using 2This is inspired by the huge ‘ dark ’ areas of the sequence space that are unexplored by nature ( Taylor et al. , 2009 ; Perdigão et al. , 2015 ) . language models to learn representations for downstream supervised tasks ( Alley et al. , 2019 ; Bepler & Berger , 2019 ; Elnaggar et al. , 2020 ; Rao et al. , 2021 ) . Most relevant to the work presented here is the set of models that have been developed to explore design using generative models conditioned on structural information . Although a range of architectures have been used , these models vary primarily in the representations of structural information used for conditioning . Amongst others , models have conditioned on low information descriptions of protein folds ( weak conditioning ) ( Greener et al. , 2018 ; Karimi et al. , 2020 ) , secondary structure labels ( Singer et al. , 2021 ) , and course descriptions of protein backbones ( Ingraham et al. , 2019 ; Strokach et al. , 2020 ; Cao et al. , 2021 ) .Some methods train proteins of one structural or functional type , effectively conditioning on that specific type ( Yu & Buehler , 2020 ; Shin et al. , 2021 ) . Conditioning out structure provides a way to address an inherent challenge to working with natural protein sequences . The vast majority of known natural proteins have either a weak signal for structure or it is mixed in with other information , such as functional constraints and evolutionary drift . Unconditional generative models , trained on natural sequences , fail to generalize to sequence with structures beyond those represented by their training sets because of this lack of structure signal ( Ingraham et al. , 2019 ) . This is also well understood when viewed from the lens of protein structure prediction . Even highly accurate structure predictions models like AlphaFold ( Jumper et al. , 2021 ) rely on the information contained in aligned sets of sequences similar to the query sequence to achieve accurate predictions for natural sequences . With only individual natural sequences , performance tends to be poor ( Moffat & Jones , 2021 ; Xu et al. , 2021 ) . Generative Models and de novo protein design A generative sequence model for de novo design needs to be highly general , learning general sequence and structure relationships . All considered , we find it unsurprising that there has been no clear and unambiguous demonstration of a deep generative model , without any aid from conditioning , that generates sequences unlike natural sequences and , crucially , with confidently predicted ordered structures . Here , we demonstrate such a model . We achieve this by learning from syntheticsequences with a strong structure signal . Previously de novo designed sequences are known to have extremely strong structure signals , but just over 100 de novo designed sequences ( Woolfson , 2021 ) have lab-determined structures in the Protein Data Bank ( PDB ) ( Burley et al. , 2021 ) . Thus , we find an alternative approach which is to generate synthetic sequences by leveraging a sequence optimization objective from the recent trDesign method ( Anishchenko et al. , 2020 ) . Like contemporary approaches ( Leaver-Fay et al. , 2011 ) , it is primarily a Monte Carlo sampling method , however in contrast , it slowly samples from a trained supervised structure predictor , using simulated annealing to maximize the structure likelihood of random sequences . The final sequences were shown to be extremely similar to pre-existing de novo designed sequences in their attributes and to have a strong structure signal . Contemporary de novo protein design Although recent nonparametric methods have been developed ( Zhou et al. , 2020 ) , by far the most historically successful de novo design approach is the Rosetta framework ( Leaver-Fay et al. , 2011 ) , which is the recognized gold-standard ( Huang et al. , 2016 ) . The Rosetta approach constitutes a complex computational pipeline that uses a variety of different protocols to iteratively sample viable structures and sequences using physics-based force-field simulations and Monte Carlo search procedures ( Vorobieva et al. , 2021 ; Marcos et al. , 2018 ) making it lengthy and computationally expensive . New techniques that can rapidly produce quality samples , such as the work presented here , offer the potential to greatly reduce these costs . For further discussion regarding de novo design , we point the reader to the following reviews and retrospectives by Huang et al . ( 2016 ) , Korendovych & DeGrado ( 2020 ) , and ( Woolfson , 2021 ) . 3 LEARNING DARK MODELS . 3.1 BACKGROUND . Let x ∈ V L be a protein sequence of length L over a vocabulary V of discrete amino acids ( |V | = 20 ) . Each amino acid is textually represented by a one-letter code . Each sequence x maps to a corresponding molecular structure y in three-dimensional space . Protein structure is described by the 3D coordinates of each atom , however more coarse-grained representations are commonly used . Here , we use the discrete representation of structure known as distograms ( Senior et al. , 2020 ) . When using AlphaFold we use its predicted distograms and atomic coordinates , depending on the task ( Jumper et al. , 2021 ) . Distograms represent a structure as a [ L , L , D ] tensor , comprising Ddimensional one-hot encodings of a discretized distance measure between residue pairs . We do not consider the amino acid Cysteine for experimental reasons when generating synthetic sequences3 , however , for consistency we allow all trained models to predict it . For simplicity , we assume a fixed length of L = 100 , however our approach easily generalizes to variable sequence lengths as it is based on autoregressively factorized probability models . We are interested in the set of sequences that are unlike those in nature xd ∈ V L with structures that are folded in some ordered and regular state yd . We would like to sample from their joint distribution , which is convenient to break down , by chain rule , to p ( xd , yd ) = p ( yd|xd ) p ( xd ) , a common way to consider the protein design problem . The first term p ( yd|xd ) is often thought of as protein structure prediction and so it is convenient to model it with some accurate proxy regression model pβ ( yd|xd ) , being a trained supervised structure predictor , with parameters β ∈ B . We refer to this proxy regression model as an oracle . In this work , we focus on modeling the prior , p ( xd ) as the tool we desire , which , when combined with AlphaFold , provides a rapid means to produce high quality sequence and structure samples for de novo design problems . | I think it helps to start by summarizing [Anischenko et al. 2020, Protein design by deep network hallucination], and then explain the differences in the submission. [Anischenko et al. 2020] aim to generate AA sequences that are diverse but that still reflect the properties of training structures. * Their goal is to generate protein sequences whose structures tend to be unlike those of random sequences. Since random sequences have structures that tend to be unordered, they incidentally generate sequences having ordered structures. * They use the deep resnet from rtRosetta (similar to AlphaFold's) to predict interresidue geometry maps from sequence, and that is how structure is represented and compared. * Their design goal is to design samples from p(structure | sequence) p(sequence). * To represent p(structure | sequence) they use a proxy objective: the KL divergence between the predicted structures and the structures of random sequences; in other words, good sequences are those whose distance maps are very different from the distance maps of random sequences. * To represent p(sequence) they just use -KL(AA frequences of predicted sequences || AA frequences of PDB sequences). * Sequences are designed by starting from random and then annealing according to the proxy objective. * Designed sequences are then clustered by template modeling score (TM-score) and selected (from each cluster) based on a measure of prediction 'consistency'. Now, the submitted manuscript (DARK) is the same objective and proxy objective as [Anischenko et al. 2020], but with following methodological changes: 1. For the sequence->structure oracle, instead of using rtRosetta's interresidue geometry maps as the structure representation, here distograms [Senior et al. 2020] are used, and are output from a modified version of DMPfold2. 2. Rather than relying solely on one round of "random initialization -> annealing", DARK uses an iterative self-training scheme. First they do one pass of [Anischenko et al. 2020] to get 1st round of annealed sequences. The annealed sequences from 1st round are used to train an autoregressive generative model (Transformer-based). That model is sampled from to generate additional "random initializations" (which are now guided, not purely random). These guided samples are then optimized (just hill-climbing now instead of annealing, for speed), and added to the training set for subsequent rounds, etc. There are other differences from [Anischenko et al. 2020], like using pLDDT score (orderedness) as a measure of "success", but the above two seem to be the main differences. The first of these two is worth trying but is not a conceptual contribution. The main idea of the paper is the second: self-training to generate diversified 'intermediate' initializations for further refinement. Basically it's using the initial refined sequences as a self-prior for exploring new sequences to refine. | SP:715b0ab82627966f2fe1c0a48d5a25a7977a7869 |
Design in the Dark: Learning Deep Generative Models for De Novo Protein Design | 1 INTRODUCTION . Generative modelling is beginning to be used for the task of designing protein molecules , a problem which offers potential solutions to a vast number of medical ( Chevalier et al. , 2017 ; Silva et al. , 2019 ) and industrial challenges ( King et al. , 2012 ; Wang et al. , 2021 ) . Computational protein design methods look to efficiently generate large numbers of candidate sequences , prior to laboratory validation , that are confidently predicted to have stable and ordered structures together with prespecified structural and functional attributes . Recent generative modelling studies have looked to improve on the high time and computational cost of contemporary design methods , which rely on Monte Carlo sampling and energy function-based physics simulations ( Huang et al. , 2016 ) . Here , our aim is to develop a tool , based on a deep generative model , that can rapidly generate sequences with stable and ordered structures . Furthermore , we build this tool for the important task of de novo protein design . Computational de novo protein design is arguably the most promising and general approach to protein design , but also the most difficult ( Huang et al. , 2016 ; Korendovych & DeGrado , 2020 ) . As an approach , it looks to design proteins unlike those seen in nature , with desired structural or functional attributes . Crucially , this is done without using any information from a preexisting protein as a starting point , scaffold , or guide.1 Instead , the designer must rely on general design methods with little , if any , provided information to design suitable sequences with suitable predicted structures ( Woolfson , 2021 ; Marcos et al. , 2018 ; Vorobieva et al. , 2021 ) . This presents a remarkably challenging design setting , evident in that de novo designs have yet to be successfully generated for a number of common but biotechnologically important folds , like immunoglobins . A tool that quickly generates sequences , unlike those seen in nature , with a diverse range of ordered structures is of great value as it can be used to both rapidly generate candidates directly for design tasks as well as provide a basis for developing further novel design methods . In this work , we develop deep generative sequence models that we show as satisfying this specification . Unlike previous generative protein design approaches that typically rely on natural sequences and structurebased conditioning information , we build an approach for de novo design by developing a framework for training unconditional autoregressive language models on synthetic sequences . We call 1The opposite of such an approach is protein engineering , an important but distinctly different field we do not cover here . However , for clarity , an example of protein engineering in a machine learning context would be fine-tuning a pre-trained language model on existing proteins with the desired attributes . this framework Design in Areas of Restricted Knowledge ( DARK ) 2 . DARK iteratively generates large datasets of synthetic sequences that are optimized in an unsupervised way to have unspecified ordered structures that are highly likely under a supervised protein structure predictor ( Figure 1 ) . We build this tool as an unconditional model to avoid limiting its potential applications and also to show that it is possible to learn general relationships between sequence and structure without the aid of conditioning information . We evaluate our approach by first demonstrating that DARK models satisfy our criteria for a de novo design tool . In particular , we show that the final model , DARK3 , generates novel sequences with ordered structures as judged by state-of-the-art structure predictor AlphaFold ( V2 ; Jumper et al . ( 2021 ) ) . We also test the structural generalization of our approach using a stringent unseen structure-based test set and find DARK models performs well . We demonstrate the applications of DARK3 as our tool with an example of designing a sequence with fold commonly used as a de novo scaffold for grafting functional sites . Finally , we show that DARK models enable the development of new methods by developing AlphaFold refinement , a novel and efficient approach for producing high confidence design candidates with AlphaFold . We also use it to de novo design a sequence with a high confidence immunoglobin fold . In summary , we make the following contributions : ( 1 ) We show that unconditional generative models of protein sequences can learn distributions that capture general structure information by learning from synthetic sequences . ( 2 ) We propose a novel framework , DARK , for efficiently training deep generative models on synthetic protein sequences . ( 3 ) We provide the final DARK3 model as a flexible and fast tool for de novo design that generates novel sequences with diverse ordered structures . ( 4 ) We demonstrate AlphaFold refinement , a novel way to efficiently de novo design high confidence sequence candidates using AlphaFold and DARK . 2 RELATED WORK . Here , we discuss related work applying generative models to protein design as well as those that have focused on de novo design , and broader contemporary protein design methods . Generative sequence modelling in protein design There have been a variety of machine learning approaches ( Killoran et al. , 2017 ; Wang et al. , 2018 ; Norn et al. , 2021 ) including generative modelling ( Anand & Huang , 2018 ; Sabban & Markovsky , 2020 ; Linder et al. , 2020 ) in protein design and protein engineering ( Yang et al. , 2018 ; Sinai & Kelsic , 2020 ) . Unconditional and conditional generative models have been explored in a variety of problems adjacent to protein design , such as variant prediction ( Riesselman et al. , 2018 ; Shin et al. , 2021 ) . Other examples are recent work using 2This is inspired by the huge ‘ dark ’ areas of the sequence space that are unexplored by nature ( Taylor et al. , 2009 ; Perdigão et al. , 2015 ) . language models to learn representations for downstream supervised tasks ( Alley et al. , 2019 ; Bepler & Berger , 2019 ; Elnaggar et al. , 2020 ; Rao et al. , 2021 ) . Most relevant to the work presented here is the set of models that have been developed to explore design using generative models conditioned on structural information . Although a range of architectures have been used , these models vary primarily in the representations of structural information used for conditioning . Amongst others , models have conditioned on low information descriptions of protein folds ( weak conditioning ) ( Greener et al. , 2018 ; Karimi et al. , 2020 ) , secondary structure labels ( Singer et al. , 2021 ) , and course descriptions of protein backbones ( Ingraham et al. , 2019 ; Strokach et al. , 2020 ; Cao et al. , 2021 ) .Some methods train proteins of one structural or functional type , effectively conditioning on that specific type ( Yu & Buehler , 2020 ; Shin et al. , 2021 ) . Conditioning out structure provides a way to address an inherent challenge to working with natural protein sequences . The vast majority of known natural proteins have either a weak signal for structure or it is mixed in with other information , such as functional constraints and evolutionary drift . Unconditional generative models , trained on natural sequences , fail to generalize to sequence with structures beyond those represented by their training sets because of this lack of structure signal ( Ingraham et al. , 2019 ) . This is also well understood when viewed from the lens of protein structure prediction . Even highly accurate structure predictions models like AlphaFold ( Jumper et al. , 2021 ) rely on the information contained in aligned sets of sequences similar to the query sequence to achieve accurate predictions for natural sequences . With only individual natural sequences , performance tends to be poor ( Moffat & Jones , 2021 ; Xu et al. , 2021 ) . Generative Models and de novo protein design A generative sequence model for de novo design needs to be highly general , learning general sequence and structure relationships . All considered , we find it unsurprising that there has been no clear and unambiguous demonstration of a deep generative model , without any aid from conditioning , that generates sequences unlike natural sequences and , crucially , with confidently predicted ordered structures . Here , we demonstrate such a model . We achieve this by learning from syntheticsequences with a strong structure signal . Previously de novo designed sequences are known to have extremely strong structure signals , but just over 100 de novo designed sequences ( Woolfson , 2021 ) have lab-determined structures in the Protein Data Bank ( PDB ) ( Burley et al. , 2021 ) . Thus , we find an alternative approach which is to generate synthetic sequences by leveraging a sequence optimization objective from the recent trDesign method ( Anishchenko et al. , 2020 ) . Like contemporary approaches ( Leaver-Fay et al. , 2011 ) , it is primarily a Monte Carlo sampling method , however in contrast , it slowly samples from a trained supervised structure predictor , using simulated annealing to maximize the structure likelihood of random sequences . The final sequences were shown to be extremely similar to pre-existing de novo designed sequences in their attributes and to have a strong structure signal . Contemporary de novo protein design Although recent nonparametric methods have been developed ( Zhou et al. , 2020 ) , by far the most historically successful de novo design approach is the Rosetta framework ( Leaver-Fay et al. , 2011 ) , which is the recognized gold-standard ( Huang et al. , 2016 ) . The Rosetta approach constitutes a complex computational pipeline that uses a variety of different protocols to iteratively sample viable structures and sequences using physics-based force-field simulations and Monte Carlo search procedures ( Vorobieva et al. , 2021 ; Marcos et al. , 2018 ) making it lengthy and computationally expensive . New techniques that can rapidly produce quality samples , such as the work presented here , offer the potential to greatly reduce these costs . For further discussion regarding de novo design , we point the reader to the following reviews and retrospectives by Huang et al . ( 2016 ) , Korendovych & DeGrado ( 2020 ) , and ( Woolfson , 2021 ) . 3 LEARNING DARK MODELS . 3.1 BACKGROUND . Let x ∈ V L be a protein sequence of length L over a vocabulary V of discrete amino acids ( |V | = 20 ) . Each amino acid is textually represented by a one-letter code . Each sequence x maps to a corresponding molecular structure y in three-dimensional space . Protein structure is described by the 3D coordinates of each atom , however more coarse-grained representations are commonly used . Here , we use the discrete representation of structure known as distograms ( Senior et al. , 2020 ) . When using AlphaFold we use its predicted distograms and atomic coordinates , depending on the task ( Jumper et al. , 2021 ) . Distograms represent a structure as a [ L , L , D ] tensor , comprising Ddimensional one-hot encodings of a discretized distance measure between residue pairs . We do not consider the amino acid Cysteine for experimental reasons when generating synthetic sequences3 , however , for consistency we allow all trained models to predict it . For simplicity , we assume a fixed length of L = 100 , however our approach easily generalizes to variable sequence lengths as it is based on autoregressively factorized probability models . We are interested in the set of sequences that are unlike those in nature xd ∈ V L with structures that are folded in some ordered and regular state yd . We would like to sample from their joint distribution , which is convenient to break down , by chain rule , to p ( xd , yd ) = p ( yd|xd ) p ( xd ) , a common way to consider the protein design problem . The first term p ( yd|xd ) is often thought of as protein structure prediction and so it is convenient to model it with some accurate proxy regression model pβ ( yd|xd ) , being a trained supervised structure predictor , with parameters β ∈ B . We refer to this proxy regression model as an oracle . In this work , we focus on modeling the prior , p ( xd ) as the tool we desire , which , when combined with AlphaFold , provides a rapid means to produce high quality sequence and structure samples for de novo design problems . | The paper present a method to sample jointly de novo protein sequences and structures without relying on any structure conditioning. The main contribution is a new iterative procedure to generate a dataset of increasing size in an unsupervised fashion. This dataset is finally used to learn a generative model that captures the distribution over the "unnatural" sequence space, structures are predicted by using AlphaFold on the generated sequences. The authors provide empirical evidence of the quality (diversity and structural stability) of the de novo designs. | SP:715b0ab82627966f2fe1c0a48d5a25a7977a7869 |
Design in the Dark: Learning Deep Generative Models for De Novo Protein Design | 1 INTRODUCTION . Generative modelling is beginning to be used for the task of designing protein molecules , a problem which offers potential solutions to a vast number of medical ( Chevalier et al. , 2017 ; Silva et al. , 2019 ) and industrial challenges ( King et al. , 2012 ; Wang et al. , 2021 ) . Computational protein design methods look to efficiently generate large numbers of candidate sequences , prior to laboratory validation , that are confidently predicted to have stable and ordered structures together with prespecified structural and functional attributes . Recent generative modelling studies have looked to improve on the high time and computational cost of contemporary design methods , which rely on Monte Carlo sampling and energy function-based physics simulations ( Huang et al. , 2016 ) . Here , our aim is to develop a tool , based on a deep generative model , that can rapidly generate sequences with stable and ordered structures . Furthermore , we build this tool for the important task of de novo protein design . Computational de novo protein design is arguably the most promising and general approach to protein design , but also the most difficult ( Huang et al. , 2016 ; Korendovych & DeGrado , 2020 ) . As an approach , it looks to design proteins unlike those seen in nature , with desired structural or functional attributes . Crucially , this is done without using any information from a preexisting protein as a starting point , scaffold , or guide.1 Instead , the designer must rely on general design methods with little , if any , provided information to design suitable sequences with suitable predicted structures ( Woolfson , 2021 ; Marcos et al. , 2018 ; Vorobieva et al. , 2021 ) . This presents a remarkably challenging design setting , evident in that de novo designs have yet to be successfully generated for a number of common but biotechnologically important folds , like immunoglobins . A tool that quickly generates sequences , unlike those seen in nature , with a diverse range of ordered structures is of great value as it can be used to both rapidly generate candidates directly for design tasks as well as provide a basis for developing further novel design methods . In this work , we develop deep generative sequence models that we show as satisfying this specification . Unlike previous generative protein design approaches that typically rely on natural sequences and structurebased conditioning information , we build an approach for de novo design by developing a framework for training unconditional autoregressive language models on synthetic sequences . We call 1The opposite of such an approach is protein engineering , an important but distinctly different field we do not cover here . However , for clarity , an example of protein engineering in a machine learning context would be fine-tuning a pre-trained language model on existing proteins with the desired attributes . this framework Design in Areas of Restricted Knowledge ( DARK ) 2 . DARK iteratively generates large datasets of synthetic sequences that are optimized in an unsupervised way to have unspecified ordered structures that are highly likely under a supervised protein structure predictor ( Figure 1 ) . We build this tool as an unconditional model to avoid limiting its potential applications and also to show that it is possible to learn general relationships between sequence and structure without the aid of conditioning information . We evaluate our approach by first demonstrating that DARK models satisfy our criteria for a de novo design tool . In particular , we show that the final model , DARK3 , generates novel sequences with ordered structures as judged by state-of-the-art structure predictor AlphaFold ( V2 ; Jumper et al . ( 2021 ) ) . We also test the structural generalization of our approach using a stringent unseen structure-based test set and find DARK models performs well . We demonstrate the applications of DARK3 as our tool with an example of designing a sequence with fold commonly used as a de novo scaffold for grafting functional sites . Finally , we show that DARK models enable the development of new methods by developing AlphaFold refinement , a novel and efficient approach for producing high confidence design candidates with AlphaFold . We also use it to de novo design a sequence with a high confidence immunoglobin fold . In summary , we make the following contributions : ( 1 ) We show that unconditional generative models of protein sequences can learn distributions that capture general structure information by learning from synthetic sequences . ( 2 ) We propose a novel framework , DARK , for efficiently training deep generative models on synthetic protein sequences . ( 3 ) We provide the final DARK3 model as a flexible and fast tool for de novo design that generates novel sequences with diverse ordered structures . ( 4 ) We demonstrate AlphaFold refinement , a novel way to efficiently de novo design high confidence sequence candidates using AlphaFold and DARK . 2 RELATED WORK . Here , we discuss related work applying generative models to protein design as well as those that have focused on de novo design , and broader contemporary protein design methods . Generative sequence modelling in protein design There have been a variety of machine learning approaches ( Killoran et al. , 2017 ; Wang et al. , 2018 ; Norn et al. , 2021 ) including generative modelling ( Anand & Huang , 2018 ; Sabban & Markovsky , 2020 ; Linder et al. , 2020 ) in protein design and protein engineering ( Yang et al. , 2018 ; Sinai & Kelsic , 2020 ) . Unconditional and conditional generative models have been explored in a variety of problems adjacent to protein design , such as variant prediction ( Riesselman et al. , 2018 ; Shin et al. , 2021 ) . Other examples are recent work using 2This is inspired by the huge ‘ dark ’ areas of the sequence space that are unexplored by nature ( Taylor et al. , 2009 ; Perdigão et al. , 2015 ) . language models to learn representations for downstream supervised tasks ( Alley et al. , 2019 ; Bepler & Berger , 2019 ; Elnaggar et al. , 2020 ; Rao et al. , 2021 ) . Most relevant to the work presented here is the set of models that have been developed to explore design using generative models conditioned on structural information . Although a range of architectures have been used , these models vary primarily in the representations of structural information used for conditioning . Amongst others , models have conditioned on low information descriptions of protein folds ( weak conditioning ) ( Greener et al. , 2018 ; Karimi et al. , 2020 ) , secondary structure labels ( Singer et al. , 2021 ) , and course descriptions of protein backbones ( Ingraham et al. , 2019 ; Strokach et al. , 2020 ; Cao et al. , 2021 ) .Some methods train proteins of one structural or functional type , effectively conditioning on that specific type ( Yu & Buehler , 2020 ; Shin et al. , 2021 ) . Conditioning out structure provides a way to address an inherent challenge to working with natural protein sequences . The vast majority of known natural proteins have either a weak signal for structure or it is mixed in with other information , such as functional constraints and evolutionary drift . Unconditional generative models , trained on natural sequences , fail to generalize to sequence with structures beyond those represented by their training sets because of this lack of structure signal ( Ingraham et al. , 2019 ) . This is also well understood when viewed from the lens of protein structure prediction . Even highly accurate structure predictions models like AlphaFold ( Jumper et al. , 2021 ) rely on the information contained in aligned sets of sequences similar to the query sequence to achieve accurate predictions for natural sequences . With only individual natural sequences , performance tends to be poor ( Moffat & Jones , 2021 ; Xu et al. , 2021 ) . Generative Models and de novo protein design A generative sequence model for de novo design needs to be highly general , learning general sequence and structure relationships . All considered , we find it unsurprising that there has been no clear and unambiguous demonstration of a deep generative model , without any aid from conditioning , that generates sequences unlike natural sequences and , crucially , with confidently predicted ordered structures . Here , we demonstrate such a model . We achieve this by learning from syntheticsequences with a strong structure signal . Previously de novo designed sequences are known to have extremely strong structure signals , but just over 100 de novo designed sequences ( Woolfson , 2021 ) have lab-determined structures in the Protein Data Bank ( PDB ) ( Burley et al. , 2021 ) . Thus , we find an alternative approach which is to generate synthetic sequences by leveraging a sequence optimization objective from the recent trDesign method ( Anishchenko et al. , 2020 ) . Like contemporary approaches ( Leaver-Fay et al. , 2011 ) , it is primarily a Monte Carlo sampling method , however in contrast , it slowly samples from a trained supervised structure predictor , using simulated annealing to maximize the structure likelihood of random sequences . The final sequences were shown to be extremely similar to pre-existing de novo designed sequences in their attributes and to have a strong structure signal . Contemporary de novo protein design Although recent nonparametric methods have been developed ( Zhou et al. , 2020 ) , by far the most historically successful de novo design approach is the Rosetta framework ( Leaver-Fay et al. , 2011 ) , which is the recognized gold-standard ( Huang et al. , 2016 ) . The Rosetta approach constitutes a complex computational pipeline that uses a variety of different protocols to iteratively sample viable structures and sequences using physics-based force-field simulations and Monte Carlo search procedures ( Vorobieva et al. , 2021 ; Marcos et al. , 2018 ) making it lengthy and computationally expensive . New techniques that can rapidly produce quality samples , such as the work presented here , offer the potential to greatly reduce these costs . For further discussion regarding de novo design , we point the reader to the following reviews and retrospectives by Huang et al . ( 2016 ) , Korendovych & DeGrado ( 2020 ) , and ( Woolfson , 2021 ) . 3 LEARNING DARK MODELS . 3.1 BACKGROUND . Let x ∈ V L be a protein sequence of length L over a vocabulary V of discrete amino acids ( |V | = 20 ) . Each amino acid is textually represented by a one-letter code . Each sequence x maps to a corresponding molecular structure y in three-dimensional space . Protein structure is described by the 3D coordinates of each atom , however more coarse-grained representations are commonly used . Here , we use the discrete representation of structure known as distograms ( Senior et al. , 2020 ) . When using AlphaFold we use its predicted distograms and atomic coordinates , depending on the task ( Jumper et al. , 2021 ) . Distograms represent a structure as a [ L , L , D ] tensor , comprising Ddimensional one-hot encodings of a discretized distance measure between residue pairs . We do not consider the amino acid Cysteine for experimental reasons when generating synthetic sequences3 , however , for consistency we allow all trained models to predict it . For simplicity , we assume a fixed length of L = 100 , however our approach easily generalizes to variable sequence lengths as it is based on autoregressively factorized probability models . We are interested in the set of sequences that are unlike those in nature xd ∈ V L with structures that are folded in some ordered and regular state yd . We would like to sample from their joint distribution , which is convenient to break down , by chain rule , to p ( xd , yd ) = p ( yd|xd ) p ( xd ) , a common way to consider the protein design problem . The first term p ( yd|xd ) is often thought of as protein structure prediction and so it is convenient to model it with some accurate proxy regression model pβ ( yd|xd ) , being a trained supervised structure predictor , with parameters β ∈ B . We refer to this proxy regression model as an oracle . In this work , we focus on modeling the prior , p ( xd ) as the tool we desire , which , when combined with AlphaFold , provides a rapid means to produce high quality sequence and structure samples for de novo design problems . | The authors propose a way to generate novel protein sequences that are likely to have folded structures. To do so, they start with a pre-trained sequence-to-structure predictor, and use simulated annealing to generate a set of initial sequences that are likely to have a structure. These seed sequences are used to train an unsupervised sequence model (an autoregressive transformer). More sequences are generated from this sequence model, and they are optimized to maximize the likelihood they have structures (using the pre-trained sequence-to-structure model), and are added to the growing set of training sequences. This process is repeated for several iterations to finetune the unsupervised sequence model. The authors show that sequences generated from this sequence model are likely to be structured as predicted by AlphaFold. | SP:715b0ab82627966f2fe1c0a48d5a25a7977a7869 |
Uncertainty Modeling for Out-of-Distribution Generalization | 1 INTRODUCTION . Deep neural networks have shown impressive success in computer vision , but with a severe reliance on the assumption that the training and testing domains follow an independent and identical distribution ( Ben-David et al. , 2010 ; Vapnik , 1992 ) . This assumption , however , does not hold in many real-world applications . For instance , when employing segmentation models trained on sunny days for rainy and foggy environments ( Choi et al. , 2021 ) , or recognizing art paintings with models that trained on photographs ( Li et al. , 2017 ) , inevitable performance drop can often be observed in such out-of-distribution deployment scenarios . Therefore , the problem of domain generalization , aiming to improve the robustness of the network on various unseen testing domains , becomes quite important . Previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) demonstrate that feature statistics ( mean and standard deviation ) , as the moments of the learned features , carry informative domain characteristics of the training data . Domain characteristics primarily refer to the information that is more specific to the individual domains but less relevant to the task objectives , such as the photo style and capturing environment information in object recognition . Consequently , domains with different data distributions generally have inconsistent feature statistics ( Wang et al. , 2020b ; 2019a ; Gao et al. , 2021a ) . Most deep learning methods follow Empirical Risk Minimization principle ( Vapnik , 1999 ) to minimize their average error over the training data ( Shen et al. , 2021 ) . Despite the satisfactory performance on the training domain , these methods do not explicitly consider the uncertain statistics discrepancy caused by potential domain shifts during testing . As a result , the trained models tend to overfit the training domain and show vulnerability to the statistic changes at testing time , substantially limiting the generalization ability of the learned representations . Intuitively , the test domains may bring uncertain statistics shifts with different potential directions and intensities compared to the training domain ( as shown in Figure 1 ) , implying the uncertain nature of domain shifts . Considering such “ uncertainty ” of potential domain shifts , synthesizing novel feature statistics variants to model diverse domain shifts can improve the robustness of the trained network to different testing distributions . Towards this end , we introduce a novel probabilistic method to improve the network generalization ability by properly modeling Domain Shifts with Uncertainty ( DSU ) , i.e. , characterizing the feature statistics as uncertain distributions . In our method , instead of treating each feature statistic as a deterministic point measured from the feature , we hypothesize that the feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . The distribution “ center ” is set as each feature ’ s original statistic value , and the distribution “ scope ” represents the variant intensity considering underlying domain shifts . Uncertainty estimation is adopted here to depict the distribution “ scope ” of probabilistic feature statistics . Specifically , we estimate the distribution “ scope ” based on the variances of the mini-batch statistics in an efficient non-parametric manner . Subsequently , feature statistics variants are randomly sampled from the estimated Gaussian distribution and then used to replace the original deterministic values for modeling diverse domain shifts , as illustrated in Figure 2 . Due to the generated feature statistics with diverse distribution possibilities , the models can be trained to properly alleviate the domain perturbations and encode better domain-invariant features . Our proposed method is simple yet fairly effective to alleviate performance drop caused by domain shifts , and can be readily integrated into existing networks without bringing additional model parameters or loss constraints . Comprehensive experiments on a wide range of vision tasks demonstrate the superiority of our proposed method , indicating that introducing uncertainty to feature statistics can well improve models ’ generalization against domain shifts . 2 RELATED WORK . 2.1 DOMAIN GENERALIZATION . Domain generalization ( DG ) has been attracting increasing attention in the past few years , which aims to achieve out-of-distribution generalization on unseen target domains using only single or multiple source domain data for training ( Blanchard et al . ( 2011 ) ) . Research on addressing this problem has been extensively conducted in the literature ( Zhou et al . ( 2021a ) ; Wang et al . ( 2021 ) ; Shen et al . ( 2021 ) ) . Here some studies that are more related to our work are introduced below . Data Augmentation : Data augmentation is an effective manner for improving generalization ability and relieving models from overfitting in training domains . Most augmentation methods adopt various transformations at the image level , such as AugMix ( Hendrycks et al . ( 2020 ) ) and CutMix ( Yun et al . ( 2019 ) ) . Besides using handcraft transformations , mixup ( Zhang et al . ( 2018 ) ) trains the model by using pair-wise linearly interpolated samples in both the image and label spaces . Manifold Mixup ( Verma et al . ( 2019 ) ) further adopts this linear interpolation from image level to feature level . Some recent works extend the above transformations to feature statistics for improving model generalization . MixStyle ( Zhou et al . ( 2021b ) ) adopts linear interpolation on feature statistics of two instances to generate synthesized samples . The pAdaIn ( Nuriel et al . ( 2021 ) ) swaps statistics between the samples applied with a random permutation of the batch . Invariant Representation Learning : The main idea of invariant representation learning is to enable models to learn features that are invariant to domain shifts . Domain alignment-based approaches ( Li et al . ( 2018c ; b ) ) learn invariant features by minimizing the distances between different distributions . Instead of enforcing the entire features to be invariant , disentangled feature learning approaches ( Chattopadhyay et al . ( 2020 ) ; Piratla et al . ( 2020 ) ) decouple the features into domain-specific and domain-invariant parts and learn their representations simultaneously . In addition , normalizationbased methods ( Xingang Pan & Tang ( 2018 ) ; Choi et al . ( 2021 ) ) can also be used to remove the style information to obtain invariant representations . Learning Strategies : There are also some effective learning strategies that can be leveraged to improve generalization ability . Ensemble learning is an effective technique in boosting model performance . The ensemble predictions using a collection of diverse models ( Zhou et al . ( 2020b ) ) or modules ( Seo et al . ( 2020 ) ) can be adopted to improve generalization and robustness . Meta-learningbased methods ( Finn et al . ( 2017 ) ; Li et al . ( 2018a ) ) learn to simulate the domain shifts following an episode training paradigm . Besides , self-challenging methods , such as RSC ( Huang et al . ( 2020 ) ) , force the model to learn a general representation by discarding dominant features activated on the training data . 2.2 UNCERTAINTY IN DEEP LEARNING . Uncertainty capturing the “ noise ” and “ randomness ” inherent in the data has received increasing attention in deep representation learning . Variational Auto-encoder ( Kingma & Welling ( 2013 ) ) , as an important method for learning generative models , can be regarded as a method to model the data uncertainty in the hidden space . Dropout ( Srivastava et al . ( 2014 ) ) , which is widely used in many deep learning models to avoid over-fitting , can be interpreted to represent model uncertainty as a Bayesian approximation ( Gal & Ghahramani ( 2016 ) ) . In some works , uncertainty is used to address the issues of low-quality training data . In person re-identification , DistributionNet ( Gal & Ghahramani ( 2016 ) ) adopts uncertainty to model the person images of noise-labels and outliers . In face recognition , DUL ( Chang et al . ( 2020 ) ) and PFE ( ( Shi & Jain , 2019 ) ) apply data uncertainty to simultaneously learn the feature embedding and its uncertainty , where the uncertainty is learned through a learnable subnetwork to describe the quality of the image . Different from the aforementioned works , our proposed method is used to model the feature statistics uncertainty under potential domain shifts and acts as a feature augmentation method for handling our-of-distribution generalization problem . 3 METHOD . 3.1 PRELIMINARIES . Given x ∈ RB×C×H×W to be the encoded features in the intermediate layers of the network , we denote µ ∈ RB×C and σ ∈ RB×C as the channel-wise feature mean and standard deviation of each instance in a mini-batch , respectively , which can be formulated as : µ ( x ) = 1 HW H∑ h=1 W∑ w=1 xb , c , h , w , ( 1 ) σ2 ( x ) = 1 HW H∑ h=1 W∑ w=1 ( xb , c , h , w − µ ( x ) ) 2 . ( 2 ) As the abstraction of features , feature statistics can capture informative characteristics of the corresponding domain ( such as color , texture , and contrast ) , according to previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) . In out-of-distribution scenarios , the feature statistics often show inconsistency with training domain due to different domain characteristics ( Wang et al. , 2019a ; Gao et al. , 2021a ) , which is ill-suited to deep learning modules like nonlinearity layers and normalization layer and degenerates the model ’ s generalization ability ( Wang et al. , 2020b ) . However , most of the deep learning methods only treat feature statistics as deterministic values measured from the features while lacking explicit consideration of the potential uncertain statistical discrepancy . Owing to the model ’ s inherent vulnerability to such discrepancy , the generalization ability of the learned representations is limited . Some recent methods ( Nuriel et al. , 2021 ; Zhou et al. , 2021b ) utilize feature statistics to tackle the domain generalization problem . Despite the success , they typically adopt linear manipulation ( i.e. , exchange and interpolation ) on pairwise samples to generate new feature statistics , which limits the diversity of synthetic changes . Specifically , the direction of their variants is determined by the chosen reference sample and such internal operation restricts their variant intensity . Thus these methods are sub-optimal when handling the diverse and uncertain domain shifts in real world . 3.2 MODELING DOMAIN SHIFTS WITH UNCERTAINTY . Given the arbitrary testing domains with uncertain feature statistic shifts in both direction and intensity , properly modeling the domain shifts becomes an important task for tackling the challenge of domain generalization problem . Considering the uncertainty and randomness of domain shifts , it is promising to employ the methods of “ uncertainty ” to treat the “ uncertainty ” of domain shifts . In this paper , we propose a novel method by modeling Domain Shifts with Uncertainty ( DSU ) . Instead of treating each feature statistic as a deterministic value measured from the learned feature , we hypothesize that the distribution of each feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . This means each feature statistic has a probabilistic representation drawn from a certain distribution , i.e. , the feature statistics mean and standard deviation follow N ( µ , Σµ ) and N ( σ , Σσ ) , respectively . Specifically , the corresponding Gaussian distribution ’ s center is set as each feature ’ s original statistics , while the Gaussian distribution ’ s standard deviation describes the uncertainty scope for different potential shifts . Through randomly sampling diverse synthesized feature statistics with the probabilistic approach , the models can be trained to improve the robustness of the network against statistics shifts . | In this paper, the authors proposed to model uncertainty with multivariate Gaussian distribution for better network generalization. Experiments on multiple benchmark datasets show improved result. Several visualizations and analysis also illustrate the effectiveness of the proposed approach. | SP:e8a6fca07fce4f8de21e4374e90863cda9d06db6 |
Uncertainty Modeling for Out-of-Distribution Generalization | 1 INTRODUCTION . Deep neural networks have shown impressive success in computer vision , but with a severe reliance on the assumption that the training and testing domains follow an independent and identical distribution ( Ben-David et al. , 2010 ; Vapnik , 1992 ) . This assumption , however , does not hold in many real-world applications . For instance , when employing segmentation models trained on sunny days for rainy and foggy environments ( Choi et al. , 2021 ) , or recognizing art paintings with models that trained on photographs ( Li et al. , 2017 ) , inevitable performance drop can often be observed in such out-of-distribution deployment scenarios . Therefore , the problem of domain generalization , aiming to improve the robustness of the network on various unseen testing domains , becomes quite important . Previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) demonstrate that feature statistics ( mean and standard deviation ) , as the moments of the learned features , carry informative domain characteristics of the training data . Domain characteristics primarily refer to the information that is more specific to the individual domains but less relevant to the task objectives , such as the photo style and capturing environment information in object recognition . Consequently , domains with different data distributions generally have inconsistent feature statistics ( Wang et al. , 2020b ; 2019a ; Gao et al. , 2021a ) . Most deep learning methods follow Empirical Risk Minimization principle ( Vapnik , 1999 ) to minimize their average error over the training data ( Shen et al. , 2021 ) . Despite the satisfactory performance on the training domain , these methods do not explicitly consider the uncertain statistics discrepancy caused by potential domain shifts during testing . As a result , the trained models tend to overfit the training domain and show vulnerability to the statistic changes at testing time , substantially limiting the generalization ability of the learned representations . Intuitively , the test domains may bring uncertain statistics shifts with different potential directions and intensities compared to the training domain ( as shown in Figure 1 ) , implying the uncertain nature of domain shifts . Considering such “ uncertainty ” of potential domain shifts , synthesizing novel feature statistics variants to model diverse domain shifts can improve the robustness of the trained network to different testing distributions . Towards this end , we introduce a novel probabilistic method to improve the network generalization ability by properly modeling Domain Shifts with Uncertainty ( DSU ) , i.e. , characterizing the feature statistics as uncertain distributions . In our method , instead of treating each feature statistic as a deterministic point measured from the feature , we hypothesize that the feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . The distribution “ center ” is set as each feature ’ s original statistic value , and the distribution “ scope ” represents the variant intensity considering underlying domain shifts . Uncertainty estimation is adopted here to depict the distribution “ scope ” of probabilistic feature statistics . Specifically , we estimate the distribution “ scope ” based on the variances of the mini-batch statistics in an efficient non-parametric manner . Subsequently , feature statistics variants are randomly sampled from the estimated Gaussian distribution and then used to replace the original deterministic values for modeling diverse domain shifts , as illustrated in Figure 2 . Due to the generated feature statistics with diverse distribution possibilities , the models can be trained to properly alleviate the domain perturbations and encode better domain-invariant features . Our proposed method is simple yet fairly effective to alleviate performance drop caused by domain shifts , and can be readily integrated into existing networks without bringing additional model parameters or loss constraints . Comprehensive experiments on a wide range of vision tasks demonstrate the superiority of our proposed method , indicating that introducing uncertainty to feature statistics can well improve models ’ generalization against domain shifts . 2 RELATED WORK . 2.1 DOMAIN GENERALIZATION . Domain generalization ( DG ) has been attracting increasing attention in the past few years , which aims to achieve out-of-distribution generalization on unseen target domains using only single or multiple source domain data for training ( Blanchard et al . ( 2011 ) ) . Research on addressing this problem has been extensively conducted in the literature ( Zhou et al . ( 2021a ) ; Wang et al . ( 2021 ) ; Shen et al . ( 2021 ) ) . Here some studies that are more related to our work are introduced below . Data Augmentation : Data augmentation is an effective manner for improving generalization ability and relieving models from overfitting in training domains . Most augmentation methods adopt various transformations at the image level , such as AugMix ( Hendrycks et al . ( 2020 ) ) and CutMix ( Yun et al . ( 2019 ) ) . Besides using handcraft transformations , mixup ( Zhang et al . ( 2018 ) ) trains the model by using pair-wise linearly interpolated samples in both the image and label spaces . Manifold Mixup ( Verma et al . ( 2019 ) ) further adopts this linear interpolation from image level to feature level . Some recent works extend the above transformations to feature statistics for improving model generalization . MixStyle ( Zhou et al . ( 2021b ) ) adopts linear interpolation on feature statistics of two instances to generate synthesized samples . The pAdaIn ( Nuriel et al . ( 2021 ) ) swaps statistics between the samples applied with a random permutation of the batch . Invariant Representation Learning : The main idea of invariant representation learning is to enable models to learn features that are invariant to domain shifts . Domain alignment-based approaches ( Li et al . ( 2018c ; b ) ) learn invariant features by minimizing the distances between different distributions . Instead of enforcing the entire features to be invariant , disentangled feature learning approaches ( Chattopadhyay et al . ( 2020 ) ; Piratla et al . ( 2020 ) ) decouple the features into domain-specific and domain-invariant parts and learn their representations simultaneously . In addition , normalizationbased methods ( Xingang Pan & Tang ( 2018 ) ; Choi et al . ( 2021 ) ) can also be used to remove the style information to obtain invariant representations . Learning Strategies : There are also some effective learning strategies that can be leveraged to improve generalization ability . Ensemble learning is an effective technique in boosting model performance . The ensemble predictions using a collection of diverse models ( Zhou et al . ( 2020b ) ) or modules ( Seo et al . ( 2020 ) ) can be adopted to improve generalization and robustness . Meta-learningbased methods ( Finn et al . ( 2017 ) ; Li et al . ( 2018a ) ) learn to simulate the domain shifts following an episode training paradigm . Besides , self-challenging methods , such as RSC ( Huang et al . ( 2020 ) ) , force the model to learn a general representation by discarding dominant features activated on the training data . 2.2 UNCERTAINTY IN DEEP LEARNING . Uncertainty capturing the “ noise ” and “ randomness ” inherent in the data has received increasing attention in deep representation learning . Variational Auto-encoder ( Kingma & Welling ( 2013 ) ) , as an important method for learning generative models , can be regarded as a method to model the data uncertainty in the hidden space . Dropout ( Srivastava et al . ( 2014 ) ) , which is widely used in many deep learning models to avoid over-fitting , can be interpreted to represent model uncertainty as a Bayesian approximation ( Gal & Ghahramani ( 2016 ) ) . In some works , uncertainty is used to address the issues of low-quality training data . In person re-identification , DistributionNet ( Gal & Ghahramani ( 2016 ) ) adopts uncertainty to model the person images of noise-labels and outliers . In face recognition , DUL ( Chang et al . ( 2020 ) ) and PFE ( ( Shi & Jain , 2019 ) ) apply data uncertainty to simultaneously learn the feature embedding and its uncertainty , where the uncertainty is learned through a learnable subnetwork to describe the quality of the image . Different from the aforementioned works , our proposed method is used to model the feature statistics uncertainty under potential domain shifts and acts as a feature augmentation method for handling our-of-distribution generalization problem . 3 METHOD . 3.1 PRELIMINARIES . Given x ∈ RB×C×H×W to be the encoded features in the intermediate layers of the network , we denote µ ∈ RB×C and σ ∈ RB×C as the channel-wise feature mean and standard deviation of each instance in a mini-batch , respectively , which can be formulated as : µ ( x ) = 1 HW H∑ h=1 W∑ w=1 xb , c , h , w , ( 1 ) σ2 ( x ) = 1 HW H∑ h=1 W∑ w=1 ( xb , c , h , w − µ ( x ) ) 2 . ( 2 ) As the abstraction of features , feature statistics can capture informative characteristics of the corresponding domain ( such as color , texture , and contrast ) , according to previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) . In out-of-distribution scenarios , the feature statistics often show inconsistency with training domain due to different domain characteristics ( Wang et al. , 2019a ; Gao et al. , 2021a ) , which is ill-suited to deep learning modules like nonlinearity layers and normalization layer and degenerates the model ’ s generalization ability ( Wang et al. , 2020b ) . However , most of the deep learning methods only treat feature statistics as deterministic values measured from the features while lacking explicit consideration of the potential uncertain statistical discrepancy . Owing to the model ’ s inherent vulnerability to such discrepancy , the generalization ability of the learned representations is limited . Some recent methods ( Nuriel et al. , 2021 ; Zhou et al. , 2021b ) utilize feature statistics to tackle the domain generalization problem . Despite the success , they typically adopt linear manipulation ( i.e. , exchange and interpolation ) on pairwise samples to generate new feature statistics , which limits the diversity of synthetic changes . Specifically , the direction of their variants is determined by the chosen reference sample and such internal operation restricts their variant intensity . Thus these methods are sub-optimal when handling the diverse and uncertain domain shifts in real world . 3.2 MODELING DOMAIN SHIFTS WITH UNCERTAINTY . Given the arbitrary testing domains with uncertain feature statistic shifts in both direction and intensity , properly modeling the domain shifts becomes an important task for tackling the challenge of domain generalization problem . Considering the uncertainty and randomness of domain shifts , it is promising to employ the methods of “ uncertainty ” to treat the “ uncertainty ” of domain shifts . In this paper , we propose a novel method by modeling Domain Shifts with Uncertainty ( DSU ) . Instead of treating each feature statistic as a deterministic value measured from the learned feature , we hypothesize that the distribution of each feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . This means each feature statistic has a probabilistic representation drawn from a certain distribution , i.e. , the feature statistics mean and standard deviation follow N ( µ , Σµ ) and N ( σ , Σσ ) , respectively . Specifically , the corresponding Gaussian distribution ’ s center is set as each feature ’ s original statistics , while the Gaussian distribution ’ s standard deviation describes the uncertainty scope for different potential shifts . Through randomly sampling diverse synthesized feature statistics with the probabilistic approach , the models can be trained to improve the robustness of the network against statistics shifts . | This paper studies the problem of out-of-distribution generalization by modeling uncertainty in feature statistics. It improves the network generalization ability by modeling the uncertainty of domain shifts with synthesized feature statistics during training. Instead of being deterministic values, the feature statistics are hypothesized to follow a multivariate Gaussian distribution. The proposed method is tested on various tasks including image classification, semantic segmentation, and instance retrieval, and shows strong performance compared to state-of-the-art methods. | SP:e8a6fca07fce4f8de21e4374e90863cda9d06db6 |
Uncertainty Modeling for Out-of-Distribution Generalization | 1 INTRODUCTION . Deep neural networks have shown impressive success in computer vision , but with a severe reliance on the assumption that the training and testing domains follow an independent and identical distribution ( Ben-David et al. , 2010 ; Vapnik , 1992 ) . This assumption , however , does not hold in many real-world applications . For instance , when employing segmentation models trained on sunny days for rainy and foggy environments ( Choi et al. , 2021 ) , or recognizing art paintings with models that trained on photographs ( Li et al. , 2017 ) , inevitable performance drop can often be observed in such out-of-distribution deployment scenarios . Therefore , the problem of domain generalization , aiming to improve the robustness of the network on various unseen testing domains , becomes quite important . Previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) demonstrate that feature statistics ( mean and standard deviation ) , as the moments of the learned features , carry informative domain characteristics of the training data . Domain characteristics primarily refer to the information that is more specific to the individual domains but less relevant to the task objectives , such as the photo style and capturing environment information in object recognition . Consequently , domains with different data distributions generally have inconsistent feature statistics ( Wang et al. , 2020b ; 2019a ; Gao et al. , 2021a ) . Most deep learning methods follow Empirical Risk Minimization principle ( Vapnik , 1999 ) to minimize their average error over the training data ( Shen et al. , 2021 ) . Despite the satisfactory performance on the training domain , these methods do not explicitly consider the uncertain statistics discrepancy caused by potential domain shifts during testing . As a result , the trained models tend to overfit the training domain and show vulnerability to the statistic changes at testing time , substantially limiting the generalization ability of the learned representations . Intuitively , the test domains may bring uncertain statistics shifts with different potential directions and intensities compared to the training domain ( as shown in Figure 1 ) , implying the uncertain nature of domain shifts . Considering such “ uncertainty ” of potential domain shifts , synthesizing novel feature statistics variants to model diverse domain shifts can improve the robustness of the trained network to different testing distributions . Towards this end , we introduce a novel probabilistic method to improve the network generalization ability by properly modeling Domain Shifts with Uncertainty ( DSU ) , i.e. , characterizing the feature statistics as uncertain distributions . In our method , instead of treating each feature statistic as a deterministic point measured from the feature , we hypothesize that the feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . The distribution “ center ” is set as each feature ’ s original statistic value , and the distribution “ scope ” represents the variant intensity considering underlying domain shifts . Uncertainty estimation is adopted here to depict the distribution “ scope ” of probabilistic feature statistics . Specifically , we estimate the distribution “ scope ” based on the variances of the mini-batch statistics in an efficient non-parametric manner . Subsequently , feature statistics variants are randomly sampled from the estimated Gaussian distribution and then used to replace the original deterministic values for modeling diverse domain shifts , as illustrated in Figure 2 . Due to the generated feature statistics with diverse distribution possibilities , the models can be trained to properly alleviate the domain perturbations and encode better domain-invariant features . Our proposed method is simple yet fairly effective to alleviate performance drop caused by domain shifts , and can be readily integrated into existing networks without bringing additional model parameters or loss constraints . Comprehensive experiments on a wide range of vision tasks demonstrate the superiority of our proposed method , indicating that introducing uncertainty to feature statistics can well improve models ’ generalization against domain shifts . 2 RELATED WORK . 2.1 DOMAIN GENERALIZATION . Domain generalization ( DG ) has been attracting increasing attention in the past few years , which aims to achieve out-of-distribution generalization on unseen target domains using only single or multiple source domain data for training ( Blanchard et al . ( 2011 ) ) . Research on addressing this problem has been extensively conducted in the literature ( Zhou et al . ( 2021a ) ; Wang et al . ( 2021 ) ; Shen et al . ( 2021 ) ) . Here some studies that are more related to our work are introduced below . Data Augmentation : Data augmentation is an effective manner for improving generalization ability and relieving models from overfitting in training domains . Most augmentation methods adopt various transformations at the image level , such as AugMix ( Hendrycks et al . ( 2020 ) ) and CutMix ( Yun et al . ( 2019 ) ) . Besides using handcraft transformations , mixup ( Zhang et al . ( 2018 ) ) trains the model by using pair-wise linearly interpolated samples in both the image and label spaces . Manifold Mixup ( Verma et al . ( 2019 ) ) further adopts this linear interpolation from image level to feature level . Some recent works extend the above transformations to feature statistics for improving model generalization . MixStyle ( Zhou et al . ( 2021b ) ) adopts linear interpolation on feature statistics of two instances to generate synthesized samples . The pAdaIn ( Nuriel et al . ( 2021 ) ) swaps statistics between the samples applied with a random permutation of the batch . Invariant Representation Learning : The main idea of invariant representation learning is to enable models to learn features that are invariant to domain shifts . Domain alignment-based approaches ( Li et al . ( 2018c ; b ) ) learn invariant features by minimizing the distances between different distributions . Instead of enforcing the entire features to be invariant , disentangled feature learning approaches ( Chattopadhyay et al . ( 2020 ) ; Piratla et al . ( 2020 ) ) decouple the features into domain-specific and domain-invariant parts and learn their representations simultaneously . In addition , normalizationbased methods ( Xingang Pan & Tang ( 2018 ) ; Choi et al . ( 2021 ) ) can also be used to remove the style information to obtain invariant representations . Learning Strategies : There are also some effective learning strategies that can be leveraged to improve generalization ability . Ensemble learning is an effective technique in boosting model performance . The ensemble predictions using a collection of diverse models ( Zhou et al . ( 2020b ) ) or modules ( Seo et al . ( 2020 ) ) can be adopted to improve generalization and robustness . Meta-learningbased methods ( Finn et al . ( 2017 ) ; Li et al . ( 2018a ) ) learn to simulate the domain shifts following an episode training paradigm . Besides , self-challenging methods , such as RSC ( Huang et al . ( 2020 ) ) , force the model to learn a general representation by discarding dominant features activated on the training data . 2.2 UNCERTAINTY IN DEEP LEARNING . Uncertainty capturing the “ noise ” and “ randomness ” inherent in the data has received increasing attention in deep representation learning . Variational Auto-encoder ( Kingma & Welling ( 2013 ) ) , as an important method for learning generative models , can be regarded as a method to model the data uncertainty in the hidden space . Dropout ( Srivastava et al . ( 2014 ) ) , which is widely used in many deep learning models to avoid over-fitting , can be interpreted to represent model uncertainty as a Bayesian approximation ( Gal & Ghahramani ( 2016 ) ) . In some works , uncertainty is used to address the issues of low-quality training data . In person re-identification , DistributionNet ( Gal & Ghahramani ( 2016 ) ) adopts uncertainty to model the person images of noise-labels and outliers . In face recognition , DUL ( Chang et al . ( 2020 ) ) and PFE ( ( Shi & Jain , 2019 ) ) apply data uncertainty to simultaneously learn the feature embedding and its uncertainty , where the uncertainty is learned through a learnable subnetwork to describe the quality of the image . Different from the aforementioned works , our proposed method is used to model the feature statistics uncertainty under potential domain shifts and acts as a feature augmentation method for handling our-of-distribution generalization problem . 3 METHOD . 3.1 PRELIMINARIES . Given x ∈ RB×C×H×W to be the encoded features in the intermediate layers of the network , we denote µ ∈ RB×C and σ ∈ RB×C as the channel-wise feature mean and standard deviation of each instance in a mini-batch , respectively , which can be formulated as : µ ( x ) = 1 HW H∑ h=1 W∑ w=1 xb , c , h , w , ( 1 ) σ2 ( x ) = 1 HW H∑ h=1 W∑ w=1 ( xb , c , h , w − µ ( x ) ) 2 . ( 2 ) As the abstraction of features , feature statistics can capture informative characteristics of the corresponding domain ( such as color , texture , and contrast ) , according to previous works ( Huang & Belongie , 2017 ; Li et al. , 2021 ) . In out-of-distribution scenarios , the feature statistics often show inconsistency with training domain due to different domain characteristics ( Wang et al. , 2019a ; Gao et al. , 2021a ) , which is ill-suited to deep learning modules like nonlinearity layers and normalization layer and degenerates the model ’ s generalization ability ( Wang et al. , 2020b ) . However , most of the deep learning methods only treat feature statistics as deterministic values measured from the features while lacking explicit consideration of the potential uncertain statistical discrepancy . Owing to the model ’ s inherent vulnerability to such discrepancy , the generalization ability of the learned representations is limited . Some recent methods ( Nuriel et al. , 2021 ; Zhou et al. , 2021b ) utilize feature statistics to tackle the domain generalization problem . Despite the success , they typically adopt linear manipulation ( i.e. , exchange and interpolation ) on pairwise samples to generate new feature statistics , which limits the diversity of synthetic changes . Specifically , the direction of their variants is determined by the chosen reference sample and such internal operation restricts their variant intensity . Thus these methods are sub-optimal when handling the diverse and uncertain domain shifts in real world . 3.2 MODELING DOMAIN SHIFTS WITH UNCERTAINTY . Given the arbitrary testing domains with uncertain feature statistic shifts in both direction and intensity , properly modeling the domain shifts becomes an important task for tackling the challenge of domain generalization problem . Considering the uncertainty and randomness of domain shifts , it is promising to employ the methods of “ uncertainty ” to treat the “ uncertainty ” of domain shifts . In this paper , we propose a novel method by modeling Domain Shifts with Uncertainty ( DSU ) . Instead of treating each feature statistic as a deterministic value measured from the learned feature , we hypothesize that the distribution of each feature statistic , after considering potential uncertainties , follows a multi-variate Gaussian distribution . This means each feature statistic has a probabilistic representation drawn from a certain distribution , i.e. , the feature statistics mean and standard deviation follow N ( µ , Σµ ) and N ( σ , Σσ ) , respectively . Specifically , the corresponding Gaussian distribution ’ s center is set as each feature ’ s original statistics , while the Gaussian distribution ’ s standard deviation describes the uncertainty scope for different potential shifts . Through randomly sampling diverse synthesized feature statistics with the probabilistic approach , the models can be trained to improve the robustness of the network against statistics shifts . | This paper proposed a feature augmentation method for domain generalization by generating probabilistic feature statistics, where the distribution of feature statistics enlarges the feature domain with possible domain shifts. The proposed method is evaluated on various vision tasks, including image classification, semantic segmentation, and instance retrieval. It achieves competitive results compared with recent domain generalization methods. | SP:e8a6fca07fce4f8de21e4374e90863cda9d06db6 |
Representation mitosis in wide neural networks | Deep neural networks ( DNNs ) defy the classical bias-variance trade-off : adding parameters to a DNN that interpolates its training data will typically improve its generalization performance . Explaining the mechanism behind this “ benign overfitting ” in deep networks remains an outstanding challenge . Here , we study the last hidden layer representations of various state-of-the-art convolutional neural networks and find evidence for an underlying mechanism that we call representation mitosis : if the last hidden representation is wide enough , its neurons tend to split into groups which carry identical information , and differ from each other only by a statistically independent noise . Like in a mitosis process , the number of such groups , or “ clones ” , increases linearly with the width of the layer , but only if the width is above a critical value . We show that a key ingredient to activate mitosis is continuing the training process until the training error is zero . 1 INTRODUCTION . Deep neural networks ( DNN ) routinely have enough parameters to achieve zero training error , even with random labels ( Zhang et al. , 2017 ; Arpit et al. , 2017 ) . In defiance of the classical bias-variance trade-off , the performance of these interpolating classifiers continuously improves as the number of parameters increases well beyond the number of training samples ( Geman et al. , 1992 ; Neyshabur et al. , 2015 ; Spigler et al. , 2019 ; Nakkiran et al. , 2020 ) . Despite recent progress in describing the implicit bias of stochastic gradient descent towards “ good ” minima ( Gunasekar et al. , 2018a ; b ; Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ; Arora et al. , 2019 ; Chizat & Bach , 2020 ) , and the detailed analysis of solvable models of learning ( Advani et al. , 2020 ; Neal et al. , 2018 ; Mei & Montanari , 2019 ; Belkin et al. , 2019 ; Hastie et al. , 2019 ; d ’ Ascoli et al. , 2020 ; Adlam & Pennington , 2020 ; Lin & Dobriban , 2020 ; Geiger et al. , 2020 ) , the mechanisms underlying this “ benign overfitting ” ( Bartlett et al. , 2020 ) in deep NNs remain unclear , especially since “ bad ” local minima exist in their optimisation landscape and SGD can reach them ( Liu et al. , 2020 ) . In this paper , we describe a phenomenon in wide , deep neural networks that we call representation mitosis and which offers a possible mechanism for benign overfitting . We illustrate this mechanism in Fig . 1 for a family of increasingly wide DenseNet40s ( Huang et al. , 2017 ) on CIFAR10 ( Krizhevsky et al. , 2009 ) . The blue line in Fig . 1 shows how the average classification error ( error ) approaches the performance of a large ensemble of networks ( error∞ ) as the width of the network increases ( Geiger et al. , 2020 ) . Consistently with Zagoruyko & Komodakis ( 2016 ) , we find that their performance improves continuously with width . For simplicity we will refer to the width W of last hidden representation as the width the network . When W is greater than 350 a network becomes wide enough to reach zero training error ( see Fig 9-c in Sec A.2 ) and the error decays approximately as W−1/2 . We make our key observation by performing the following experiment : we randomly select a number wc of neurons from the last hidden layer of the widest DenseNet40 , and remove all the other neurons from that layer as well as their connections . We then evaluate the performance of this “ chunk ” of wc neurons , without retraining the network . The performance of chunks of varying sizes is shown in the same figure in orange . There are clearly two regimes : for small chunks , the error decays faster than w −1/2 c , while beyond a critical chunk size w∗c ( shaded area ) , the error of a chunk of wc neurons is roughly the same as the one of a full network with wc neurons . Furthermore , the error of the chunks decays with the same power-law w −1/2 c beyond this critical chunk size . This observation suggests that the final hidden representation of an input in a trained , wide DNN is highly redundant beyond the critical width w∗c . The decay rate of −1/2 in particular implies that in this regime chunks of wc neurons can be thought as statistically independent estimators of the same features of the data , differing only by a small , uncorrelated noise . This suggests a possible mechanism for benign overfitting : as the network becomes wider , additional neurons are first used to learn new features of the data . Beyond the critical width w∗c , additional neurons in the final layer don ’ t fit to new features in the data , and hence over-fit ; instead , they make a copy , or a clone , of a feature that is already part of the final representation . The last layer thus splits into more and more clones as the networks grows wider in a process akin to mitosis in cell biology ( Alberts et al. , 2015 ) , as we illustrate in the bottom of Fig . 1 . The accuracy of these wide networks then improves with their width because the network implicitly averages over an increasing number of clones in its representations to make its prediction . We thus call this effect representation mitosis . This paper provides a quantitative analysis of representation mitosis in non-trivial datasets and architectures . Our main findings can be summarised as follows : 1 . A chunk of wc random neurons of the last hidden representation of a wide neural network predicts the output with an accuracy which scales with w−1/2c if the layer is wide enough and wc is large enough . In this regime we call the chunk a “ clone ” ; 2 . Clones can be linearly mapped one to another , or to the full representation , with an error which can be described as uncorrelated random noise . 3 . Clones are created by training a well regularised model until the model reaches zero training error . If training is stopped too early ( e.g . when the training accuracy is similar to the test accuracy ) , or if the training is performed without sufficient regularization , 1. and 2. do not take place , even if the last representation is very wide . 2 METHODS . 2.1 NEURAL NETWORK ARCHITECTURES . We report experimental results obtained with various architectures ( fully connected networks , WideResNet-28 , DenseNet40 , ResNet50 ) and various data sets ( CIFAR10/100 Krizhevsky et al . ( 2009 ) , ImageNet Deng et al . ( 2009 ) ) . We trained all the networks with SGD with momentum and weight decay following the standard practice to set the relevant hyperparameters . We give detailed information on our training setups in A.1 . All our experiments are run on Volta V100 GPUs . In the following , we discuss how we vary the architecture of the models . Fully-connected networks on MNIST We train a fully-connected network to classify the parity of the MNIST digits ( LeCun & Cortes , 1998 ) ( pMNIST ) following the protocol of Geiger et al . ( 2020 ) . MNIST digits are projected on the first ten principal components , which are then used as inputs of a five layer fully-connected network ( FC5 ) . The four hidden representations have the same width W and the output is a real number whose sign is the predictor of the parity of the input digit . Wide-ResNet-28 and DenseNet40 on CIFAR10/100 We train CIFAR10 and CIFAR100 on family of Wide-ResNet-28 ( Zagoruyko & Komodakis , 2016 ) ( WR28 ) . The number of last hidden neurons in a WR28_n is 64 · n , obtained after average pooling the last 64 · n channels of the network . In our experiments we also analyze two narrow versions of the standard WR28_1 which are not typically used in the literature . We name them WR28_0.25 and WR28_0.5 since they have 1/4 and 1/2 of the number of channels of WR28_1 . Our implementation of DenseNet40 follows the DeseNet40-BC variant ( Huang et al. , 2017 ) . We vary the number of input channels c in { 8 , 16 , 32 , 64 , 128 , 256 } . The number of last hidden features for this architecture is 5.5 · c. ResNet50 on ImageNet We modify the ResNet50 architecture ( He et al. , 2016 ) multiplying by a constant factor c ∈ { 0.25 , 0.5 , 1 , 2 , 4 } the number of channels of all the layers after the input stem . When c = 2 our networks differ from the standard Wide-ResNet50_2 since Zagoruyko & Komodakis ( 2016 ) only double the number of channels of the bottleneck of each ResNet block . As a consequence in our implementation the number of features w after the last pooling layer is w = 2048 · c while in Zagoruyko & Komodakis ( 2016 ) w is fixed to 2048 . 2.2 ANALYSIS METHODS . Reconstructing the wide representation from a smaller chunk To assess the predictive power of the chunk representations we search for the best linear map A , of dimensions W × w , able to minimise the squared difference ( x ( W ) − x̂ ( W ) ) 2 between the W activations of the full layer representation ( x ( W ) ) and the activations predicted from a chunk of size w , x̂ ( W ) = Ax ( w ) . ( 1 ) This least squares problem is solved with ridge regression ( Hastie et al. , 2001 ) with regularization set to 10−8 , and we use the R2 coefficient of the fit to measure the predictive power of a given chunk size . The multi-output R2 value is computed as an average of the W single-output R2 values corresponding to the different coordinates , weighted by the variance of each coordinate . We further compute the covariance matrix Cij ( of dimensions W ×W ) of the residuals of this fit , and then obtain the correlation matrix as ρij = Cij√ CiiCjj + 10−8 , ( 2 ) with a small regularisation in the denominator to avoid instabilities when the standard deviation of the residuals falls below machine precision . To quantify the independence of the chunk representations we take the average of the absolute values of the non-diagonal entries of the correlation matrix ρij . For short we refer to this quantity as a ‘ mean correlation ’ . Reproducibility We provide code to reproduce our experiments and our analysis online at https : //anonymous.4open.science/r/representation_mitosis-EB80 . 3 RESULTS The test error of chunks of wc neurons of the final representation asymptotically scales as w−1/2c The mechanism of representation mitosis is inspired by the following experiment : we compute the accuracy of models obtained by selecting a random subset of wc neurons from the final hidden representation of a wide neural network . We consider three different data sets ( pMNIST , CIFAR10 and CIFAR100 ) and trained networks of width W = 512 for pMNIST and CIFAR10 , and W = 1024 for CIFAR100 . In all these cases , W is large enough to be firmly in the regime where the accuracy of the networks scales ( approximately ) as W−1/2 ( see Fig . 2 ) . We select wc neurons at random and we compute the test accuracy of a network in which we set to zero the activation of all the other w −wc neurons . Importantly , we do not fine-tune the weights after selecting the wc neurons : all the parameters are left unchanged , except that the activations of the “ killed ” neurons are not used to compute the output . We take 500 random samples of neurons for each chunk width wc . In Fig . 3 we plot the test error of the chunked models as a function of wc ( orange lines ) . In all the three networks the behaviour is similar . When wc becomes larger than a critical value w∗c , which depends on the dataset and architecture used , the test error decays as w −1/2 c with the chunk size , the same law observed for full networks of the same width ( Fig . 2 ) . This implies that a model obtained by selecting a random chunk of wc > w∗c neurons from a wide final representation behaves similarly to a full network of width W = wc . Furthermore , a decay with rate −1/2 suggests that the final representation of the wide networks can be thought of as a collection of statistically independent estimates of a finite set of data features relevant for classification . Adding additional neurons to the chunk hence reduces their prediction error in the same way an additional measurement reduces the measurement uncertainty , leading to the −1/2 decay . At smaller wc < w∗c instead , the test error of the chunked models decays faster than w −1/2 c in all the cases we considered , including the DenseNet architecture trained on CIFAR10 shown in Fig . 1 . In this regime , adding neurons to the the final representation , improves the quality of the model significantly quicker than it would in independently trained models of the same width ( see Fig . 1 for a pictorial representation of this process ) . We call chunks of neurons of size wc ≥ w∗c clones . In a wide network , clones can exist only if the width W of the last representation is larger than w∗c , and the maximum number of clones is W/w∗c . In the following we characterize more precisely the properties of the clones . Clones have the same expressive power of the full representation A well trained deep network often represents the salient features of the data set well enough to achieve ( close to ) zero classification error on the training data . In the top panels of Fig . 4 , we show that wide networks are able to interpolate their training set also using just a subset of wc > w∗c random neurons : the dark orange profiles show that when the size of a chunk is greater than ∼ 50 for pMNINST , 100 for CIFAR10 and regions indicate regions where the error of the chunks with wc neurons decays as w −1/2 c . 200 for CIFAR100 , the predictive accuracy on the training set remains almost 100 % . Beyond w∗c , the neurons of the final representation therefore become redundant , since the training error remains ( close to ) zero even after removing neurons from it . We call a chunk of neurons a clone if it fully captures the relevant features of the data , up to some uncorrelated random noise . Clones reconstruct almost perfectly the full representation From a geometrical perspective , the important features of the final representation correspond to directions in which the data landscape show large variations ( Bengio et al. , 2013 ) . A clone can be seen as a chunk that is wide enough to encode almost exactly these directions , but using much less neurons than the full final representation . We analyze this aspect by fitting all the W activations starting from a random chunk of wc activations with ridge regression with a small regularization penalty according to Eq . ( 1 ) . The blue profiles in Fig . 4 , bottom panels , show the R2 coefficient of fit as a function of the chunk size wc for pMNIST ( left ) , CIFAR10 ( center ) , CIFAR100 ( right ) . When wc is really small , say below 6 for pMNIST , 20 for CIFAR10 and 60 for CIFAR100 , the R2 coefficient grows almost linearly with wc . In this regime , adding a randomly chosen activation from the full representation to the chunk increases substantially R2 . When wc becomes larger R2 reaches almost one and the representation enters what we call a mitosis phase . This transition happens when wc is still much smaller than W and correspond approximately to the regime in which the test error starts scaling with the inverse square root of wc ( see Fig . 3 ) . The almost perfect reconstruction of the original data landscape with few neurons can be seen as a consequence of the low intrinsic dimension of the representation ( Ansuini et al. , 2019 ) . The ID of the widest representations gives a lower bound on the number of coordinates required to describe the data manifold , and hence on the neurons that a chunk needs in order to have the same classification accuracy as the whole representation . The ID of the last hidden representation is 2 in pMNIST , 12 in CIFAR10 , 14 in CIFAR100 , numbers which are much lower that the width at which a chunk can be considered a clone . Clones differ from each other by uncorrelated random noise In the mitosis regime , the small residual difference between the representation chunks and the full representation can be approximately described as statistically independent random noise . The green profile of Fig . 4 , bottom panels , show the mean absolute non-diagonal correlation of the residuals of the linear fit , a measure which indicates the level of correlation of the chunk representations and the full representation ( see Methods ) . Before the mitosis width w∗c , the residuals are not only large , but also significantly correlated , but as their width increases above w∗c the correlation drops basically to zero . Therefore , in network which are wider than w∗c any two chunks of equal size wc > w ∗ c can be effectively considered as equivalent copies , or clones , of the same representation , differing only by a small and non-correlated noise , consistently with the scaling law of the error shown in Fig . 3 . The dynamics of mitosis In the previous paragraphs we set forth evidence in support of the hypothesis that large chunks of the final representation of wide DNNs behave approximately like an ensemble of independent measures of the full feature space . This allowed us to interpret the decay of the test error of the full networks with the network width observed empirically in Fig . 2 . The three conditions that a chunked model satisfies in the regime in which its test error decays as w −1/2 c are represented in Fig . 4 : ( i ) the training error of the chunked model is close to zero ; ( ii ) the chunked model can be used to reconstruct the full final representation with an R2 ∼ 1 and ( iii ) the residuals of this reconstruction can be modeled as independent random noise . These three conditions are all observed at the end of the training . We now analyze the dynamics of mitosis . We will see that to enter the mitosis regime , models not only need to be wide enough , but also , crucially , they need to be trained to maximise their performance . Clones are formed in two stages , which occur at different times during training . The first phase begins as soon as training starts : the network gradually adjusts the chunk representations in order to produce independent copies of the data manifold . This can be clearly observed in the left panel of Fig . 5 , which depicts the mean correlation between the residuals of the linear fit from the chunked to the full final representations of the network , the same quantity that we analyze in Fig . 4 , but now as a function of the training epoch . Both Figs . 4 and 5 analyse the WR28-8 on CIFAR10 . As training proceeds , the correlations between residuals diminish gradually until epoch 160 , and becomes particularly low for chunks greater than 64 . After epoch 160 further training does not bring any sizeable reduction in their correlation . At epoch 160 the full network achieves zero error on the training set , as shown in orange in the middle and right panels of Fig . 5 . This event marks the end of the first phase , and the beginning of the second phase of the mitosis process where the training error of the clones keeps decreasing while the full representation ( blue ) has already reached zero training error . For example , chunks of size 64 at epoch 150 have training errors comparable to the test error ( dashed line of the middle panel ) . In the subsequent ∼ 20 epochs the training error of clones of size 128 and 256 reaches exactly zero , and the training error of chunks of size 64 reaches a plateau . Importantly , both phases of mitosis improve the generalization properties of the network . This can be seen in the right panel of Fig . 5 , which reports training and test error of the network , with the two mitosis phases highlighted . The figure shows that both mitosis phases lead to a reduction in the test error , although the first phase leads by far to the greatest reduction , consistently with the fact that the greatest improvements in accuracy typically arise during the first epochs of training . The mitosis process can be considered finished around epoch 180 , when all the clones have reached almost zero error on the training set . After epoch 180 we also observe that the test error stops improving . In Sec . A.2 we report the same analysis done on CIFAR100 ( see Fig . 7 ) and CIFAR10 trained on a DenseNet40 ( see Fig . 9- ( d-e-f ) ) . | The paper shows empirically that under certain conditions (overtraining, large width in all layers, data augmentation and regularization) neural networks (NNs) tend to learn redundant representations in the last layer. Precisely, a large enough random subset of the penultimate layer activations of size $w_c$ can almost perfectly linearly predict the whole activation of width $W$. Further, the training error when pruning the network to these random subsets also goes down (lagging behind the training error of the full network) to 0 monotonically as training progresses. Test error of these pruned networks appears to go down as $w_c^{-1/2}$, similarly to the test error of regular networks going down as $W^{-1/2}$. The authors put forward some preliminary interpretation of the effect and suggest this redundancy effect could be causally responsible for the phenomenon of generalization of wide networks improving with width. | SP:90f7c9bb319abaf4314ca7b722ce1262fc6360bd |
Representation mitosis in wide neural networks | Deep neural networks ( DNNs ) defy the classical bias-variance trade-off : adding parameters to a DNN that interpolates its training data will typically improve its generalization performance . Explaining the mechanism behind this “ benign overfitting ” in deep networks remains an outstanding challenge . Here , we study the last hidden layer representations of various state-of-the-art convolutional neural networks and find evidence for an underlying mechanism that we call representation mitosis : if the last hidden representation is wide enough , its neurons tend to split into groups which carry identical information , and differ from each other only by a statistically independent noise . Like in a mitosis process , the number of such groups , or “ clones ” , increases linearly with the width of the layer , but only if the width is above a critical value . We show that a key ingredient to activate mitosis is continuing the training process until the training error is zero . 1 INTRODUCTION . Deep neural networks ( DNN ) routinely have enough parameters to achieve zero training error , even with random labels ( Zhang et al. , 2017 ; Arpit et al. , 2017 ) . In defiance of the classical bias-variance trade-off , the performance of these interpolating classifiers continuously improves as the number of parameters increases well beyond the number of training samples ( Geman et al. , 1992 ; Neyshabur et al. , 2015 ; Spigler et al. , 2019 ; Nakkiran et al. , 2020 ) . Despite recent progress in describing the implicit bias of stochastic gradient descent towards “ good ” minima ( Gunasekar et al. , 2018a ; b ; Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ; Arora et al. , 2019 ; Chizat & Bach , 2020 ) , and the detailed analysis of solvable models of learning ( Advani et al. , 2020 ; Neal et al. , 2018 ; Mei & Montanari , 2019 ; Belkin et al. , 2019 ; Hastie et al. , 2019 ; d ’ Ascoli et al. , 2020 ; Adlam & Pennington , 2020 ; Lin & Dobriban , 2020 ; Geiger et al. , 2020 ) , the mechanisms underlying this “ benign overfitting ” ( Bartlett et al. , 2020 ) in deep NNs remain unclear , especially since “ bad ” local minima exist in their optimisation landscape and SGD can reach them ( Liu et al. , 2020 ) . In this paper , we describe a phenomenon in wide , deep neural networks that we call representation mitosis and which offers a possible mechanism for benign overfitting . We illustrate this mechanism in Fig . 1 for a family of increasingly wide DenseNet40s ( Huang et al. , 2017 ) on CIFAR10 ( Krizhevsky et al. , 2009 ) . The blue line in Fig . 1 shows how the average classification error ( error ) approaches the performance of a large ensemble of networks ( error∞ ) as the width of the network increases ( Geiger et al. , 2020 ) . Consistently with Zagoruyko & Komodakis ( 2016 ) , we find that their performance improves continuously with width . For simplicity we will refer to the width W of last hidden representation as the width the network . When W is greater than 350 a network becomes wide enough to reach zero training error ( see Fig 9-c in Sec A.2 ) and the error decays approximately as W−1/2 . We make our key observation by performing the following experiment : we randomly select a number wc of neurons from the last hidden layer of the widest DenseNet40 , and remove all the other neurons from that layer as well as their connections . We then evaluate the performance of this “ chunk ” of wc neurons , without retraining the network . The performance of chunks of varying sizes is shown in the same figure in orange . There are clearly two regimes : for small chunks , the error decays faster than w −1/2 c , while beyond a critical chunk size w∗c ( shaded area ) , the error of a chunk of wc neurons is roughly the same as the one of a full network with wc neurons . Furthermore , the error of the chunks decays with the same power-law w −1/2 c beyond this critical chunk size . This observation suggests that the final hidden representation of an input in a trained , wide DNN is highly redundant beyond the critical width w∗c . The decay rate of −1/2 in particular implies that in this regime chunks of wc neurons can be thought as statistically independent estimators of the same features of the data , differing only by a small , uncorrelated noise . This suggests a possible mechanism for benign overfitting : as the network becomes wider , additional neurons are first used to learn new features of the data . Beyond the critical width w∗c , additional neurons in the final layer don ’ t fit to new features in the data , and hence over-fit ; instead , they make a copy , or a clone , of a feature that is already part of the final representation . The last layer thus splits into more and more clones as the networks grows wider in a process akin to mitosis in cell biology ( Alberts et al. , 2015 ) , as we illustrate in the bottom of Fig . 1 . The accuracy of these wide networks then improves with their width because the network implicitly averages over an increasing number of clones in its representations to make its prediction . We thus call this effect representation mitosis . This paper provides a quantitative analysis of representation mitosis in non-trivial datasets and architectures . Our main findings can be summarised as follows : 1 . A chunk of wc random neurons of the last hidden representation of a wide neural network predicts the output with an accuracy which scales with w−1/2c if the layer is wide enough and wc is large enough . In this regime we call the chunk a “ clone ” ; 2 . Clones can be linearly mapped one to another , or to the full representation , with an error which can be described as uncorrelated random noise . 3 . Clones are created by training a well regularised model until the model reaches zero training error . If training is stopped too early ( e.g . when the training accuracy is similar to the test accuracy ) , or if the training is performed without sufficient regularization , 1. and 2. do not take place , even if the last representation is very wide . 2 METHODS . 2.1 NEURAL NETWORK ARCHITECTURES . We report experimental results obtained with various architectures ( fully connected networks , WideResNet-28 , DenseNet40 , ResNet50 ) and various data sets ( CIFAR10/100 Krizhevsky et al . ( 2009 ) , ImageNet Deng et al . ( 2009 ) ) . We trained all the networks with SGD with momentum and weight decay following the standard practice to set the relevant hyperparameters . We give detailed information on our training setups in A.1 . All our experiments are run on Volta V100 GPUs . In the following , we discuss how we vary the architecture of the models . Fully-connected networks on MNIST We train a fully-connected network to classify the parity of the MNIST digits ( LeCun & Cortes , 1998 ) ( pMNIST ) following the protocol of Geiger et al . ( 2020 ) . MNIST digits are projected on the first ten principal components , which are then used as inputs of a five layer fully-connected network ( FC5 ) . The four hidden representations have the same width W and the output is a real number whose sign is the predictor of the parity of the input digit . Wide-ResNet-28 and DenseNet40 on CIFAR10/100 We train CIFAR10 and CIFAR100 on family of Wide-ResNet-28 ( Zagoruyko & Komodakis , 2016 ) ( WR28 ) . The number of last hidden neurons in a WR28_n is 64 · n , obtained after average pooling the last 64 · n channels of the network . In our experiments we also analyze two narrow versions of the standard WR28_1 which are not typically used in the literature . We name them WR28_0.25 and WR28_0.5 since they have 1/4 and 1/2 of the number of channels of WR28_1 . Our implementation of DenseNet40 follows the DeseNet40-BC variant ( Huang et al. , 2017 ) . We vary the number of input channels c in { 8 , 16 , 32 , 64 , 128 , 256 } . The number of last hidden features for this architecture is 5.5 · c. ResNet50 on ImageNet We modify the ResNet50 architecture ( He et al. , 2016 ) multiplying by a constant factor c ∈ { 0.25 , 0.5 , 1 , 2 , 4 } the number of channels of all the layers after the input stem . When c = 2 our networks differ from the standard Wide-ResNet50_2 since Zagoruyko & Komodakis ( 2016 ) only double the number of channels of the bottleneck of each ResNet block . As a consequence in our implementation the number of features w after the last pooling layer is w = 2048 · c while in Zagoruyko & Komodakis ( 2016 ) w is fixed to 2048 . 2.2 ANALYSIS METHODS . Reconstructing the wide representation from a smaller chunk To assess the predictive power of the chunk representations we search for the best linear map A , of dimensions W × w , able to minimise the squared difference ( x ( W ) − x̂ ( W ) ) 2 between the W activations of the full layer representation ( x ( W ) ) and the activations predicted from a chunk of size w , x̂ ( W ) = Ax ( w ) . ( 1 ) This least squares problem is solved with ridge regression ( Hastie et al. , 2001 ) with regularization set to 10−8 , and we use the R2 coefficient of the fit to measure the predictive power of a given chunk size . The multi-output R2 value is computed as an average of the W single-output R2 values corresponding to the different coordinates , weighted by the variance of each coordinate . We further compute the covariance matrix Cij ( of dimensions W ×W ) of the residuals of this fit , and then obtain the correlation matrix as ρij = Cij√ CiiCjj + 10−8 , ( 2 ) with a small regularisation in the denominator to avoid instabilities when the standard deviation of the residuals falls below machine precision . To quantify the independence of the chunk representations we take the average of the absolute values of the non-diagonal entries of the correlation matrix ρij . For short we refer to this quantity as a ‘ mean correlation ’ . Reproducibility We provide code to reproduce our experiments and our analysis online at https : //anonymous.4open.science/r/representation_mitosis-EB80 . 3 RESULTS The test error of chunks of wc neurons of the final representation asymptotically scales as w−1/2c The mechanism of representation mitosis is inspired by the following experiment : we compute the accuracy of models obtained by selecting a random subset of wc neurons from the final hidden representation of a wide neural network . We consider three different data sets ( pMNIST , CIFAR10 and CIFAR100 ) and trained networks of width W = 512 for pMNIST and CIFAR10 , and W = 1024 for CIFAR100 . In all these cases , W is large enough to be firmly in the regime where the accuracy of the networks scales ( approximately ) as W−1/2 ( see Fig . 2 ) . We select wc neurons at random and we compute the test accuracy of a network in which we set to zero the activation of all the other w −wc neurons . Importantly , we do not fine-tune the weights after selecting the wc neurons : all the parameters are left unchanged , except that the activations of the “ killed ” neurons are not used to compute the output . We take 500 random samples of neurons for each chunk width wc . In Fig . 3 we plot the test error of the chunked models as a function of wc ( orange lines ) . In all the three networks the behaviour is similar . When wc becomes larger than a critical value w∗c , which depends on the dataset and architecture used , the test error decays as w −1/2 c with the chunk size , the same law observed for full networks of the same width ( Fig . 2 ) . This implies that a model obtained by selecting a random chunk of wc > w∗c neurons from a wide final representation behaves similarly to a full network of width W = wc . Furthermore , a decay with rate −1/2 suggests that the final representation of the wide networks can be thought of as a collection of statistically independent estimates of a finite set of data features relevant for classification . Adding additional neurons to the chunk hence reduces their prediction error in the same way an additional measurement reduces the measurement uncertainty , leading to the −1/2 decay . At smaller wc < w∗c instead , the test error of the chunked models decays faster than w −1/2 c in all the cases we considered , including the DenseNet architecture trained on CIFAR10 shown in Fig . 1 . In this regime , adding neurons to the the final representation , improves the quality of the model significantly quicker than it would in independently trained models of the same width ( see Fig . 1 for a pictorial representation of this process ) . We call chunks of neurons of size wc ≥ w∗c clones . In a wide network , clones can exist only if the width W of the last representation is larger than w∗c , and the maximum number of clones is W/w∗c . In the following we characterize more precisely the properties of the clones . Clones have the same expressive power of the full representation A well trained deep network often represents the salient features of the data set well enough to achieve ( close to ) zero classification error on the training data . In the top panels of Fig . 4 , we show that wide networks are able to interpolate their training set also using just a subset of wc > w∗c random neurons : the dark orange profiles show that when the size of a chunk is greater than ∼ 50 for pMNINST , 100 for CIFAR10 and regions indicate regions where the error of the chunks with wc neurons decays as w −1/2 c . 200 for CIFAR100 , the predictive accuracy on the training set remains almost 100 % . Beyond w∗c , the neurons of the final representation therefore become redundant , since the training error remains ( close to ) zero even after removing neurons from it . We call a chunk of neurons a clone if it fully captures the relevant features of the data , up to some uncorrelated random noise . Clones reconstruct almost perfectly the full representation From a geometrical perspective , the important features of the final representation correspond to directions in which the data landscape show large variations ( Bengio et al. , 2013 ) . A clone can be seen as a chunk that is wide enough to encode almost exactly these directions , but using much less neurons than the full final representation . We analyze this aspect by fitting all the W activations starting from a random chunk of wc activations with ridge regression with a small regularization penalty according to Eq . ( 1 ) . The blue profiles in Fig . 4 , bottom panels , show the R2 coefficient of fit as a function of the chunk size wc for pMNIST ( left ) , CIFAR10 ( center ) , CIFAR100 ( right ) . When wc is really small , say below 6 for pMNIST , 20 for CIFAR10 and 60 for CIFAR100 , the R2 coefficient grows almost linearly with wc . In this regime , adding a randomly chosen activation from the full representation to the chunk increases substantially R2 . When wc becomes larger R2 reaches almost one and the representation enters what we call a mitosis phase . This transition happens when wc is still much smaller than W and correspond approximately to the regime in which the test error starts scaling with the inverse square root of wc ( see Fig . 3 ) . The almost perfect reconstruction of the original data landscape with few neurons can be seen as a consequence of the low intrinsic dimension of the representation ( Ansuini et al. , 2019 ) . The ID of the widest representations gives a lower bound on the number of coordinates required to describe the data manifold , and hence on the neurons that a chunk needs in order to have the same classification accuracy as the whole representation . The ID of the last hidden representation is 2 in pMNIST , 12 in CIFAR10 , 14 in CIFAR100 , numbers which are much lower that the width at which a chunk can be considered a clone . Clones differ from each other by uncorrelated random noise In the mitosis regime , the small residual difference between the representation chunks and the full representation can be approximately described as statistically independent random noise . The green profile of Fig . 4 , bottom panels , show the mean absolute non-diagonal correlation of the residuals of the linear fit , a measure which indicates the level of correlation of the chunk representations and the full representation ( see Methods ) . Before the mitosis width w∗c , the residuals are not only large , but also significantly correlated , but as their width increases above w∗c the correlation drops basically to zero . Therefore , in network which are wider than w∗c any two chunks of equal size wc > w ∗ c can be effectively considered as equivalent copies , or clones , of the same representation , differing only by a small and non-correlated noise , consistently with the scaling law of the error shown in Fig . 3 . The dynamics of mitosis In the previous paragraphs we set forth evidence in support of the hypothesis that large chunks of the final representation of wide DNNs behave approximately like an ensemble of independent measures of the full feature space . This allowed us to interpret the decay of the test error of the full networks with the network width observed empirically in Fig . 2 . The three conditions that a chunked model satisfies in the regime in which its test error decays as w −1/2 c are represented in Fig . 4 : ( i ) the training error of the chunked model is close to zero ; ( ii ) the chunked model can be used to reconstruct the full final representation with an R2 ∼ 1 and ( iii ) the residuals of this reconstruction can be modeled as independent random noise . These three conditions are all observed at the end of the training . We now analyze the dynamics of mitosis . We will see that to enter the mitosis regime , models not only need to be wide enough , but also , crucially , they need to be trained to maximise their performance . Clones are formed in two stages , which occur at different times during training . The first phase begins as soon as training starts : the network gradually adjusts the chunk representations in order to produce independent copies of the data manifold . This can be clearly observed in the left panel of Fig . 5 , which depicts the mean correlation between the residuals of the linear fit from the chunked to the full final representations of the network , the same quantity that we analyze in Fig . 4 , but now as a function of the training epoch . Both Figs . 4 and 5 analyse the WR28-8 on CIFAR10 . As training proceeds , the correlations between residuals diminish gradually until epoch 160 , and becomes particularly low for chunks greater than 64 . After epoch 160 further training does not bring any sizeable reduction in their correlation . At epoch 160 the full network achieves zero error on the training set , as shown in orange in the middle and right panels of Fig . 5 . This event marks the end of the first phase , and the beginning of the second phase of the mitosis process where the training error of the clones keeps decreasing while the full representation ( blue ) has already reached zero training error . For example , chunks of size 64 at epoch 150 have training errors comparable to the test error ( dashed line of the middle panel ) . In the subsequent ∼ 20 epochs the training error of clones of size 128 and 256 reaches exactly zero , and the training error of chunks of size 64 reaches a plateau . Importantly , both phases of mitosis improve the generalization properties of the network . This can be seen in the right panel of Fig . 5 , which reports training and test error of the network , with the two mitosis phases highlighted . The figure shows that both mitosis phases lead to a reduction in the test error , although the first phase leads by far to the greatest reduction , consistently with the fact that the greatest improvements in accuracy typically arise during the first epochs of training . The mitosis process can be considered finished around epoch 180 , when all the clones have reached almost zero error on the training set . After epoch 180 we also observe that the test error stops improving . In Sec . A.2 we report the same analysis done on CIFAR100 ( see Fig . 7 ) and CIFAR10 trained on a DenseNet40 ( see Fig . 9- ( d-e-f ) ) . | This paper investigates the overparameterization problem in deep learning through a set of experiments that study the final-layer hidden representations of wide and deep networks. The authors find that -- for wide enough networks and after training long enough -- that they can achieve similar test error from a model made by sampling only a subset of the final-layer hidden representations and then deleting the other connections in that layer. Furthermore, in such situations they can find a linear map from the subset that predicts the full set of final-layer representations, suggesting that the information contained in the deleted features is "cloned" and present in remaining subset. Overall, this effect and its dynamics are explored empirically across a number of models, datasets, and learning scenarios. Curiously, the cloning only appears in networks where data augmentation and weight decay is used, and the authors were unable to exhibit this effect on ImageNet. | SP:90f7c9bb319abaf4314ca7b722ce1262fc6360bd |
Representation mitosis in wide neural networks | Deep neural networks ( DNNs ) defy the classical bias-variance trade-off : adding parameters to a DNN that interpolates its training data will typically improve its generalization performance . Explaining the mechanism behind this “ benign overfitting ” in deep networks remains an outstanding challenge . Here , we study the last hidden layer representations of various state-of-the-art convolutional neural networks and find evidence for an underlying mechanism that we call representation mitosis : if the last hidden representation is wide enough , its neurons tend to split into groups which carry identical information , and differ from each other only by a statistically independent noise . Like in a mitosis process , the number of such groups , or “ clones ” , increases linearly with the width of the layer , but only if the width is above a critical value . We show that a key ingredient to activate mitosis is continuing the training process until the training error is zero . 1 INTRODUCTION . Deep neural networks ( DNN ) routinely have enough parameters to achieve zero training error , even with random labels ( Zhang et al. , 2017 ; Arpit et al. , 2017 ) . In defiance of the classical bias-variance trade-off , the performance of these interpolating classifiers continuously improves as the number of parameters increases well beyond the number of training samples ( Geman et al. , 1992 ; Neyshabur et al. , 2015 ; Spigler et al. , 2019 ; Nakkiran et al. , 2020 ) . Despite recent progress in describing the implicit bias of stochastic gradient descent towards “ good ” minima ( Gunasekar et al. , 2018a ; b ; Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ; Arora et al. , 2019 ; Chizat & Bach , 2020 ) , and the detailed analysis of solvable models of learning ( Advani et al. , 2020 ; Neal et al. , 2018 ; Mei & Montanari , 2019 ; Belkin et al. , 2019 ; Hastie et al. , 2019 ; d ’ Ascoli et al. , 2020 ; Adlam & Pennington , 2020 ; Lin & Dobriban , 2020 ; Geiger et al. , 2020 ) , the mechanisms underlying this “ benign overfitting ” ( Bartlett et al. , 2020 ) in deep NNs remain unclear , especially since “ bad ” local minima exist in their optimisation landscape and SGD can reach them ( Liu et al. , 2020 ) . In this paper , we describe a phenomenon in wide , deep neural networks that we call representation mitosis and which offers a possible mechanism for benign overfitting . We illustrate this mechanism in Fig . 1 for a family of increasingly wide DenseNet40s ( Huang et al. , 2017 ) on CIFAR10 ( Krizhevsky et al. , 2009 ) . The blue line in Fig . 1 shows how the average classification error ( error ) approaches the performance of a large ensemble of networks ( error∞ ) as the width of the network increases ( Geiger et al. , 2020 ) . Consistently with Zagoruyko & Komodakis ( 2016 ) , we find that their performance improves continuously with width . For simplicity we will refer to the width W of last hidden representation as the width the network . When W is greater than 350 a network becomes wide enough to reach zero training error ( see Fig 9-c in Sec A.2 ) and the error decays approximately as W−1/2 . We make our key observation by performing the following experiment : we randomly select a number wc of neurons from the last hidden layer of the widest DenseNet40 , and remove all the other neurons from that layer as well as their connections . We then evaluate the performance of this “ chunk ” of wc neurons , without retraining the network . The performance of chunks of varying sizes is shown in the same figure in orange . There are clearly two regimes : for small chunks , the error decays faster than w −1/2 c , while beyond a critical chunk size w∗c ( shaded area ) , the error of a chunk of wc neurons is roughly the same as the one of a full network with wc neurons . Furthermore , the error of the chunks decays with the same power-law w −1/2 c beyond this critical chunk size . This observation suggests that the final hidden representation of an input in a trained , wide DNN is highly redundant beyond the critical width w∗c . The decay rate of −1/2 in particular implies that in this regime chunks of wc neurons can be thought as statistically independent estimators of the same features of the data , differing only by a small , uncorrelated noise . This suggests a possible mechanism for benign overfitting : as the network becomes wider , additional neurons are first used to learn new features of the data . Beyond the critical width w∗c , additional neurons in the final layer don ’ t fit to new features in the data , and hence over-fit ; instead , they make a copy , or a clone , of a feature that is already part of the final representation . The last layer thus splits into more and more clones as the networks grows wider in a process akin to mitosis in cell biology ( Alberts et al. , 2015 ) , as we illustrate in the bottom of Fig . 1 . The accuracy of these wide networks then improves with their width because the network implicitly averages over an increasing number of clones in its representations to make its prediction . We thus call this effect representation mitosis . This paper provides a quantitative analysis of representation mitosis in non-trivial datasets and architectures . Our main findings can be summarised as follows : 1 . A chunk of wc random neurons of the last hidden representation of a wide neural network predicts the output with an accuracy which scales with w−1/2c if the layer is wide enough and wc is large enough . In this regime we call the chunk a “ clone ” ; 2 . Clones can be linearly mapped one to another , or to the full representation , with an error which can be described as uncorrelated random noise . 3 . Clones are created by training a well regularised model until the model reaches zero training error . If training is stopped too early ( e.g . when the training accuracy is similar to the test accuracy ) , or if the training is performed without sufficient regularization , 1. and 2. do not take place , even if the last representation is very wide . 2 METHODS . 2.1 NEURAL NETWORK ARCHITECTURES . We report experimental results obtained with various architectures ( fully connected networks , WideResNet-28 , DenseNet40 , ResNet50 ) and various data sets ( CIFAR10/100 Krizhevsky et al . ( 2009 ) , ImageNet Deng et al . ( 2009 ) ) . We trained all the networks with SGD with momentum and weight decay following the standard practice to set the relevant hyperparameters . We give detailed information on our training setups in A.1 . All our experiments are run on Volta V100 GPUs . In the following , we discuss how we vary the architecture of the models . Fully-connected networks on MNIST We train a fully-connected network to classify the parity of the MNIST digits ( LeCun & Cortes , 1998 ) ( pMNIST ) following the protocol of Geiger et al . ( 2020 ) . MNIST digits are projected on the first ten principal components , which are then used as inputs of a five layer fully-connected network ( FC5 ) . The four hidden representations have the same width W and the output is a real number whose sign is the predictor of the parity of the input digit . Wide-ResNet-28 and DenseNet40 on CIFAR10/100 We train CIFAR10 and CIFAR100 on family of Wide-ResNet-28 ( Zagoruyko & Komodakis , 2016 ) ( WR28 ) . The number of last hidden neurons in a WR28_n is 64 · n , obtained after average pooling the last 64 · n channels of the network . In our experiments we also analyze two narrow versions of the standard WR28_1 which are not typically used in the literature . We name them WR28_0.25 and WR28_0.5 since they have 1/4 and 1/2 of the number of channels of WR28_1 . Our implementation of DenseNet40 follows the DeseNet40-BC variant ( Huang et al. , 2017 ) . We vary the number of input channels c in { 8 , 16 , 32 , 64 , 128 , 256 } . The number of last hidden features for this architecture is 5.5 · c. ResNet50 on ImageNet We modify the ResNet50 architecture ( He et al. , 2016 ) multiplying by a constant factor c ∈ { 0.25 , 0.5 , 1 , 2 , 4 } the number of channels of all the layers after the input stem . When c = 2 our networks differ from the standard Wide-ResNet50_2 since Zagoruyko & Komodakis ( 2016 ) only double the number of channels of the bottleneck of each ResNet block . As a consequence in our implementation the number of features w after the last pooling layer is w = 2048 · c while in Zagoruyko & Komodakis ( 2016 ) w is fixed to 2048 . 2.2 ANALYSIS METHODS . Reconstructing the wide representation from a smaller chunk To assess the predictive power of the chunk representations we search for the best linear map A , of dimensions W × w , able to minimise the squared difference ( x ( W ) − x̂ ( W ) ) 2 between the W activations of the full layer representation ( x ( W ) ) and the activations predicted from a chunk of size w , x̂ ( W ) = Ax ( w ) . ( 1 ) This least squares problem is solved with ridge regression ( Hastie et al. , 2001 ) with regularization set to 10−8 , and we use the R2 coefficient of the fit to measure the predictive power of a given chunk size . The multi-output R2 value is computed as an average of the W single-output R2 values corresponding to the different coordinates , weighted by the variance of each coordinate . We further compute the covariance matrix Cij ( of dimensions W ×W ) of the residuals of this fit , and then obtain the correlation matrix as ρij = Cij√ CiiCjj + 10−8 , ( 2 ) with a small regularisation in the denominator to avoid instabilities when the standard deviation of the residuals falls below machine precision . To quantify the independence of the chunk representations we take the average of the absolute values of the non-diagonal entries of the correlation matrix ρij . For short we refer to this quantity as a ‘ mean correlation ’ . Reproducibility We provide code to reproduce our experiments and our analysis online at https : //anonymous.4open.science/r/representation_mitosis-EB80 . 3 RESULTS The test error of chunks of wc neurons of the final representation asymptotically scales as w−1/2c The mechanism of representation mitosis is inspired by the following experiment : we compute the accuracy of models obtained by selecting a random subset of wc neurons from the final hidden representation of a wide neural network . We consider three different data sets ( pMNIST , CIFAR10 and CIFAR100 ) and trained networks of width W = 512 for pMNIST and CIFAR10 , and W = 1024 for CIFAR100 . In all these cases , W is large enough to be firmly in the regime where the accuracy of the networks scales ( approximately ) as W−1/2 ( see Fig . 2 ) . We select wc neurons at random and we compute the test accuracy of a network in which we set to zero the activation of all the other w −wc neurons . Importantly , we do not fine-tune the weights after selecting the wc neurons : all the parameters are left unchanged , except that the activations of the “ killed ” neurons are not used to compute the output . We take 500 random samples of neurons for each chunk width wc . In Fig . 3 we plot the test error of the chunked models as a function of wc ( orange lines ) . In all the three networks the behaviour is similar . When wc becomes larger than a critical value w∗c , which depends on the dataset and architecture used , the test error decays as w −1/2 c with the chunk size , the same law observed for full networks of the same width ( Fig . 2 ) . This implies that a model obtained by selecting a random chunk of wc > w∗c neurons from a wide final representation behaves similarly to a full network of width W = wc . Furthermore , a decay with rate −1/2 suggests that the final representation of the wide networks can be thought of as a collection of statistically independent estimates of a finite set of data features relevant for classification . Adding additional neurons to the chunk hence reduces their prediction error in the same way an additional measurement reduces the measurement uncertainty , leading to the −1/2 decay . At smaller wc < w∗c instead , the test error of the chunked models decays faster than w −1/2 c in all the cases we considered , including the DenseNet architecture trained on CIFAR10 shown in Fig . 1 . In this regime , adding neurons to the the final representation , improves the quality of the model significantly quicker than it would in independently trained models of the same width ( see Fig . 1 for a pictorial representation of this process ) . We call chunks of neurons of size wc ≥ w∗c clones . In a wide network , clones can exist only if the width W of the last representation is larger than w∗c , and the maximum number of clones is W/w∗c . In the following we characterize more precisely the properties of the clones . Clones have the same expressive power of the full representation A well trained deep network often represents the salient features of the data set well enough to achieve ( close to ) zero classification error on the training data . In the top panels of Fig . 4 , we show that wide networks are able to interpolate their training set also using just a subset of wc > w∗c random neurons : the dark orange profiles show that when the size of a chunk is greater than ∼ 50 for pMNINST , 100 for CIFAR10 and regions indicate regions where the error of the chunks with wc neurons decays as w −1/2 c . 200 for CIFAR100 , the predictive accuracy on the training set remains almost 100 % . Beyond w∗c , the neurons of the final representation therefore become redundant , since the training error remains ( close to ) zero even after removing neurons from it . We call a chunk of neurons a clone if it fully captures the relevant features of the data , up to some uncorrelated random noise . Clones reconstruct almost perfectly the full representation From a geometrical perspective , the important features of the final representation correspond to directions in which the data landscape show large variations ( Bengio et al. , 2013 ) . A clone can be seen as a chunk that is wide enough to encode almost exactly these directions , but using much less neurons than the full final representation . We analyze this aspect by fitting all the W activations starting from a random chunk of wc activations with ridge regression with a small regularization penalty according to Eq . ( 1 ) . The blue profiles in Fig . 4 , bottom panels , show the R2 coefficient of fit as a function of the chunk size wc for pMNIST ( left ) , CIFAR10 ( center ) , CIFAR100 ( right ) . When wc is really small , say below 6 for pMNIST , 20 for CIFAR10 and 60 for CIFAR100 , the R2 coefficient grows almost linearly with wc . In this regime , adding a randomly chosen activation from the full representation to the chunk increases substantially R2 . When wc becomes larger R2 reaches almost one and the representation enters what we call a mitosis phase . This transition happens when wc is still much smaller than W and correspond approximately to the regime in which the test error starts scaling with the inverse square root of wc ( see Fig . 3 ) . The almost perfect reconstruction of the original data landscape with few neurons can be seen as a consequence of the low intrinsic dimension of the representation ( Ansuini et al. , 2019 ) . The ID of the widest representations gives a lower bound on the number of coordinates required to describe the data manifold , and hence on the neurons that a chunk needs in order to have the same classification accuracy as the whole representation . The ID of the last hidden representation is 2 in pMNIST , 12 in CIFAR10 , 14 in CIFAR100 , numbers which are much lower that the width at which a chunk can be considered a clone . Clones differ from each other by uncorrelated random noise In the mitosis regime , the small residual difference between the representation chunks and the full representation can be approximately described as statistically independent random noise . The green profile of Fig . 4 , bottom panels , show the mean absolute non-diagonal correlation of the residuals of the linear fit , a measure which indicates the level of correlation of the chunk representations and the full representation ( see Methods ) . Before the mitosis width w∗c , the residuals are not only large , but also significantly correlated , but as their width increases above w∗c the correlation drops basically to zero . Therefore , in network which are wider than w∗c any two chunks of equal size wc > w ∗ c can be effectively considered as equivalent copies , or clones , of the same representation , differing only by a small and non-correlated noise , consistently with the scaling law of the error shown in Fig . 3 . The dynamics of mitosis In the previous paragraphs we set forth evidence in support of the hypothesis that large chunks of the final representation of wide DNNs behave approximately like an ensemble of independent measures of the full feature space . This allowed us to interpret the decay of the test error of the full networks with the network width observed empirically in Fig . 2 . The three conditions that a chunked model satisfies in the regime in which its test error decays as w −1/2 c are represented in Fig . 4 : ( i ) the training error of the chunked model is close to zero ; ( ii ) the chunked model can be used to reconstruct the full final representation with an R2 ∼ 1 and ( iii ) the residuals of this reconstruction can be modeled as independent random noise . These three conditions are all observed at the end of the training . We now analyze the dynamics of mitosis . We will see that to enter the mitosis regime , models not only need to be wide enough , but also , crucially , they need to be trained to maximise their performance . Clones are formed in two stages , which occur at different times during training . The first phase begins as soon as training starts : the network gradually adjusts the chunk representations in order to produce independent copies of the data manifold . This can be clearly observed in the left panel of Fig . 5 , which depicts the mean correlation between the residuals of the linear fit from the chunked to the full final representations of the network , the same quantity that we analyze in Fig . 4 , but now as a function of the training epoch . Both Figs . 4 and 5 analyse the WR28-8 on CIFAR10 . As training proceeds , the correlations between residuals diminish gradually until epoch 160 , and becomes particularly low for chunks greater than 64 . After epoch 160 further training does not bring any sizeable reduction in their correlation . At epoch 160 the full network achieves zero error on the training set , as shown in orange in the middle and right panels of Fig . 5 . This event marks the end of the first phase , and the beginning of the second phase of the mitosis process where the training error of the clones keeps decreasing while the full representation ( blue ) has already reached zero training error . For example , chunks of size 64 at epoch 150 have training errors comparable to the test error ( dashed line of the middle panel ) . In the subsequent ∼ 20 epochs the training error of clones of size 128 and 256 reaches exactly zero , and the training error of chunks of size 64 reaches a plateau . Importantly , both phases of mitosis improve the generalization properties of the network . This can be seen in the right panel of Fig . 5 , which reports training and test error of the network , with the two mitosis phases highlighted . The figure shows that both mitosis phases lead to a reduction in the test error , although the first phase leads by far to the greatest reduction , consistently with the fact that the greatest improvements in accuracy typically arise during the first epochs of training . The mitosis process can be considered finished around epoch 180 , when all the clones have reached almost zero error on the training set . After epoch 180 we also observe that the test error stops improving . In Sec . A.2 we report the same analysis done on CIFAR100 ( see Fig . 7 ) and CIFAR10 trained on a DenseNet40 ( see Fig . 9- ( d-e-f ) ) . | This paper provides a novel explanation of benign overfitting in wide neural networks by introducing and studying a mechanism called representation mitosis. The key idea is that if the readout layer of the properly trained network is wide enough, then its neurons could split into groups (clones) that carry identical information, and differ from each other by a statistically independent noise (this mimics what happen in mitosis, thus the name for the mechanism). Moreover, above certain threshold the number of such groups increases linearly with the width, shedding light on when features are learnt. Empirical results are provided to demonstrate the mechanism. | SP:90f7c9bb319abaf4314ca7b722ce1262fc6360bd |
ComPhy: Compositional Physical Reasoning of Objects and Events from Videos | 1 INTRODUCTION . Why do apples float in water while bananas sink ? Why do magnets attract each other on a certain side and repel on the other ? Objects in nature often exhibit complex properties that define how they interact with the physical world . To humans , the unraveling of new intrinsic physical properties often marks important milestones towards a deeper and more accurate understanding of nature . Most of these properties are intrinsic as they are not directly reflected in the object ’ s visual appearances or otherwise detectable without imposing an interaction . Moreover , these properties affect object motion in a compositional fashion , and the causal dependency and mathematical law between different properties are often complex . As shown in Fig . 1 , different intrinsic physical properties , such as charge and inertia , often lead to drastically different future evolutions . Objects carrying the same or opposite charge will exert a repulsive or attractive force on each other . The resulting motion not only depends on the amount of charge each object carries , but also their signs ( see Fig . 1- ( a ) ) . The inertia determines how sensitive an object ’ s motion is to external forces . When a massive object interacts with a light object via attraction , repulsion , or collision , the lighter object will undergo larger changes in its motion compared with the massive object ’ s trajectory ( see Fig . 1- ( b ) ) . Recent studies have established a series of benchmarks to evaluate and diagnose machine learning systems in various physics-related environments ( Bakhtin et al. , 2019 ; Yi et al. , 2020 ; Baradel et al. , 2020 ) . These benchmarks introduce reasoning tasks over a wide range of complex object motion and interactions , which poses enormous challenges to existing models since most tasks require them to fully capture the underlying physical dynamics and , in some cases , be able to make predictions . However , the majority of complexity in the motion trajectories facilitated by these environments 1Project page : https : //comphyreasoning.github.io comes from changes or interventions in the initial conditions of the physical experiments . The effects of object intrinsic physical properties , as well as the unique set of their challenges , are therefore of great importance for further investigation . It ’ s non-trivial to build a benchmark for compositional physical reasoning . Existing benchmarks ( Yi et al. , 2020 ; Ates et al. , 2020 ) assume that there is no variance in objects ’ physical properties and ask models to learn physical reasoning from massive videos and question-answer pairs . A straightforward solution is to correlate object appearance with physical properties like making all red spheres to be heavy and then ask questions about their dynamics . However , such a design may incur shortcuts for models by just memorizing the appearance prior rather than understanding coupled physical properties . In this work , we propose a novel benchmark called ComPhy that focuses on understanding object-centric and relational physics properties hidden from visual appearances . ComPhy first provides few video examples with dynamic interactions among objects for models to identify objects ’ physical properties and then asks questions about the physical properties and corresponding dynamics . As shown in Fig . 2 , ComPhy consists of meta-train sets and meta-test sets , where each data point contains 4 reference videos and 1 target video . Within each set , the objects share the same intrinsic physical properties across all videos . Reasoning on ComPhy requires the model to infer the intrinsic and compositional physical properties of the object set from the reference videos , and then answer questions about this query video . To make the task feasible , we systematically control each object in the query video that should appear at least in one of the reference videos . We also introduce an oracle model to tackle this task . Inspired by recent work on neural-symbolic reasoning on images and videos ( Yi et al. , 2018 ; 2020 ; Chen et al. , 2021 ) , our model consists of four disentangled components : perception , physical property learning , dynamics prediction , and symbolic reasoning . Our model is able to infer objects ’ compositional and intrinsic physical properties , predict their future , make counterfactual imaginations , and answer questions . To summarize , this paper makes the following contributions . First , we present a new physical reasoning benchmark ComPhy with physical properties ( mass and charge ) , physical events ( attraction , repulsion ) , and their composition with visual appearance and motions . Second , we decorrelate physical properties and visual appearance with a few-shot reasoning setting . It requires models to infer hidden physical properties from only a few examples and then make predictions about the system ’ s evolution to help answer the questions . Third , we propose an oracle neural-symbolic framework , which is a modularized model that can infer objects ’ physical properties and predict the objects ’ movements . At the core of our model are graph neural networks that capture the compositional nature of the underlying system . 2 RELATED WORK . Physical Reasoning . Our work is closely related to recent developments in physical reasoning benchmarks ( Riochet et al. , 2018 ; Girdhar & Ramanan , 2020 ; Ates et al. , 2020 ) . PHYRE ( Bakhtin et al. , 2019 ) and its variant ESPRIT ( Rajani et al. , 2020 ) defines an environment where objects can move within a vertical 2D plane under gravity . Each task is associated with a goal state , and the model solves the task by specifying the initial condition that will lead to the goal state . CLEVRER ( Yi et al. , 2020 ) contains videos of multiple objects moving and colliding on a flat plane , posting natural language questions about description , explanation , prediction , and counterfactual reasoning on the collision events . CoPhy ( Baradel et al. , 2020 ) includes experiment trials of objects moving in 3D space under gravity . The task focuses on predicting object trajectories under counterfactual interventions on the initial conditions . Our dataset contributes to this line of physical reasoning benchmarks by focusing on physical events driven by object intrinsic properties ( situations shown in Fig . 2 ) . ComPhy requires models to identify intrinsic properties from only a few video examples and make dynamic predictions based on the identified properties and their compositionality . Dynamics Modeling . Dynamics modeling of physical systems has been a long-standing research direction . Some researchers have studied this problem via physical simulations , drawing inference on the important system- and object-level properties via statistical approaches such as MCMC ( Battaglia et al. , 2013 ; Hamrick et al. , 2016 ; Wu et al. , 2015 ) , while others propose to directly learn the forward dynamics via neural networks ( Lerer et al. , 2016 ) . Graph neural networks ( Kipf & Welling , 2017 ) , due to their object- and relation-centric inductive biases and efficiency , have been widely applied in forwarding dynamics prediction on a wide variety of systems ( Battaglia et al. , 2016 ; Chang et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019a ) . Our work combines the best of the two approaches by first inferring the object-centric intrinsic physical properties and then predicting their dynamics based on the intrinsic properties . Video Question Answering . Our work is also related to answering questions about visual content . Various benchmarks have been proposed to handle the task of video question answering , e.g . MarioQA ( Mun et al. , 2017 ) , TVQA ( Lei et al. , 2018 ) and AGQA ( Grunde-McLaughlin et al. , 2021 ) . However , they mainly focus on understanding human actions and activities rather than learning physical events and properties , which is essential for robot planning and control . Following CLEVRER , we summarize the difference between ComPhy and the previous related benchmarks in Table 1 . ComPhy is the only dataset that requires the model to learn physical property from few video examples , make dynamic predictions based on the physical property , and finally answer corresponding questions . Few-shot Learning . Our work is also related to few-shot learning , which typically learns to classify images from only a few labelled examples ( Vinyals et al. , 2016 ; Snell et al. , 2017 ; Sung et al. , 2018 ; Han et al. , 2019 ) . ComPhy also requires models to identify objects ’ property labels from only a few video examples . Different from them , reference videos have no labels for objects ’ physical properties but more interaction among objects , providing more information for models to identify objects ’ physical properties . 3 DATASET . ComPhy studies objects ’ intrinsic physical properties from objects ’ interactions and how these properties affect their motions in future and counterfactual scenes to answer corresponding questions . We first introduce videos and task setup in Section 3.1 . We then discuss question types in Section 3.2 , and statistics and balancing in Section 3.3 . 3.1 VIDEOS . Objects and Events . Following Johnson et al . ( 2017 ) , objects in ComPhy contain compositional appearance attributes like color , shape , and material . Each object in videos can be uniquely identified by these three attributes for simplicity . There are events , in , out , collision , attraction and repulsion . These object appearance attributes and events form the basic concepts of the questions in ComPhy . Physical Property . Previous benchmarks ( Riochet et al. , 2018 ; Yi et al. , 2020 ) mainly study appearance concepts like color and collision that can be perceived in even a single frame . In ComPhy , we additionally study intrinsic physical properties , mass and charge , which can not be directly captured from objects ’ static appearance . As shown in Fig . 1 ( a ) , objects with same or opposite charge will repel or attract each other while objects without charge will not affect each other ’ s motion without collision . As shown Fig . 1 ( b ) , the object with larger mass ( inertia ) tends to maintain its original moving direction after the collision while the light object changes much more in its moving direction . Note that these intrinsic physical properties are orthogonal to the appearance attributes and can be combined with each other to generate more complicated and diverse dynamic scenes . For simplicity , ComPhy contains two mass values ( heavy and light ) and three charge types ( positive charged , negative charged and uncharged ) . Theoretically , we can add more physical properties like bounciness coefficients and friction into ComPhy and make their values continuous . However , such a design will make the dataset too complicated and even difficult for people to infer the properties . Video Generations . For each video , we first use a physical engine ( Coumans & Bai , 2016–2021 ) to simulate objects ’ motions and then adopt a graphs engine ( Community , 2018 ) to render frame sequences . Each target video for question answering contains 3 to 5 objects with random composition between their appearance attributes and physical properties . We set the length of the target video to be 5 seconds and additionally simulate the 6-th and 7-th seconds of the target video for predictive question annotation . We provide more video generation details in the Appendix . Task Setup . It is not trivial to design a task setup to evaluate models ’ ability for physical reasoning since physical properties are not observable in a static frame . A straightforward design is to correlate object appearance with the physical property like “ red object is heavy ” , “ yellow object is light ” and then ask “ what would happen if they collide ” . However , such a setting is imperfect since it can not evaluate whether a model really understands the physical properties or just memorize the visual appearance prior . An ideal setting should be able to evaluate whether a model is like a human that can identify objects ’ properties from objects ’ motion and interactions with each other in the dynamic scenes and make the corresponding dynamic predictions . To achieve this , we design a meta setting for physical reasoning , which provides few reference video samples along with the target video for models to infer objects ’ physical properties and then ask questions about the objects ’ physical properties and dynamics . Following CLEVRER , we show a sample of the dataset in Fig . 2 . Each set contains a target video , 4 reference videos , and some questions about the visual attributes , physical properties , events , and dynamics of the target video . Objects in each set share the same visual attributes ( color , shape , and material ) and intrinsic physical property ( mass and charge ) . Reference videos . To provide abundant visual content for physical property inference , we additionally provide 4 reference videos for each target video . We sample 2-3 objects from the target video , provide them with different initial velocities and locations , and make them interact ( attract , repel or collide ) with each other . The generation of the reference video follows the same standard as the target video , but the length of the videos is set to 2 seconds for scaling up . The interaction among objects in reference videos helps models to inference objects ’ properties . For example , the repulsion in Reference video 1 of Fig . 2 can help us identify that object 1 and object 2 carrying the same charge . | The authors propose a new task and corresponding dataset ComPhy, a video question-answering dataset for evaluating video reasoning capability. First, a model is given 4 reference videos (2-sec clips showing object interactions in isolation) which is used to deduce object properties. Then a new query video (which could have more than 2 objects) is given on which 3 types of questions are asked: factual (about what happens in the video), counterfactual (what would happen if some condition changed), and predictive (what would happen after), with later two being multiple-choice questions. A particular contribution is the focus is on latent properties of the objects (mass and charge) which needs to be deduced from the reference videos. Multiple video reasoning model baselines are reported along with a newly proposed oracle Composition Physics Learner (CPL) model which shows considerable improvement over the baselines. | SP:5e4ae0220fea08bd3057e3f07c55869fd978d134 |
ComPhy: Compositional Physical Reasoning of Objects and Events from Videos | 1 INTRODUCTION . Why do apples float in water while bananas sink ? Why do magnets attract each other on a certain side and repel on the other ? Objects in nature often exhibit complex properties that define how they interact with the physical world . To humans , the unraveling of new intrinsic physical properties often marks important milestones towards a deeper and more accurate understanding of nature . Most of these properties are intrinsic as they are not directly reflected in the object ’ s visual appearances or otherwise detectable without imposing an interaction . Moreover , these properties affect object motion in a compositional fashion , and the causal dependency and mathematical law between different properties are often complex . As shown in Fig . 1 , different intrinsic physical properties , such as charge and inertia , often lead to drastically different future evolutions . Objects carrying the same or opposite charge will exert a repulsive or attractive force on each other . The resulting motion not only depends on the amount of charge each object carries , but also their signs ( see Fig . 1- ( a ) ) . The inertia determines how sensitive an object ’ s motion is to external forces . When a massive object interacts with a light object via attraction , repulsion , or collision , the lighter object will undergo larger changes in its motion compared with the massive object ’ s trajectory ( see Fig . 1- ( b ) ) . Recent studies have established a series of benchmarks to evaluate and diagnose machine learning systems in various physics-related environments ( Bakhtin et al. , 2019 ; Yi et al. , 2020 ; Baradel et al. , 2020 ) . These benchmarks introduce reasoning tasks over a wide range of complex object motion and interactions , which poses enormous challenges to existing models since most tasks require them to fully capture the underlying physical dynamics and , in some cases , be able to make predictions . However , the majority of complexity in the motion trajectories facilitated by these environments 1Project page : https : //comphyreasoning.github.io comes from changes or interventions in the initial conditions of the physical experiments . The effects of object intrinsic physical properties , as well as the unique set of their challenges , are therefore of great importance for further investigation . It ’ s non-trivial to build a benchmark for compositional physical reasoning . Existing benchmarks ( Yi et al. , 2020 ; Ates et al. , 2020 ) assume that there is no variance in objects ’ physical properties and ask models to learn physical reasoning from massive videos and question-answer pairs . A straightforward solution is to correlate object appearance with physical properties like making all red spheres to be heavy and then ask questions about their dynamics . However , such a design may incur shortcuts for models by just memorizing the appearance prior rather than understanding coupled physical properties . In this work , we propose a novel benchmark called ComPhy that focuses on understanding object-centric and relational physics properties hidden from visual appearances . ComPhy first provides few video examples with dynamic interactions among objects for models to identify objects ’ physical properties and then asks questions about the physical properties and corresponding dynamics . As shown in Fig . 2 , ComPhy consists of meta-train sets and meta-test sets , where each data point contains 4 reference videos and 1 target video . Within each set , the objects share the same intrinsic physical properties across all videos . Reasoning on ComPhy requires the model to infer the intrinsic and compositional physical properties of the object set from the reference videos , and then answer questions about this query video . To make the task feasible , we systematically control each object in the query video that should appear at least in one of the reference videos . We also introduce an oracle model to tackle this task . Inspired by recent work on neural-symbolic reasoning on images and videos ( Yi et al. , 2018 ; 2020 ; Chen et al. , 2021 ) , our model consists of four disentangled components : perception , physical property learning , dynamics prediction , and symbolic reasoning . Our model is able to infer objects ’ compositional and intrinsic physical properties , predict their future , make counterfactual imaginations , and answer questions . To summarize , this paper makes the following contributions . First , we present a new physical reasoning benchmark ComPhy with physical properties ( mass and charge ) , physical events ( attraction , repulsion ) , and their composition with visual appearance and motions . Second , we decorrelate physical properties and visual appearance with a few-shot reasoning setting . It requires models to infer hidden physical properties from only a few examples and then make predictions about the system ’ s evolution to help answer the questions . Third , we propose an oracle neural-symbolic framework , which is a modularized model that can infer objects ’ physical properties and predict the objects ’ movements . At the core of our model are graph neural networks that capture the compositional nature of the underlying system . 2 RELATED WORK . Physical Reasoning . Our work is closely related to recent developments in physical reasoning benchmarks ( Riochet et al. , 2018 ; Girdhar & Ramanan , 2020 ; Ates et al. , 2020 ) . PHYRE ( Bakhtin et al. , 2019 ) and its variant ESPRIT ( Rajani et al. , 2020 ) defines an environment where objects can move within a vertical 2D plane under gravity . Each task is associated with a goal state , and the model solves the task by specifying the initial condition that will lead to the goal state . CLEVRER ( Yi et al. , 2020 ) contains videos of multiple objects moving and colliding on a flat plane , posting natural language questions about description , explanation , prediction , and counterfactual reasoning on the collision events . CoPhy ( Baradel et al. , 2020 ) includes experiment trials of objects moving in 3D space under gravity . The task focuses on predicting object trajectories under counterfactual interventions on the initial conditions . Our dataset contributes to this line of physical reasoning benchmarks by focusing on physical events driven by object intrinsic properties ( situations shown in Fig . 2 ) . ComPhy requires models to identify intrinsic properties from only a few video examples and make dynamic predictions based on the identified properties and their compositionality . Dynamics Modeling . Dynamics modeling of physical systems has been a long-standing research direction . Some researchers have studied this problem via physical simulations , drawing inference on the important system- and object-level properties via statistical approaches such as MCMC ( Battaglia et al. , 2013 ; Hamrick et al. , 2016 ; Wu et al. , 2015 ) , while others propose to directly learn the forward dynamics via neural networks ( Lerer et al. , 2016 ) . Graph neural networks ( Kipf & Welling , 2017 ) , due to their object- and relation-centric inductive biases and efficiency , have been widely applied in forwarding dynamics prediction on a wide variety of systems ( Battaglia et al. , 2016 ; Chang et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019a ) . Our work combines the best of the two approaches by first inferring the object-centric intrinsic physical properties and then predicting their dynamics based on the intrinsic properties . Video Question Answering . Our work is also related to answering questions about visual content . Various benchmarks have been proposed to handle the task of video question answering , e.g . MarioQA ( Mun et al. , 2017 ) , TVQA ( Lei et al. , 2018 ) and AGQA ( Grunde-McLaughlin et al. , 2021 ) . However , they mainly focus on understanding human actions and activities rather than learning physical events and properties , which is essential for robot planning and control . Following CLEVRER , we summarize the difference between ComPhy and the previous related benchmarks in Table 1 . ComPhy is the only dataset that requires the model to learn physical property from few video examples , make dynamic predictions based on the physical property , and finally answer corresponding questions . Few-shot Learning . Our work is also related to few-shot learning , which typically learns to classify images from only a few labelled examples ( Vinyals et al. , 2016 ; Snell et al. , 2017 ; Sung et al. , 2018 ; Han et al. , 2019 ) . ComPhy also requires models to identify objects ’ property labels from only a few video examples . Different from them , reference videos have no labels for objects ’ physical properties but more interaction among objects , providing more information for models to identify objects ’ physical properties . 3 DATASET . ComPhy studies objects ’ intrinsic physical properties from objects ’ interactions and how these properties affect their motions in future and counterfactual scenes to answer corresponding questions . We first introduce videos and task setup in Section 3.1 . We then discuss question types in Section 3.2 , and statistics and balancing in Section 3.3 . 3.1 VIDEOS . Objects and Events . Following Johnson et al . ( 2017 ) , objects in ComPhy contain compositional appearance attributes like color , shape , and material . Each object in videos can be uniquely identified by these three attributes for simplicity . There are events , in , out , collision , attraction and repulsion . These object appearance attributes and events form the basic concepts of the questions in ComPhy . Physical Property . Previous benchmarks ( Riochet et al. , 2018 ; Yi et al. , 2020 ) mainly study appearance concepts like color and collision that can be perceived in even a single frame . In ComPhy , we additionally study intrinsic physical properties , mass and charge , which can not be directly captured from objects ’ static appearance . As shown in Fig . 1 ( a ) , objects with same or opposite charge will repel or attract each other while objects without charge will not affect each other ’ s motion without collision . As shown Fig . 1 ( b ) , the object with larger mass ( inertia ) tends to maintain its original moving direction after the collision while the light object changes much more in its moving direction . Note that these intrinsic physical properties are orthogonal to the appearance attributes and can be combined with each other to generate more complicated and diverse dynamic scenes . For simplicity , ComPhy contains two mass values ( heavy and light ) and three charge types ( positive charged , negative charged and uncharged ) . Theoretically , we can add more physical properties like bounciness coefficients and friction into ComPhy and make their values continuous . However , such a design will make the dataset too complicated and even difficult for people to infer the properties . Video Generations . For each video , we first use a physical engine ( Coumans & Bai , 2016–2021 ) to simulate objects ’ motions and then adopt a graphs engine ( Community , 2018 ) to render frame sequences . Each target video for question answering contains 3 to 5 objects with random composition between their appearance attributes and physical properties . We set the length of the target video to be 5 seconds and additionally simulate the 6-th and 7-th seconds of the target video for predictive question annotation . We provide more video generation details in the Appendix . Task Setup . It is not trivial to design a task setup to evaluate models ’ ability for physical reasoning since physical properties are not observable in a static frame . A straightforward design is to correlate object appearance with the physical property like “ red object is heavy ” , “ yellow object is light ” and then ask “ what would happen if they collide ” . However , such a setting is imperfect since it can not evaluate whether a model really understands the physical properties or just memorize the visual appearance prior . An ideal setting should be able to evaluate whether a model is like a human that can identify objects ’ properties from objects ’ motion and interactions with each other in the dynamic scenes and make the corresponding dynamic predictions . To achieve this , we design a meta setting for physical reasoning , which provides few reference video samples along with the target video for models to infer objects ’ physical properties and then ask questions about the objects ’ physical properties and dynamics . Following CLEVRER , we show a sample of the dataset in Fig . 2 . Each set contains a target video , 4 reference videos , and some questions about the visual attributes , physical properties , events , and dynamics of the target video . Objects in each set share the same visual attributes ( color , shape , and material ) and intrinsic physical property ( mass and charge ) . Reference videos . To provide abundant visual content for physical property inference , we additionally provide 4 reference videos for each target video . We sample 2-3 objects from the target video , provide them with different initial velocities and locations , and make them interact ( attract , repel or collide ) with each other . The generation of the reference video follows the same standard as the target video , but the length of the videos is set to 2 seconds for scaling up . The interaction among objects in reference videos helps models to inference objects ’ properties . For example , the repulsion in Reference video 1 of Fig . 2 can help us identify that object 1 and object 2 carrying the same charge . | This work extends prior datasets (chiefly, CLEVRER) for physical reasoning from visual input. It endows objects with two latent properties–mass and charge–thereby producing object dynamics like attraction or repulsion. The paper also presents VQA results on the dataset from a modular architecture (similar to NS-DR from CLEVRER) trained by supervision. | SP:5e4ae0220fea08bd3057e3f07c55869fd978d134 |
ComPhy: Compositional Physical Reasoning of Objects and Events from Videos | 1 INTRODUCTION . Why do apples float in water while bananas sink ? Why do magnets attract each other on a certain side and repel on the other ? Objects in nature often exhibit complex properties that define how they interact with the physical world . To humans , the unraveling of new intrinsic physical properties often marks important milestones towards a deeper and more accurate understanding of nature . Most of these properties are intrinsic as they are not directly reflected in the object ’ s visual appearances or otherwise detectable without imposing an interaction . Moreover , these properties affect object motion in a compositional fashion , and the causal dependency and mathematical law between different properties are often complex . As shown in Fig . 1 , different intrinsic physical properties , such as charge and inertia , often lead to drastically different future evolutions . Objects carrying the same or opposite charge will exert a repulsive or attractive force on each other . The resulting motion not only depends on the amount of charge each object carries , but also their signs ( see Fig . 1- ( a ) ) . The inertia determines how sensitive an object ’ s motion is to external forces . When a massive object interacts with a light object via attraction , repulsion , or collision , the lighter object will undergo larger changes in its motion compared with the massive object ’ s trajectory ( see Fig . 1- ( b ) ) . Recent studies have established a series of benchmarks to evaluate and diagnose machine learning systems in various physics-related environments ( Bakhtin et al. , 2019 ; Yi et al. , 2020 ; Baradel et al. , 2020 ) . These benchmarks introduce reasoning tasks over a wide range of complex object motion and interactions , which poses enormous challenges to existing models since most tasks require them to fully capture the underlying physical dynamics and , in some cases , be able to make predictions . However , the majority of complexity in the motion trajectories facilitated by these environments 1Project page : https : //comphyreasoning.github.io comes from changes or interventions in the initial conditions of the physical experiments . The effects of object intrinsic physical properties , as well as the unique set of their challenges , are therefore of great importance for further investigation . It ’ s non-trivial to build a benchmark for compositional physical reasoning . Existing benchmarks ( Yi et al. , 2020 ; Ates et al. , 2020 ) assume that there is no variance in objects ’ physical properties and ask models to learn physical reasoning from massive videos and question-answer pairs . A straightforward solution is to correlate object appearance with physical properties like making all red spheres to be heavy and then ask questions about their dynamics . However , such a design may incur shortcuts for models by just memorizing the appearance prior rather than understanding coupled physical properties . In this work , we propose a novel benchmark called ComPhy that focuses on understanding object-centric and relational physics properties hidden from visual appearances . ComPhy first provides few video examples with dynamic interactions among objects for models to identify objects ’ physical properties and then asks questions about the physical properties and corresponding dynamics . As shown in Fig . 2 , ComPhy consists of meta-train sets and meta-test sets , where each data point contains 4 reference videos and 1 target video . Within each set , the objects share the same intrinsic physical properties across all videos . Reasoning on ComPhy requires the model to infer the intrinsic and compositional physical properties of the object set from the reference videos , and then answer questions about this query video . To make the task feasible , we systematically control each object in the query video that should appear at least in one of the reference videos . We also introduce an oracle model to tackle this task . Inspired by recent work on neural-symbolic reasoning on images and videos ( Yi et al. , 2018 ; 2020 ; Chen et al. , 2021 ) , our model consists of four disentangled components : perception , physical property learning , dynamics prediction , and symbolic reasoning . Our model is able to infer objects ’ compositional and intrinsic physical properties , predict their future , make counterfactual imaginations , and answer questions . To summarize , this paper makes the following contributions . First , we present a new physical reasoning benchmark ComPhy with physical properties ( mass and charge ) , physical events ( attraction , repulsion ) , and their composition with visual appearance and motions . Second , we decorrelate physical properties and visual appearance with a few-shot reasoning setting . It requires models to infer hidden physical properties from only a few examples and then make predictions about the system ’ s evolution to help answer the questions . Third , we propose an oracle neural-symbolic framework , which is a modularized model that can infer objects ’ physical properties and predict the objects ’ movements . At the core of our model are graph neural networks that capture the compositional nature of the underlying system . 2 RELATED WORK . Physical Reasoning . Our work is closely related to recent developments in physical reasoning benchmarks ( Riochet et al. , 2018 ; Girdhar & Ramanan , 2020 ; Ates et al. , 2020 ) . PHYRE ( Bakhtin et al. , 2019 ) and its variant ESPRIT ( Rajani et al. , 2020 ) defines an environment where objects can move within a vertical 2D plane under gravity . Each task is associated with a goal state , and the model solves the task by specifying the initial condition that will lead to the goal state . CLEVRER ( Yi et al. , 2020 ) contains videos of multiple objects moving and colliding on a flat plane , posting natural language questions about description , explanation , prediction , and counterfactual reasoning on the collision events . CoPhy ( Baradel et al. , 2020 ) includes experiment trials of objects moving in 3D space under gravity . The task focuses on predicting object trajectories under counterfactual interventions on the initial conditions . Our dataset contributes to this line of physical reasoning benchmarks by focusing on physical events driven by object intrinsic properties ( situations shown in Fig . 2 ) . ComPhy requires models to identify intrinsic properties from only a few video examples and make dynamic predictions based on the identified properties and their compositionality . Dynamics Modeling . Dynamics modeling of physical systems has been a long-standing research direction . Some researchers have studied this problem via physical simulations , drawing inference on the important system- and object-level properties via statistical approaches such as MCMC ( Battaglia et al. , 2013 ; Hamrick et al. , 2016 ; Wu et al. , 2015 ) , while others propose to directly learn the forward dynamics via neural networks ( Lerer et al. , 2016 ) . Graph neural networks ( Kipf & Welling , 2017 ) , due to their object- and relation-centric inductive biases and efficiency , have been widely applied in forwarding dynamics prediction on a wide variety of systems ( Battaglia et al. , 2016 ; Chang et al. , 2016 ; Sanchez-Gonzalez et al. , 2020 ; Li et al. , 2019a ) . Our work combines the best of the two approaches by first inferring the object-centric intrinsic physical properties and then predicting their dynamics based on the intrinsic properties . Video Question Answering . Our work is also related to answering questions about visual content . Various benchmarks have been proposed to handle the task of video question answering , e.g . MarioQA ( Mun et al. , 2017 ) , TVQA ( Lei et al. , 2018 ) and AGQA ( Grunde-McLaughlin et al. , 2021 ) . However , they mainly focus on understanding human actions and activities rather than learning physical events and properties , which is essential for robot planning and control . Following CLEVRER , we summarize the difference between ComPhy and the previous related benchmarks in Table 1 . ComPhy is the only dataset that requires the model to learn physical property from few video examples , make dynamic predictions based on the physical property , and finally answer corresponding questions . Few-shot Learning . Our work is also related to few-shot learning , which typically learns to classify images from only a few labelled examples ( Vinyals et al. , 2016 ; Snell et al. , 2017 ; Sung et al. , 2018 ; Han et al. , 2019 ) . ComPhy also requires models to identify objects ’ property labels from only a few video examples . Different from them , reference videos have no labels for objects ’ physical properties but more interaction among objects , providing more information for models to identify objects ’ physical properties . 3 DATASET . ComPhy studies objects ’ intrinsic physical properties from objects ’ interactions and how these properties affect their motions in future and counterfactual scenes to answer corresponding questions . We first introduce videos and task setup in Section 3.1 . We then discuss question types in Section 3.2 , and statistics and balancing in Section 3.3 . 3.1 VIDEOS . Objects and Events . Following Johnson et al . ( 2017 ) , objects in ComPhy contain compositional appearance attributes like color , shape , and material . Each object in videos can be uniquely identified by these three attributes for simplicity . There are events , in , out , collision , attraction and repulsion . These object appearance attributes and events form the basic concepts of the questions in ComPhy . Physical Property . Previous benchmarks ( Riochet et al. , 2018 ; Yi et al. , 2020 ) mainly study appearance concepts like color and collision that can be perceived in even a single frame . In ComPhy , we additionally study intrinsic physical properties , mass and charge , which can not be directly captured from objects ’ static appearance . As shown in Fig . 1 ( a ) , objects with same or opposite charge will repel or attract each other while objects without charge will not affect each other ’ s motion without collision . As shown Fig . 1 ( b ) , the object with larger mass ( inertia ) tends to maintain its original moving direction after the collision while the light object changes much more in its moving direction . Note that these intrinsic physical properties are orthogonal to the appearance attributes and can be combined with each other to generate more complicated and diverse dynamic scenes . For simplicity , ComPhy contains two mass values ( heavy and light ) and three charge types ( positive charged , negative charged and uncharged ) . Theoretically , we can add more physical properties like bounciness coefficients and friction into ComPhy and make their values continuous . However , such a design will make the dataset too complicated and even difficult for people to infer the properties . Video Generations . For each video , we first use a physical engine ( Coumans & Bai , 2016–2021 ) to simulate objects ’ motions and then adopt a graphs engine ( Community , 2018 ) to render frame sequences . Each target video for question answering contains 3 to 5 objects with random composition between their appearance attributes and physical properties . We set the length of the target video to be 5 seconds and additionally simulate the 6-th and 7-th seconds of the target video for predictive question annotation . We provide more video generation details in the Appendix . Task Setup . It is not trivial to design a task setup to evaluate models ’ ability for physical reasoning since physical properties are not observable in a static frame . A straightforward design is to correlate object appearance with the physical property like “ red object is heavy ” , “ yellow object is light ” and then ask “ what would happen if they collide ” . However , such a setting is imperfect since it can not evaluate whether a model really understands the physical properties or just memorize the visual appearance prior . An ideal setting should be able to evaluate whether a model is like a human that can identify objects ’ properties from objects ’ motion and interactions with each other in the dynamic scenes and make the corresponding dynamic predictions . To achieve this , we design a meta setting for physical reasoning , which provides few reference video samples along with the target video for models to infer objects ’ physical properties and then ask questions about the objects ’ physical properties and dynamics . Following CLEVRER , we show a sample of the dataset in Fig . 2 . Each set contains a target video , 4 reference videos , and some questions about the visual attributes , physical properties , events , and dynamics of the target video . Objects in each set share the same visual attributes ( color , shape , and material ) and intrinsic physical property ( mass and charge ) . Reference videos . To provide abundant visual content for physical property inference , we additionally provide 4 reference videos for each target video . We sample 2-3 objects from the target video , provide them with different initial velocities and locations , and make them interact ( attract , repel or collide ) with each other . The generation of the reference video follows the same standard as the target video , but the length of the videos is set to 2 seconds for scaling up . The interaction among objects in reference videos helps models to inference objects ’ properties . For example , the repulsion in Reference video 1 of Fig . 2 can help us identify that object 1 and object 2 carrying the same charge . | The paper focuses on inferring two hidden physical properties (mass and electricity charge). A synthetic dataset, called ComPhy is created. The dataset consists of simple shapes (such as cubes and sphere) that move on a flat plane. For each query video, there are four reference videos that the models can use to learn the properties of objects. The dataset also includes three types of questions: factual, counterfactual and predictive. The paper also presents a pipeline approach called CPL that leverages graphs to model the relationship of objects and solve the QA tasks. | SP:5e4ae0220fea08bd3057e3f07c55869fd978d134 |
MAGNEx: A Model Agnostic Global Neural Explainer | 1 INTRODUCTION . Black-box decision models have for some time now posed a dilemma between power and interpretability . For use cases where explanations are necessary , the inability of black-box models to supply them is often a deterrent to adoption . However , even in low-risk scenarios this lack of explainability often causes distrust to both the developers and the users of these models , who are often puzzled about how decisions emerge ( Ribeiro et al. , 2016 ) . Also , explainability is an important mechanism when investigating if black-box models act fairly and without bias ( Sun et al. , 2019 ) .1 In this paper , we propose MAGNEx , a model-agnostic neural explainer that globally learns to explain an already trained model , neural or not . In this post-hoc interpretability setting , most methods ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Lundberg & Lee , 2017 ; Luo et al. , 2020 ) create feature-based explanations , i.e. , explanations that assign a score to each feature of the input based on how important the feature is to the model ’ s decision . This importance score may rely on some internal mechanism of the model we wish to explain , e.g. , gradients ( Sundararajan et al. , 2017 ; Shrikumar et al. , 2017 ) or attention ( Jain & Wallace , 2019 ; Wiegreffe & Pinter , 2019 ) . Such methods have limitations to the types of model they can explain , e.g. , gradient-based methods work only with differentiable models . Perturbation-based methods , e.g. , LIME ( Ribeiro et al. , 2016 ) , SHAP ( Lundberg & Lee , 2017 ) , drop combinations of features for a specific input to the model and observe its output . Omitted features that have a large impact on the output of the model across perturbations are deemed important , while other features are considered unimportant . This allows perturbation-based methods to be model-agnostic , but adds severe computational complexity , since a large number of perturbations is required per input instance to create quality explanations . The search for an optimal solution by erasure ( feature drop ) is combinatorial and practically infeasible for even small feature spaces ; the search space is the power set of the feature set resulting in a complexity of O ( 2n ) for n features . Therefore , pertubation-based methods find approximate ( sub-optimal ) solutions , but even this process is cumbersome , especially when the input is large ( i.e. , contains many features ) and the explainability method is local ( a different search must be performed for each input instance ) . 1We use explainability and interpretability interchangeably as there is no clear consensus in the literature . MAGNEx also creates feature-based explanations , but contrary to most methods , its explainer is a neural network that globally learns to assign feature importance scores . This is similar to the work of De Cao et al . ( 2020 ) , which relies on gradients to produce feature importance scores ; their explainer is a shallow network directly attached to the model being explained , requiring the gradients to flow through both the explainer and the model . This limits the approach of De Cao et al . ( 2020 ) to explaining only differentiable models , while increasing the memory and computational complexity . Neural explanation modules have also been used in explainable by-design models ( Lei et al. , 2016 ; Bastings et al. , 2019 ; Yu et al. , 2019 ; Chang et al. , 2019 ; Chalkidis et al. , 2021 ) . These models mainly focus on human-centric explainability and jointly train a rationale extractor and a classifier . This setting poses an extra burden on the training procedure and disincentivizes exploring parts of the space of possible solutions the model can arrive to , possibly leading to loss of model performance at the expense of interpretability . MAGNEx disentangles the explainer from the model it wishes to explain , aiming to produce explanations that are faithful , i.e. , accurately reflect the features considered important by the model ( Lipton , 2018 ; Jacovi & Goldberg , 2020 ) . The generated explanations do not have to agree with human annotated rationales ( e.g. , gold text snippets ) , which are often used as an optimal solution in explainable by-design methods . MAGNEx ’ s goal is to faithfully reveal information about a model ’ s inner workings to its developers and if its explanations agree with human intuition , then MAGNEx can also be used as an explanation algorithm for end-users . If the explanations do not agree with human intuition , MAGNEx can reveal weaknesses of the explained model and/or of the data used to train it . For instance , training data may not be diverse enough , allowing a model to overfit to insignificant features in its input . The explainer of MAGNEx is a shallow neural network that attributes scores to input features ( Figure 1 ) . Its training is dictated by a two-fold objective that can be classified under constrained optimization . The scoring of the explainer must be primarily sufficient , i.e. , the explanations when fed to the underlying model must result in the same output ( DeYoung et al. , 2020 ) . Also , among all possible sufficient explanations the explainer is tasked with finding one that is maximally sparse , i.e. , utilizes the minimum number of features ( Lei et al. , 2016 ) . This constrained objective , or a relaxed version of it , has been also used by perturbation-based systems ( De Cao et al. , 2020 ; Ribeiro et al. , 2016 ) . Our contributions are as follows : • We propose MAGNEx a method that explains the inner workings of a pre-trained model in a post-hoc manner . MAGNEx , is completely model agnostic and thus can explain any pre-trained model across modalities ( e.g. , vision , text ) and applications . • The proposed approach is global , allowing MAGNEx to generalize across instances ; learning from many samples has a regularization effect alleviating hindsight bias ( Fischhoff & Beyth , 1975 ) which is a common phenomenon in machine learning problems ( Mahdavi & Rahimian , 2017 ) and more specificaly in perturbation-based explainability ( De Cao et al. , 2020 ) . Also , the global nature of MAGNEx transfers the computationally expensive feature search to the training stage allowing for more efficient inference than its competitors . • The experiments showed that MAGNEx produces explanations of better quality than popular explainability methods ( LIME ( Ribeiro et al. , 2016 ) , IG ( Sundararajan et al. , 2017 ) ) , while also being more stable across instances and much more efficient during inference . 2 METHODOLOGY . 2.1 FORMULATION . Let M : I → O be the model we wish to explain . Each input i ∈ I is a set of input features such that i = { f1 , f2 , . . . , fn } , where n is the number of features . An explainer , E , operates on i and associates each feature in i with an importance score sj ∈ [ 0 , 1 ] for j ∈ { 1 , 2 , . . . , n } : E ( i ) = { s1 , s2 , . . . , sn } ( 1 ) A masking function µ , operates on an input i = { f1 , f2 , . . . , fn } and its corresponding scoring s = { s1 , s2 , . . . , sn } to produce a masked version of i : µ ( i , s ) = { e1 ∈ { f1 , m } , e2 ∈ { f2 , m } , . . . , en ∈ { fn , m } } ( 2 ) where m is a feature which carries no information for M and is chosen according to the task , e.g. , a black pixel in computer vision or a pad token in natural language processing . In practise , µ is realized in different ways in training and inference . During training whether a feature fj will be replaced by m is determined by performing a biased coin flip based on sj ( the score of fj ) , while during inference µ is realized as : µ ( i , s ) j = { fj , if sj > m , otherwise ( 3 ) Given an input i and a scoring s = E ( i ) , we compute the quality of the explainer ’ s scoring in terms of sufficiency ( su ) and sparsity ( sp ) , defined as follows : su = gsu ( M ( i ) , M ( µ ( i , s ) ) ) ( 4 ) sp = gsp ( µ ( i , s ) ) ( 5 ) where , gsu : O×O → [ 0 , 1 ] is a function measuring to what extent the output of M when presented with µ ( i , s ) resembles the output of M when presented with i , and gsp computes the percentage of features which have been replaced with m. Since we opt for maximally sparse inputs with high sufficiency , the total quality score for the explanation is computed as : q = { su + sp , if su > υ su , otherwise ( 6 ) Note that we force explanations that have a sufficiency of at least υ to ensure a minimum quality . Unless otherwise specified , we use a gsu tailored to classification where we assume O = [ 0 , 1 ] c and c is the number of classes . Classification sufficiency is then calculated as : gsu ( y , ŷ ) = 1− ( max ( y ) − ŷp ) ( 7 ) where p = argmax ( y ) is the predicted class in y ∈ O and gsu is bounded in [ 0 , 1 ] with higher scores signaling more faithful explanations . The term max ( y ) − ŷp measures the divergence between the top probability estimate across classes in y and the probability estimate for the same class in ŷ . 2.2 LEARNING . Our explainer is realized as a neural network with parameters θ throughout . We aim to find the optimal values θ∗ which maximize q ( Eq . 6 ) across a number of training examples { i1 , i2 , . . . , im } ⊆ I . However , the standard backpropagation optimization approach falls short in this case since it is impossible to produce gradients to update the explainer . While the explainer itself is differentiable , in order for a sufficiency score to be computed for some input i a hard choice must be made on which features in i to retain and which to substitute with m. The masking function µ is therefore non-differentiable . More importantly , our approach is completely model-agnostic and we make no assumptions about whether the model we wish to explain ( M ) is differentiable or not . In the simplest scenario , where only the masking function is non-differentiable , a number of approaches have attempted to produce gradient estimations with methods other than the score estimator , based on REINFORCE ( Williams , 1992 ) . The most common of these approaches are the straightthrough estimator ( Chang et al. , 2019 ; Chalkidis et al. , 2021 ) and relaxation to binary variables ( Louizos et al. , 2018 ; Bastings et al. , 2019 ; De Cao et al. , 2020 ) which leverages the reparametrization trick ( Kingma & Welling , 2013 ) . Both of these approaches can be used only when the masking function is the only non-differentiable component , i.e. , they require M to be differentiable , thus breaking the model-agnostic nature of the explainer , which is a requirement in MAGNEx . To retain the model-agnostic nature of our formulation and alleviate large computational strain to our method we opt to train our model by estimating gradients for updates to our explainer network with the score estimator ( REINFORCE ) . For training on a single input i we create a multi-variable policy using the output of our explainer . πθ ( i ) = { B ( Eθ ( i ) j ) } |i|j=1 ( 8 ) where B is the Bernoulli distribution . Sampling from this policy is equivalent to sampling from each of the Bernoulli distributions independently . Therefore a sample τ ∼ πθ ( i ) is a sequence of binary variables indicating the presence or the absence of the feature at position j . We train our method using the score estimator which in this case can be written as : ∇θJ ( πθ ( i ) ) = ∇θEτ∼πθ ( i ) [ q ( τ ) ] ( 9 ) Following Williams ( 1992 ) we can rewrite the above gradient in the form : ∇θJ ( πθ ( i ) ) = Eτ∼πθ ( i ) [ ∇θ log P ( τ |i ; θ ) q ( τ ) ] ( 10 ) where P ( τ |i ; θ ) = ∏|i| j=1 P ( τj |πθ ( i ) j ) . We can easily approximate Eq . 10 by Monte-Carlo sampling.2 We further add a baseline in order to reduce the variance of the gradient estimator : ∇θJ ( πθ ) = Eτ∼πθ [ ∇θ log P ( τ |i ; θ ) ( q ( τ ) − b ) ] ( 11 ) In Mnih et al . ( 2014 ) , which bears some similarities to our setting a learned baseline was used . Here , we use a moving average baseline which seems to be sufficient for our use cases . While similar methods relying on differentiable relaxation to binary variables have been shown to outperform REINFORCE in some cases ( Bastings et al. , 2019 ; De Cao et al. , 2020 ) , we choose this gradient estimator for a number of reasons . Firstly , we want our method to remain purely modelagnostic , a requirement which can not be satisfied by the estimators in Bastings et al . ( 2019 ) and De Cao et al . ( 2020 ) which support only differentiable models . Secondly , the fact that the estimator works by simple exposure to a scalar metric ( Eq . 6 ) , which does not need to have a gradient , greatly reduces the space complexity of the method , allowing a higher degree of parallelism on the same hardware , and in practice allowing very complex models to be explained in reasonable time . Lastly , this problem involves constrained optimization . Looking back at the definition of our total metric ( Eq . 6 ) we can see that we are optimizing sparsity subject to sufficiency being higher than some threshold . This objective is therefore non-differentiable and De Cao et al . ( 2020 ) and Bastings et al . ( 2019 ) employ Lagrangian relaxation to approximate the constrained objective in a differentiable manner . This adds a new hyperparameter , the Lagrangian multiplier , which needs to be tuned , adding further overhead to the explainer ’ s development procedure and is in all cases an approximation of the true constrained objective . | This paper proposes a post-hoc explainability algorithm that is global and model-agnostic. The global comes from training from batches of data while the model-agnostic property is achieved by a gradient estimator. Experiments show the proposed method outperforms IG and LIME from aspects of sparsity, sufficiency, and time. Some case studies also validate its effectiveness. | SP:ba6d62de546f9a52d767665b96790951d046ece8 |
MAGNEx: A Model Agnostic Global Neural Explainer | 1 INTRODUCTION . Black-box decision models have for some time now posed a dilemma between power and interpretability . For use cases where explanations are necessary , the inability of black-box models to supply them is often a deterrent to adoption . However , even in low-risk scenarios this lack of explainability often causes distrust to both the developers and the users of these models , who are often puzzled about how decisions emerge ( Ribeiro et al. , 2016 ) . Also , explainability is an important mechanism when investigating if black-box models act fairly and without bias ( Sun et al. , 2019 ) .1 In this paper , we propose MAGNEx , a model-agnostic neural explainer that globally learns to explain an already trained model , neural or not . In this post-hoc interpretability setting , most methods ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Lundberg & Lee , 2017 ; Luo et al. , 2020 ) create feature-based explanations , i.e. , explanations that assign a score to each feature of the input based on how important the feature is to the model ’ s decision . This importance score may rely on some internal mechanism of the model we wish to explain , e.g. , gradients ( Sundararajan et al. , 2017 ; Shrikumar et al. , 2017 ) or attention ( Jain & Wallace , 2019 ; Wiegreffe & Pinter , 2019 ) . Such methods have limitations to the types of model they can explain , e.g. , gradient-based methods work only with differentiable models . Perturbation-based methods , e.g. , LIME ( Ribeiro et al. , 2016 ) , SHAP ( Lundberg & Lee , 2017 ) , drop combinations of features for a specific input to the model and observe its output . Omitted features that have a large impact on the output of the model across perturbations are deemed important , while other features are considered unimportant . This allows perturbation-based methods to be model-agnostic , but adds severe computational complexity , since a large number of perturbations is required per input instance to create quality explanations . The search for an optimal solution by erasure ( feature drop ) is combinatorial and practically infeasible for even small feature spaces ; the search space is the power set of the feature set resulting in a complexity of O ( 2n ) for n features . Therefore , pertubation-based methods find approximate ( sub-optimal ) solutions , but even this process is cumbersome , especially when the input is large ( i.e. , contains many features ) and the explainability method is local ( a different search must be performed for each input instance ) . 1We use explainability and interpretability interchangeably as there is no clear consensus in the literature . MAGNEx also creates feature-based explanations , but contrary to most methods , its explainer is a neural network that globally learns to assign feature importance scores . This is similar to the work of De Cao et al . ( 2020 ) , which relies on gradients to produce feature importance scores ; their explainer is a shallow network directly attached to the model being explained , requiring the gradients to flow through both the explainer and the model . This limits the approach of De Cao et al . ( 2020 ) to explaining only differentiable models , while increasing the memory and computational complexity . Neural explanation modules have also been used in explainable by-design models ( Lei et al. , 2016 ; Bastings et al. , 2019 ; Yu et al. , 2019 ; Chang et al. , 2019 ; Chalkidis et al. , 2021 ) . These models mainly focus on human-centric explainability and jointly train a rationale extractor and a classifier . This setting poses an extra burden on the training procedure and disincentivizes exploring parts of the space of possible solutions the model can arrive to , possibly leading to loss of model performance at the expense of interpretability . MAGNEx disentangles the explainer from the model it wishes to explain , aiming to produce explanations that are faithful , i.e. , accurately reflect the features considered important by the model ( Lipton , 2018 ; Jacovi & Goldberg , 2020 ) . The generated explanations do not have to agree with human annotated rationales ( e.g. , gold text snippets ) , which are often used as an optimal solution in explainable by-design methods . MAGNEx ’ s goal is to faithfully reveal information about a model ’ s inner workings to its developers and if its explanations agree with human intuition , then MAGNEx can also be used as an explanation algorithm for end-users . If the explanations do not agree with human intuition , MAGNEx can reveal weaknesses of the explained model and/or of the data used to train it . For instance , training data may not be diverse enough , allowing a model to overfit to insignificant features in its input . The explainer of MAGNEx is a shallow neural network that attributes scores to input features ( Figure 1 ) . Its training is dictated by a two-fold objective that can be classified under constrained optimization . The scoring of the explainer must be primarily sufficient , i.e. , the explanations when fed to the underlying model must result in the same output ( DeYoung et al. , 2020 ) . Also , among all possible sufficient explanations the explainer is tasked with finding one that is maximally sparse , i.e. , utilizes the minimum number of features ( Lei et al. , 2016 ) . This constrained objective , or a relaxed version of it , has been also used by perturbation-based systems ( De Cao et al. , 2020 ; Ribeiro et al. , 2016 ) . Our contributions are as follows : • We propose MAGNEx a method that explains the inner workings of a pre-trained model in a post-hoc manner . MAGNEx , is completely model agnostic and thus can explain any pre-trained model across modalities ( e.g. , vision , text ) and applications . • The proposed approach is global , allowing MAGNEx to generalize across instances ; learning from many samples has a regularization effect alleviating hindsight bias ( Fischhoff & Beyth , 1975 ) which is a common phenomenon in machine learning problems ( Mahdavi & Rahimian , 2017 ) and more specificaly in perturbation-based explainability ( De Cao et al. , 2020 ) . Also , the global nature of MAGNEx transfers the computationally expensive feature search to the training stage allowing for more efficient inference than its competitors . • The experiments showed that MAGNEx produces explanations of better quality than popular explainability methods ( LIME ( Ribeiro et al. , 2016 ) , IG ( Sundararajan et al. , 2017 ) ) , while also being more stable across instances and much more efficient during inference . 2 METHODOLOGY . 2.1 FORMULATION . Let M : I → O be the model we wish to explain . Each input i ∈ I is a set of input features such that i = { f1 , f2 , . . . , fn } , where n is the number of features . An explainer , E , operates on i and associates each feature in i with an importance score sj ∈ [ 0 , 1 ] for j ∈ { 1 , 2 , . . . , n } : E ( i ) = { s1 , s2 , . . . , sn } ( 1 ) A masking function µ , operates on an input i = { f1 , f2 , . . . , fn } and its corresponding scoring s = { s1 , s2 , . . . , sn } to produce a masked version of i : µ ( i , s ) = { e1 ∈ { f1 , m } , e2 ∈ { f2 , m } , . . . , en ∈ { fn , m } } ( 2 ) where m is a feature which carries no information for M and is chosen according to the task , e.g. , a black pixel in computer vision or a pad token in natural language processing . In practise , µ is realized in different ways in training and inference . During training whether a feature fj will be replaced by m is determined by performing a biased coin flip based on sj ( the score of fj ) , while during inference µ is realized as : µ ( i , s ) j = { fj , if sj > m , otherwise ( 3 ) Given an input i and a scoring s = E ( i ) , we compute the quality of the explainer ’ s scoring in terms of sufficiency ( su ) and sparsity ( sp ) , defined as follows : su = gsu ( M ( i ) , M ( µ ( i , s ) ) ) ( 4 ) sp = gsp ( µ ( i , s ) ) ( 5 ) where , gsu : O×O → [ 0 , 1 ] is a function measuring to what extent the output of M when presented with µ ( i , s ) resembles the output of M when presented with i , and gsp computes the percentage of features which have been replaced with m. Since we opt for maximally sparse inputs with high sufficiency , the total quality score for the explanation is computed as : q = { su + sp , if su > υ su , otherwise ( 6 ) Note that we force explanations that have a sufficiency of at least υ to ensure a minimum quality . Unless otherwise specified , we use a gsu tailored to classification where we assume O = [ 0 , 1 ] c and c is the number of classes . Classification sufficiency is then calculated as : gsu ( y , ŷ ) = 1− ( max ( y ) − ŷp ) ( 7 ) where p = argmax ( y ) is the predicted class in y ∈ O and gsu is bounded in [ 0 , 1 ] with higher scores signaling more faithful explanations . The term max ( y ) − ŷp measures the divergence between the top probability estimate across classes in y and the probability estimate for the same class in ŷ . 2.2 LEARNING . Our explainer is realized as a neural network with parameters θ throughout . We aim to find the optimal values θ∗ which maximize q ( Eq . 6 ) across a number of training examples { i1 , i2 , . . . , im } ⊆ I . However , the standard backpropagation optimization approach falls short in this case since it is impossible to produce gradients to update the explainer . While the explainer itself is differentiable , in order for a sufficiency score to be computed for some input i a hard choice must be made on which features in i to retain and which to substitute with m. The masking function µ is therefore non-differentiable . More importantly , our approach is completely model-agnostic and we make no assumptions about whether the model we wish to explain ( M ) is differentiable or not . In the simplest scenario , where only the masking function is non-differentiable , a number of approaches have attempted to produce gradient estimations with methods other than the score estimator , based on REINFORCE ( Williams , 1992 ) . The most common of these approaches are the straightthrough estimator ( Chang et al. , 2019 ; Chalkidis et al. , 2021 ) and relaxation to binary variables ( Louizos et al. , 2018 ; Bastings et al. , 2019 ; De Cao et al. , 2020 ) which leverages the reparametrization trick ( Kingma & Welling , 2013 ) . Both of these approaches can be used only when the masking function is the only non-differentiable component , i.e. , they require M to be differentiable , thus breaking the model-agnostic nature of the explainer , which is a requirement in MAGNEx . To retain the model-agnostic nature of our formulation and alleviate large computational strain to our method we opt to train our model by estimating gradients for updates to our explainer network with the score estimator ( REINFORCE ) . For training on a single input i we create a multi-variable policy using the output of our explainer . πθ ( i ) = { B ( Eθ ( i ) j ) } |i|j=1 ( 8 ) where B is the Bernoulli distribution . Sampling from this policy is equivalent to sampling from each of the Bernoulli distributions independently . Therefore a sample τ ∼ πθ ( i ) is a sequence of binary variables indicating the presence or the absence of the feature at position j . We train our method using the score estimator which in this case can be written as : ∇θJ ( πθ ( i ) ) = ∇θEτ∼πθ ( i ) [ q ( τ ) ] ( 9 ) Following Williams ( 1992 ) we can rewrite the above gradient in the form : ∇θJ ( πθ ( i ) ) = Eτ∼πθ ( i ) [ ∇θ log P ( τ |i ; θ ) q ( τ ) ] ( 10 ) where P ( τ |i ; θ ) = ∏|i| j=1 P ( τj |πθ ( i ) j ) . We can easily approximate Eq . 10 by Monte-Carlo sampling.2 We further add a baseline in order to reduce the variance of the gradient estimator : ∇θJ ( πθ ) = Eτ∼πθ [ ∇θ log P ( τ |i ; θ ) ( q ( τ ) − b ) ] ( 11 ) In Mnih et al . ( 2014 ) , which bears some similarities to our setting a learned baseline was used . Here , we use a moving average baseline which seems to be sufficient for our use cases . While similar methods relying on differentiable relaxation to binary variables have been shown to outperform REINFORCE in some cases ( Bastings et al. , 2019 ; De Cao et al. , 2020 ) , we choose this gradient estimator for a number of reasons . Firstly , we want our method to remain purely modelagnostic , a requirement which can not be satisfied by the estimators in Bastings et al . ( 2019 ) and De Cao et al . ( 2020 ) which support only differentiable models . Secondly , the fact that the estimator works by simple exposure to a scalar metric ( Eq . 6 ) , which does not need to have a gradient , greatly reduces the space complexity of the method , allowing a higher degree of parallelism on the same hardware , and in practice allowing very complex models to be explained in reasonable time . Lastly , this problem involves constrained optimization . Looking back at the definition of our total metric ( Eq . 6 ) we can see that we are optimizing sparsity subject to sufficiency being higher than some threshold . This objective is therefore non-differentiable and De Cao et al . ( 2020 ) and Bastings et al . ( 2019 ) employ Lagrangian relaxation to approximate the constrained objective in a differentiable manner . This adds a new hyperparameter , the Lagrangian multiplier , which needs to be tuned , adding further overhead to the explainer ’ s development procedure and is in all cases an approximation of the true constrained objective . | This paper proposes a global explainers for black-box models. Original inputs/features are fed in parallel with the black-box model to an explainer model that is in charge of deciding important scores for each feature. Depending on the scores, features are dropped and the remaining input is also bed to the original model. The outputs for the original input and the trimmed version with the explainer's help are compared. The explainer is trained such that the original input and the trimmed version produce similar scores when fed to the original model. In addition, the sparsity of the trimmed input is maximized. The new explainer is compared to LIME and Integrated Gradients in terms of how faithful the produced explanations are (how close the results of the original input and the trimmed one are when passed through the black-box model) and the execution time on three different tasks: image classification, sentiment analysis and question answering. The new explainer produces the results much faster and with similar and sometimes higher quality (as measured by faithfullness). | SP:ba6d62de546f9a52d767665b96790951d046ece8 |
MAGNEx: A Model Agnostic Global Neural Explainer | 1 INTRODUCTION . Black-box decision models have for some time now posed a dilemma between power and interpretability . For use cases where explanations are necessary , the inability of black-box models to supply them is often a deterrent to adoption . However , even in low-risk scenarios this lack of explainability often causes distrust to both the developers and the users of these models , who are often puzzled about how decisions emerge ( Ribeiro et al. , 2016 ) . Also , explainability is an important mechanism when investigating if black-box models act fairly and without bias ( Sun et al. , 2019 ) .1 In this paper , we propose MAGNEx , a model-agnostic neural explainer that globally learns to explain an already trained model , neural or not . In this post-hoc interpretability setting , most methods ( Ribeiro et al. , 2016 ; Sundararajan et al. , 2017 ; Lundberg & Lee , 2017 ; Luo et al. , 2020 ) create feature-based explanations , i.e. , explanations that assign a score to each feature of the input based on how important the feature is to the model ’ s decision . This importance score may rely on some internal mechanism of the model we wish to explain , e.g. , gradients ( Sundararajan et al. , 2017 ; Shrikumar et al. , 2017 ) or attention ( Jain & Wallace , 2019 ; Wiegreffe & Pinter , 2019 ) . Such methods have limitations to the types of model they can explain , e.g. , gradient-based methods work only with differentiable models . Perturbation-based methods , e.g. , LIME ( Ribeiro et al. , 2016 ) , SHAP ( Lundberg & Lee , 2017 ) , drop combinations of features for a specific input to the model and observe its output . Omitted features that have a large impact on the output of the model across perturbations are deemed important , while other features are considered unimportant . This allows perturbation-based methods to be model-agnostic , but adds severe computational complexity , since a large number of perturbations is required per input instance to create quality explanations . The search for an optimal solution by erasure ( feature drop ) is combinatorial and practically infeasible for even small feature spaces ; the search space is the power set of the feature set resulting in a complexity of O ( 2n ) for n features . Therefore , pertubation-based methods find approximate ( sub-optimal ) solutions , but even this process is cumbersome , especially when the input is large ( i.e. , contains many features ) and the explainability method is local ( a different search must be performed for each input instance ) . 1We use explainability and interpretability interchangeably as there is no clear consensus in the literature . MAGNEx also creates feature-based explanations , but contrary to most methods , its explainer is a neural network that globally learns to assign feature importance scores . This is similar to the work of De Cao et al . ( 2020 ) , which relies on gradients to produce feature importance scores ; their explainer is a shallow network directly attached to the model being explained , requiring the gradients to flow through both the explainer and the model . This limits the approach of De Cao et al . ( 2020 ) to explaining only differentiable models , while increasing the memory and computational complexity . Neural explanation modules have also been used in explainable by-design models ( Lei et al. , 2016 ; Bastings et al. , 2019 ; Yu et al. , 2019 ; Chang et al. , 2019 ; Chalkidis et al. , 2021 ) . These models mainly focus on human-centric explainability and jointly train a rationale extractor and a classifier . This setting poses an extra burden on the training procedure and disincentivizes exploring parts of the space of possible solutions the model can arrive to , possibly leading to loss of model performance at the expense of interpretability . MAGNEx disentangles the explainer from the model it wishes to explain , aiming to produce explanations that are faithful , i.e. , accurately reflect the features considered important by the model ( Lipton , 2018 ; Jacovi & Goldberg , 2020 ) . The generated explanations do not have to agree with human annotated rationales ( e.g. , gold text snippets ) , which are often used as an optimal solution in explainable by-design methods . MAGNEx ’ s goal is to faithfully reveal information about a model ’ s inner workings to its developers and if its explanations agree with human intuition , then MAGNEx can also be used as an explanation algorithm for end-users . If the explanations do not agree with human intuition , MAGNEx can reveal weaknesses of the explained model and/or of the data used to train it . For instance , training data may not be diverse enough , allowing a model to overfit to insignificant features in its input . The explainer of MAGNEx is a shallow neural network that attributes scores to input features ( Figure 1 ) . Its training is dictated by a two-fold objective that can be classified under constrained optimization . The scoring of the explainer must be primarily sufficient , i.e. , the explanations when fed to the underlying model must result in the same output ( DeYoung et al. , 2020 ) . Also , among all possible sufficient explanations the explainer is tasked with finding one that is maximally sparse , i.e. , utilizes the minimum number of features ( Lei et al. , 2016 ) . This constrained objective , or a relaxed version of it , has been also used by perturbation-based systems ( De Cao et al. , 2020 ; Ribeiro et al. , 2016 ) . Our contributions are as follows : • We propose MAGNEx a method that explains the inner workings of a pre-trained model in a post-hoc manner . MAGNEx , is completely model agnostic and thus can explain any pre-trained model across modalities ( e.g. , vision , text ) and applications . • The proposed approach is global , allowing MAGNEx to generalize across instances ; learning from many samples has a regularization effect alleviating hindsight bias ( Fischhoff & Beyth , 1975 ) which is a common phenomenon in machine learning problems ( Mahdavi & Rahimian , 2017 ) and more specificaly in perturbation-based explainability ( De Cao et al. , 2020 ) . Also , the global nature of MAGNEx transfers the computationally expensive feature search to the training stage allowing for more efficient inference than its competitors . • The experiments showed that MAGNEx produces explanations of better quality than popular explainability methods ( LIME ( Ribeiro et al. , 2016 ) , IG ( Sundararajan et al. , 2017 ) ) , while also being more stable across instances and much more efficient during inference . 2 METHODOLOGY . 2.1 FORMULATION . Let M : I → O be the model we wish to explain . Each input i ∈ I is a set of input features such that i = { f1 , f2 , . . . , fn } , where n is the number of features . An explainer , E , operates on i and associates each feature in i with an importance score sj ∈ [ 0 , 1 ] for j ∈ { 1 , 2 , . . . , n } : E ( i ) = { s1 , s2 , . . . , sn } ( 1 ) A masking function µ , operates on an input i = { f1 , f2 , . . . , fn } and its corresponding scoring s = { s1 , s2 , . . . , sn } to produce a masked version of i : µ ( i , s ) = { e1 ∈ { f1 , m } , e2 ∈ { f2 , m } , . . . , en ∈ { fn , m } } ( 2 ) where m is a feature which carries no information for M and is chosen according to the task , e.g. , a black pixel in computer vision or a pad token in natural language processing . In practise , µ is realized in different ways in training and inference . During training whether a feature fj will be replaced by m is determined by performing a biased coin flip based on sj ( the score of fj ) , while during inference µ is realized as : µ ( i , s ) j = { fj , if sj > m , otherwise ( 3 ) Given an input i and a scoring s = E ( i ) , we compute the quality of the explainer ’ s scoring in terms of sufficiency ( su ) and sparsity ( sp ) , defined as follows : su = gsu ( M ( i ) , M ( µ ( i , s ) ) ) ( 4 ) sp = gsp ( µ ( i , s ) ) ( 5 ) where , gsu : O×O → [ 0 , 1 ] is a function measuring to what extent the output of M when presented with µ ( i , s ) resembles the output of M when presented with i , and gsp computes the percentage of features which have been replaced with m. Since we opt for maximally sparse inputs with high sufficiency , the total quality score for the explanation is computed as : q = { su + sp , if su > υ su , otherwise ( 6 ) Note that we force explanations that have a sufficiency of at least υ to ensure a minimum quality . Unless otherwise specified , we use a gsu tailored to classification where we assume O = [ 0 , 1 ] c and c is the number of classes . Classification sufficiency is then calculated as : gsu ( y , ŷ ) = 1− ( max ( y ) − ŷp ) ( 7 ) where p = argmax ( y ) is the predicted class in y ∈ O and gsu is bounded in [ 0 , 1 ] with higher scores signaling more faithful explanations . The term max ( y ) − ŷp measures the divergence between the top probability estimate across classes in y and the probability estimate for the same class in ŷ . 2.2 LEARNING . Our explainer is realized as a neural network with parameters θ throughout . We aim to find the optimal values θ∗ which maximize q ( Eq . 6 ) across a number of training examples { i1 , i2 , . . . , im } ⊆ I . However , the standard backpropagation optimization approach falls short in this case since it is impossible to produce gradients to update the explainer . While the explainer itself is differentiable , in order for a sufficiency score to be computed for some input i a hard choice must be made on which features in i to retain and which to substitute with m. The masking function µ is therefore non-differentiable . More importantly , our approach is completely model-agnostic and we make no assumptions about whether the model we wish to explain ( M ) is differentiable or not . In the simplest scenario , where only the masking function is non-differentiable , a number of approaches have attempted to produce gradient estimations with methods other than the score estimator , based on REINFORCE ( Williams , 1992 ) . The most common of these approaches are the straightthrough estimator ( Chang et al. , 2019 ; Chalkidis et al. , 2021 ) and relaxation to binary variables ( Louizos et al. , 2018 ; Bastings et al. , 2019 ; De Cao et al. , 2020 ) which leverages the reparametrization trick ( Kingma & Welling , 2013 ) . Both of these approaches can be used only when the masking function is the only non-differentiable component , i.e. , they require M to be differentiable , thus breaking the model-agnostic nature of the explainer , which is a requirement in MAGNEx . To retain the model-agnostic nature of our formulation and alleviate large computational strain to our method we opt to train our model by estimating gradients for updates to our explainer network with the score estimator ( REINFORCE ) . For training on a single input i we create a multi-variable policy using the output of our explainer . πθ ( i ) = { B ( Eθ ( i ) j ) } |i|j=1 ( 8 ) where B is the Bernoulli distribution . Sampling from this policy is equivalent to sampling from each of the Bernoulli distributions independently . Therefore a sample τ ∼ πθ ( i ) is a sequence of binary variables indicating the presence or the absence of the feature at position j . We train our method using the score estimator which in this case can be written as : ∇θJ ( πθ ( i ) ) = ∇θEτ∼πθ ( i ) [ q ( τ ) ] ( 9 ) Following Williams ( 1992 ) we can rewrite the above gradient in the form : ∇θJ ( πθ ( i ) ) = Eτ∼πθ ( i ) [ ∇θ log P ( τ |i ; θ ) q ( τ ) ] ( 10 ) where P ( τ |i ; θ ) = ∏|i| j=1 P ( τj |πθ ( i ) j ) . We can easily approximate Eq . 10 by Monte-Carlo sampling.2 We further add a baseline in order to reduce the variance of the gradient estimator : ∇θJ ( πθ ) = Eτ∼πθ [ ∇θ log P ( τ |i ; θ ) ( q ( τ ) − b ) ] ( 11 ) In Mnih et al . ( 2014 ) , which bears some similarities to our setting a learned baseline was used . Here , we use a moving average baseline which seems to be sufficient for our use cases . While similar methods relying on differentiable relaxation to binary variables have been shown to outperform REINFORCE in some cases ( Bastings et al. , 2019 ; De Cao et al. , 2020 ) , we choose this gradient estimator for a number of reasons . Firstly , we want our method to remain purely modelagnostic , a requirement which can not be satisfied by the estimators in Bastings et al . ( 2019 ) and De Cao et al . ( 2020 ) which support only differentiable models . Secondly , the fact that the estimator works by simple exposure to a scalar metric ( Eq . 6 ) , which does not need to have a gradient , greatly reduces the space complexity of the method , allowing a higher degree of parallelism on the same hardware , and in practice allowing very complex models to be explained in reasonable time . Lastly , this problem involves constrained optimization . Looking back at the definition of our total metric ( Eq . 6 ) we can see that we are optimizing sparsity subject to sufficiency being higher than some threshold . This objective is therefore non-differentiable and De Cao et al . ( 2020 ) and Bastings et al . ( 2019 ) employ Lagrangian relaxation to approximate the constrained objective in a differentiable manner . This adds a new hyperparameter , the Lagrangian multiplier , which needs to be tuned , adding further overhead to the explainer ’ s development procedure and is in all cases an approximation of the true constrained objective . | This paper proposes a global model-agnostic explanation method. The method relies on a neural model that learns to predict which input features are important for the original model’s predictions. Through substantial experimentation, the authors demonstrate that their approach outperforms LIME and Integrated Gradients. They compare between explanation methods in terms of the faithfulness of its explanations and in computational complexity. The main contribution of this paper is MAGNEx, a neural model-agnostic explanation method that is substantially faster than popular methods on high-dimensional inputs. | SP:ba6d62de546f9a52d767665b96790951d046ece8 |
On Covariate Shift of Latent Confounders in Imitation and Reinforcement Learning | 1 INTRODUCTION . Reinforcement Learning ( RL ) is increasingly used across many fields to create agents that learn via interaction and reward feedback . In many such cases , we rely on experts to perform certain tasks , integrating their knowledge to improve learning efficiency and overall performance . Imitation Learning ( IL , Hussein et al . ( 2017 ) ) is concerned with learning via expert demonstrations without access to a reward function . Similarly , RL settings often use expert data to boost performance , eliminating the need to learn from scratch . In this work we consider the IL and RL paradigms in the presence of partially observable expert data . While expert demonstration data is useful , in many realistic settings such data may be prone to hidden confounding ( Gottesman et al. , 2019 ) , i.e. , there may be features used by the expert which are not observed by the learning agent . This can occur due to , e.g. , privacy constraints , continually changing features in ongoing production pipelines , or when not all information available to the human expert was recorded . As we show in our work , covariate shift of unobserved factors between the expert data and the real world may lead to significant negative impact on performance , frequently rendering the data useless for imitation ( see Figure 1 and Theorem 2 ) . In this paper we define the tasks of imitation and reinforcement learning using expert data with unobserved confounders and possible covariate shift . We focus on a contextual MDP setting ( Hallak et al. , 2015 ) , where a context is sampled at every episode from some distribution , affecting both the reward and the transition between states . We assume that the agent has access to additional expert data , generated by an optimal policy , for which the sampled context is missing , yet is observed in the online environment . We begin by analyzing the imitation-learning problem , ( i.e. , without access to reward ) in Section 3 . Under no covariate shift in the unobserved context , we characterize a sufficient and necessary set of optimal policies . In contrast , we prove that in the presence of a covariate shift , if the true reward depends on the context , then the imitation-learning problem is non-identifiable and prone to catastrophic errors ( see Section 3.2 and Theorem 2 ) . We further analyze the RL setting ( i.e. , with access to reward and confounded expert data ) in Section 4 . Figure 1 depicts a possible failure case of using confounded expert data with unknown covariate shift in a dressing task . Unlike the imitation setting , we show that optimality can still be achieved in the RL setting while using confounded expert data with arbitrary covariate shift . We use a corrective data sampling procedure and prove convergence to an optimal policy . Our contributions are as follows . ( 1 ) We introduce IL and RL with hidden confounding and prove fundamental characteristics w.r.t . covariate shift and the feasibility of imitation . ( 2 ) In the RL setting , under arbitrary covariate shift , we provide a novel algorithm with convergence guarantees which uses a corrective sampling technique to account for the unknown context distribution in the expert data . ( 3 ) Finally , we conduct extensive experiments on recommender system ( Ie et al. , 2019 ) and assistive-healthcare ( Erickson et al. , 2020 ) environments , demonstrating our theoretical results , and suggesting that confounded expert data can be used in a controlled manner to improve the efficiency and performance of RL agents . 2 PRELIMINARIES Online Environment . We consider a contextual MDP ( Hallak et al. , 2015 ) defined by the tuple M = ( S , X , A , P , r , ρo , ν , γ ) , where S is the state space , X is the context space , A is the action space , P : S × S × A ×X 7→ [ 0 , 1 ] is the context dependent transition kernel , r : S × A ×X 7→ [ 0 , 1 ] is the context dependent reward function , and γ ∈ ( 0 , 1 ) is the discount factor . We assume an initial distribution over contexts ρo : X 7→ [ 0 , 1 ] and an initial state distribution ν : S × X 7→ [ 0 , 1 ] . The environment initializes at some context x ∼ ρo ( · ) , and state s0 ∼ ν ( ·|x ) . At time t , the environment is at state st ∈ S and an agent selects an action at ∈ A . The agent receives a reward rt = r ( st , at , x ) and the environment then transitions to state st+1 ∼ P ( ·|st , at , x ) . We define a Markovian stationary policy π as a mapping π : S × X × A 7→ [ 0 , 1 ] , such that π ( ·|s , x ) is the action sampling probability . We define the value of a policy π by vM ( π ) = Eπ [ ( 1− γ ) ∑∞ t=0 γ tr ( st , at , x ) | x ∼ ρo , s0 ∼ ν ( · | x ) ] , where Eπ denotes the expectation induced by the policy π . We denote by Π the set of all Markovian policies and Πdet the set of deterministic Markovian policies . We define the optimal value and policy by v∗M = maxπ∈Π vM ( π ) , and π ∗ M ∈ arg maxπ∈Π vM ( π ) , respectively . Whenever appropriate , we simplify notation and write v∗ , π∗ . We use Π∗M to denote the set of optimal policies inM , i.e. , Π∗M = arg maxπ∈Π vM ( π ) . We also define the set of catastrophic policies Π † M as the set Π†M = arg min π∈Π vM ( π ) . ( 1 ) We later use this set to show impossibility of imitation under arbitrary covariate shift and a contextindependent transition function . Expert Data with Unobserved Confounders . We assume additional access to a confounded dataset consisting of expert trajectories D∗ = { ( si0 , a i 0 , s i 1 , a i 1 , . . . , s i H , a i H ) } n i=1 , where aij ∼ π∗ ∈ Π∗M . The trajectories in the dataset were sampled i.i.d . from the marginalized expert distribution ( under possible context covariate shift ) P ∗ ( s0 , a0 , s1 , a1 , . . . , sH ) = ∑ x ρe ( x ) ν ( s0|x ) ∏H−1 t=0 P ( st+1|st , at , x ) π∗ ( at|st , x ) , where ρe is some distribution over contexts . Importantly , ρe does not necessarily equal ρo – the distribution of contexts in the online environment . Notice that it is assumed that π∗ that generated the data had access to the context xi ( i.e. , π∗ is context-dependent ) , though it is missing in the data . In this work , we consider two settings : 1 . Confounded Imitation Learning ( Section 3 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment ( S , X , A , P , ρo , ν , γ ) , without access to reward . 2 . Reinforcement Learning with Confounded Expert Data ( Section 4 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment M = ( S , X , A , P , r , ρo , ν , γ ) , with access to reward . In both settings we aim to find a context-dependent policy which maximizes the cumulative reward . The confounding factor here is w.r.t . the unobserved context and distribution ρe in the offline data . Marginalized State Action Distribution . We denote the state-action frequency of a policy π ∈ Π given context x ∈ X by dπ ( s , a|x ) = ( 1 − γ ) ∑∞ t=0 γ tPπ ( st = s , at = a|x , s0 ∼ ν ( ·|x ) ) , where Pπ denotes the probability measure induced by π . Similarly , given a distribution over contexts , we define the marginalized state-action frequency of a policy π under the corresponding context distribution by dπρo ( s , a ) = Ex∼ρo [ d π ( s , a | x ) ] ( online environment ) , dπ ∗ ρe ( s , a ) = Ex∼ρe [ dπ ∗ ( s , a | x ) ] ( offline expert data ) . A Causal Perspective . Our work sits at an intersection between the fields of RL and Causal Inference ( CI ) . We believe it is essential to bridge the gap between these two fields , and include an interpretation of our model using CI terminology in Appendix D , where we equivalently define our objective as an intervention over the unknown distribution ρe in a specified Structural Causal Model , as depicted in Figure 2 . 3 IMITATION LEARNING WITH UNOBSERVED CONFOUNDERS . In this section , we analyze the problem of confounded imitation learning , namely , learning from expert trajectories with hidden confounders and without reward . Similar to previous work , we consider the task of imitation learning from expert data in the setting where the agent is allowed to interact with the environment ( Ho & Ermon , 2016 ; Fu et al. , 2017 ; Kostrikov et al. , 2019 ; Brantley et al. , 2019 ) . In the first part of this section we assume no covariate shift between the online environment and the data is present , i.e. , ρe = ρo . We lift this assumption in the second part , where we focus on the covariate shift of the hidden confounders . 3.1 NO COVARIATE SHIFT : ρo = ρe We first consider the scenario in which no covariate shift is present between the offline data and the online environment , i.e. , ρo = ρe . We begin by defining the marginalized ambiguity set , a central component of our work . Definition 1 . For π ∈ Π , we define the set of deterministic policies that match the marginalized state-action frequency of π by Υπ = { π′ ∈ Πdet : dπ ′ ρo ( s , a ) = d π ρe ( s , a ) ∀ s ∈ S , a ∈ A } . Recall that , in general , π∗ ∈ Π∗M may depend on the context x ∈ X . Therefore , the set Υπ∗ corresponds to all deterministic policies that can not be distinguished from π∗ based on the observed expert data . The following theorem shows that for any policy π∗ ∈ Π∗M and any policy π0 ∈ Υπ∗ , one could design a reward function r0 , for which π0 is optimal , while the set Υπ∗ is indiscernible from Υπ0 , i.e. , Υπ∗ = Υπ0 ( see Appendix F for proof ) . In other words , Υπ∗ is the smallest set of candidate optimal policies . Theorem 1 . [ Sufficiency of Υπ∗ ] Assume ρe ≡ ρo . Let π∗ ∈ Π∗M and let π0 ∈ Υπ∗ . Then , Υπ∗ = Υπ0 . Moreover , if π0 6= π∗ , then there exists r0 such that π0 ∈ Π∗M0 but π ∗ /∈ Π∗M0 , where M0 = ( S , A , X , P , r0 , ρo , ν , γ ) . The above theorem shows that any policy in Υπ∗ is a candidate optimal policy , yet without knowing the context the expert used . Such ambiguity can result in selection of a suboptimal or even catastrophic policy . We provide a practical algorithm in Appendix B which calculates the ambiguity set Υπ∗ , and returns an average policy , with computational guarantees . In the next subsection we analyze a more challenging scenario , for which ρo 6= ρe . In this case , Υπ∗ may not be sufficient for the imitation problem . 3.2 WITH COVARIATE SHIFT : ρo 6= ρe Next , we assume covariate shift exists between the online environment and the expert data , i.e. , ρo 6= ρe . Particularly , without further assumptions on the extent of covariate shift , we show two extremes of the problem . In Theorem 2 we prove that whenever the transitions are independent of the context , the data can not in general be used for imitation . In contrast , in Theorem 3 we prove that , whenever the reward is independent of the context , the imitation problem can be efficiently solved . Clearly , if Supp ( ρo ) 6⊆ Supp ( ρe ) 1 then there exists x ∈ Supp ( ρo ) for which π∗ is not identifiable from the expert data2 . We therefore assume throughout that Supp ( ρo ) ⊆ Supp ( ρe ) . We begin by defining the set of non-identifiable policies as those that can not be distinguished from their respective state-action frequencies without information on ρe . Definition 2 . We say that { πi } ki=1 are non-identifiable policies if there exist { ρi } k i=1 such that dπiρi ( s , a ) = d πj ρj ( s , a ) for all i 6= j . Next , focusing on catastrophic policies ( recall Equation ( 1 ) ) , we define catastrophic expert policies as those which could be either optimal or catastrophic under ρo for different reward functions . Definition 3 . We say that { πi } ki=1 are catastrophic expert policies if there exist { ri } k i=1 such that for all i , πi ∈ Π∗Mi , and ∃j ∈ [ k ] , j 6= i such that πi ∈ Π † Mj , whereMj = ( S , X , A , P , rj , ρo , ν , γ ) . Using the fact that both ρe and r are unknown , the following theorem shows that whenever P ( s′|s , a , x ) is independent of x , one could find two policies which are non-identifiable , catastrophic expert policies ( see Appendix F for proof ) . In other words , in the case of context-independent transitions , without further information on ρe or r the expert data is useless for imitation . Furthermore , attempting to imitate the policy using the expert data could result in a catastrophic policy . Theorem 2 . [ Catastrophic Imitation ] Assume |X | ≥ |A| , and P ( s′|s , a , x ) = P ( s′|s , a , x′ ) for all x , x′ ∈ X . Then ∃πe,1 , πe,2 s.t . { πe,1 , πe,2 } are non-identifiable , catastrophic expert policies . 1For a distribution P we denote by Supp ( P ) the support of P. 2We define non-identifiability in Definition 2 . We use a similar notion of identifiability as in Pearl ( 2009b ) While Theorem 2 shows the impossibility of imitation for context-free transitions , whenever the reward is independent of the context , the imitation problem becomes feasible . In fact , as we show in the following theorem , for context-free rewards , any policy in Υπ∗ is an optimal policy . Theorem 3 . [ Sufficiency of Context-Free Reward ] Assume Supp ( ρo ) ⊆ Supp ( ρe ) and r ( s , a , x ) = r ( s , a , x′ ) for all x , x′ ∈ X . Then Υπ∗ ⊆ Π∗M . Theorems 2 and 3 suggest that the hardness of the imitation problem under covariate shift lies on a wide spectrum ( as depicted in Figure 3 ) . While dependence of the transition P ( s′|s , a , x ) on x provides us with information to identify x in the expert data , the dependence of the reward r ( s , a , x ) on x increases the degree of confounding in the imitation problem . Both of these results are concerned with arbitrary confounding . Bounded Confounding : A Sensitivity Perspective . A common approach in causal inference is to bound the bias of unobserved confounding through sensitivity analysis ( Hsu & Small , 2013 ; Namkoong et al. , 2020 ; Kallus & Zhou , 2021 ) . In our setting , this confounding bias occurs due to a covariate shift of the unobserved covariates . As we ’ ve shown in Theorem 2 , though these covariates are observed in the online environment , their shifted and unobserved distribution in the offline data can render catastrophic results . Therefore , we consider the odds-ratio bounds of the sensitivity in distribution between the online environment and the expert data , as stated formally below . Assumption 1 ( Bounded Sensitivity ) . We assume that Supp ( ρe ) ⊆ Supp ( ρo ) and that there exists some Γ ≥ 1 such that for all x ∈ Supp ( ρe ) , Γ−1 ≤ ρo ( x ) ( 1−ρe ( x ) ) ρe ( x ) ( 1−ρo ( x ) ) ≤ Γ . Next , we define the notion of δ-ambiguity , a generalization of the ambiguity set in Definition 1 . Definition 4 ( δ-Ambiguity Set ) . For a policy π ∈ Π , we define the set of all deterministic policies that are δ-close to π by Υδπ = { π′ ∈ Πdet : ∣∣∣dπ′ρo ( s , a ) − dπρe ( s , a ) ∣∣∣ < δ , s ∈ S , a ∈ A } . Similar to Definition 1 , the δ-ambiguity set considers all deterministic policies with a marginalized state-action frequency of distance at most δ from π . The following results shows that ΥΓ−1π∗ is a sufficient set of candidate optimal policies , as long as Assumption 2 holds for some Γ ≥ 1 . Theorem 4 . [ Sufficiency of ΥΓ−1π∗ ] Let Assumption 2 hold for some Γ ≥ 1 . Then π∗ ∈ ΥΓ−1π∗ . For the interested reader , we further analyze the case of bounded confounding in Appendix C. We also demonstrate the effect of bounded confounding in Section 5 . In the following section , we show that , while arbitrary confounding may result in catastrophic results for the imitation learning problem , when coupled with reward , one can still make use of the expert data . | The authors considered the problem of imitation and reinforcement learning in the setting of contextual MDP with latent confounders. They defined an ambiguity set, i.e., the set of all deterministic policies that match the marginalized stationary distributions of a given policy. In imitation learning, in the case of no covariate shift, no policy in the ambiguity set of optimal policy can be ruled out. Moreover, they showed that acting uniformly with respect to this set results in a policy that is better than the worst policy in the set. In the case of having covariate shift, the authors showed that imitating the policy of the expert might result in a catastrophic policy if the transition probabilities are context-free. However, if the reward function is independent of context, then the problem of imitation learning becomes feasible. Moreover, the case of bounded confounding is studied in the appendix. In particular, it is shown that under some conditions, the optimal policy is in a \delta-ambiguity set. Finally, in the problem of RL, the proposed algorithm converges to the optimal policy using corrective trajectory sampling. | SP:c01af121743e1bc7ddd7de789a134e1f821e8f78 |
On Covariate Shift of Latent Confounders in Imitation and Reinforcement Learning | 1 INTRODUCTION . Reinforcement Learning ( RL ) is increasingly used across many fields to create agents that learn via interaction and reward feedback . In many such cases , we rely on experts to perform certain tasks , integrating their knowledge to improve learning efficiency and overall performance . Imitation Learning ( IL , Hussein et al . ( 2017 ) ) is concerned with learning via expert demonstrations without access to a reward function . Similarly , RL settings often use expert data to boost performance , eliminating the need to learn from scratch . In this work we consider the IL and RL paradigms in the presence of partially observable expert data . While expert demonstration data is useful , in many realistic settings such data may be prone to hidden confounding ( Gottesman et al. , 2019 ) , i.e. , there may be features used by the expert which are not observed by the learning agent . This can occur due to , e.g. , privacy constraints , continually changing features in ongoing production pipelines , or when not all information available to the human expert was recorded . As we show in our work , covariate shift of unobserved factors between the expert data and the real world may lead to significant negative impact on performance , frequently rendering the data useless for imitation ( see Figure 1 and Theorem 2 ) . In this paper we define the tasks of imitation and reinforcement learning using expert data with unobserved confounders and possible covariate shift . We focus on a contextual MDP setting ( Hallak et al. , 2015 ) , where a context is sampled at every episode from some distribution , affecting both the reward and the transition between states . We assume that the agent has access to additional expert data , generated by an optimal policy , for which the sampled context is missing , yet is observed in the online environment . We begin by analyzing the imitation-learning problem , ( i.e. , without access to reward ) in Section 3 . Under no covariate shift in the unobserved context , we characterize a sufficient and necessary set of optimal policies . In contrast , we prove that in the presence of a covariate shift , if the true reward depends on the context , then the imitation-learning problem is non-identifiable and prone to catastrophic errors ( see Section 3.2 and Theorem 2 ) . We further analyze the RL setting ( i.e. , with access to reward and confounded expert data ) in Section 4 . Figure 1 depicts a possible failure case of using confounded expert data with unknown covariate shift in a dressing task . Unlike the imitation setting , we show that optimality can still be achieved in the RL setting while using confounded expert data with arbitrary covariate shift . We use a corrective data sampling procedure and prove convergence to an optimal policy . Our contributions are as follows . ( 1 ) We introduce IL and RL with hidden confounding and prove fundamental characteristics w.r.t . covariate shift and the feasibility of imitation . ( 2 ) In the RL setting , under arbitrary covariate shift , we provide a novel algorithm with convergence guarantees which uses a corrective sampling technique to account for the unknown context distribution in the expert data . ( 3 ) Finally , we conduct extensive experiments on recommender system ( Ie et al. , 2019 ) and assistive-healthcare ( Erickson et al. , 2020 ) environments , demonstrating our theoretical results , and suggesting that confounded expert data can be used in a controlled manner to improve the efficiency and performance of RL agents . 2 PRELIMINARIES Online Environment . We consider a contextual MDP ( Hallak et al. , 2015 ) defined by the tuple M = ( S , X , A , P , r , ρo , ν , γ ) , where S is the state space , X is the context space , A is the action space , P : S × S × A ×X 7→ [ 0 , 1 ] is the context dependent transition kernel , r : S × A ×X 7→ [ 0 , 1 ] is the context dependent reward function , and γ ∈ ( 0 , 1 ) is the discount factor . We assume an initial distribution over contexts ρo : X 7→ [ 0 , 1 ] and an initial state distribution ν : S × X 7→ [ 0 , 1 ] . The environment initializes at some context x ∼ ρo ( · ) , and state s0 ∼ ν ( ·|x ) . At time t , the environment is at state st ∈ S and an agent selects an action at ∈ A . The agent receives a reward rt = r ( st , at , x ) and the environment then transitions to state st+1 ∼ P ( ·|st , at , x ) . We define a Markovian stationary policy π as a mapping π : S × X × A 7→ [ 0 , 1 ] , such that π ( ·|s , x ) is the action sampling probability . We define the value of a policy π by vM ( π ) = Eπ [ ( 1− γ ) ∑∞ t=0 γ tr ( st , at , x ) | x ∼ ρo , s0 ∼ ν ( · | x ) ] , where Eπ denotes the expectation induced by the policy π . We denote by Π the set of all Markovian policies and Πdet the set of deterministic Markovian policies . We define the optimal value and policy by v∗M = maxπ∈Π vM ( π ) , and π ∗ M ∈ arg maxπ∈Π vM ( π ) , respectively . Whenever appropriate , we simplify notation and write v∗ , π∗ . We use Π∗M to denote the set of optimal policies inM , i.e. , Π∗M = arg maxπ∈Π vM ( π ) . We also define the set of catastrophic policies Π † M as the set Π†M = arg min π∈Π vM ( π ) . ( 1 ) We later use this set to show impossibility of imitation under arbitrary covariate shift and a contextindependent transition function . Expert Data with Unobserved Confounders . We assume additional access to a confounded dataset consisting of expert trajectories D∗ = { ( si0 , a i 0 , s i 1 , a i 1 , . . . , s i H , a i H ) } n i=1 , where aij ∼ π∗ ∈ Π∗M . The trajectories in the dataset were sampled i.i.d . from the marginalized expert distribution ( under possible context covariate shift ) P ∗ ( s0 , a0 , s1 , a1 , . . . , sH ) = ∑ x ρe ( x ) ν ( s0|x ) ∏H−1 t=0 P ( st+1|st , at , x ) π∗ ( at|st , x ) , where ρe is some distribution over contexts . Importantly , ρe does not necessarily equal ρo – the distribution of contexts in the online environment . Notice that it is assumed that π∗ that generated the data had access to the context xi ( i.e. , π∗ is context-dependent ) , though it is missing in the data . In this work , we consider two settings : 1 . Confounded Imitation Learning ( Section 3 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment ( S , X , A , P , ρo , ν , γ ) , without access to reward . 2 . Reinforcement Learning with Confounded Expert Data ( Section 4 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment M = ( S , X , A , P , r , ρo , ν , γ ) , with access to reward . In both settings we aim to find a context-dependent policy which maximizes the cumulative reward . The confounding factor here is w.r.t . the unobserved context and distribution ρe in the offline data . Marginalized State Action Distribution . We denote the state-action frequency of a policy π ∈ Π given context x ∈ X by dπ ( s , a|x ) = ( 1 − γ ) ∑∞ t=0 γ tPπ ( st = s , at = a|x , s0 ∼ ν ( ·|x ) ) , where Pπ denotes the probability measure induced by π . Similarly , given a distribution over contexts , we define the marginalized state-action frequency of a policy π under the corresponding context distribution by dπρo ( s , a ) = Ex∼ρo [ d π ( s , a | x ) ] ( online environment ) , dπ ∗ ρe ( s , a ) = Ex∼ρe [ dπ ∗ ( s , a | x ) ] ( offline expert data ) . A Causal Perspective . Our work sits at an intersection between the fields of RL and Causal Inference ( CI ) . We believe it is essential to bridge the gap between these two fields , and include an interpretation of our model using CI terminology in Appendix D , where we equivalently define our objective as an intervention over the unknown distribution ρe in a specified Structural Causal Model , as depicted in Figure 2 . 3 IMITATION LEARNING WITH UNOBSERVED CONFOUNDERS . In this section , we analyze the problem of confounded imitation learning , namely , learning from expert trajectories with hidden confounders and without reward . Similar to previous work , we consider the task of imitation learning from expert data in the setting where the agent is allowed to interact with the environment ( Ho & Ermon , 2016 ; Fu et al. , 2017 ; Kostrikov et al. , 2019 ; Brantley et al. , 2019 ) . In the first part of this section we assume no covariate shift between the online environment and the data is present , i.e. , ρe = ρo . We lift this assumption in the second part , where we focus on the covariate shift of the hidden confounders . 3.1 NO COVARIATE SHIFT : ρo = ρe We first consider the scenario in which no covariate shift is present between the offline data and the online environment , i.e. , ρo = ρe . We begin by defining the marginalized ambiguity set , a central component of our work . Definition 1 . For π ∈ Π , we define the set of deterministic policies that match the marginalized state-action frequency of π by Υπ = { π′ ∈ Πdet : dπ ′ ρo ( s , a ) = d π ρe ( s , a ) ∀ s ∈ S , a ∈ A } . Recall that , in general , π∗ ∈ Π∗M may depend on the context x ∈ X . Therefore , the set Υπ∗ corresponds to all deterministic policies that can not be distinguished from π∗ based on the observed expert data . The following theorem shows that for any policy π∗ ∈ Π∗M and any policy π0 ∈ Υπ∗ , one could design a reward function r0 , for which π0 is optimal , while the set Υπ∗ is indiscernible from Υπ0 , i.e. , Υπ∗ = Υπ0 ( see Appendix F for proof ) . In other words , Υπ∗ is the smallest set of candidate optimal policies . Theorem 1 . [ Sufficiency of Υπ∗ ] Assume ρe ≡ ρo . Let π∗ ∈ Π∗M and let π0 ∈ Υπ∗ . Then , Υπ∗ = Υπ0 . Moreover , if π0 6= π∗ , then there exists r0 such that π0 ∈ Π∗M0 but π ∗ /∈ Π∗M0 , where M0 = ( S , A , X , P , r0 , ρo , ν , γ ) . The above theorem shows that any policy in Υπ∗ is a candidate optimal policy , yet without knowing the context the expert used . Such ambiguity can result in selection of a suboptimal or even catastrophic policy . We provide a practical algorithm in Appendix B which calculates the ambiguity set Υπ∗ , and returns an average policy , with computational guarantees . In the next subsection we analyze a more challenging scenario , for which ρo 6= ρe . In this case , Υπ∗ may not be sufficient for the imitation problem . 3.2 WITH COVARIATE SHIFT : ρo 6= ρe Next , we assume covariate shift exists between the online environment and the expert data , i.e. , ρo 6= ρe . Particularly , without further assumptions on the extent of covariate shift , we show two extremes of the problem . In Theorem 2 we prove that whenever the transitions are independent of the context , the data can not in general be used for imitation . In contrast , in Theorem 3 we prove that , whenever the reward is independent of the context , the imitation problem can be efficiently solved . Clearly , if Supp ( ρo ) 6⊆ Supp ( ρe ) 1 then there exists x ∈ Supp ( ρo ) for which π∗ is not identifiable from the expert data2 . We therefore assume throughout that Supp ( ρo ) ⊆ Supp ( ρe ) . We begin by defining the set of non-identifiable policies as those that can not be distinguished from their respective state-action frequencies without information on ρe . Definition 2 . We say that { πi } ki=1 are non-identifiable policies if there exist { ρi } k i=1 such that dπiρi ( s , a ) = d πj ρj ( s , a ) for all i 6= j . Next , focusing on catastrophic policies ( recall Equation ( 1 ) ) , we define catastrophic expert policies as those which could be either optimal or catastrophic under ρo for different reward functions . Definition 3 . We say that { πi } ki=1 are catastrophic expert policies if there exist { ri } k i=1 such that for all i , πi ∈ Π∗Mi , and ∃j ∈ [ k ] , j 6= i such that πi ∈ Π † Mj , whereMj = ( S , X , A , P , rj , ρo , ν , γ ) . Using the fact that both ρe and r are unknown , the following theorem shows that whenever P ( s′|s , a , x ) is independent of x , one could find two policies which are non-identifiable , catastrophic expert policies ( see Appendix F for proof ) . In other words , in the case of context-independent transitions , without further information on ρe or r the expert data is useless for imitation . Furthermore , attempting to imitate the policy using the expert data could result in a catastrophic policy . Theorem 2 . [ Catastrophic Imitation ] Assume |X | ≥ |A| , and P ( s′|s , a , x ) = P ( s′|s , a , x′ ) for all x , x′ ∈ X . Then ∃πe,1 , πe,2 s.t . { πe,1 , πe,2 } are non-identifiable , catastrophic expert policies . 1For a distribution P we denote by Supp ( P ) the support of P. 2We define non-identifiability in Definition 2 . We use a similar notion of identifiability as in Pearl ( 2009b ) While Theorem 2 shows the impossibility of imitation for context-free transitions , whenever the reward is independent of the context , the imitation problem becomes feasible . In fact , as we show in the following theorem , for context-free rewards , any policy in Υπ∗ is an optimal policy . Theorem 3 . [ Sufficiency of Context-Free Reward ] Assume Supp ( ρo ) ⊆ Supp ( ρe ) and r ( s , a , x ) = r ( s , a , x′ ) for all x , x′ ∈ X . Then Υπ∗ ⊆ Π∗M . Theorems 2 and 3 suggest that the hardness of the imitation problem under covariate shift lies on a wide spectrum ( as depicted in Figure 3 ) . While dependence of the transition P ( s′|s , a , x ) on x provides us with information to identify x in the expert data , the dependence of the reward r ( s , a , x ) on x increases the degree of confounding in the imitation problem . Both of these results are concerned with arbitrary confounding . Bounded Confounding : A Sensitivity Perspective . A common approach in causal inference is to bound the bias of unobserved confounding through sensitivity analysis ( Hsu & Small , 2013 ; Namkoong et al. , 2020 ; Kallus & Zhou , 2021 ) . In our setting , this confounding bias occurs due to a covariate shift of the unobserved covariates . As we ’ ve shown in Theorem 2 , though these covariates are observed in the online environment , their shifted and unobserved distribution in the offline data can render catastrophic results . Therefore , we consider the odds-ratio bounds of the sensitivity in distribution between the online environment and the expert data , as stated formally below . Assumption 1 ( Bounded Sensitivity ) . We assume that Supp ( ρe ) ⊆ Supp ( ρo ) and that there exists some Γ ≥ 1 such that for all x ∈ Supp ( ρe ) , Γ−1 ≤ ρo ( x ) ( 1−ρe ( x ) ) ρe ( x ) ( 1−ρo ( x ) ) ≤ Γ . Next , we define the notion of δ-ambiguity , a generalization of the ambiguity set in Definition 1 . Definition 4 ( δ-Ambiguity Set ) . For a policy π ∈ Π , we define the set of all deterministic policies that are δ-close to π by Υδπ = { π′ ∈ Πdet : ∣∣∣dπ′ρo ( s , a ) − dπρe ( s , a ) ∣∣∣ < δ , s ∈ S , a ∈ A } . Similar to Definition 1 , the δ-ambiguity set considers all deterministic policies with a marginalized state-action frequency of distance at most δ from π . The following results shows that ΥΓ−1π∗ is a sufficient set of candidate optimal policies , as long as Assumption 2 holds for some Γ ≥ 1 . Theorem 4 . [ Sufficiency of ΥΓ−1π∗ ] Let Assumption 2 hold for some Γ ≥ 1 . Then π∗ ∈ ΥΓ−1π∗ . For the interested reader , we further analyze the case of bounded confounding in Appendix C. We also demonstrate the effect of bounded confounding in Section 5 . In the following section , we show that , while arbitrary confounding may result in catastrophic results for the imitation learning problem , when coupled with reward , one can still make use of the expert data . | The paper studies how to incoporate expert data with covariate shift, defined in a contextual MDP where expert data comes from a different context distribution and where the expert contexts are unobserved. The paper provides limited theoretical results for pure imitation based on state-action marginals only, in particular showing that matching state-aciton marginals alone can lead to arbitrarily bad policies with covariate shift in the contexts. They also propose a hybrid RL-imitation algorithm that utilizes the expert data without allowing it to bias the final solution. | SP:c01af121743e1bc7ddd7de789a134e1f821e8f78 |
On Covariate Shift of Latent Confounders in Imitation and Reinforcement Learning | 1 INTRODUCTION . Reinforcement Learning ( RL ) is increasingly used across many fields to create agents that learn via interaction and reward feedback . In many such cases , we rely on experts to perform certain tasks , integrating their knowledge to improve learning efficiency and overall performance . Imitation Learning ( IL , Hussein et al . ( 2017 ) ) is concerned with learning via expert demonstrations without access to a reward function . Similarly , RL settings often use expert data to boost performance , eliminating the need to learn from scratch . In this work we consider the IL and RL paradigms in the presence of partially observable expert data . While expert demonstration data is useful , in many realistic settings such data may be prone to hidden confounding ( Gottesman et al. , 2019 ) , i.e. , there may be features used by the expert which are not observed by the learning agent . This can occur due to , e.g. , privacy constraints , continually changing features in ongoing production pipelines , or when not all information available to the human expert was recorded . As we show in our work , covariate shift of unobserved factors between the expert data and the real world may lead to significant negative impact on performance , frequently rendering the data useless for imitation ( see Figure 1 and Theorem 2 ) . In this paper we define the tasks of imitation and reinforcement learning using expert data with unobserved confounders and possible covariate shift . We focus on a contextual MDP setting ( Hallak et al. , 2015 ) , where a context is sampled at every episode from some distribution , affecting both the reward and the transition between states . We assume that the agent has access to additional expert data , generated by an optimal policy , for which the sampled context is missing , yet is observed in the online environment . We begin by analyzing the imitation-learning problem , ( i.e. , without access to reward ) in Section 3 . Under no covariate shift in the unobserved context , we characterize a sufficient and necessary set of optimal policies . In contrast , we prove that in the presence of a covariate shift , if the true reward depends on the context , then the imitation-learning problem is non-identifiable and prone to catastrophic errors ( see Section 3.2 and Theorem 2 ) . We further analyze the RL setting ( i.e. , with access to reward and confounded expert data ) in Section 4 . Figure 1 depicts a possible failure case of using confounded expert data with unknown covariate shift in a dressing task . Unlike the imitation setting , we show that optimality can still be achieved in the RL setting while using confounded expert data with arbitrary covariate shift . We use a corrective data sampling procedure and prove convergence to an optimal policy . Our contributions are as follows . ( 1 ) We introduce IL and RL with hidden confounding and prove fundamental characteristics w.r.t . covariate shift and the feasibility of imitation . ( 2 ) In the RL setting , under arbitrary covariate shift , we provide a novel algorithm with convergence guarantees which uses a corrective sampling technique to account for the unknown context distribution in the expert data . ( 3 ) Finally , we conduct extensive experiments on recommender system ( Ie et al. , 2019 ) and assistive-healthcare ( Erickson et al. , 2020 ) environments , demonstrating our theoretical results , and suggesting that confounded expert data can be used in a controlled manner to improve the efficiency and performance of RL agents . 2 PRELIMINARIES Online Environment . We consider a contextual MDP ( Hallak et al. , 2015 ) defined by the tuple M = ( S , X , A , P , r , ρo , ν , γ ) , where S is the state space , X is the context space , A is the action space , P : S × S × A ×X 7→ [ 0 , 1 ] is the context dependent transition kernel , r : S × A ×X 7→ [ 0 , 1 ] is the context dependent reward function , and γ ∈ ( 0 , 1 ) is the discount factor . We assume an initial distribution over contexts ρo : X 7→ [ 0 , 1 ] and an initial state distribution ν : S × X 7→ [ 0 , 1 ] . The environment initializes at some context x ∼ ρo ( · ) , and state s0 ∼ ν ( ·|x ) . At time t , the environment is at state st ∈ S and an agent selects an action at ∈ A . The agent receives a reward rt = r ( st , at , x ) and the environment then transitions to state st+1 ∼ P ( ·|st , at , x ) . We define a Markovian stationary policy π as a mapping π : S × X × A 7→ [ 0 , 1 ] , such that π ( ·|s , x ) is the action sampling probability . We define the value of a policy π by vM ( π ) = Eπ [ ( 1− γ ) ∑∞ t=0 γ tr ( st , at , x ) | x ∼ ρo , s0 ∼ ν ( · | x ) ] , where Eπ denotes the expectation induced by the policy π . We denote by Π the set of all Markovian policies and Πdet the set of deterministic Markovian policies . We define the optimal value and policy by v∗M = maxπ∈Π vM ( π ) , and π ∗ M ∈ arg maxπ∈Π vM ( π ) , respectively . Whenever appropriate , we simplify notation and write v∗ , π∗ . We use Π∗M to denote the set of optimal policies inM , i.e. , Π∗M = arg maxπ∈Π vM ( π ) . We also define the set of catastrophic policies Π † M as the set Π†M = arg min π∈Π vM ( π ) . ( 1 ) We later use this set to show impossibility of imitation under arbitrary covariate shift and a contextindependent transition function . Expert Data with Unobserved Confounders . We assume additional access to a confounded dataset consisting of expert trajectories D∗ = { ( si0 , a i 0 , s i 1 , a i 1 , . . . , s i H , a i H ) } n i=1 , where aij ∼ π∗ ∈ Π∗M . The trajectories in the dataset were sampled i.i.d . from the marginalized expert distribution ( under possible context covariate shift ) P ∗ ( s0 , a0 , s1 , a1 , . . . , sH ) = ∑ x ρe ( x ) ν ( s0|x ) ∏H−1 t=0 P ( st+1|st , at , x ) π∗ ( at|st , x ) , where ρe is some distribution over contexts . Importantly , ρe does not necessarily equal ρo – the distribution of contexts in the online environment . Notice that it is assumed that π∗ that generated the data had access to the context xi ( i.e. , π∗ is context-dependent ) , though it is missing in the data . In this work , we consider two settings : 1 . Confounded Imitation Learning ( Section 3 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment ( S , X , A , P , ρo , ν , γ ) , without access to reward . 2 . Reinforcement Learning with Confounded Expert Data ( Section 4 ) : The agent has access to confounded expert data ( with context distribution ρe ) as well as real environment M = ( S , X , A , P , r , ρo , ν , γ ) , with access to reward . In both settings we aim to find a context-dependent policy which maximizes the cumulative reward . The confounding factor here is w.r.t . the unobserved context and distribution ρe in the offline data . Marginalized State Action Distribution . We denote the state-action frequency of a policy π ∈ Π given context x ∈ X by dπ ( s , a|x ) = ( 1 − γ ) ∑∞ t=0 γ tPπ ( st = s , at = a|x , s0 ∼ ν ( ·|x ) ) , where Pπ denotes the probability measure induced by π . Similarly , given a distribution over contexts , we define the marginalized state-action frequency of a policy π under the corresponding context distribution by dπρo ( s , a ) = Ex∼ρo [ d π ( s , a | x ) ] ( online environment ) , dπ ∗ ρe ( s , a ) = Ex∼ρe [ dπ ∗ ( s , a | x ) ] ( offline expert data ) . A Causal Perspective . Our work sits at an intersection between the fields of RL and Causal Inference ( CI ) . We believe it is essential to bridge the gap between these two fields , and include an interpretation of our model using CI terminology in Appendix D , where we equivalently define our objective as an intervention over the unknown distribution ρe in a specified Structural Causal Model , as depicted in Figure 2 . 3 IMITATION LEARNING WITH UNOBSERVED CONFOUNDERS . In this section , we analyze the problem of confounded imitation learning , namely , learning from expert trajectories with hidden confounders and without reward . Similar to previous work , we consider the task of imitation learning from expert data in the setting where the agent is allowed to interact with the environment ( Ho & Ermon , 2016 ; Fu et al. , 2017 ; Kostrikov et al. , 2019 ; Brantley et al. , 2019 ) . In the first part of this section we assume no covariate shift between the online environment and the data is present , i.e. , ρe = ρo . We lift this assumption in the second part , where we focus on the covariate shift of the hidden confounders . 3.1 NO COVARIATE SHIFT : ρo = ρe We first consider the scenario in which no covariate shift is present between the offline data and the online environment , i.e. , ρo = ρe . We begin by defining the marginalized ambiguity set , a central component of our work . Definition 1 . For π ∈ Π , we define the set of deterministic policies that match the marginalized state-action frequency of π by Υπ = { π′ ∈ Πdet : dπ ′ ρo ( s , a ) = d π ρe ( s , a ) ∀ s ∈ S , a ∈ A } . Recall that , in general , π∗ ∈ Π∗M may depend on the context x ∈ X . Therefore , the set Υπ∗ corresponds to all deterministic policies that can not be distinguished from π∗ based on the observed expert data . The following theorem shows that for any policy π∗ ∈ Π∗M and any policy π0 ∈ Υπ∗ , one could design a reward function r0 , for which π0 is optimal , while the set Υπ∗ is indiscernible from Υπ0 , i.e. , Υπ∗ = Υπ0 ( see Appendix F for proof ) . In other words , Υπ∗ is the smallest set of candidate optimal policies . Theorem 1 . [ Sufficiency of Υπ∗ ] Assume ρe ≡ ρo . Let π∗ ∈ Π∗M and let π0 ∈ Υπ∗ . Then , Υπ∗ = Υπ0 . Moreover , if π0 6= π∗ , then there exists r0 such that π0 ∈ Π∗M0 but π ∗ /∈ Π∗M0 , where M0 = ( S , A , X , P , r0 , ρo , ν , γ ) . The above theorem shows that any policy in Υπ∗ is a candidate optimal policy , yet without knowing the context the expert used . Such ambiguity can result in selection of a suboptimal or even catastrophic policy . We provide a practical algorithm in Appendix B which calculates the ambiguity set Υπ∗ , and returns an average policy , with computational guarantees . In the next subsection we analyze a more challenging scenario , for which ρo 6= ρe . In this case , Υπ∗ may not be sufficient for the imitation problem . 3.2 WITH COVARIATE SHIFT : ρo 6= ρe Next , we assume covariate shift exists between the online environment and the expert data , i.e. , ρo 6= ρe . Particularly , without further assumptions on the extent of covariate shift , we show two extremes of the problem . In Theorem 2 we prove that whenever the transitions are independent of the context , the data can not in general be used for imitation . In contrast , in Theorem 3 we prove that , whenever the reward is independent of the context , the imitation problem can be efficiently solved . Clearly , if Supp ( ρo ) 6⊆ Supp ( ρe ) 1 then there exists x ∈ Supp ( ρo ) for which π∗ is not identifiable from the expert data2 . We therefore assume throughout that Supp ( ρo ) ⊆ Supp ( ρe ) . We begin by defining the set of non-identifiable policies as those that can not be distinguished from their respective state-action frequencies without information on ρe . Definition 2 . We say that { πi } ki=1 are non-identifiable policies if there exist { ρi } k i=1 such that dπiρi ( s , a ) = d πj ρj ( s , a ) for all i 6= j . Next , focusing on catastrophic policies ( recall Equation ( 1 ) ) , we define catastrophic expert policies as those which could be either optimal or catastrophic under ρo for different reward functions . Definition 3 . We say that { πi } ki=1 are catastrophic expert policies if there exist { ri } k i=1 such that for all i , πi ∈ Π∗Mi , and ∃j ∈ [ k ] , j 6= i such that πi ∈ Π † Mj , whereMj = ( S , X , A , P , rj , ρo , ν , γ ) . Using the fact that both ρe and r are unknown , the following theorem shows that whenever P ( s′|s , a , x ) is independent of x , one could find two policies which are non-identifiable , catastrophic expert policies ( see Appendix F for proof ) . In other words , in the case of context-independent transitions , without further information on ρe or r the expert data is useless for imitation . Furthermore , attempting to imitate the policy using the expert data could result in a catastrophic policy . Theorem 2 . [ Catastrophic Imitation ] Assume |X | ≥ |A| , and P ( s′|s , a , x ) = P ( s′|s , a , x′ ) for all x , x′ ∈ X . Then ∃πe,1 , πe,2 s.t . { πe,1 , πe,2 } are non-identifiable , catastrophic expert policies . 1For a distribution P we denote by Supp ( P ) the support of P. 2We define non-identifiability in Definition 2 . We use a similar notion of identifiability as in Pearl ( 2009b ) While Theorem 2 shows the impossibility of imitation for context-free transitions , whenever the reward is independent of the context , the imitation problem becomes feasible . In fact , as we show in the following theorem , for context-free rewards , any policy in Υπ∗ is an optimal policy . Theorem 3 . [ Sufficiency of Context-Free Reward ] Assume Supp ( ρo ) ⊆ Supp ( ρe ) and r ( s , a , x ) = r ( s , a , x′ ) for all x , x′ ∈ X . Then Υπ∗ ⊆ Π∗M . Theorems 2 and 3 suggest that the hardness of the imitation problem under covariate shift lies on a wide spectrum ( as depicted in Figure 3 ) . While dependence of the transition P ( s′|s , a , x ) on x provides us with information to identify x in the expert data , the dependence of the reward r ( s , a , x ) on x increases the degree of confounding in the imitation problem . Both of these results are concerned with arbitrary confounding . Bounded Confounding : A Sensitivity Perspective . A common approach in causal inference is to bound the bias of unobserved confounding through sensitivity analysis ( Hsu & Small , 2013 ; Namkoong et al. , 2020 ; Kallus & Zhou , 2021 ) . In our setting , this confounding bias occurs due to a covariate shift of the unobserved covariates . As we ’ ve shown in Theorem 2 , though these covariates are observed in the online environment , their shifted and unobserved distribution in the offline data can render catastrophic results . Therefore , we consider the odds-ratio bounds of the sensitivity in distribution between the online environment and the expert data , as stated formally below . Assumption 1 ( Bounded Sensitivity ) . We assume that Supp ( ρe ) ⊆ Supp ( ρo ) and that there exists some Γ ≥ 1 such that for all x ∈ Supp ( ρe ) , Γ−1 ≤ ρo ( x ) ( 1−ρe ( x ) ) ρe ( x ) ( 1−ρo ( x ) ) ≤ Γ . Next , we define the notion of δ-ambiguity , a generalization of the ambiguity set in Definition 1 . Definition 4 ( δ-Ambiguity Set ) . For a policy π ∈ Π , we define the set of all deterministic policies that are δ-close to π by Υδπ = { π′ ∈ Πdet : ∣∣∣dπ′ρo ( s , a ) − dπρe ( s , a ) ∣∣∣ < δ , s ∈ S , a ∈ A } . Similar to Definition 1 , the δ-ambiguity set considers all deterministic policies with a marginalized state-action frequency of distance at most δ from π . The following results shows that ΥΓ−1π∗ is a sufficient set of candidate optimal policies , as long as Assumption 2 holds for some Γ ≥ 1 . Theorem 4 . [ Sufficiency of ΥΓ−1π∗ ] Let Assumption 2 hold for some Γ ≥ 1 . Then π∗ ∈ ΥΓ−1π∗ . For the interested reader , we further analyze the case of bounded confounding in Appendix C. We also demonstrate the effect of bounded confounding in Section 5 . In the following section , we show that , while arbitrary confounding may result in catastrophic results for the imitation learning problem , when coupled with reward , one can still make use of the expert data . | This paper focuses on imitation learning with confounded expert data (with no contextual information) that might have covariate shifts. Theoretical results (upper and lower bounds) are obtained, supported by numerical experiments and real data applications. The main conclusions are: (1) with no access to reward in the online setting, it is impossible to learn the optimal policy with confounded expert data with covariate shifts; (2) but with access to reward, then it is possible to learn the optimal policy consistently. | SP:c01af121743e1bc7ddd7de789a134e1f821e8f78 |
3D-Transformer: Molecular Representation with Transformer in 3D Space | 1 INTRODUCTION . Spatial structures are among the most crucial factors to decide molecular properties and understand their principles of action in the physical world . For example , 3D structures of proteins provide valuable information for inferring biological interventions , such as structure-based drug development and targeted mutagenesis ( Senior et al. , 2020 ; Jumper et al. , 2021 ; Baek et al. , 2021 ) . In chemistry , zeolites show obvious differences in separation properties caused by subtle changes in their 3D geometric compositions ( Chai et al. , 2020 ; Pfriem et al. , 2021 ) . Apart from that , in the pharmaceutical industry , the same compounds can have different 3D structures , resulting in different solubility ( Zhang et al. , 2017 ) . To sum up , capturing 3D spatial structures is essential to accurately forecast molecular properties . Based on these facts , researchers have studied molecular representation learning techniques ( Rao et al. , 2019 ) to include 3D spatial information ( Zhavoronkov et al. , 2019 ) . The dominant 3D molecular models are Graph Neural Networks ( GNNs ) and 3D Convolutional Neural Networks ( 3DCNNs ) ( Derevyanko et al. , 2018 ; Pagès et al. , 2019 ; Townshend et al. , 2019 ) . GNNs create edges by using either chemical bonds or finding the neighbors of each node within a distance cutoff ( Zhang et al. , 2020b ) . They encode pairwise connectivity of atoms and require running multiple hops for an atom to reach to another . 3DCNNs encode translational and permutational symmetries , but need to stack deep layers to build direct connections between distant regions , incurring significant computational costs . In contrast , Transformers rely on the self-attention mechanism to capture long-term dependencies in parallel ( Hernández & Amigó , 2021 ) . Meanwhile , Equivariant Neural Networks ( ENNs ) ( Thomas et al. , 2018 ) have emerged as a new class of methods , where geometric transformations of their inputs lead to well-defined transformations of outputs . Some ENNs adopt Transformers as the backbone but fail to surmount the intrinsic drawbacks of this architecture , including its insensibility to local patterns among non-uniformly distancing atoms and its ineffi- ciency to aggregate atom features . Some other Transformer-based methods have been proposed to fuse distance and graph neighbourhood information ( Maziarka et al. , 2020 ; 2021 ) . However , they take no consideration of employing motifs , which are frequently-occurring substructures in molecules and can be leveraged to uncover global graph properties . In this work , we present the Molformer on the basis of all preceding analysis . For the sake of injecting chemical domain knowledge , we construct a motif-template vocabulary based on functional groups and adopt trainable motif embeddings to maintain the semantic meanings of those essential substructures . Then with both motifs and atoms as input , Molformer operates on a fully-connected graph with direct connections between remote regions ( Veličković et al. , 2017 ; Joshi , 2020 ) , which reduces computational burden of multi-hop GNNs and stacked 3DCNNs . However , this characteristic limits Molformer ’ s capacity in exploiting local structures and leads to poor generalization in unseen cases ( Qi et al. , 2017 ) . Therefore , we propose a Multi-scale Self-Attention ( MSA ) module to recognize fine-grained patterns from neighborhoods . Moreover , we introduce a roto-translation invariant Convolutional Position Encoding ( CPE ) to depict position relationships among atoms and their adjacencies . After that , to retain a comprehensive representation of the entire molecule , we propose an Attentive Farthest Point Sampling ( AFPS ) module that selects important atoms with the assistance of the attention score map . To summarize , our contributions are as follows : • To the best of our knowledge , we are the foremost to incorporate motifs with knowledge of functional groups into a Transformer architecture for 3D molecular representation learning . • We propose a novel MSA to extract local patterns , a roto-translation invariant CPE method to encode relative distance at a linear computational time cost , and a simple yet effective downsampling algorithm to gather molecular representations . • We show significant improvements on several benchmarks in three domains . Code and all datasets are available at https : //github.com/smiles724/Molformer . 2 PRELIMINARIES . Problem Definition . A molecule S = ( E , P ) has N atoms and C atom classes , where E = { e1 , ... , eN } ∈ RN×C contains the one-hot atom representations and P = { p1 , ... , pN } ∈ RN×3 contains the 3D coordinates of each atom . Each one-hot ei can be converted to a dense vector xi = eiW E , with xi ∈ Rdmodel and WE ∈ RC×dmodel being the embedding matrix . The 3D coordinates of the atom i is a three-dimensional vector pi = [ pxi , p y i , p z i ] . A representation learning model f acts on S , obtaining its representation r = f ( S ) . Then r is forwarded to a prediction model g and attain the prediction of a biochemical property ŷ = g ( r ) . Self-attention Mechanism . The Transformer ( Vaswani et al. , 2017 ) has become very successful due to its core component , self-attention . Given a set of input features { xi } i=1 , ... , N , the standard dot-product attention layer is as the following : qi = fQ ( xi ) , ki = fK ( xi ) , vi = fV ( xi ) , aij = qik T j / √ dk , zi = N∑ j=1 σ ( aij ) vj ( 1 ) where { fQ , fK , fV } are embedding transformations , and { qi , ki , vi } are respectively the query , key , and value vectors with the same dimension dk . aij is the attention that the token i pays to the token j. σ denotes the Softmax function and zi is the output embedding of the token i . This formula conforms to a non-local network ( Wang et al. , 2018 ) , indicating its inability to capture fine-grained patterns in a local context . Position Encoding . Self-attention is invariant to permutation of the input ( Dufter et al. , 2021 ) , and position encoding ensures that the Transformer will reveal positional information . Position encoding methods can be either based on absolute positions or relative distances . The former takes the raw position information as input and is sensitive to spatial transformations . The latter manipulates the attention score by incorporating relative distances ( Guo et al. , 2020a ; Pan et al. , 2021 ) : aij = qik T j / √ dk + fPE ( pi−pj ) , where fPE ( · ) is the position encoding function and is translation invariant . The rotation invariance can be further accomplished by taking a L2-norm ||pi − pj ||2 ( Chen et al. , 2019b ) . 3 MOLFORMER . Molformer is based on the architecture of Transformer but adopts several significantly different and novel components ( see Figure 1 ) . First , a vocabulary of motif templates is constructed on the basis of functional groups and we extract all available motifs from each molecule . Then both atoms and motifs acquire their corresponding embeddings and are forwarded into L feature learning blocks . Each block consists of a convolutional position encoding , a multi-scale self-attention , and a feedforward network . After that , an attentive subsampling method is utilized to adaptively aggregate the molecular presentation , which is later fed into a predictor to forecast properties in a broad range of downstream tasks . 3.1 TRAINABLE MOTIF-BASED EMBEDDING . Motifs are frequently-occurring substructure patterns as well as the building blocks of complex molecular structures . They usually maintain semantic meanings and have great expressiveness of the biochemical characteristics of the whole molecule ( Zhang et al. , 2020a ) . In the chemical community , researchers have developed a set of standard criterion to recognize motifs with essential functionalities in molecules ( Milo et al. , 2002 ) . Despite that , few of prior studies directly incorporate those informative motifs into their model architectures . To fill this gap , we define a series of momentous substructures using external domain knowledge , and introduce a trainable motif embeddings method to fully exploit them in our Molformer . To begin with , all motifs are first extracted according to the motif vocabulary , which is built by functional groups . Practically , we rely on RDKit ( Landrum , 2013 ) to draw them from the SMILES ( Weininger , 1988 ) representation of each molecule . We assume M motifs { m1 , ... , mM } are detected in the molecule S , and each motif mi contains a certain number of at least two atoms . Then we regard each kind of motif as a new type of token and append them to the input . Therefore , the input for our Molformer becomes { x1 , ... , xN , xm1 , ... , xmM } , where xmi is obtained through an learnable embedding matrix WM ∈ RC′×dmodel and C ′ denotes the number of motif categories . As for the position of each motif , we adopt a weighted sum of the 3D coordinates of its component atoms as pmi = ∑ xi∈mi ( wi∑ xi∈mi wi ) · pi , where wi are the atomic weights . Our approach requires the model to automatically learn a customized embedding for each motif template through backpropagations , which follows a data-driven pattern . In some data-sufficient tasks , its greatest potential can be unlocked and those motif embeddings can be well trained . Nevertheless , in the case of few-shot learning or small datasets , each category of motif might only appear rare times . Those embeddings are not fully tuned and can be extremely biased and noisy , which will do little helps to the ultimate property prediction . 3.2 CONVOLUTIONAL POSITION ENCODING . To enable roto-translation invariance and take fully advantage of geometric information , instead of adding a term of fPE ( pi − pj ) , we propose a CPE that applies a convolutional operation to the interatomic distance D ∈ RN×N : Acov = Conv2d ( D ) A , ( 2 ) where A = [ ai , j ] i , j=1 , ···N ∈ RN×N is the attention matrix , Conv2d ( · ) denotes a 2D shallow convolutional network with a kernel size of 1× 1 , and is the element-wise product . With multi-headed self-attention , Acov is expanded in the sense that Acov ∈ RH×N×N , and Conv2d ( · ) has H output channels . The CPE method induces O ( N ) convolution operations on each atom and can drastically reduce training time when the number of atoms is very large ( Wu et al. , 2021 ) . 3.3 MULTI-SCALE SELF-ATTENTION . The self-attention mechanism in the Transformer is good at capturing global data patterns but ignores local context ( Guo et al. , 2020a ) . Exploiting local context has proven to be important for 3D spatial data such as 3D point clouds ( Qi et al. , 2017 ) . Therefore , we impose a distance-based constraint in self-attention in order to extract multi-scaled patterns from both local and global contexts . Guo et al . ( 2020b ) propose to use integer-based distance to limit attention to local word neighbors , which can not be used in molecules . This is because different types of molecules have different densities and molecules of the same type have different spatial regularity , which results in the nonuniformity of interatomic distances . Normally , small molecules have a mean interatomic distance of 1-2 Å ( Angstrom , 10−10m ) , which is denser than large molecules like proteins with approximately 5 Å on average . To address that , we design a new multi-scale methodology to robustly capture details . Specifically , we mask atoms beyond a certain distance τs ( a real number as opposed to an integer in Guo et al . ( 2020b ) ) at each scale s. We denote dij = ||pi−pj ||2 as the Euclidean distance between the i-th and j-th atom . The attention calculation is modified as : aτsij = qik T j · 1 { dij < τs } √ dk , zτsi = N∑ j=1 σ ( aτsij ) vj , ( 3 ) where 1 { dij < τs } is the indicator function . For small molecules , Equation 3 can be complementally combined with Equation 2 . Then features extracted from S different scales { τs } s=1 , ... , S as well as the informative global feature are concatenated together to form a multi-scale representation , denoted by z′i = z τ1 i ⊕ ... ⊕z τS i ⊕z global i ∈ R ( S+1 ) dk . After that , z′i is forwarded into a multi-layer perceptron to be compressed as z′′i with the original dimension dk . | The paper presents an approach to represent 3D atomic structure in a machine learning context. The paper distinguishes between representations for "small" and "large" molecules based on a metric that takes the spatial extension and number of atoms in the molecule into account. Structures of small molecules are represented by an interatomic distance map. Large molecules are represented by what the authors refer to as a "sinusoidal function-based absolute position encoding method". In both cases, a transformer architecture is used on top of this initial representation. The authors further introduce a subsampling procedure to select a subset of points/ atoms and aggregate information. The authors demonstrate quantitative results on datasets relating to 1) small molecule property prediction (QM datasets), 2) protein-ligand binding (PDBbind dataset), and 3) a dataset from material science on metalorganic compounds (CoRE-MOF dataset) | SP:d4befa9a790afd16af52b933f9a5e4147180a2f8 |
3D-Transformer: Molecular Representation with Transformer in 3D Space | 1 INTRODUCTION . Spatial structures are among the most crucial factors to decide molecular properties and understand their principles of action in the physical world . For example , 3D structures of proteins provide valuable information for inferring biological interventions , such as structure-based drug development and targeted mutagenesis ( Senior et al. , 2020 ; Jumper et al. , 2021 ; Baek et al. , 2021 ) . In chemistry , zeolites show obvious differences in separation properties caused by subtle changes in their 3D geometric compositions ( Chai et al. , 2020 ; Pfriem et al. , 2021 ) . Apart from that , in the pharmaceutical industry , the same compounds can have different 3D structures , resulting in different solubility ( Zhang et al. , 2017 ) . To sum up , capturing 3D spatial structures is essential to accurately forecast molecular properties . Based on these facts , researchers have studied molecular representation learning techniques ( Rao et al. , 2019 ) to include 3D spatial information ( Zhavoronkov et al. , 2019 ) . The dominant 3D molecular models are Graph Neural Networks ( GNNs ) and 3D Convolutional Neural Networks ( 3DCNNs ) ( Derevyanko et al. , 2018 ; Pagès et al. , 2019 ; Townshend et al. , 2019 ) . GNNs create edges by using either chemical bonds or finding the neighbors of each node within a distance cutoff ( Zhang et al. , 2020b ) . They encode pairwise connectivity of atoms and require running multiple hops for an atom to reach to another . 3DCNNs encode translational and permutational symmetries , but need to stack deep layers to build direct connections between distant regions , incurring significant computational costs . In contrast , Transformers rely on the self-attention mechanism to capture long-term dependencies in parallel ( Hernández & Amigó , 2021 ) . Meanwhile , Equivariant Neural Networks ( ENNs ) ( Thomas et al. , 2018 ) have emerged as a new class of methods , where geometric transformations of their inputs lead to well-defined transformations of outputs . Some ENNs adopt Transformers as the backbone but fail to surmount the intrinsic drawbacks of this architecture , including its insensibility to local patterns among non-uniformly distancing atoms and its ineffi- ciency to aggregate atom features . Some other Transformer-based methods have been proposed to fuse distance and graph neighbourhood information ( Maziarka et al. , 2020 ; 2021 ) . However , they take no consideration of employing motifs , which are frequently-occurring substructures in molecules and can be leveraged to uncover global graph properties . In this work , we present the Molformer on the basis of all preceding analysis . For the sake of injecting chemical domain knowledge , we construct a motif-template vocabulary based on functional groups and adopt trainable motif embeddings to maintain the semantic meanings of those essential substructures . Then with both motifs and atoms as input , Molformer operates on a fully-connected graph with direct connections between remote regions ( Veličković et al. , 2017 ; Joshi , 2020 ) , which reduces computational burden of multi-hop GNNs and stacked 3DCNNs . However , this characteristic limits Molformer ’ s capacity in exploiting local structures and leads to poor generalization in unseen cases ( Qi et al. , 2017 ) . Therefore , we propose a Multi-scale Self-Attention ( MSA ) module to recognize fine-grained patterns from neighborhoods . Moreover , we introduce a roto-translation invariant Convolutional Position Encoding ( CPE ) to depict position relationships among atoms and their adjacencies . After that , to retain a comprehensive representation of the entire molecule , we propose an Attentive Farthest Point Sampling ( AFPS ) module that selects important atoms with the assistance of the attention score map . To summarize , our contributions are as follows : • To the best of our knowledge , we are the foremost to incorporate motifs with knowledge of functional groups into a Transformer architecture for 3D molecular representation learning . • We propose a novel MSA to extract local patterns , a roto-translation invariant CPE method to encode relative distance at a linear computational time cost , and a simple yet effective downsampling algorithm to gather molecular representations . • We show significant improvements on several benchmarks in three domains . Code and all datasets are available at https : //github.com/smiles724/Molformer . 2 PRELIMINARIES . Problem Definition . A molecule S = ( E , P ) has N atoms and C atom classes , where E = { e1 , ... , eN } ∈ RN×C contains the one-hot atom representations and P = { p1 , ... , pN } ∈ RN×3 contains the 3D coordinates of each atom . Each one-hot ei can be converted to a dense vector xi = eiW E , with xi ∈ Rdmodel and WE ∈ RC×dmodel being the embedding matrix . The 3D coordinates of the atom i is a three-dimensional vector pi = [ pxi , p y i , p z i ] . A representation learning model f acts on S , obtaining its representation r = f ( S ) . Then r is forwarded to a prediction model g and attain the prediction of a biochemical property ŷ = g ( r ) . Self-attention Mechanism . The Transformer ( Vaswani et al. , 2017 ) has become very successful due to its core component , self-attention . Given a set of input features { xi } i=1 , ... , N , the standard dot-product attention layer is as the following : qi = fQ ( xi ) , ki = fK ( xi ) , vi = fV ( xi ) , aij = qik T j / √ dk , zi = N∑ j=1 σ ( aij ) vj ( 1 ) where { fQ , fK , fV } are embedding transformations , and { qi , ki , vi } are respectively the query , key , and value vectors with the same dimension dk . aij is the attention that the token i pays to the token j. σ denotes the Softmax function and zi is the output embedding of the token i . This formula conforms to a non-local network ( Wang et al. , 2018 ) , indicating its inability to capture fine-grained patterns in a local context . Position Encoding . Self-attention is invariant to permutation of the input ( Dufter et al. , 2021 ) , and position encoding ensures that the Transformer will reveal positional information . Position encoding methods can be either based on absolute positions or relative distances . The former takes the raw position information as input and is sensitive to spatial transformations . The latter manipulates the attention score by incorporating relative distances ( Guo et al. , 2020a ; Pan et al. , 2021 ) : aij = qik T j / √ dk + fPE ( pi−pj ) , where fPE ( · ) is the position encoding function and is translation invariant . The rotation invariance can be further accomplished by taking a L2-norm ||pi − pj ||2 ( Chen et al. , 2019b ) . 3 MOLFORMER . Molformer is based on the architecture of Transformer but adopts several significantly different and novel components ( see Figure 1 ) . First , a vocabulary of motif templates is constructed on the basis of functional groups and we extract all available motifs from each molecule . Then both atoms and motifs acquire their corresponding embeddings and are forwarded into L feature learning blocks . Each block consists of a convolutional position encoding , a multi-scale self-attention , and a feedforward network . After that , an attentive subsampling method is utilized to adaptively aggregate the molecular presentation , which is later fed into a predictor to forecast properties in a broad range of downstream tasks . 3.1 TRAINABLE MOTIF-BASED EMBEDDING . Motifs are frequently-occurring substructure patterns as well as the building blocks of complex molecular structures . They usually maintain semantic meanings and have great expressiveness of the biochemical characteristics of the whole molecule ( Zhang et al. , 2020a ) . In the chemical community , researchers have developed a set of standard criterion to recognize motifs with essential functionalities in molecules ( Milo et al. , 2002 ) . Despite that , few of prior studies directly incorporate those informative motifs into their model architectures . To fill this gap , we define a series of momentous substructures using external domain knowledge , and introduce a trainable motif embeddings method to fully exploit them in our Molformer . To begin with , all motifs are first extracted according to the motif vocabulary , which is built by functional groups . Practically , we rely on RDKit ( Landrum , 2013 ) to draw them from the SMILES ( Weininger , 1988 ) representation of each molecule . We assume M motifs { m1 , ... , mM } are detected in the molecule S , and each motif mi contains a certain number of at least two atoms . Then we regard each kind of motif as a new type of token and append them to the input . Therefore , the input for our Molformer becomes { x1 , ... , xN , xm1 , ... , xmM } , where xmi is obtained through an learnable embedding matrix WM ∈ RC′×dmodel and C ′ denotes the number of motif categories . As for the position of each motif , we adopt a weighted sum of the 3D coordinates of its component atoms as pmi = ∑ xi∈mi ( wi∑ xi∈mi wi ) · pi , where wi are the atomic weights . Our approach requires the model to automatically learn a customized embedding for each motif template through backpropagations , which follows a data-driven pattern . In some data-sufficient tasks , its greatest potential can be unlocked and those motif embeddings can be well trained . Nevertheless , in the case of few-shot learning or small datasets , each category of motif might only appear rare times . Those embeddings are not fully tuned and can be extremely biased and noisy , which will do little helps to the ultimate property prediction . 3.2 CONVOLUTIONAL POSITION ENCODING . To enable roto-translation invariance and take fully advantage of geometric information , instead of adding a term of fPE ( pi − pj ) , we propose a CPE that applies a convolutional operation to the interatomic distance D ∈ RN×N : Acov = Conv2d ( D ) A , ( 2 ) where A = [ ai , j ] i , j=1 , ···N ∈ RN×N is the attention matrix , Conv2d ( · ) denotes a 2D shallow convolutional network with a kernel size of 1× 1 , and is the element-wise product . With multi-headed self-attention , Acov is expanded in the sense that Acov ∈ RH×N×N , and Conv2d ( · ) has H output channels . The CPE method induces O ( N ) convolution operations on each atom and can drastically reduce training time when the number of atoms is very large ( Wu et al. , 2021 ) . 3.3 MULTI-SCALE SELF-ATTENTION . The self-attention mechanism in the Transformer is good at capturing global data patterns but ignores local context ( Guo et al. , 2020a ) . Exploiting local context has proven to be important for 3D spatial data such as 3D point clouds ( Qi et al. , 2017 ) . Therefore , we impose a distance-based constraint in self-attention in order to extract multi-scaled patterns from both local and global contexts . Guo et al . ( 2020b ) propose to use integer-based distance to limit attention to local word neighbors , which can not be used in molecules . This is because different types of molecules have different densities and molecules of the same type have different spatial regularity , which results in the nonuniformity of interatomic distances . Normally , small molecules have a mean interatomic distance of 1-2 Å ( Angstrom , 10−10m ) , which is denser than large molecules like proteins with approximately 5 Å on average . To address that , we design a new multi-scale methodology to robustly capture details . Specifically , we mask atoms beyond a certain distance τs ( a real number as opposed to an integer in Guo et al . ( 2020b ) ) at each scale s. We denote dij = ||pi−pj ||2 as the Euclidean distance between the i-th and j-th atom . The attention calculation is modified as : aτsij = qik T j · 1 { dij < τs } √ dk , zτsi = N∑ j=1 σ ( aτsij ) vj , ( 3 ) where 1 { dij < τs } is the indicator function . For small molecules , Equation 3 can be complementally combined with Equation 2 . Then features extracted from S different scales { τs } s=1 , ... , S as well as the informative global feature are concatenated together to form a multi-scale representation , denoted by z′i = z τ1 i ⊕ ... ⊕z τS i ⊕z global i ∈ R ( S+1 ) dk . After that , z′i is forwarded into a multi-layer perceptron to be compressed as z′′i with the original dimension dk . | This paper proposes 3D-Transformers, which is a variant of Transformer that incorporates the 3D spatial information. The authors develop a multi-scale attention module, an adaptive position encoding module, and a farthest sampling scheme for the 3D-Transformer. The authors validate the performance of 3D-Transformer on three different domains. | SP:d4befa9a790afd16af52b933f9a5e4147180a2f8 |
3D-Transformer: Molecular Representation with Transformer in 3D Space | 1 INTRODUCTION . Spatial structures are among the most crucial factors to decide molecular properties and understand their principles of action in the physical world . For example , 3D structures of proteins provide valuable information for inferring biological interventions , such as structure-based drug development and targeted mutagenesis ( Senior et al. , 2020 ; Jumper et al. , 2021 ; Baek et al. , 2021 ) . In chemistry , zeolites show obvious differences in separation properties caused by subtle changes in their 3D geometric compositions ( Chai et al. , 2020 ; Pfriem et al. , 2021 ) . Apart from that , in the pharmaceutical industry , the same compounds can have different 3D structures , resulting in different solubility ( Zhang et al. , 2017 ) . To sum up , capturing 3D spatial structures is essential to accurately forecast molecular properties . Based on these facts , researchers have studied molecular representation learning techniques ( Rao et al. , 2019 ) to include 3D spatial information ( Zhavoronkov et al. , 2019 ) . The dominant 3D molecular models are Graph Neural Networks ( GNNs ) and 3D Convolutional Neural Networks ( 3DCNNs ) ( Derevyanko et al. , 2018 ; Pagès et al. , 2019 ; Townshend et al. , 2019 ) . GNNs create edges by using either chemical bonds or finding the neighbors of each node within a distance cutoff ( Zhang et al. , 2020b ) . They encode pairwise connectivity of atoms and require running multiple hops for an atom to reach to another . 3DCNNs encode translational and permutational symmetries , but need to stack deep layers to build direct connections between distant regions , incurring significant computational costs . In contrast , Transformers rely on the self-attention mechanism to capture long-term dependencies in parallel ( Hernández & Amigó , 2021 ) . Meanwhile , Equivariant Neural Networks ( ENNs ) ( Thomas et al. , 2018 ) have emerged as a new class of methods , where geometric transformations of their inputs lead to well-defined transformations of outputs . Some ENNs adopt Transformers as the backbone but fail to surmount the intrinsic drawbacks of this architecture , including its insensibility to local patterns among non-uniformly distancing atoms and its ineffi- ciency to aggregate atom features . Some other Transformer-based methods have been proposed to fuse distance and graph neighbourhood information ( Maziarka et al. , 2020 ; 2021 ) . However , they take no consideration of employing motifs , which are frequently-occurring substructures in molecules and can be leveraged to uncover global graph properties . In this work , we present the Molformer on the basis of all preceding analysis . For the sake of injecting chemical domain knowledge , we construct a motif-template vocabulary based on functional groups and adopt trainable motif embeddings to maintain the semantic meanings of those essential substructures . Then with both motifs and atoms as input , Molformer operates on a fully-connected graph with direct connections between remote regions ( Veličković et al. , 2017 ; Joshi , 2020 ) , which reduces computational burden of multi-hop GNNs and stacked 3DCNNs . However , this characteristic limits Molformer ’ s capacity in exploiting local structures and leads to poor generalization in unseen cases ( Qi et al. , 2017 ) . Therefore , we propose a Multi-scale Self-Attention ( MSA ) module to recognize fine-grained patterns from neighborhoods . Moreover , we introduce a roto-translation invariant Convolutional Position Encoding ( CPE ) to depict position relationships among atoms and their adjacencies . After that , to retain a comprehensive representation of the entire molecule , we propose an Attentive Farthest Point Sampling ( AFPS ) module that selects important atoms with the assistance of the attention score map . To summarize , our contributions are as follows : • To the best of our knowledge , we are the foremost to incorporate motifs with knowledge of functional groups into a Transformer architecture for 3D molecular representation learning . • We propose a novel MSA to extract local patterns , a roto-translation invariant CPE method to encode relative distance at a linear computational time cost , and a simple yet effective downsampling algorithm to gather molecular representations . • We show significant improvements on several benchmarks in three domains . Code and all datasets are available at https : //github.com/smiles724/Molformer . 2 PRELIMINARIES . Problem Definition . A molecule S = ( E , P ) has N atoms and C atom classes , where E = { e1 , ... , eN } ∈ RN×C contains the one-hot atom representations and P = { p1 , ... , pN } ∈ RN×3 contains the 3D coordinates of each atom . Each one-hot ei can be converted to a dense vector xi = eiW E , with xi ∈ Rdmodel and WE ∈ RC×dmodel being the embedding matrix . The 3D coordinates of the atom i is a three-dimensional vector pi = [ pxi , p y i , p z i ] . A representation learning model f acts on S , obtaining its representation r = f ( S ) . Then r is forwarded to a prediction model g and attain the prediction of a biochemical property ŷ = g ( r ) . Self-attention Mechanism . The Transformer ( Vaswani et al. , 2017 ) has become very successful due to its core component , self-attention . Given a set of input features { xi } i=1 , ... , N , the standard dot-product attention layer is as the following : qi = fQ ( xi ) , ki = fK ( xi ) , vi = fV ( xi ) , aij = qik T j / √ dk , zi = N∑ j=1 σ ( aij ) vj ( 1 ) where { fQ , fK , fV } are embedding transformations , and { qi , ki , vi } are respectively the query , key , and value vectors with the same dimension dk . aij is the attention that the token i pays to the token j. σ denotes the Softmax function and zi is the output embedding of the token i . This formula conforms to a non-local network ( Wang et al. , 2018 ) , indicating its inability to capture fine-grained patterns in a local context . Position Encoding . Self-attention is invariant to permutation of the input ( Dufter et al. , 2021 ) , and position encoding ensures that the Transformer will reveal positional information . Position encoding methods can be either based on absolute positions or relative distances . The former takes the raw position information as input and is sensitive to spatial transformations . The latter manipulates the attention score by incorporating relative distances ( Guo et al. , 2020a ; Pan et al. , 2021 ) : aij = qik T j / √ dk + fPE ( pi−pj ) , where fPE ( · ) is the position encoding function and is translation invariant . The rotation invariance can be further accomplished by taking a L2-norm ||pi − pj ||2 ( Chen et al. , 2019b ) . 3 MOLFORMER . Molformer is based on the architecture of Transformer but adopts several significantly different and novel components ( see Figure 1 ) . First , a vocabulary of motif templates is constructed on the basis of functional groups and we extract all available motifs from each molecule . Then both atoms and motifs acquire their corresponding embeddings and are forwarded into L feature learning blocks . Each block consists of a convolutional position encoding , a multi-scale self-attention , and a feedforward network . After that , an attentive subsampling method is utilized to adaptively aggregate the molecular presentation , which is later fed into a predictor to forecast properties in a broad range of downstream tasks . 3.1 TRAINABLE MOTIF-BASED EMBEDDING . Motifs are frequently-occurring substructure patterns as well as the building blocks of complex molecular structures . They usually maintain semantic meanings and have great expressiveness of the biochemical characteristics of the whole molecule ( Zhang et al. , 2020a ) . In the chemical community , researchers have developed a set of standard criterion to recognize motifs with essential functionalities in molecules ( Milo et al. , 2002 ) . Despite that , few of prior studies directly incorporate those informative motifs into their model architectures . To fill this gap , we define a series of momentous substructures using external domain knowledge , and introduce a trainable motif embeddings method to fully exploit them in our Molformer . To begin with , all motifs are first extracted according to the motif vocabulary , which is built by functional groups . Practically , we rely on RDKit ( Landrum , 2013 ) to draw them from the SMILES ( Weininger , 1988 ) representation of each molecule . We assume M motifs { m1 , ... , mM } are detected in the molecule S , and each motif mi contains a certain number of at least two atoms . Then we regard each kind of motif as a new type of token and append them to the input . Therefore , the input for our Molformer becomes { x1 , ... , xN , xm1 , ... , xmM } , where xmi is obtained through an learnable embedding matrix WM ∈ RC′×dmodel and C ′ denotes the number of motif categories . As for the position of each motif , we adopt a weighted sum of the 3D coordinates of its component atoms as pmi = ∑ xi∈mi ( wi∑ xi∈mi wi ) · pi , where wi are the atomic weights . Our approach requires the model to automatically learn a customized embedding for each motif template through backpropagations , which follows a data-driven pattern . In some data-sufficient tasks , its greatest potential can be unlocked and those motif embeddings can be well trained . Nevertheless , in the case of few-shot learning or small datasets , each category of motif might only appear rare times . Those embeddings are not fully tuned and can be extremely biased and noisy , which will do little helps to the ultimate property prediction . 3.2 CONVOLUTIONAL POSITION ENCODING . To enable roto-translation invariance and take fully advantage of geometric information , instead of adding a term of fPE ( pi − pj ) , we propose a CPE that applies a convolutional operation to the interatomic distance D ∈ RN×N : Acov = Conv2d ( D ) A , ( 2 ) where A = [ ai , j ] i , j=1 , ···N ∈ RN×N is the attention matrix , Conv2d ( · ) denotes a 2D shallow convolutional network with a kernel size of 1× 1 , and is the element-wise product . With multi-headed self-attention , Acov is expanded in the sense that Acov ∈ RH×N×N , and Conv2d ( · ) has H output channels . The CPE method induces O ( N ) convolution operations on each atom and can drastically reduce training time when the number of atoms is very large ( Wu et al. , 2021 ) . 3.3 MULTI-SCALE SELF-ATTENTION . The self-attention mechanism in the Transformer is good at capturing global data patterns but ignores local context ( Guo et al. , 2020a ) . Exploiting local context has proven to be important for 3D spatial data such as 3D point clouds ( Qi et al. , 2017 ) . Therefore , we impose a distance-based constraint in self-attention in order to extract multi-scaled patterns from both local and global contexts . Guo et al . ( 2020b ) propose to use integer-based distance to limit attention to local word neighbors , which can not be used in molecules . This is because different types of molecules have different densities and molecules of the same type have different spatial regularity , which results in the nonuniformity of interatomic distances . Normally , small molecules have a mean interatomic distance of 1-2 Å ( Angstrom , 10−10m ) , which is denser than large molecules like proteins with approximately 5 Å on average . To address that , we design a new multi-scale methodology to robustly capture details . Specifically , we mask atoms beyond a certain distance τs ( a real number as opposed to an integer in Guo et al . ( 2020b ) ) at each scale s. We denote dij = ||pi−pj ||2 as the Euclidean distance between the i-th and j-th atom . The attention calculation is modified as : aτsij = qik T j · 1 { dij < τs } √ dk , zτsi = N∑ j=1 σ ( aτsij ) vj , ( 3 ) where 1 { dij < τs } is the indicator function . For small molecules , Equation 3 can be complementally combined with Equation 2 . Then features extracted from S different scales { τs } s=1 , ... , S as well as the informative global feature are concatenated together to form a multi-scale representation , denoted by z′i = z τ1 i ⊕ ... ⊕z τS i ⊕z global i ∈ R ( S+1 ) dk . After that , z′i is forwarded into a multi-layer perceptron to be compressed as z′′i with the original dimension dk . | In the paper, the authors proposed a new Transformer dedicated to working with molecular representation. It is a modification of classical Transformer using the information of 3D coordinates of atoms. 3D-Transformer operates on a fully-connected graph with direct connections between atoms. | SP:d4befa9a790afd16af52b933f9a5e4147180a2f8 |
Continual Learning Using Task Conditional Neural Networks | 1 INTRODUCTION . The human brain can adapt and learn new knowledge in response to changing environments . Hoshi et al . ( 1998 ) demonstrate that we can continually learn different tasks while retaining previously learned variations of the same or similar phenomenon and give different reactions under different contexts . Similarly , Asaad et al . ( 2000 ) have found that our neurons are task-independent . Under different context , the neurons are fired selectively with respect to the stimulus . In contrast , most of the machine learning models , in a scalable way , are not capable of adapting to changing environments quickly and automatically using artificial neurons corresponding to different tasks . Consequently , conventional machine learning models tend to forget the previously learned task after learning a new task . This scenario is known as catastrophic forgetting or interference in machine learning ( McCloskey & Cohen ( 1989 ) ) . Catastrophic interference problem in machine learning is one of the hurdles to implement a general artificial intelligence learning systems ( Legg & Hutter ( 2007 ) ) . Unable to learn several tasks , a model should be trained with all the possible scenarios in advance . This requirement is intractable in practice and is not inline with the continual learning models ( Thrun & Mitchell ( 1995 ) ) . Continual machine learning algorithms change over time and adapt their parameters to data or learning goals changes . We refer to the learning goal or a specific part of the data with a learning goal as a task . The learning models are not often equipped with solutions to quickly adapt to the situations which they have seen before if their parameters have significantly changed over time by continual learning . A variety of continual learning methods have been proposed to solve the problems mentioned above . Shin et al . ( 2017 ) proposed a memory-based approach which is to replay the trained samples to solve the forgetting problem while learning a new task . Lee et al . ( 2017 ) ; Kirkpatrick et al . ( 2017 ) ; Zeng et al . ( 2018 ) leverage the regularisation methods reduce the representational overlap of different tasks . Dynamic network approaches assign extra neuron resources to new tasks ( Yoon et al . ( 2017 ) ) . Most of the existing solutions need to know all the task changes in advance , or this information is given manually to the model throughout the learning . Some other works detect in-task and out-task samples to inference the task identity ( Li et al . ( 2019 ) ; Lee et al . ( 2020 ) ) . In this work , we propose a novel method to overcome the catastrophic forgetting problem . We leverage Misture of Experts ( MoE ) ( Masoudnia & Ebrahimpour ( 2014 ) ) to train the task-specific models . One of the advantage of MoE is that we can use a shallower networks and utilise the capacity as much as possible for each expert . Theoretically , the potential capacity of the combined networks is infinite . In other words , we do not need to initialise a giant network at the beginning of the training to avoid learning further tasks without forgetting them . In each expert , we integrate the probabilistic neural networks ( Specht ( 1990 ) ) and conventional neural networks ( Haykin ( 1994 ) ) to produce the task likelihood . The final prediction of each expert will be weighted by the task likelihood and calculate the task conditional probabilities . We name our approach as Task Conditional Neural Network ( TCNN ) . 2 RELATED WORK . There are different approaches to address the forgetting problem in continual learning . Parisi et al . ( 2019 ) categorise these approaches into three groups : Regularisation , Memory Replay and Dynamic Network approaches . The regularisation approaches find the overlap of the parameter space between different tasks . One of the popular algorithms in this group is Elastic Weight Consolidation ( EWC ) proposed by Kirkpatrick et al . ( 2017 ) . EWC avoids significantly changing the parameters that are important to a learned task . It assumes the weights have Gaussian distributions and approximates the posterior distribution of the weights by the Laplace approximation . A similar idea is used in Incremental Moment Matching ( IMM ) proposed by Lee et al . ( 2017 ) . IMM finds the overlap of the parameter distributions by smoothing the loss surface of the tasks . Zeng et al . ( 2018 ) address the forgetting problem by allowing the weights to change within the same subspace of the previously learned task . Li & Hoiem ( 2018 ) address the problem by using the knowledge distillation ( Hinton et al . ( 2015 ) ) . They enforce the prediction of the learned tasks to be similar to the new tasks ( Parisi et al . ( 2019 ) ) . However , these models require advance knowledge of the training tasks and the task changes . Memory Replay methods mainly focus on interleaving the trained samples with the new tasks . A pseudo-rehearsal mechanism proposed by Robins ( 1995 ) reduce the memory requirement to store the training samples for each task . In a pseudo-rehearsal , instead of explicitly storing the entire training samples , the training samples of previously learned tasks are drawn from a probabilistic distribution model . Shin et al . ( 2017 ) propose an architecture consisting of a deep generative model and a task solver . Similarly , Kamra et al . ( 2017 ) use a variational autoencoder to generate the previously trained samples . However , this group of models are complex to train , and in real-world cases , the sampling methods do not offer an efficient solution for sporadic and rare occurrences . These models also often require advance knowledge of the change occurring . Dynamic Networks allocate new neurons to new tasks . Yoon et al . ( 2017 ) propose Dynamic Expandable Networks ( DEN ) to learn new tasks with new parameters continuously . Similarly , Serrà et al . ( 2018 ) also allocate new parameters to learn new tasks . Masse et al . ( 2018 ) propose dynamic networks Context Dependent Gating ( XdG ) which provides the task context information to train the model . However , this group of models require the task information to be given to the model explicitly . In other words , the model knows in advance which neurons should be activated to perform each test task . To identify which neurons or experts should be used during the test state , Aljundi et al . ( 2017 ) proposed the Expert Gate and Lee et al . ( 2020 ) proposed Continual Neural Dirichlet Process Mixture ( CN-DPM ) leverage generative models to achieve the task-free continual learning , which does not need the task identities in the test phase . For each task , the Expert Gate and CN-DPM need to train a generator to distinguish the in-task and out-task samples . As the complexity of the dataset grows , the extra demand including parameters and computational resources of training a generator increases . Different from them , we introduce the probabilistic layer added into the discriminative model . Our method saves the memory since we do not need an extra model which is a generator to recognise the task identity . Furthermore , our approach can save the computational resources ( the probabilistic layer can be simultaneously trained with classification tasks and we do not need to train a generator for each expert ) . van de Ven & Tolias ( 2019 ) define different scenarios to illustrate the demand of a model for the task information . Generally , the class-incremental scenario ( Class-IL ) represents the model does not need the task information in advance , task-incremental scenario ( Task-IL ) represents the model need the task information at inference phase . 3 TASK CONDITIONAL NEURAL NETWORK . In the TCNN , each expert is independent of others and has the same behaviour during the training and inference phases . One model contains multiple expert corresponding to a different task . In this section , we introduce our model by taking one expert as an example . 3.1 ESTIMATING THE TASK LIKELIHOOD . In this work , we refer to the task likelihood as P ( t = k|x ) to represent the sample x from the kth task . To estimate the task likelihood efficiently , we add a probabilistic layer into the expert . Different from the conventional neural networks , this model contains two heads performing estimating task likelihood and classification . The classification head is connected to a classification layer , which is similar to a conventional neural network . The task likelihood head is connected to the probabilistic layer . The probabilistic layers contains several kernels , each of which performs the function shown in Equation 1 . Where the f ( · ) is the function of hidden , zi is a vector representing the ith kernel , zi has the same dimension with the output from previous layer , Σ is the covariance matrix of z1 : n , where n is the number of the kernels in the probabilistic layer . Calculating the covariance matrix could be intractable due to the high dimension of z1 : n. Since the kernels can be viewed as different data patterns , we assume the kernels in the probabilistic layers are independent of each other . K ( f ( x ) , zi ) = exp [ − 1 2 ( f ( x ) − zi ) T Σ−1 ( f ( x ) − zi ) ] ( 1 ) The Equation 1 measures the similarity between the input and existing kernels acting as anchors . The output of the probabilistic layer is an n dimensional vector . Each element in the vector can be regarded as the similarity of the input to one of the existing kernel . The summation of these n similarities can be viewed as the task likelihood . To estimate the task likelihood , we perform a normalised summation shown in Equation ( 2 ) . The range of the task likelihood P ( t|x , · ) is from 0 to 1 . P ( t|x , · ) = ∑n i=1K ( f ( x ) , zi ) n∑ i=1 K ( f ( x ) , zi ) + 1− max j=1 ... n { K ( f ( x ) , zj ) } ( 2 ) While training a new expert , we jointly maximise the task likelihood and the classification likelihood by minimizing Equation ( 3 ) . Where { x , y } is the training sample set of task k , C is the number of classes in the task k , { x ( c ) , y ( c ) } is the samples of cth class , θS is the parameters in the hidden layers shared by classification and probabilistic layer , θD and θT are the parameters in the classification and probabilistic layers respectively , λ is a hyper-parameter to weight the task likelihood loss , N is number of samples . Lv ( θS , θD , θT ) = − 1 N ( C∑ c=1 y ( c ) logP ( y ( c ) |x ( c ) , θD , θS ) + λ ∗ logP ( t = k|x , θT , θS ) ) ( 3 ) 3.2 TRAINING AND INFERENCE . Each expert is corresponding to a single task . We augment each samples to generate different views and make these views converge to the kernels in the probabilistic layer . A view generated by different pre-defined functions is a variation of the input . In this work , we define several functions to get a different view of the inputs . Including Zero Component Analysis ( ZCA ) Pal & Sudeep ( 2016 ) , shift , rotation shear and flip . More specifically , we minimize the loss function ( 4 ) , where m is the number of agumented views , Lv ( θS , θD , θT ) is the loss for the vth view . After training all K experts , we augment the test data by the same functions used in training process of each expert , and estimate the P ( y|x ) by Equation ( 5 ) , where xv is the vth view after augmentation , t = k represents the kth expert is responsible for the input . Overall , we do the training and inference process by averaging several different views . The idea is inspired by contrastive learning ( Chen et al . ( 2020 ) ) . We take the in-task samples as positive pairs and out-task samples as negative pairs to train a good feature extractor . However , in the continual learning scenarios , the out-task samples is not accessible . Hence we average multiple different views of the in-task samples to learn an anchor to distinguish the in-task and out-task samples . L = 1 m m∑ v=1 Lv ( θS , θD , θT ) ( 4 ) P ( y|x ) ≈ 1 m m∑ v=1 P ( yv|xv ) ≈ 1 m K∑ k=1 m∑ v=1 P ( yv|xv , t = k ) P ( t = k|xv ) ( 5 ) | This paper provides a new method to infer the task identity without directly accessing the old data distributions. The proposed method can learn task-specific experts with task-specific kernels to decide which expert should be chosen and activated under different tasks given to the model. The proposed method achieves strong performance on split-MNIST and split-CIFAR100 without requiring task information in advance. | SP:149fb029243e0009f79d6ba3cb2ba9ac31827c41 |
Continual Learning Using Task Conditional Neural Networks | 1 INTRODUCTION . The human brain can adapt and learn new knowledge in response to changing environments . Hoshi et al . ( 1998 ) demonstrate that we can continually learn different tasks while retaining previously learned variations of the same or similar phenomenon and give different reactions under different contexts . Similarly , Asaad et al . ( 2000 ) have found that our neurons are task-independent . Under different context , the neurons are fired selectively with respect to the stimulus . In contrast , most of the machine learning models , in a scalable way , are not capable of adapting to changing environments quickly and automatically using artificial neurons corresponding to different tasks . Consequently , conventional machine learning models tend to forget the previously learned task after learning a new task . This scenario is known as catastrophic forgetting or interference in machine learning ( McCloskey & Cohen ( 1989 ) ) . Catastrophic interference problem in machine learning is one of the hurdles to implement a general artificial intelligence learning systems ( Legg & Hutter ( 2007 ) ) . Unable to learn several tasks , a model should be trained with all the possible scenarios in advance . This requirement is intractable in practice and is not inline with the continual learning models ( Thrun & Mitchell ( 1995 ) ) . Continual machine learning algorithms change over time and adapt their parameters to data or learning goals changes . We refer to the learning goal or a specific part of the data with a learning goal as a task . The learning models are not often equipped with solutions to quickly adapt to the situations which they have seen before if their parameters have significantly changed over time by continual learning . A variety of continual learning methods have been proposed to solve the problems mentioned above . Shin et al . ( 2017 ) proposed a memory-based approach which is to replay the trained samples to solve the forgetting problem while learning a new task . Lee et al . ( 2017 ) ; Kirkpatrick et al . ( 2017 ) ; Zeng et al . ( 2018 ) leverage the regularisation methods reduce the representational overlap of different tasks . Dynamic network approaches assign extra neuron resources to new tasks ( Yoon et al . ( 2017 ) ) . Most of the existing solutions need to know all the task changes in advance , or this information is given manually to the model throughout the learning . Some other works detect in-task and out-task samples to inference the task identity ( Li et al . ( 2019 ) ; Lee et al . ( 2020 ) ) . In this work , we propose a novel method to overcome the catastrophic forgetting problem . We leverage Misture of Experts ( MoE ) ( Masoudnia & Ebrahimpour ( 2014 ) ) to train the task-specific models . One of the advantage of MoE is that we can use a shallower networks and utilise the capacity as much as possible for each expert . Theoretically , the potential capacity of the combined networks is infinite . In other words , we do not need to initialise a giant network at the beginning of the training to avoid learning further tasks without forgetting them . In each expert , we integrate the probabilistic neural networks ( Specht ( 1990 ) ) and conventional neural networks ( Haykin ( 1994 ) ) to produce the task likelihood . The final prediction of each expert will be weighted by the task likelihood and calculate the task conditional probabilities . We name our approach as Task Conditional Neural Network ( TCNN ) . 2 RELATED WORK . There are different approaches to address the forgetting problem in continual learning . Parisi et al . ( 2019 ) categorise these approaches into three groups : Regularisation , Memory Replay and Dynamic Network approaches . The regularisation approaches find the overlap of the parameter space between different tasks . One of the popular algorithms in this group is Elastic Weight Consolidation ( EWC ) proposed by Kirkpatrick et al . ( 2017 ) . EWC avoids significantly changing the parameters that are important to a learned task . It assumes the weights have Gaussian distributions and approximates the posterior distribution of the weights by the Laplace approximation . A similar idea is used in Incremental Moment Matching ( IMM ) proposed by Lee et al . ( 2017 ) . IMM finds the overlap of the parameter distributions by smoothing the loss surface of the tasks . Zeng et al . ( 2018 ) address the forgetting problem by allowing the weights to change within the same subspace of the previously learned task . Li & Hoiem ( 2018 ) address the problem by using the knowledge distillation ( Hinton et al . ( 2015 ) ) . They enforce the prediction of the learned tasks to be similar to the new tasks ( Parisi et al . ( 2019 ) ) . However , these models require advance knowledge of the training tasks and the task changes . Memory Replay methods mainly focus on interleaving the trained samples with the new tasks . A pseudo-rehearsal mechanism proposed by Robins ( 1995 ) reduce the memory requirement to store the training samples for each task . In a pseudo-rehearsal , instead of explicitly storing the entire training samples , the training samples of previously learned tasks are drawn from a probabilistic distribution model . Shin et al . ( 2017 ) propose an architecture consisting of a deep generative model and a task solver . Similarly , Kamra et al . ( 2017 ) use a variational autoencoder to generate the previously trained samples . However , this group of models are complex to train , and in real-world cases , the sampling methods do not offer an efficient solution for sporadic and rare occurrences . These models also often require advance knowledge of the change occurring . Dynamic Networks allocate new neurons to new tasks . Yoon et al . ( 2017 ) propose Dynamic Expandable Networks ( DEN ) to learn new tasks with new parameters continuously . Similarly , Serrà et al . ( 2018 ) also allocate new parameters to learn new tasks . Masse et al . ( 2018 ) propose dynamic networks Context Dependent Gating ( XdG ) which provides the task context information to train the model . However , this group of models require the task information to be given to the model explicitly . In other words , the model knows in advance which neurons should be activated to perform each test task . To identify which neurons or experts should be used during the test state , Aljundi et al . ( 2017 ) proposed the Expert Gate and Lee et al . ( 2020 ) proposed Continual Neural Dirichlet Process Mixture ( CN-DPM ) leverage generative models to achieve the task-free continual learning , which does not need the task identities in the test phase . For each task , the Expert Gate and CN-DPM need to train a generator to distinguish the in-task and out-task samples . As the complexity of the dataset grows , the extra demand including parameters and computational resources of training a generator increases . Different from them , we introduce the probabilistic layer added into the discriminative model . Our method saves the memory since we do not need an extra model which is a generator to recognise the task identity . Furthermore , our approach can save the computational resources ( the probabilistic layer can be simultaneously trained with classification tasks and we do not need to train a generator for each expert ) . van de Ven & Tolias ( 2019 ) define different scenarios to illustrate the demand of a model for the task information . Generally , the class-incremental scenario ( Class-IL ) represents the model does not need the task information in advance , task-incremental scenario ( Task-IL ) represents the model need the task information at inference phase . 3 TASK CONDITIONAL NEURAL NETWORK . In the TCNN , each expert is independent of others and has the same behaviour during the training and inference phases . One model contains multiple expert corresponding to a different task . In this section , we introduce our model by taking one expert as an example . 3.1 ESTIMATING THE TASK LIKELIHOOD . In this work , we refer to the task likelihood as P ( t = k|x ) to represent the sample x from the kth task . To estimate the task likelihood efficiently , we add a probabilistic layer into the expert . Different from the conventional neural networks , this model contains two heads performing estimating task likelihood and classification . The classification head is connected to a classification layer , which is similar to a conventional neural network . The task likelihood head is connected to the probabilistic layer . The probabilistic layers contains several kernels , each of which performs the function shown in Equation 1 . Where the f ( · ) is the function of hidden , zi is a vector representing the ith kernel , zi has the same dimension with the output from previous layer , Σ is the covariance matrix of z1 : n , where n is the number of the kernels in the probabilistic layer . Calculating the covariance matrix could be intractable due to the high dimension of z1 : n. Since the kernels can be viewed as different data patterns , we assume the kernels in the probabilistic layers are independent of each other . K ( f ( x ) , zi ) = exp [ − 1 2 ( f ( x ) − zi ) T Σ−1 ( f ( x ) − zi ) ] ( 1 ) The Equation 1 measures the similarity between the input and existing kernels acting as anchors . The output of the probabilistic layer is an n dimensional vector . Each element in the vector can be regarded as the similarity of the input to one of the existing kernel . The summation of these n similarities can be viewed as the task likelihood . To estimate the task likelihood , we perform a normalised summation shown in Equation ( 2 ) . The range of the task likelihood P ( t|x , · ) is from 0 to 1 . P ( t|x , · ) = ∑n i=1K ( f ( x ) , zi ) n∑ i=1 K ( f ( x ) , zi ) + 1− max j=1 ... n { K ( f ( x ) , zj ) } ( 2 ) While training a new expert , we jointly maximise the task likelihood and the classification likelihood by minimizing Equation ( 3 ) . Where { x , y } is the training sample set of task k , C is the number of classes in the task k , { x ( c ) , y ( c ) } is the samples of cth class , θS is the parameters in the hidden layers shared by classification and probabilistic layer , θD and θT are the parameters in the classification and probabilistic layers respectively , λ is a hyper-parameter to weight the task likelihood loss , N is number of samples . Lv ( θS , θD , θT ) = − 1 N ( C∑ c=1 y ( c ) logP ( y ( c ) |x ( c ) , θD , θS ) + λ ∗ logP ( t = k|x , θT , θS ) ) ( 3 ) 3.2 TRAINING AND INFERENCE . Each expert is corresponding to a single task . We augment each samples to generate different views and make these views converge to the kernels in the probabilistic layer . A view generated by different pre-defined functions is a variation of the input . In this work , we define several functions to get a different view of the inputs . Including Zero Component Analysis ( ZCA ) Pal & Sudeep ( 2016 ) , shift , rotation shear and flip . More specifically , we minimize the loss function ( 4 ) , where m is the number of agumented views , Lv ( θS , θD , θT ) is the loss for the vth view . After training all K experts , we augment the test data by the same functions used in training process of each expert , and estimate the P ( y|x ) by Equation ( 5 ) , where xv is the vth view after augmentation , t = k represents the kth expert is responsible for the input . Overall , we do the training and inference process by averaging several different views . The idea is inspired by contrastive learning ( Chen et al . ( 2020 ) ) . We take the in-task samples as positive pairs and out-task samples as negative pairs to train a good feature extractor . However , in the continual learning scenarios , the out-task samples is not accessible . Hence we average multiple different views of the in-task samples to learn an anchor to distinguish the in-task and out-task samples . L = 1 m m∑ v=1 Lv ( θS , θD , θT ) ( 4 ) P ( y|x ) ≈ 1 m m∑ v=1 P ( yv|xv ) ≈ 1 m K∑ k=1 m∑ v=1 P ( yv|xv , t = k ) P ( t = k|xv ) ( 5 ) | This paper introduces Task Conditional Neural Network for continual learning. The method is based on mixture of experts. Each expert is independent of other experts and therefore the model is not susceptible to catastrophic forgetting. | SP:149fb029243e0009f79d6ba3cb2ba9ac31827c41 |
Continual Learning Using Task Conditional Neural Networks | 1 INTRODUCTION . The human brain can adapt and learn new knowledge in response to changing environments . Hoshi et al . ( 1998 ) demonstrate that we can continually learn different tasks while retaining previously learned variations of the same or similar phenomenon and give different reactions under different contexts . Similarly , Asaad et al . ( 2000 ) have found that our neurons are task-independent . Under different context , the neurons are fired selectively with respect to the stimulus . In contrast , most of the machine learning models , in a scalable way , are not capable of adapting to changing environments quickly and automatically using artificial neurons corresponding to different tasks . Consequently , conventional machine learning models tend to forget the previously learned task after learning a new task . This scenario is known as catastrophic forgetting or interference in machine learning ( McCloskey & Cohen ( 1989 ) ) . Catastrophic interference problem in machine learning is one of the hurdles to implement a general artificial intelligence learning systems ( Legg & Hutter ( 2007 ) ) . Unable to learn several tasks , a model should be trained with all the possible scenarios in advance . This requirement is intractable in practice and is not inline with the continual learning models ( Thrun & Mitchell ( 1995 ) ) . Continual machine learning algorithms change over time and adapt their parameters to data or learning goals changes . We refer to the learning goal or a specific part of the data with a learning goal as a task . The learning models are not often equipped with solutions to quickly adapt to the situations which they have seen before if their parameters have significantly changed over time by continual learning . A variety of continual learning methods have been proposed to solve the problems mentioned above . Shin et al . ( 2017 ) proposed a memory-based approach which is to replay the trained samples to solve the forgetting problem while learning a new task . Lee et al . ( 2017 ) ; Kirkpatrick et al . ( 2017 ) ; Zeng et al . ( 2018 ) leverage the regularisation methods reduce the representational overlap of different tasks . Dynamic network approaches assign extra neuron resources to new tasks ( Yoon et al . ( 2017 ) ) . Most of the existing solutions need to know all the task changes in advance , or this information is given manually to the model throughout the learning . Some other works detect in-task and out-task samples to inference the task identity ( Li et al . ( 2019 ) ; Lee et al . ( 2020 ) ) . In this work , we propose a novel method to overcome the catastrophic forgetting problem . We leverage Misture of Experts ( MoE ) ( Masoudnia & Ebrahimpour ( 2014 ) ) to train the task-specific models . One of the advantage of MoE is that we can use a shallower networks and utilise the capacity as much as possible for each expert . Theoretically , the potential capacity of the combined networks is infinite . In other words , we do not need to initialise a giant network at the beginning of the training to avoid learning further tasks without forgetting them . In each expert , we integrate the probabilistic neural networks ( Specht ( 1990 ) ) and conventional neural networks ( Haykin ( 1994 ) ) to produce the task likelihood . The final prediction of each expert will be weighted by the task likelihood and calculate the task conditional probabilities . We name our approach as Task Conditional Neural Network ( TCNN ) . 2 RELATED WORK . There are different approaches to address the forgetting problem in continual learning . Parisi et al . ( 2019 ) categorise these approaches into three groups : Regularisation , Memory Replay and Dynamic Network approaches . The regularisation approaches find the overlap of the parameter space between different tasks . One of the popular algorithms in this group is Elastic Weight Consolidation ( EWC ) proposed by Kirkpatrick et al . ( 2017 ) . EWC avoids significantly changing the parameters that are important to a learned task . It assumes the weights have Gaussian distributions and approximates the posterior distribution of the weights by the Laplace approximation . A similar idea is used in Incremental Moment Matching ( IMM ) proposed by Lee et al . ( 2017 ) . IMM finds the overlap of the parameter distributions by smoothing the loss surface of the tasks . Zeng et al . ( 2018 ) address the forgetting problem by allowing the weights to change within the same subspace of the previously learned task . Li & Hoiem ( 2018 ) address the problem by using the knowledge distillation ( Hinton et al . ( 2015 ) ) . They enforce the prediction of the learned tasks to be similar to the new tasks ( Parisi et al . ( 2019 ) ) . However , these models require advance knowledge of the training tasks and the task changes . Memory Replay methods mainly focus on interleaving the trained samples with the new tasks . A pseudo-rehearsal mechanism proposed by Robins ( 1995 ) reduce the memory requirement to store the training samples for each task . In a pseudo-rehearsal , instead of explicitly storing the entire training samples , the training samples of previously learned tasks are drawn from a probabilistic distribution model . Shin et al . ( 2017 ) propose an architecture consisting of a deep generative model and a task solver . Similarly , Kamra et al . ( 2017 ) use a variational autoencoder to generate the previously trained samples . However , this group of models are complex to train , and in real-world cases , the sampling methods do not offer an efficient solution for sporadic and rare occurrences . These models also often require advance knowledge of the change occurring . Dynamic Networks allocate new neurons to new tasks . Yoon et al . ( 2017 ) propose Dynamic Expandable Networks ( DEN ) to learn new tasks with new parameters continuously . Similarly , Serrà et al . ( 2018 ) also allocate new parameters to learn new tasks . Masse et al . ( 2018 ) propose dynamic networks Context Dependent Gating ( XdG ) which provides the task context information to train the model . However , this group of models require the task information to be given to the model explicitly . In other words , the model knows in advance which neurons should be activated to perform each test task . To identify which neurons or experts should be used during the test state , Aljundi et al . ( 2017 ) proposed the Expert Gate and Lee et al . ( 2020 ) proposed Continual Neural Dirichlet Process Mixture ( CN-DPM ) leverage generative models to achieve the task-free continual learning , which does not need the task identities in the test phase . For each task , the Expert Gate and CN-DPM need to train a generator to distinguish the in-task and out-task samples . As the complexity of the dataset grows , the extra demand including parameters and computational resources of training a generator increases . Different from them , we introduce the probabilistic layer added into the discriminative model . Our method saves the memory since we do not need an extra model which is a generator to recognise the task identity . Furthermore , our approach can save the computational resources ( the probabilistic layer can be simultaneously trained with classification tasks and we do not need to train a generator for each expert ) . van de Ven & Tolias ( 2019 ) define different scenarios to illustrate the demand of a model for the task information . Generally , the class-incremental scenario ( Class-IL ) represents the model does not need the task information in advance , task-incremental scenario ( Task-IL ) represents the model need the task information at inference phase . 3 TASK CONDITIONAL NEURAL NETWORK . In the TCNN , each expert is independent of others and has the same behaviour during the training and inference phases . One model contains multiple expert corresponding to a different task . In this section , we introduce our model by taking one expert as an example . 3.1 ESTIMATING THE TASK LIKELIHOOD . In this work , we refer to the task likelihood as P ( t = k|x ) to represent the sample x from the kth task . To estimate the task likelihood efficiently , we add a probabilistic layer into the expert . Different from the conventional neural networks , this model contains two heads performing estimating task likelihood and classification . The classification head is connected to a classification layer , which is similar to a conventional neural network . The task likelihood head is connected to the probabilistic layer . The probabilistic layers contains several kernels , each of which performs the function shown in Equation 1 . Where the f ( · ) is the function of hidden , zi is a vector representing the ith kernel , zi has the same dimension with the output from previous layer , Σ is the covariance matrix of z1 : n , where n is the number of the kernels in the probabilistic layer . Calculating the covariance matrix could be intractable due to the high dimension of z1 : n. Since the kernels can be viewed as different data patterns , we assume the kernels in the probabilistic layers are independent of each other . K ( f ( x ) , zi ) = exp [ − 1 2 ( f ( x ) − zi ) T Σ−1 ( f ( x ) − zi ) ] ( 1 ) The Equation 1 measures the similarity between the input and existing kernels acting as anchors . The output of the probabilistic layer is an n dimensional vector . Each element in the vector can be regarded as the similarity of the input to one of the existing kernel . The summation of these n similarities can be viewed as the task likelihood . To estimate the task likelihood , we perform a normalised summation shown in Equation ( 2 ) . The range of the task likelihood P ( t|x , · ) is from 0 to 1 . P ( t|x , · ) = ∑n i=1K ( f ( x ) , zi ) n∑ i=1 K ( f ( x ) , zi ) + 1− max j=1 ... n { K ( f ( x ) , zj ) } ( 2 ) While training a new expert , we jointly maximise the task likelihood and the classification likelihood by minimizing Equation ( 3 ) . Where { x , y } is the training sample set of task k , C is the number of classes in the task k , { x ( c ) , y ( c ) } is the samples of cth class , θS is the parameters in the hidden layers shared by classification and probabilistic layer , θD and θT are the parameters in the classification and probabilistic layers respectively , λ is a hyper-parameter to weight the task likelihood loss , N is number of samples . Lv ( θS , θD , θT ) = − 1 N ( C∑ c=1 y ( c ) logP ( y ( c ) |x ( c ) , θD , θS ) + λ ∗ logP ( t = k|x , θT , θS ) ) ( 3 ) 3.2 TRAINING AND INFERENCE . Each expert is corresponding to a single task . We augment each samples to generate different views and make these views converge to the kernels in the probabilistic layer . A view generated by different pre-defined functions is a variation of the input . In this work , we define several functions to get a different view of the inputs . Including Zero Component Analysis ( ZCA ) Pal & Sudeep ( 2016 ) , shift , rotation shear and flip . More specifically , we minimize the loss function ( 4 ) , where m is the number of agumented views , Lv ( θS , θD , θT ) is the loss for the vth view . After training all K experts , we augment the test data by the same functions used in training process of each expert , and estimate the P ( y|x ) by Equation ( 5 ) , where xv is the vth view after augmentation , t = k represents the kth expert is responsible for the input . Overall , we do the training and inference process by averaging several different views . The idea is inspired by contrastive learning ( Chen et al . ( 2020 ) ) . We take the in-task samples as positive pairs and out-task samples as negative pairs to train a good feature extractor . However , in the continual learning scenarios , the out-task samples is not accessible . Hence we average multiple different views of the in-task samples to learn an anchor to distinguish the in-task and out-task samples . L = 1 m m∑ v=1 Lv ( θS , θD , θT ) ( 4 ) P ( y|x ) ≈ 1 m m∑ v=1 P ( yv|xv ) ≈ 1 m K∑ k=1 m∑ v=1 P ( yv|xv , t = k ) P ( t = k|xv ) ( 5 ) | This paper attempts to proposed a new method called Task Continual Neural Network to address the problem of task identity inference in continual learning. The proposed method estimates the task likelihood by constructing a probabilistic layer based on the idea of mixture of experts (MoE). Experiments on benchmark datasets demonstrate the effectiveness of this method. | SP:149fb029243e0009f79d6ba3cb2ba9ac31827c41 |
Learning to Pool in Graph Neural Networks for Extrapolation | 1 INTRODUCTION . Many real-world data , such as relationships between people in social networks or chemical bonds between atoms , can naturally be represented as graphs . Finding models with proper inductive biases to better describe such graph data has been a common goal for many researchers , and Graph Neural Networks ( GNNs ) ( Scarselli et al. , 2009 ; Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2019 ; Maron et al. , 2019 ; Xu et al. , 2020 ) are considered to be the most successful model . They have proved effective for a variety of tasks , including recommendation ( Ying et al. , 2018a ) , drug discovery ( Stokes et al. , 2020 ) , and chip design ( Mirhoseini et al. , 2020 ) . An important design choice for a GNN often overlooked is the specification of pooling functions , the functions used for the aggregation or readout operation in GNNs . They are usually required to be invariant w.r.t . the permutation of nodes in a graph , and common choices are element-wise summation ( sum ) , maximum ( max ) , minimum ( min ) , or average ( mean ) . Some recent works also proposed to use parametric models and learn them from data as well ( Ying et al. , 2018b ; Lee et al. , 2019b ; Gao & Ji , 2019 ; Yuan & Ji , 2020 ) . While most of the previous works on this line focused on improving predictive performance for their own tasks , recently , Xu et al . ( 2021 ) studied the impact of the choice of pooling functions on the ability of a neural network to extrapolate . Specifically , Xu et al . ( 2021 ) highlighted the importance of the choice of pooling functions in order to make GNNs generalize over the data lying outside of the support of the training data distribution , and they argued that the specification of the pooling functions acts as an important inductive bias that can make GNNs either completely fail to extrapolate or gracefully generalize to out-of-distribution data . As a motivating example , consider the problem of counting the number of nodes in a graph . If we are to solve this problem with a single-layer GNN having one readout layer , probably the best pooling function would be sum , and the corresponding model will readily generalize to graphs with a much larger number of nodes than the ones seen during training . On the other hand , if we choose the pooling function as max instead , it may still fit the training data well but completely fail to predict the number of nodes in out-of-distribution graphs . The findings in Xu et al . ( 2021 ) raise a natural question ; which pooling functions should be used for a given problem in order to make GNNs constructed with them successfully extrapolate for out-of-distribution data ? Xu et al . ( 2021 ) did not present any guide but empirically showed that we do have the “ right ” pooling function for each problem tested , and when a pooling function is not properly selected , GNNs completely fails to extrapolate . The caveat here is that we do not know which pooling function is the right choice before actually training and validating the model . To this end , in this paper , we present a generic learning-based method to find proper pooling functions for a given arbitrary problem . Our method , entitled Generalized Norm-based Pooling ( GNP ) , formulates the pooling functions as a generic Lp norm-like function ( including negative p as well ) , and learns the parameters inside the pooling functions in an end-to-end fashion . Unlike previous learning-based pooling methods that are usually tailored for specific tasks or focused on improving predictive performances , GNP can be applied to arbitrary tasks , and it improves the extrapolation ability of GNNs constructed with it . Also , GNP includes most of the pooling functions being used for GNNs as special cases . Despite the enhanced flexibility , GNP incurs minimal overhead in GNN in terms of the model complexity . A naı̈ve application of GNP to GNNs is likely to fail because of some difficulty in training , so we propose a simple remedy to this . Using nine graph-level , node-level , and set-related tasks , we demonstrate that GNNs with GNP trained by our training scheme extrapolate for out-of-distribution data comparably and sometimes even better than those with pooling functions that are carefully chosen among of widely-used ones . In addition , we demonstrate the effectiveness of GNP on four real-world tasks ( graph classification , influence maximization , node classification , and graph regression ) using six additional GNN architectures ( GCN ( Kipf & Welling , 2017 ) , GAT ( Veličković et al. , 2018 ) , PNA ( Corso et al. , 2020 ) , hierarchical SAGPool ( Lee et al. , 2019b ) , ASAPool ( Ranjan et al. , 2020 ) , and MONSTOR ( Ko et al. , 2020 ) ) and eight real-world graphs . We summarize our contributions as follows : • Generalized pooling function : We propose GNP , a simple yet flexible pooling function that can readily be applied to arbitrary tasks involving GNNs , with minimal parameter overhead . • Effective training methods : We propose effective training methods for GNP . • Extensive experiments : We empirically demonstrate that GNNs with GNP generalize to out-of- distribution data on nine extrapolation tasks . We also show successful application of GNP to six GNN architectures on four real-world tasks in eight real-world graphs with up to one million edges . 2 RELATED WORK . Aggregation functions Various aggregation functions have been appeared to enhance the performance of GNNs . Hamilton et al . ( 2017 ) proposed GraphSAGE with four different aggregation methods ; max , mean , GCN ( Kipf & Welling , 2017 ) , and LSTM ( Hochreiter & Schmidhuber , 1997 ) . Veličković et al . ( 2018 ) proposed Graph Attention neTworks ( GATs ) including attention-based aggregation functions ( Vaswani et al. , 2017 ) . Xu et al . ( 2019 ) proposed Graph Isomorphism Networks ( GINs ) and proved that GNN can satisfy the 1-Weisfeiler-Lehman ( WL ) condition only with sum pooling function as aggregation function . Recently , Li et al . ( 2020 ) proposed a trainable softmax and power-mean aggregation function that generalizes basic operators . Compared to these methods designed to improve interpolation performance on specific tasks , ours can improve extrapolation performance for generic tasks . Readout functions Zhang et al . ( 2018 ) suggested SortPooling that chooses top-k values from the sorted list of the node features to construct outputs . Another popular idea is hierarchical pooling , where outputs are obtained by iteratively coarsening nodes in graphs in a hierarchical fashion ( Ying et al. , 2018b ; Gao & Ji , 2019 ; Lee et al. , 2019b ; Yuan & Ji , 2020 ) . Although demonstrated to be effective for the tasks they have been designed for , most of these methods require heavy computation and it is not straightforward to extend them for aggregation functions . On the other hand , our GNP can be applied to both aggregation and readout functions with minimal overhead . Pooling functions in generic context Vinyals et al . ( 2015 ) proposed Set2Set to get a representation of set-structured data with a LSTM-based pooling function . Lee et al . ( 2019a ) proposed to use an attention-based pooling function to get summaries of set data . For convolutional neural networks , there were some approaches to generalize average pooling and max pooling widely used for many neural network architectures . Gulcehre et al . ( 2014 ) proposed a normalized learnable Lp norm function that generalizes average pooling and max pooling . Lee et al . ( 2016 ) further extended those pooling functions with learnable tree-structured pooling filters . Norm-based pooling functions There have been several works to employ norm-based pooling functions . Gulcehre et al . ( 2014 ) proposed a learnable Lp norm function of the form f ( v ) = ( 1 |v| |v|∑ i=1 |vi|p ) 1/p to substitute max pooling or average pooling used in convolutional neural networks . Similar normbased pooling functions were used for acoustic modeling ( Swietojanski & Renals , 2016 ) and text representation ( Wu et al. , 2020 ) . Compared to GNP , these pooling methods can not express the sum pooling . Li et al . ( 2020 ) further generalized this by multiplying |v|q to include sum pooling as well , but not considered the case where p is positive and the case where p is negative at the same time . GNP is the most generic norm-based pooling function , compared to all aforementioned approaches , and more importantly , no other works studied their usefulness in the context of learning to extrapolate . Extrapolation Trask et al . ( 2018 ) pointed out that most of the feed-forward neural networks fail to extrapolate even for the simplest possible identity mapping , and suggested using alternative computation units mimicking the behavior of arithmetic logic units . The ability to extrapolate is also important in the GNN context , for instance , many combinatorial optimization problems involving graphs often require extrapolation . Selsam et al . ( 2019 ) ; Prates et al . ( 2019 ) tackled the extrapolation problem by performing large iterations of message passing . Using various classical graph algorithms , Veličković et al . ( 2020 ) showed that the extrapolation performance of GNNs depends heavily on the choice of the aggregation function . Similarly , Xu et al . ( 2021 ) demonstrated that choosing the right non-linear function for both MLPs and GNNs is crucial for the extrapolation . 3 MAIN CONTRIBUTION : GENERALIZED NORM-BASED POOLING . In this section , we present our Generalized Norm-based Pooling ( GNP ) and discuss its expressiveness . Then , we describe some difficulties in training GNP and our remedy . Lastly , we present a task on which a GNN with GNP can extrapolate , while that equipped with the basic pooling functions can not . 3.1 GENERALIZATION OF BASIC POOLING FUNCTIONS . While GNP is motivated by the Lp-norm function , which includes the sum and max functions as special cases , further ingredients are added to make GNP more flexible than the Lp-norm function . Specifically , we allow p to be negative to let GNP express a wider class of functions than the previous norm-based or learning-based pooling functions . Let V = { vi } ni=1 be a set of node features with vi ∈ Rd for i = 1 , . . . , n. We define GNP to be an element-wise function where the output for each jth element is GNPj ( V ) = 1 nq ( n∑ i=1 |vi , j |p ) 1/p , where p ∈ R \ { 0 } and q ∈ R are learnable parameters . GNP includes the basic pooling functions ( sum , mean , max , and min ) as special cases . Proposition 1 . Suppose all the entries of v are non-negative in equation 3.1 . Then , GNP includes sum , max , mean as special cases . If we further restrict v to be positive , GNP includes min . Proof . GNPj ( V ) is equivalent to elementwise sum when ( p , q ) = ( 1 , 0 ) and elementwise mean when ( p , q ) = ( 1 , 1 ) . When q = 0 , we have lim p→∞ GNPj ( V ) = max i vi lim p→∞ ( n∑ i=1 ( |vi , j | maxi |vi , j | ) p ) 1/p = max i |vi , j | · 1 = max i |vi , j | , ( 1 ) so GNP converges to max . Similarly , we can obtain min as a limit for p→ −∞ . 3.2 HANDLING OF NEGATIVE p The GNP function in equation 3.1 is not continuous and even not defined at p = 0 . Hence , directly learning GNP in the original form as in equation 3.1 ( even with p = 0 ignored ) can cause instability , especially when an algorithm is trying to move from a positive p value to a negative p value . Instead , we suggest splitting the GNP function into two parts , GNP+ with positive p and GNP− with negative p , and let the model choose the right balance between them . Specifically , define GNP+j ( V ) = 1 nq+ ( n∑ i=1 |vi , j |p + ) 1/p+ , GNP−j ( V ) = 1 nq− ( n∑ i=1 |vi , j |−p − ) −1/p− , ( 2 ) where p+ > 0 , q+ , p− > 0 , and q− are learnable parameters . Given a set of node features V , we first split the feature dimension into two , and compute the output from GNP+ for the first half and from GNP− for the second half . Then we mix two outputs with a single linear layer to get the final output . y = [ GNP+1 ( V ) . . . GNP + bd/2c ( V ) GNP − bd/2c+1 ( V ) . . . GNP − d ( V ) ] , ( 3 ) GNP ( V ) = Wy + b , ( 4 ) where b·c is the floor function , W ∈ Rd×d and b ∈ Rd are learnable parameters . Note that widelyused GNN layers have a linear layer or MLP after message-passing between nodes . Instead of using an additional linear layer , GNP concatenates the outputs of GNP+ and GNP− and passes them to the linear layer or MLP . Therefore , we have only four extra parameters ( p+ , p− , q+ and q− ) for each GNN layer of typical GNN architectures . With this design , GNP can easily switch between positive p and negative p , choosing proper values according to tasks . | Authors propose GNP, a new pooling operation for Graph Neural Network which subsumes max, min, mean and sum as special cases. The premise of the paper is promising - if a single layer can provide the performance of max, min mean and sum, through two new learning parameters, it would be a big win for research. On certain occasions, it is unclear which pooling function is the best and researchers resort to large grid searches to identify which ones work best. This could do away with that. However, I feel that the paper falls a little short of delivering this. | SP:2220849fb4d0a0a21502b239865c70a49fa4962c |
Learning to Pool in Graph Neural Networks for Extrapolation | 1 INTRODUCTION . Many real-world data , such as relationships between people in social networks or chemical bonds between atoms , can naturally be represented as graphs . Finding models with proper inductive biases to better describe such graph data has been a common goal for many researchers , and Graph Neural Networks ( GNNs ) ( Scarselli et al. , 2009 ; Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2019 ; Maron et al. , 2019 ; Xu et al. , 2020 ) are considered to be the most successful model . They have proved effective for a variety of tasks , including recommendation ( Ying et al. , 2018a ) , drug discovery ( Stokes et al. , 2020 ) , and chip design ( Mirhoseini et al. , 2020 ) . An important design choice for a GNN often overlooked is the specification of pooling functions , the functions used for the aggregation or readout operation in GNNs . They are usually required to be invariant w.r.t . the permutation of nodes in a graph , and common choices are element-wise summation ( sum ) , maximum ( max ) , minimum ( min ) , or average ( mean ) . Some recent works also proposed to use parametric models and learn them from data as well ( Ying et al. , 2018b ; Lee et al. , 2019b ; Gao & Ji , 2019 ; Yuan & Ji , 2020 ) . While most of the previous works on this line focused on improving predictive performance for their own tasks , recently , Xu et al . ( 2021 ) studied the impact of the choice of pooling functions on the ability of a neural network to extrapolate . Specifically , Xu et al . ( 2021 ) highlighted the importance of the choice of pooling functions in order to make GNNs generalize over the data lying outside of the support of the training data distribution , and they argued that the specification of the pooling functions acts as an important inductive bias that can make GNNs either completely fail to extrapolate or gracefully generalize to out-of-distribution data . As a motivating example , consider the problem of counting the number of nodes in a graph . If we are to solve this problem with a single-layer GNN having one readout layer , probably the best pooling function would be sum , and the corresponding model will readily generalize to graphs with a much larger number of nodes than the ones seen during training . On the other hand , if we choose the pooling function as max instead , it may still fit the training data well but completely fail to predict the number of nodes in out-of-distribution graphs . The findings in Xu et al . ( 2021 ) raise a natural question ; which pooling functions should be used for a given problem in order to make GNNs constructed with them successfully extrapolate for out-of-distribution data ? Xu et al . ( 2021 ) did not present any guide but empirically showed that we do have the “ right ” pooling function for each problem tested , and when a pooling function is not properly selected , GNNs completely fails to extrapolate . The caveat here is that we do not know which pooling function is the right choice before actually training and validating the model . To this end , in this paper , we present a generic learning-based method to find proper pooling functions for a given arbitrary problem . Our method , entitled Generalized Norm-based Pooling ( GNP ) , formulates the pooling functions as a generic Lp norm-like function ( including negative p as well ) , and learns the parameters inside the pooling functions in an end-to-end fashion . Unlike previous learning-based pooling methods that are usually tailored for specific tasks or focused on improving predictive performances , GNP can be applied to arbitrary tasks , and it improves the extrapolation ability of GNNs constructed with it . Also , GNP includes most of the pooling functions being used for GNNs as special cases . Despite the enhanced flexibility , GNP incurs minimal overhead in GNN in terms of the model complexity . A naı̈ve application of GNP to GNNs is likely to fail because of some difficulty in training , so we propose a simple remedy to this . Using nine graph-level , node-level , and set-related tasks , we demonstrate that GNNs with GNP trained by our training scheme extrapolate for out-of-distribution data comparably and sometimes even better than those with pooling functions that are carefully chosen among of widely-used ones . In addition , we demonstrate the effectiveness of GNP on four real-world tasks ( graph classification , influence maximization , node classification , and graph regression ) using six additional GNN architectures ( GCN ( Kipf & Welling , 2017 ) , GAT ( Veličković et al. , 2018 ) , PNA ( Corso et al. , 2020 ) , hierarchical SAGPool ( Lee et al. , 2019b ) , ASAPool ( Ranjan et al. , 2020 ) , and MONSTOR ( Ko et al. , 2020 ) ) and eight real-world graphs . We summarize our contributions as follows : • Generalized pooling function : We propose GNP , a simple yet flexible pooling function that can readily be applied to arbitrary tasks involving GNNs , with minimal parameter overhead . • Effective training methods : We propose effective training methods for GNP . • Extensive experiments : We empirically demonstrate that GNNs with GNP generalize to out-of- distribution data on nine extrapolation tasks . We also show successful application of GNP to six GNN architectures on four real-world tasks in eight real-world graphs with up to one million edges . 2 RELATED WORK . Aggregation functions Various aggregation functions have been appeared to enhance the performance of GNNs . Hamilton et al . ( 2017 ) proposed GraphSAGE with four different aggregation methods ; max , mean , GCN ( Kipf & Welling , 2017 ) , and LSTM ( Hochreiter & Schmidhuber , 1997 ) . Veličković et al . ( 2018 ) proposed Graph Attention neTworks ( GATs ) including attention-based aggregation functions ( Vaswani et al. , 2017 ) . Xu et al . ( 2019 ) proposed Graph Isomorphism Networks ( GINs ) and proved that GNN can satisfy the 1-Weisfeiler-Lehman ( WL ) condition only with sum pooling function as aggregation function . Recently , Li et al . ( 2020 ) proposed a trainable softmax and power-mean aggregation function that generalizes basic operators . Compared to these methods designed to improve interpolation performance on specific tasks , ours can improve extrapolation performance for generic tasks . Readout functions Zhang et al . ( 2018 ) suggested SortPooling that chooses top-k values from the sorted list of the node features to construct outputs . Another popular idea is hierarchical pooling , where outputs are obtained by iteratively coarsening nodes in graphs in a hierarchical fashion ( Ying et al. , 2018b ; Gao & Ji , 2019 ; Lee et al. , 2019b ; Yuan & Ji , 2020 ) . Although demonstrated to be effective for the tasks they have been designed for , most of these methods require heavy computation and it is not straightforward to extend them for aggregation functions . On the other hand , our GNP can be applied to both aggregation and readout functions with minimal overhead . Pooling functions in generic context Vinyals et al . ( 2015 ) proposed Set2Set to get a representation of set-structured data with a LSTM-based pooling function . Lee et al . ( 2019a ) proposed to use an attention-based pooling function to get summaries of set data . For convolutional neural networks , there were some approaches to generalize average pooling and max pooling widely used for many neural network architectures . Gulcehre et al . ( 2014 ) proposed a normalized learnable Lp norm function that generalizes average pooling and max pooling . Lee et al . ( 2016 ) further extended those pooling functions with learnable tree-structured pooling filters . Norm-based pooling functions There have been several works to employ norm-based pooling functions . Gulcehre et al . ( 2014 ) proposed a learnable Lp norm function of the form f ( v ) = ( 1 |v| |v|∑ i=1 |vi|p ) 1/p to substitute max pooling or average pooling used in convolutional neural networks . Similar normbased pooling functions were used for acoustic modeling ( Swietojanski & Renals , 2016 ) and text representation ( Wu et al. , 2020 ) . Compared to GNP , these pooling methods can not express the sum pooling . Li et al . ( 2020 ) further generalized this by multiplying |v|q to include sum pooling as well , but not considered the case where p is positive and the case where p is negative at the same time . GNP is the most generic norm-based pooling function , compared to all aforementioned approaches , and more importantly , no other works studied their usefulness in the context of learning to extrapolate . Extrapolation Trask et al . ( 2018 ) pointed out that most of the feed-forward neural networks fail to extrapolate even for the simplest possible identity mapping , and suggested using alternative computation units mimicking the behavior of arithmetic logic units . The ability to extrapolate is also important in the GNN context , for instance , many combinatorial optimization problems involving graphs often require extrapolation . Selsam et al . ( 2019 ) ; Prates et al . ( 2019 ) tackled the extrapolation problem by performing large iterations of message passing . Using various classical graph algorithms , Veličković et al . ( 2020 ) showed that the extrapolation performance of GNNs depends heavily on the choice of the aggregation function . Similarly , Xu et al . ( 2021 ) demonstrated that choosing the right non-linear function for both MLPs and GNNs is crucial for the extrapolation . 3 MAIN CONTRIBUTION : GENERALIZED NORM-BASED POOLING . In this section , we present our Generalized Norm-based Pooling ( GNP ) and discuss its expressiveness . Then , we describe some difficulties in training GNP and our remedy . Lastly , we present a task on which a GNN with GNP can extrapolate , while that equipped with the basic pooling functions can not . 3.1 GENERALIZATION OF BASIC POOLING FUNCTIONS . While GNP is motivated by the Lp-norm function , which includes the sum and max functions as special cases , further ingredients are added to make GNP more flexible than the Lp-norm function . Specifically , we allow p to be negative to let GNP express a wider class of functions than the previous norm-based or learning-based pooling functions . Let V = { vi } ni=1 be a set of node features with vi ∈ Rd for i = 1 , . . . , n. We define GNP to be an element-wise function where the output for each jth element is GNPj ( V ) = 1 nq ( n∑ i=1 |vi , j |p ) 1/p , where p ∈ R \ { 0 } and q ∈ R are learnable parameters . GNP includes the basic pooling functions ( sum , mean , max , and min ) as special cases . Proposition 1 . Suppose all the entries of v are non-negative in equation 3.1 . Then , GNP includes sum , max , mean as special cases . If we further restrict v to be positive , GNP includes min . Proof . GNPj ( V ) is equivalent to elementwise sum when ( p , q ) = ( 1 , 0 ) and elementwise mean when ( p , q ) = ( 1 , 1 ) . When q = 0 , we have lim p→∞ GNPj ( V ) = max i vi lim p→∞ ( n∑ i=1 ( |vi , j | maxi |vi , j | ) p ) 1/p = max i |vi , j | · 1 = max i |vi , j | , ( 1 ) so GNP converges to max . Similarly , we can obtain min as a limit for p→ −∞ . 3.2 HANDLING OF NEGATIVE p The GNP function in equation 3.1 is not continuous and even not defined at p = 0 . Hence , directly learning GNP in the original form as in equation 3.1 ( even with p = 0 ignored ) can cause instability , especially when an algorithm is trying to move from a positive p value to a negative p value . Instead , we suggest splitting the GNP function into two parts , GNP+ with positive p and GNP− with negative p , and let the model choose the right balance between them . Specifically , define GNP+j ( V ) = 1 nq+ ( n∑ i=1 |vi , j |p + ) 1/p+ , GNP−j ( V ) = 1 nq− ( n∑ i=1 |vi , j |−p − ) −1/p− , ( 2 ) where p+ > 0 , q+ , p− > 0 , and q− are learnable parameters . Given a set of node features V , we first split the feature dimension into two , and compute the output from GNP+ for the first half and from GNP− for the second half . Then we mix two outputs with a single linear layer to get the final output . y = [ GNP+1 ( V ) . . . GNP + bd/2c ( V ) GNP − bd/2c+1 ( V ) . . . GNP − d ( V ) ] , ( 3 ) GNP ( V ) = Wy + b , ( 4 ) where b·c is the floor function , W ∈ Rd×d and b ∈ Rd are learnable parameters . Note that widelyused GNN layers have a linear layer or MLP after message-passing between nodes . Instead of using an additional linear layer , GNP concatenates the outputs of GNP+ and GNP− and passes them to the linear layer or MLP . Therefore , we have only four extra parameters ( p+ , p− , q+ and q− ) for each GNN layer of typical GNN architectures . With this design , GNP can easily switch between positive p and negative p , choosing proper values according to tasks . | This paper focus on the extrapolation ability of graph neural networks and propose a new pooling function for graph-level readout based on vector norm. The proposed method can be applied to replace the commonly used pooling function like max/mean/sum in GNNs and is proved able for extrapolation in a simple example. Experiments on several synthetic tasks and a few real-world datasets are conducted to verify the effectiveness of the proposed method. | SP:2220849fb4d0a0a21502b239865c70a49fa4962c |
Learning to Pool in Graph Neural Networks for Extrapolation | 1 INTRODUCTION . Many real-world data , such as relationships between people in social networks or chemical bonds between atoms , can naturally be represented as graphs . Finding models with proper inductive biases to better describe such graph data has been a common goal for many researchers , and Graph Neural Networks ( GNNs ) ( Scarselli et al. , 2009 ; Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2019 ; Maron et al. , 2019 ; Xu et al. , 2020 ) are considered to be the most successful model . They have proved effective for a variety of tasks , including recommendation ( Ying et al. , 2018a ) , drug discovery ( Stokes et al. , 2020 ) , and chip design ( Mirhoseini et al. , 2020 ) . An important design choice for a GNN often overlooked is the specification of pooling functions , the functions used for the aggregation or readout operation in GNNs . They are usually required to be invariant w.r.t . the permutation of nodes in a graph , and common choices are element-wise summation ( sum ) , maximum ( max ) , minimum ( min ) , or average ( mean ) . Some recent works also proposed to use parametric models and learn them from data as well ( Ying et al. , 2018b ; Lee et al. , 2019b ; Gao & Ji , 2019 ; Yuan & Ji , 2020 ) . While most of the previous works on this line focused on improving predictive performance for their own tasks , recently , Xu et al . ( 2021 ) studied the impact of the choice of pooling functions on the ability of a neural network to extrapolate . Specifically , Xu et al . ( 2021 ) highlighted the importance of the choice of pooling functions in order to make GNNs generalize over the data lying outside of the support of the training data distribution , and they argued that the specification of the pooling functions acts as an important inductive bias that can make GNNs either completely fail to extrapolate or gracefully generalize to out-of-distribution data . As a motivating example , consider the problem of counting the number of nodes in a graph . If we are to solve this problem with a single-layer GNN having one readout layer , probably the best pooling function would be sum , and the corresponding model will readily generalize to graphs with a much larger number of nodes than the ones seen during training . On the other hand , if we choose the pooling function as max instead , it may still fit the training data well but completely fail to predict the number of nodes in out-of-distribution graphs . The findings in Xu et al . ( 2021 ) raise a natural question ; which pooling functions should be used for a given problem in order to make GNNs constructed with them successfully extrapolate for out-of-distribution data ? Xu et al . ( 2021 ) did not present any guide but empirically showed that we do have the “ right ” pooling function for each problem tested , and when a pooling function is not properly selected , GNNs completely fails to extrapolate . The caveat here is that we do not know which pooling function is the right choice before actually training and validating the model . To this end , in this paper , we present a generic learning-based method to find proper pooling functions for a given arbitrary problem . Our method , entitled Generalized Norm-based Pooling ( GNP ) , formulates the pooling functions as a generic Lp norm-like function ( including negative p as well ) , and learns the parameters inside the pooling functions in an end-to-end fashion . Unlike previous learning-based pooling methods that are usually tailored for specific tasks or focused on improving predictive performances , GNP can be applied to arbitrary tasks , and it improves the extrapolation ability of GNNs constructed with it . Also , GNP includes most of the pooling functions being used for GNNs as special cases . Despite the enhanced flexibility , GNP incurs minimal overhead in GNN in terms of the model complexity . A naı̈ve application of GNP to GNNs is likely to fail because of some difficulty in training , so we propose a simple remedy to this . Using nine graph-level , node-level , and set-related tasks , we demonstrate that GNNs with GNP trained by our training scheme extrapolate for out-of-distribution data comparably and sometimes even better than those with pooling functions that are carefully chosen among of widely-used ones . In addition , we demonstrate the effectiveness of GNP on four real-world tasks ( graph classification , influence maximization , node classification , and graph regression ) using six additional GNN architectures ( GCN ( Kipf & Welling , 2017 ) , GAT ( Veličković et al. , 2018 ) , PNA ( Corso et al. , 2020 ) , hierarchical SAGPool ( Lee et al. , 2019b ) , ASAPool ( Ranjan et al. , 2020 ) , and MONSTOR ( Ko et al. , 2020 ) ) and eight real-world graphs . We summarize our contributions as follows : • Generalized pooling function : We propose GNP , a simple yet flexible pooling function that can readily be applied to arbitrary tasks involving GNNs , with minimal parameter overhead . • Effective training methods : We propose effective training methods for GNP . • Extensive experiments : We empirically demonstrate that GNNs with GNP generalize to out-of- distribution data on nine extrapolation tasks . We also show successful application of GNP to six GNN architectures on four real-world tasks in eight real-world graphs with up to one million edges . 2 RELATED WORK . Aggregation functions Various aggregation functions have been appeared to enhance the performance of GNNs . Hamilton et al . ( 2017 ) proposed GraphSAGE with four different aggregation methods ; max , mean , GCN ( Kipf & Welling , 2017 ) , and LSTM ( Hochreiter & Schmidhuber , 1997 ) . Veličković et al . ( 2018 ) proposed Graph Attention neTworks ( GATs ) including attention-based aggregation functions ( Vaswani et al. , 2017 ) . Xu et al . ( 2019 ) proposed Graph Isomorphism Networks ( GINs ) and proved that GNN can satisfy the 1-Weisfeiler-Lehman ( WL ) condition only with sum pooling function as aggregation function . Recently , Li et al . ( 2020 ) proposed a trainable softmax and power-mean aggregation function that generalizes basic operators . Compared to these methods designed to improve interpolation performance on specific tasks , ours can improve extrapolation performance for generic tasks . Readout functions Zhang et al . ( 2018 ) suggested SortPooling that chooses top-k values from the sorted list of the node features to construct outputs . Another popular idea is hierarchical pooling , where outputs are obtained by iteratively coarsening nodes in graphs in a hierarchical fashion ( Ying et al. , 2018b ; Gao & Ji , 2019 ; Lee et al. , 2019b ; Yuan & Ji , 2020 ) . Although demonstrated to be effective for the tasks they have been designed for , most of these methods require heavy computation and it is not straightforward to extend them for aggregation functions . On the other hand , our GNP can be applied to both aggregation and readout functions with minimal overhead . Pooling functions in generic context Vinyals et al . ( 2015 ) proposed Set2Set to get a representation of set-structured data with a LSTM-based pooling function . Lee et al . ( 2019a ) proposed to use an attention-based pooling function to get summaries of set data . For convolutional neural networks , there were some approaches to generalize average pooling and max pooling widely used for many neural network architectures . Gulcehre et al . ( 2014 ) proposed a normalized learnable Lp norm function that generalizes average pooling and max pooling . Lee et al . ( 2016 ) further extended those pooling functions with learnable tree-structured pooling filters . Norm-based pooling functions There have been several works to employ norm-based pooling functions . Gulcehre et al . ( 2014 ) proposed a learnable Lp norm function of the form f ( v ) = ( 1 |v| |v|∑ i=1 |vi|p ) 1/p to substitute max pooling or average pooling used in convolutional neural networks . Similar normbased pooling functions were used for acoustic modeling ( Swietojanski & Renals , 2016 ) and text representation ( Wu et al. , 2020 ) . Compared to GNP , these pooling methods can not express the sum pooling . Li et al . ( 2020 ) further generalized this by multiplying |v|q to include sum pooling as well , but not considered the case where p is positive and the case where p is negative at the same time . GNP is the most generic norm-based pooling function , compared to all aforementioned approaches , and more importantly , no other works studied their usefulness in the context of learning to extrapolate . Extrapolation Trask et al . ( 2018 ) pointed out that most of the feed-forward neural networks fail to extrapolate even for the simplest possible identity mapping , and suggested using alternative computation units mimicking the behavior of arithmetic logic units . The ability to extrapolate is also important in the GNN context , for instance , many combinatorial optimization problems involving graphs often require extrapolation . Selsam et al . ( 2019 ) ; Prates et al . ( 2019 ) tackled the extrapolation problem by performing large iterations of message passing . Using various classical graph algorithms , Veličković et al . ( 2020 ) showed that the extrapolation performance of GNNs depends heavily on the choice of the aggregation function . Similarly , Xu et al . ( 2021 ) demonstrated that choosing the right non-linear function for both MLPs and GNNs is crucial for the extrapolation . 3 MAIN CONTRIBUTION : GENERALIZED NORM-BASED POOLING . In this section , we present our Generalized Norm-based Pooling ( GNP ) and discuss its expressiveness . Then , we describe some difficulties in training GNP and our remedy . Lastly , we present a task on which a GNN with GNP can extrapolate , while that equipped with the basic pooling functions can not . 3.1 GENERALIZATION OF BASIC POOLING FUNCTIONS . While GNP is motivated by the Lp-norm function , which includes the sum and max functions as special cases , further ingredients are added to make GNP more flexible than the Lp-norm function . Specifically , we allow p to be negative to let GNP express a wider class of functions than the previous norm-based or learning-based pooling functions . Let V = { vi } ni=1 be a set of node features with vi ∈ Rd for i = 1 , . . . , n. We define GNP to be an element-wise function where the output for each jth element is GNPj ( V ) = 1 nq ( n∑ i=1 |vi , j |p ) 1/p , where p ∈ R \ { 0 } and q ∈ R are learnable parameters . GNP includes the basic pooling functions ( sum , mean , max , and min ) as special cases . Proposition 1 . Suppose all the entries of v are non-negative in equation 3.1 . Then , GNP includes sum , max , mean as special cases . If we further restrict v to be positive , GNP includes min . Proof . GNPj ( V ) is equivalent to elementwise sum when ( p , q ) = ( 1 , 0 ) and elementwise mean when ( p , q ) = ( 1 , 1 ) . When q = 0 , we have lim p→∞ GNPj ( V ) = max i vi lim p→∞ ( n∑ i=1 ( |vi , j | maxi |vi , j | ) p ) 1/p = max i |vi , j | · 1 = max i |vi , j | , ( 1 ) so GNP converges to max . Similarly , we can obtain min as a limit for p→ −∞ . 3.2 HANDLING OF NEGATIVE p The GNP function in equation 3.1 is not continuous and even not defined at p = 0 . Hence , directly learning GNP in the original form as in equation 3.1 ( even with p = 0 ignored ) can cause instability , especially when an algorithm is trying to move from a positive p value to a negative p value . Instead , we suggest splitting the GNP function into two parts , GNP+ with positive p and GNP− with negative p , and let the model choose the right balance between them . Specifically , define GNP+j ( V ) = 1 nq+ ( n∑ i=1 |vi , j |p + ) 1/p+ , GNP−j ( V ) = 1 nq− ( n∑ i=1 |vi , j |−p − ) −1/p− , ( 2 ) where p+ > 0 , q+ , p− > 0 , and q− are learnable parameters . Given a set of node features V , we first split the feature dimension into two , and compute the output from GNP+ for the first half and from GNP− for the second half . Then we mix two outputs with a single linear layer to get the final output . y = [ GNP+1 ( V ) . . . GNP + bd/2c ( V ) GNP − bd/2c+1 ( V ) . . . GNP − d ( V ) ] , ( 3 ) GNP ( V ) = Wy + b , ( 4 ) where b·c is the floor function , W ∈ Rd×d and b ∈ Rd are learnable parameters . Note that widelyused GNN layers have a linear layer or MLP after message-passing between nodes . Instead of using an additional linear layer , GNP concatenates the outputs of GNP+ and GNP− and passes them to the linear layer or MLP . Therefore , we have only four extra parameters ( p+ , p− , q+ and q− ) for each GNN layer of typical GNN architectures . With this design , GNP can easily switch between positive p and negative p , choosing proper values according to tasks . | This paper presents Generalized Norm-based Pooling (GNP), a L^p norm like pooling function with the trainable p for Graph Neural Network to achieve extrapolation. The authors also propose a training method that use a single linear layer to address the gradient exploding issue. Equally splitting the GNP function, the model can learn both positive and negative p. Experiments were done to demonstrate GNP at the node-/graph-/set- levels. | SP:2220849fb4d0a0a21502b239865c70a49fa4962c |
Composing Features: Compositional Model Augmentation for Steerability of Music Transformers | 1 INTRODUCTION . Recent research has focused on ways of adapting unconditional language models to perform well on conditional tasks they were not initially trained on . Methods such as fine-tuning , side-tuning , bias-tuning , and prompt or prefix tuning have emerged as lead candidates for such tasks such as steering the sentiment of or words mentioned in a sentence ( Ben-Zaken et al. , 2021 ; Li & Liang , 2021 ; Lester et al. , 2021 ; Dathathri et al. , 2020 ) . However , such tasks are normally presented in a non- or minimally-compositional approach ( possibly controlling for two orthogonal variables , such as sentiment and topic ( Keskar et al. , 2019 ) , but rarely more than that ) . In contrast , in the domain of music generation , sequence-continuation is inherently a highly compositional problem : the user likely has many aspects of the output they would like to control , such as speed , dynamics , harmony , or texture , each of which can be decomposed into multiple sub-features . Furthermore , the relationship between these features and the output is more diffuse than in the NLP settings : while in examples such as Keskar et al . ( 2019 ) , individual words indicate the different conditions being satisfied , in music the entire sequence of tokens are used in evaluating a single feature ( for instance , average pitch over a span of time depends on all tokens representing that span ) . This makes compositionality even more challenging than in the text generation setting . On the other hand , music is a sequential domain where there are clear logical features which can be examined , such as average dynamics or number of notes per second . This further motivates using music as a test-bed for highly compositional tasks involving simultaneously steering an autoregressive model towards several particular desired attributes according to different classifiers . As a more immediate motivation , consider the following scenario : a composer wants to sample from the pre-trained Music Transformer ( Huang et al. , 2018 ) to complete a musical phrase . In addition to the overall musical quality of the continuation , they want it to stay in key and switch to using block chords ( i.e . a few notes played together at once ) . Repeatedly sampling continuations from the model and cherry-picking a good sample ( rejection sampling ) would be very labor-intensive , but assuming they can compute binary features for “ stays in key ” and “ uses block chords ” , the composer could sample a large number of continuations and cherry-pick from the smaller set of continuations which exhibit all features ( thereby delegating part of the accept/reject step ) . While significantly less labor-intensive , this solution could potentially require sampling enormous amounts of continuations if , for instance , 6 the requested features significantly differ from those of the priming sequence ( such that it and the desired continuation form an unlikely sequence according to the generative model ) . In other words , the pre-trained model could be a poor proposal distribution for some applications . In this work , we are interested in developing better proposal distributions through an adaptation approach which can steer the generative model towards continuations which i ) are significantly more likely to exhibit the requested feature , and ii ) exhibit a satisfactory musical quality . The approach should be able to accommodate a large number of features without adding significant memory or computation overhead . We achieve this by making features composable , making it possible to steer features independently and also multiple features at once . Figure 1 shows that when using a pretrained transformer model augmented with a relatively small number of additional parameters , we are able to steer towards arbitrary logical music features and achieve realistic music generation simply by sampling directly from the model 1 . In contrast , the same unconditional transformer model fails to produce any examples satisfying those features even when generating 100 samples . With our method , a composer can control both the short-chunk features , and the long-form structure , by chaining together chunks steered in different directions ( using different combinations of features ) , while maintaining long-term coherence ( by leveraging the transformers ’ full self-attention receptive field ) . See the demo in the footnote for longer steered examples , and compositions semi-automatically generated using our feature tuning approach in a musician-directed way . 2 PROBLEM FORMULATION . Music Transformer is an autoregressive language model which decomposes the joint probability of a sequence of tokens x1 , . . . , xN ( where xn ∈ K , and K is a set of categorical tokens ) into p ( x = x1 , . . . , xN ) = p ( x1 ) N∏ n=2 p ( xn | x1 , . . . , xn−1 ) . ( 1 ) It leverages a common modeling approach which represents the conditional probabilities p ( xn | x1 , . . . , xn−1 ) using a neural network ( Bengio et al. , 2003 ) . As its name implies , Music Transformer uses a Transformer network architecture ( Vaswani et al. , 2017a ) . Each token xn is first mapped to a real-valued embedding en ( for instance using a lookup table ) , then the network maps each sequence e1 , . . . , en−1 to a probability distribution for the value of xn over the elements of K. Sequence continuation in an autoregressive language model works by repeatedly sampling from its distribution over the next token given the previous tokens . Starting from some priming se- 1Listen to these examples at https : //storage.googleapis.com/composing-features/ index.html quence xp = ( x0 , . . . , xM ) , we first sample yM+1 ∼ p ( · | x0 , . . . , xM ) , then yM+2 ∼ p ( · | x0 , . . . , xM , yM+1 ) , and so on , until the end of the continued sequence xc = ( yM+1 , . . . , yN ) . 2 Many downstream tasks can be cast as sequence continuation problems , including the steerable music generation problem investigated in this work . We are given a set of features Φ = { φj } Jj=1 , φj ∈ KN → { 0 , 1 } . Each φj takes the value 1 if a prime-continuation pair exhibits that feature ( which we note as ( xp , xc ) |= φj ) , and 0 otherwise . Note that the features must take both prime and continuation sequences as input , since some continuation features may be relative to the priming sequence ( e.g . “ significantly higher pitch ” ) . Our true objective with respect to feature φj is to steer the model towards a distribution which maximizes Exc|xp [ ( xp , xc ) |= φj ] ( 2 ) while maintaining musicality . This objective is non-differentiable because ( xp , xc ) |= φj is a nondifferentiable satisfiability criterion . In addition to the single-feature problem , we also consider the problem of composed features Φ̂ , i.e . ( xp , xc ) |= Φ̂ ≡ ∧ φj∈Φ̂⊆Φ ( xp , xc ) |= φj , ( 3 ) to account for scenarios where a user is interested in steering the model towards multiple features ( such as in the “ stays in key ” and “ exhibits extreme dynamical contrast ” scenario dicussed in the introduction ) . 3 PROPOSED APPROACH . We start by describing our proposed approach in the single-feature case and later on explain how we adapt it to the compositional case . 3.1 LIKELIHOOD-BASED TRAINING . While approaches using reinforcement learning—such as KL-regularized deep Q-learning ( Jaques et al. , 2016 ) —could be used to overcome the non-differentiability problem , in this work we consider a proxy loss in the form of the negative log-likelihood l = − log pθ ( xc | xp ) , ( 4 ) which we use in two ways : 1 . Positively : given a prime–continuation pair ( xp , xc ) |= φj , we find an adaptation θj of the model ’ s parameters θ that minimizes lX ( we use the symbol X to denote the fact that l is computed using the correct parameters θj ) . By using prime–continuation examples that sound musical , we ensure that the steered model stays musically grounded . 2 . Negatively : we can also take advantage of other features φi for which ( xp , xc ) 6|= φi , by maximizing l× ( we use the symbol × to denote the fact that l is computed using the incorrect parameters θi ) . The positive case corresponds to maximum-likelihood training . Additionally , we can exploit the intuition that the adapted parameters θj should “ explain ” the prime–continuation pair ( xp , xc ) |= φj better than θi ( for some feature φi for which ( xp , xc ) 6|= φi ) or θ ( the non-adapted model parameters , with a corresponding loss l∅ ) . In other words , we can maximize the probability of choosing θj over θi and θ by minimizing a contrastive loss of the form 2To simplify the discussion , we assume a fixed sequence length N , but the explanation applies to sequences of varying lengths as well . − log ( pθj ( xc | xp ) pθj ( xc | xp ) + pθi ( xc | xp ) + pθ ( xc | xp ) ) = − log ( e−lX e−lX + e−l× + e−l∅ ) ( 5 ) We propose a loss that interpolates between Equations 4 and 5 using an α coefficient ( which is treated as a hyperparameter ) : Lj = α · lX − ( 1− α ) · log ( e−lX e−lX + e−l× + e−l∅ ) ( 6 ) Intuitively , the maximum-likelihood setting should suffice to achieve our adaptation goals , but in practice we find that the approach benefits from the inclusion of negative cases through a contrastive loss term . We tried different α values and found α = 0.8 to work well in practice . See Figure 2 for an illustration of the training setup . 3.2 FEATURE-CONDITIONAL ADAPTATION . Fine-tuning all model parameters can be prohibitive if the number J of features is large ( let alone combinatorially large in the compositional case ) ; however , recent work provides effective and lightweight alternatives : 1 . Prefix tuning ( Li & Liang , 2021 ) works by preprending learnable task embeddings e−K , . . . , e−1 to the priming sequence embeddings e1 , . . . , eM . The loss gradient is then backpropagated through the language model and into the task embeddings . 2 . Bias-tuning ( Ben-Zaken et al. , 2021 ) works by adapting a small subset θb ⊂ θ of the transformer ’ s parameters , namely the biases of its affine transformations . Since these biases amount to a small fraction of the model ’ s parameters , in the case where the number of tasks is relatively small , tuning separate θb for each task becomes feasible . We present an extension to bias-tuning where the number of tasks is exponential in the number of total classification functions , using an approach which nevertheless only requires a number of tuned parameters linear in the number of total classification functions . In practice , while prefix tuning showed promise in the single-feature setting , we were unable to make it work in the compositional setting . We therefore focus our investigation on bias-tuning and present prefix tuning results in the Appendix . In the compositional setting , a naive approach requires learning 2|Φ|−1 model adaptations . Instead , we propose to express the adaptation for a composed feature Φ̂ as the combination of the θj of its underlying features φj ∈ Φ̂ . More specifically , for bias-tuning we average the adapted biases as θb = 1 |Φ̂| ∑ φj∈Φ̂ θb , j . ( 7 ) Note that we do not simply use the above heuristic to compose feature adaptations post-hoc ; we train the model in a compositional setting ( by sampling prime–continuation pairs ( xp , xc ) |= Φ̂ for various composed features ) so that the single-feature adaptations can learn to work well in conjunction with each other . See Figure 3 for an illustration of the methods . | This paper presents a model tuning strategy for steering conditional music generation given the pre-trained Music Transformer model. The authors pose the steering as musical feature matching between two sequences from prime and continuation, respectively, and tune the parameters using two methods, prefix tuning and bias-tuning. They show that the latter is more effective for steering conditional music generation. They also present a differentiable proxy of music feature matching considering the positive, negative, and non-adaptive cases. The contrastive loss outperforms the non-contrastive loss and bias-tuning is more effective than prefix tuning in the experiment. | SP:047ebda9f8166b5f44783e8774ceac5a472223a3 |
Composing Features: Compositional Model Augmentation for Steerability of Music Transformers | 1 INTRODUCTION . Recent research has focused on ways of adapting unconditional language models to perform well on conditional tasks they were not initially trained on . Methods such as fine-tuning , side-tuning , bias-tuning , and prompt or prefix tuning have emerged as lead candidates for such tasks such as steering the sentiment of or words mentioned in a sentence ( Ben-Zaken et al. , 2021 ; Li & Liang , 2021 ; Lester et al. , 2021 ; Dathathri et al. , 2020 ) . However , such tasks are normally presented in a non- or minimally-compositional approach ( possibly controlling for two orthogonal variables , such as sentiment and topic ( Keskar et al. , 2019 ) , but rarely more than that ) . In contrast , in the domain of music generation , sequence-continuation is inherently a highly compositional problem : the user likely has many aspects of the output they would like to control , such as speed , dynamics , harmony , or texture , each of which can be decomposed into multiple sub-features . Furthermore , the relationship between these features and the output is more diffuse than in the NLP settings : while in examples such as Keskar et al . ( 2019 ) , individual words indicate the different conditions being satisfied , in music the entire sequence of tokens are used in evaluating a single feature ( for instance , average pitch over a span of time depends on all tokens representing that span ) . This makes compositionality even more challenging than in the text generation setting . On the other hand , music is a sequential domain where there are clear logical features which can be examined , such as average dynamics or number of notes per second . This further motivates using music as a test-bed for highly compositional tasks involving simultaneously steering an autoregressive model towards several particular desired attributes according to different classifiers . As a more immediate motivation , consider the following scenario : a composer wants to sample from the pre-trained Music Transformer ( Huang et al. , 2018 ) to complete a musical phrase . In addition to the overall musical quality of the continuation , they want it to stay in key and switch to using block chords ( i.e . a few notes played together at once ) . Repeatedly sampling continuations from the model and cherry-picking a good sample ( rejection sampling ) would be very labor-intensive , but assuming they can compute binary features for “ stays in key ” and “ uses block chords ” , the composer could sample a large number of continuations and cherry-pick from the smaller set of continuations which exhibit all features ( thereby delegating part of the accept/reject step ) . While significantly less labor-intensive , this solution could potentially require sampling enormous amounts of continuations if , for instance , 6 the requested features significantly differ from those of the priming sequence ( such that it and the desired continuation form an unlikely sequence according to the generative model ) . In other words , the pre-trained model could be a poor proposal distribution for some applications . In this work , we are interested in developing better proposal distributions through an adaptation approach which can steer the generative model towards continuations which i ) are significantly more likely to exhibit the requested feature , and ii ) exhibit a satisfactory musical quality . The approach should be able to accommodate a large number of features without adding significant memory or computation overhead . We achieve this by making features composable , making it possible to steer features independently and also multiple features at once . Figure 1 shows that when using a pretrained transformer model augmented with a relatively small number of additional parameters , we are able to steer towards arbitrary logical music features and achieve realistic music generation simply by sampling directly from the model 1 . In contrast , the same unconditional transformer model fails to produce any examples satisfying those features even when generating 100 samples . With our method , a composer can control both the short-chunk features , and the long-form structure , by chaining together chunks steered in different directions ( using different combinations of features ) , while maintaining long-term coherence ( by leveraging the transformers ’ full self-attention receptive field ) . See the demo in the footnote for longer steered examples , and compositions semi-automatically generated using our feature tuning approach in a musician-directed way . 2 PROBLEM FORMULATION . Music Transformer is an autoregressive language model which decomposes the joint probability of a sequence of tokens x1 , . . . , xN ( where xn ∈ K , and K is a set of categorical tokens ) into p ( x = x1 , . . . , xN ) = p ( x1 ) N∏ n=2 p ( xn | x1 , . . . , xn−1 ) . ( 1 ) It leverages a common modeling approach which represents the conditional probabilities p ( xn | x1 , . . . , xn−1 ) using a neural network ( Bengio et al. , 2003 ) . As its name implies , Music Transformer uses a Transformer network architecture ( Vaswani et al. , 2017a ) . Each token xn is first mapped to a real-valued embedding en ( for instance using a lookup table ) , then the network maps each sequence e1 , . . . , en−1 to a probability distribution for the value of xn over the elements of K. Sequence continuation in an autoregressive language model works by repeatedly sampling from its distribution over the next token given the previous tokens . Starting from some priming se- 1Listen to these examples at https : //storage.googleapis.com/composing-features/ index.html quence xp = ( x0 , . . . , xM ) , we first sample yM+1 ∼ p ( · | x0 , . . . , xM ) , then yM+2 ∼ p ( · | x0 , . . . , xM , yM+1 ) , and so on , until the end of the continued sequence xc = ( yM+1 , . . . , yN ) . 2 Many downstream tasks can be cast as sequence continuation problems , including the steerable music generation problem investigated in this work . We are given a set of features Φ = { φj } Jj=1 , φj ∈ KN → { 0 , 1 } . Each φj takes the value 1 if a prime-continuation pair exhibits that feature ( which we note as ( xp , xc ) |= φj ) , and 0 otherwise . Note that the features must take both prime and continuation sequences as input , since some continuation features may be relative to the priming sequence ( e.g . “ significantly higher pitch ” ) . Our true objective with respect to feature φj is to steer the model towards a distribution which maximizes Exc|xp [ ( xp , xc ) |= φj ] ( 2 ) while maintaining musicality . This objective is non-differentiable because ( xp , xc ) |= φj is a nondifferentiable satisfiability criterion . In addition to the single-feature problem , we also consider the problem of composed features Φ̂ , i.e . ( xp , xc ) |= Φ̂ ≡ ∧ φj∈Φ̂⊆Φ ( xp , xc ) |= φj , ( 3 ) to account for scenarios where a user is interested in steering the model towards multiple features ( such as in the “ stays in key ” and “ exhibits extreme dynamical contrast ” scenario dicussed in the introduction ) . 3 PROPOSED APPROACH . We start by describing our proposed approach in the single-feature case and later on explain how we adapt it to the compositional case . 3.1 LIKELIHOOD-BASED TRAINING . While approaches using reinforcement learning—such as KL-regularized deep Q-learning ( Jaques et al. , 2016 ) —could be used to overcome the non-differentiability problem , in this work we consider a proxy loss in the form of the negative log-likelihood l = − log pθ ( xc | xp ) , ( 4 ) which we use in two ways : 1 . Positively : given a prime–continuation pair ( xp , xc ) |= φj , we find an adaptation θj of the model ’ s parameters θ that minimizes lX ( we use the symbol X to denote the fact that l is computed using the correct parameters θj ) . By using prime–continuation examples that sound musical , we ensure that the steered model stays musically grounded . 2 . Negatively : we can also take advantage of other features φi for which ( xp , xc ) 6|= φi , by maximizing l× ( we use the symbol × to denote the fact that l is computed using the incorrect parameters θi ) . The positive case corresponds to maximum-likelihood training . Additionally , we can exploit the intuition that the adapted parameters θj should “ explain ” the prime–continuation pair ( xp , xc ) |= φj better than θi ( for some feature φi for which ( xp , xc ) 6|= φi ) or θ ( the non-adapted model parameters , with a corresponding loss l∅ ) . In other words , we can maximize the probability of choosing θj over θi and θ by minimizing a contrastive loss of the form 2To simplify the discussion , we assume a fixed sequence length N , but the explanation applies to sequences of varying lengths as well . − log ( pθj ( xc | xp ) pθj ( xc | xp ) + pθi ( xc | xp ) + pθ ( xc | xp ) ) = − log ( e−lX e−lX + e−l× + e−l∅ ) ( 5 ) We propose a loss that interpolates between Equations 4 and 5 using an α coefficient ( which is treated as a hyperparameter ) : Lj = α · lX − ( 1− α ) · log ( e−lX e−lX + e−l× + e−l∅ ) ( 6 ) Intuitively , the maximum-likelihood setting should suffice to achieve our adaptation goals , but in practice we find that the approach benefits from the inclusion of negative cases through a contrastive loss term . We tried different α values and found α = 0.8 to work well in practice . See Figure 2 for an illustration of the training setup . 3.2 FEATURE-CONDITIONAL ADAPTATION . Fine-tuning all model parameters can be prohibitive if the number J of features is large ( let alone combinatorially large in the compositional case ) ; however , recent work provides effective and lightweight alternatives : 1 . Prefix tuning ( Li & Liang , 2021 ) works by preprending learnable task embeddings e−K , . . . , e−1 to the priming sequence embeddings e1 , . . . , eM . The loss gradient is then backpropagated through the language model and into the task embeddings . 2 . Bias-tuning ( Ben-Zaken et al. , 2021 ) works by adapting a small subset θb ⊂ θ of the transformer ’ s parameters , namely the biases of its affine transformations . Since these biases amount to a small fraction of the model ’ s parameters , in the case where the number of tasks is relatively small , tuning separate θb for each task becomes feasible . We present an extension to bias-tuning where the number of tasks is exponential in the number of total classification functions , using an approach which nevertheless only requires a number of tuned parameters linear in the number of total classification functions . In practice , while prefix tuning showed promise in the single-feature setting , we were unable to make it work in the compositional setting . We therefore focus our investigation on bias-tuning and present prefix tuning results in the Appendix . In the compositional setting , a naive approach requires learning 2|Φ|−1 model adaptations . Instead , we propose to express the adaptation for a composed feature Φ̂ as the combination of the θj of its underlying features φj ∈ Φ̂ . More specifically , for bias-tuning we average the adapted biases as θb = 1 |Φ̂| ∑ φj∈Φ̂ θb , j . ( 7 ) Note that we do not simply use the above heuristic to compose feature adaptations post-hoc ; we train the model in a compositional setting ( by sampling prime–continuation pairs ( xp , xc ) |= Φ̂ for various composed features ) so that the single-feature adaptations can learn to work well in conjunction with each other . See Figure 3 for an illustration of the methods . | This work considers how to control sampling from transformer-based autoregressive generative models of music. In particular, it considers constraint satisfaction problems (CSP) given a collection of binary constraints. The technical contributions of this paper are (1) a method for fine-tuning (bias-tuning) a model using a contrastive loss for adaptation to a given CSP (Section 3.1) and (2) an additive approximation to bias-tuning for satisfying combinatorial constraints (Section 3.2). | SP:047ebda9f8166b5f44783e8774ceac5a472223a3 |
Composing Features: Compositional Model Augmentation for Steerability of Music Transformers | 1 INTRODUCTION . Recent research has focused on ways of adapting unconditional language models to perform well on conditional tasks they were not initially trained on . Methods such as fine-tuning , side-tuning , bias-tuning , and prompt or prefix tuning have emerged as lead candidates for such tasks such as steering the sentiment of or words mentioned in a sentence ( Ben-Zaken et al. , 2021 ; Li & Liang , 2021 ; Lester et al. , 2021 ; Dathathri et al. , 2020 ) . However , such tasks are normally presented in a non- or minimally-compositional approach ( possibly controlling for two orthogonal variables , such as sentiment and topic ( Keskar et al. , 2019 ) , but rarely more than that ) . In contrast , in the domain of music generation , sequence-continuation is inherently a highly compositional problem : the user likely has many aspects of the output they would like to control , such as speed , dynamics , harmony , or texture , each of which can be decomposed into multiple sub-features . Furthermore , the relationship between these features and the output is more diffuse than in the NLP settings : while in examples such as Keskar et al . ( 2019 ) , individual words indicate the different conditions being satisfied , in music the entire sequence of tokens are used in evaluating a single feature ( for instance , average pitch over a span of time depends on all tokens representing that span ) . This makes compositionality even more challenging than in the text generation setting . On the other hand , music is a sequential domain where there are clear logical features which can be examined , such as average dynamics or number of notes per second . This further motivates using music as a test-bed for highly compositional tasks involving simultaneously steering an autoregressive model towards several particular desired attributes according to different classifiers . As a more immediate motivation , consider the following scenario : a composer wants to sample from the pre-trained Music Transformer ( Huang et al. , 2018 ) to complete a musical phrase . In addition to the overall musical quality of the continuation , they want it to stay in key and switch to using block chords ( i.e . a few notes played together at once ) . Repeatedly sampling continuations from the model and cherry-picking a good sample ( rejection sampling ) would be very labor-intensive , but assuming they can compute binary features for “ stays in key ” and “ uses block chords ” , the composer could sample a large number of continuations and cherry-pick from the smaller set of continuations which exhibit all features ( thereby delegating part of the accept/reject step ) . While significantly less labor-intensive , this solution could potentially require sampling enormous amounts of continuations if , for instance , 6 the requested features significantly differ from those of the priming sequence ( such that it and the desired continuation form an unlikely sequence according to the generative model ) . In other words , the pre-trained model could be a poor proposal distribution for some applications . In this work , we are interested in developing better proposal distributions through an adaptation approach which can steer the generative model towards continuations which i ) are significantly more likely to exhibit the requested feature , and ii ) exhibit a satisfactory musical quality . The approach should be able to accommodate a large number of features without adding significant memory or computation overhead . We achieve this by making features composable , making it possible to steer features independently and also multiple features at once . Figure 1 shows that when using a pretrained transformer model augmented with a relatively small number of additional parameters , we are able to steer towards arbitrary logical music features and achieve realistic music generation simply by sampling directly from the model 1 . In contrast , the same unconditional transformer model fails to produce any examples satisfying those features even when generating 100 samples . With our method , a composer can control both the short-chunk features , and the long-form structure , by chaining together chunks steered in different directions ( using different combinations of features ) , while maintaining long-term coherence ( by leveraging the transformers ’ full self-attention receptive field ) . See the demo in the footnote for longer steered examples , and compositions semi-automatically generated using our feature tuning approach in a musician-directed way . 2 PROBLEM FORMULATION . Music Transformer is an autoregressive language model which decomposes the joint probability of a sequence of tokens x1 , . . . , xN ( where xn ∈ K , and K is a set of categorical tokens ) into p ( x = x1 , . . . , xN ) = p ( x1 ) N∏ n=2 p ( xn | x1 , . . . , xn−1 ) . ( 1 ) It leverages a common modeling approach which represents the conditional probabilities p ( xn | x1 , . . . , xn−1 ) using a neural network ( Bengio et al. , 2003 ) . As its name implies , Music Transformer uses a Transformer network architecture ( Vaswani et al. , 2017a ) . Each token xn is first mapped to a real-valued embedding en ( for instance using a lookup table ) , then the network maps each sequence e1 , . . . , en−1 to a probability distribution for the value of xn over the elements of K. Sequence continuation in an autoregressive language model works by repeatedly sampling from its distribution over the next token given the previous tokens . Starting from some priming se- 1Listen to these examples at https : //storage.googleapis.com/composing-features/ index.html quence xp = ( x0 , . . . , xM ) , we first sample yM+1 ∼ p ( · | x0 , . . . , xM ) , then yM+2 ∼ p ( · | x0 , . . . , xM , yM+1 ) , and so on , until the end of the continued sequence xc = ( yM+1 , . . . , yN ) . 2 Many downstream tasks can be cast as sequence continuation problems , including the steerable music generation problem investigated in this work . We are given a set of features Φ = { φj } Jj=1 , φj ∈ KN → { 0 , 1 } . Each φj takes the value 1 if a prime-continuation pair exhibits that feature ( which we note as ( xp , xc ) |= φj ) , and 0 otherwise . Note that the features must take both prime and continuation sequences as input , since some continuation features may be relative to the priming sequence ( e.g . “ significantly higher pitch ” ) . Our true objective with respect to feature φj is to steer the model towards a distribution which maximizes Exc|xp [ ( xp , xc ) |= φj ] ( 2 ) while maintaining musicality . This objective is non-differentiable because ( xp , xc ) |= φj is a nondifferentiable satisfiability criterion . In addition to the single-feature problem , we also consider the problem of composed features Φ̂ , i.e . ( xp , xc ) |= Φ̂ ≡ ∧ φj∈Φ̂⊆Φ ( xp , xc ) |= φj , ( 3 ) to account for scenarios where a user is interested in steering the model towards multiple features ( such as in the “ stays in key ” and “ exhibits extreme dynamical contrast ” scenario dicussed in the introduction ) . 3 PROPOSED APPROACH . We start by describing our proposed approach in the single-feature case and later on explain how we adapt it to the compositional case . 3.1 LIKELIHOOD-BASED TRAINING . While approaches using reinforcement learning—such as KL-regularized deep Q-learning ( Jaques et al. , 2016 ) —could be used to overcome the non-differentiability problem , in this work we consider a proxy loss in the form of the negative log-likelihood l = − log pθ ( xc | xp ) , ( 4 ) which we use in two ways : 1 . Positively : given a prime–continuation pair ( xp , xc ) |= φj , we find an adaptation θj of the model ’ s parameters θ that minimizes lX ( we use the symbol X to denote the fact that l is computed using the correct parameters θj ) . By using prime–continuation examples that sound musical , we ensure that the steered model stays musically grounded . 2 . Negatively : we can also take advantage of other features φi for which ( xp , xc ) 6|= φi , by maximizing l× ( we use the symbol × to denote the fact that l is computed using the incorrect parameters θi ) . The positive case corresponds to maximum-likelihood training . Additionally , we can exploit the intuition that the adapted parameters θj should “ explain ” the prime–continuation pair ( xp , xc ) |= φj better than θi ( for some feature φi for which ( xp , xc ) 6|= φi ) or θ ( the non-adapted model parameters , with a corresponding loss l∅ ) . In other words , we can maximize the probability of choosing θj over θi and θ by minimizing a contrastive loss of the form 2To simplify the discussion , we assume a fixed sequence length N , but the explanation applies to sequences of varying lengths as well . − log ( pθj ( xc | xp ) pθj ( xc | xp ) + pθi ( xc | xp ) + pθ ( xc | xp ) ) = − log ( e−lX e−lX + e−l× + e−l∅ ) ( 5 ) We propose a loss that interpolates between Equations 4 and 5 using an α coefficient ( which is treated as a hyperparameter ) : Lj = α · lX − ( 1− α ) · log ( e−lX e−lX + e−l× + e−l∅ ) ( 6 ) Intuitively , the maximum-likelihood setting should suffice to achieve our adaptation goals , but in practice we find that the approach benefits from the inclusion of negative cases through a contrastive loss term . We tried different α values and found α = 0.8 to work well in practice . See Figure 2 for an illustration of the training setup . 3.2 FEATURE-CONDITIONAL ADAPTATION . Fine-tuning all model parameters can be prohibitive if the number J of features is large ( let alone combinatorially large in the compositional case ) ; however , recent work provides effective and lightweight alternatives : 1 . Prefix tuning ( Li & Liang , 2021 ) works by preprending learnable task embeddings e−K , . . . , e−1 to the priming sequence embeddings e1 , . . . , eM . The loss gradient is then backpropagated through the language model and into the task embeddings . 2 . Bias-tuning ( Ben-Zaken et al. , 2021 ) works by adapting a small subset θb ⊂ θ of the transformer ’ s parameters , namely the biases of its affine transformations . Since these biases amount to a small fraction of the model ’ s parameters , in the case where the number of tasks is relatively small , tuning separate θb for each task becomes feasible . We present an extension to bias-tuning where the number of tasks is exponential in the number of total classification functions , using an approach which nevertheless only requires a number of tuned parameters linear in the number of total classification functions . In practice , while prefix tuning showed promise in the single-feature setting , we were unable to make it work in the compositional setting . We therefore focus our investigation on bias-tuning and present prefix tuning results in the Appendix . In the compositional setting , a naive approach requires learning 2|Φ|−1 model adaptations . Instead , we propose to express the adaptation for a composed feature Φ̂ as the combination of the θj of its underlying features φj ∈ Φ̂ . More specifically , for bias-tuning we average the adapted biases as θb = 1 |Φ̂| ∑ φj∈Φ̂ θb , j . ( 7 ) Note that we do not simply use the above heuristic to compose feature adaptations post-hoc ; we train the model in a compositional setting ( by sampling prime–continuation pairs ( xp , xc ) |= Φ̂ for various composed features ) so that the single-feature adaptations can learn to work well in conjunction with each other . See Figure 3 for an illustration of the methods . | This paper describes a method for adapting the parameters of a symbolic music generation model such that generated continuations of a prefix are more likely to satisfy a set of user-specified constraints. The method builds on prior work by supporting conjunctions (compositions) of constraints, which are treated by embedding constraint specifications as vectors which are provided as input to a bias tuning layer; multiple constraints are handled by averaging their predicted model outputs together. (A prefix-tuning method is also investigated, but consistently outperformed by the bias-tuning method.) The model is fine-tuned with a contrastive loss that attempts to maximize the likelihood of continuations that satisfy the supplied constraints while minimizing the likelihood of continuations that violate constraints. The proposed method is evaluated by its "efficacy", that is, efficiency of generating valid continuations relative to the unconditional model. A human subject listening test demonstrates that the proposed method is more likely to generate "more musical" continuations than the unconditional model. | SP:047ebda9f8166b5f44783e8774ceac5a472223a3 |
Anti-Concentrated Confidence Bonuses For Scalable Exploration | √ T ) regret bounds for poly ( d ) fixed actions . We develop a practical variant for deep reinforcement learning that is competitive with contemporary intrinsic reward heuristics on Atari benchmarks . 1 INTRODUCTION . Optimism in the face of uncertainty ( OFU ) is a ubiquitous algorithmic principle for online decisionmaking in bandit and reinforcement learning problems . Broadly , optimistic decision-making algorithms augment their reward models with a bonus ( or intrinsic reward ) proportional to their uncertainty about an action ’ s outcome , ideally balancing exploration and exploitation . A vast literature is dedicated to developing and analyzing the theoretical guarantees of these algorithms ( Lattimore & Szepesvári , 2020 ) . In fundamental settings such as stochastic multi-armed and linear bandits , optimistic algorithms are known to enjoy minimax-optimal regret bounds . In modern deep reinforcement learning , many approaches to exploration have been developed with the same principle of optimism , with most empirical successes coming from uncertainty-based intrinsic reward modules ( Burda et al. , 2018b ; Pathak et al. , 2017 ; Osband et al. , 2016 ) . Such bonuses can be very useful , with prior work demonstrating impressive results on a wide array of challenging exploration problems . Several of these methods draw inspiration from theoretical work on multiarmed bandits , using ideas like count-based exploration bonuses . However , a related body of work on linear bandits provides tools for extending exploration bonuses to large but structured action spaces , a paradigm which may be appropriate for deep reinforcement learning . The Linear UCB ( LinUCB ) algorithm ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Abbasi-Yadkori et al. , 2011 ) is attractive in this setting because it enjoys minimax-optimal statistical guarantees . To obtain these , LinUCB leverages a so-called elliptical bonus , the computation of which requires maintaining an inverse covariance matrix over action features . The principal challenge in generalizing the elliptical potential used in bandits to the deep setting lies in computing and storing this object . Due to the moving internal representation of the policy network , and the number of parameters used to compose it , a naive implementation of the LinUCB algorithm would require remembering all of the agent ’ s experience and constantly recomputing and inverting this matrix , which is likely extremely large . Clearly , such an approach is too computationally intensive to be useful . As we discuss in the next section , several works have used neural features for LinUCB-style bonuses , but all require an inversion of this sort , limiting their ability to scale to high dimensions . Towards bridging foundational algorithms with empirical frontiers , we develop a scalable strategy for computing LinUCB ’ s elliptical bonus , enabling us to investigate its effectiveness as an intrinsic reward in deep reinforcement learning . We use an ensemble of least-squares regressors to approximate these bonuses without explicitly maintaining the covariance matrix or its inverse . Our algorithm is both theoretically principled and computationally tractable , and we demonstrate that its empirical performance on Atari games is often competitive with popular baselines . 1.1 OUR CONTRIBUTIONS . We propose the use of anti-concentrated confidence bounds ( ACB ) to efficiently approximate the LinUCB bonus . ACB estimates per-action elliptical confidence intervals by regressing random targets on policy features . It anti-concentrates these bonuses by taking a maximum over the predictions from an ensemble of these regressors . First , we introduce ACB in the basic stochastic linear bandit setting . We show that these bonuses provably approximate LinUCB ’ s elliptical potential ; thus , optimistic exploration with ACB directly inherits standard analysis techniques for LinUCB . We derive near-optimal high-probability regret bounds for ACB , when the size of the action space is polynomial in the action feature dimension . We derive sufficient ensemble sizes for the special cases of multi-armed bandits and fixed actions , as well as the general case of changing actions . These follow from lower tail bounds for the maximum of independent Gaussians ; we conjecture that they are improvable using more sophisticated analytical tools . The main contribution of this work is empirical : we find that ACB provides a viable exploration bonus for deep reinforcement learning . After defining a suitable nonlinear analogue using action features from the policy network , we demonstrate that the intrinsic rewards produced by ACB are competitive with those from state-of-the-art algorithms in deep RL on a variety of Atari benchmarks ( Figure 1 ) . To the best of our knowledge , our work is the first to scalably study bonuses from the linear bandits literature in these deep reinforcement learning settings . 1.2 RELATED WORK . Linear bandits . Stochastic linear bandits were first introduced by Abe & Long ( 1999 ) . Optimistic algorithms are fundamental in this setting ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Rusmevichientong & Tsitsiklis , 2010 ; Abbasi-Yadkori et al. , 2011 ) , and provide minimax-optimal regret bounds . Several works are concerned with designing more scalable optimism-based algorithms , with a focus on empirical bandit settings ( as opposed to deep RL ) . Jun et al . ( 2017 ) consider streaming confidence bound estimates ( obtaining per-iteration update costs independent of t ) in the generalized linear bandits model , but still incur the cost of maintaining the inverse covariance matrix via online Newton step updates . Ding et al . ( 2021 ) give strong regret guarantees for epoch-batched SGD with Thompson sampling , under more stringent assumptions ( i.i.d . action features , and a “ diversity ” condition to induce strong convexity ) . Korda et al . ( 2015 ) demonstrate that variance-reduced algorithms succeed in practice for estimating the LinUCB bonus . Most closely related to our work , Kveton et al . ( 2019 ) ; Ishfaq et al . ( 2021 ) study perturbed regressions for exploration , obtaining similar regret bounds to ours ( including the suboptimal √ logA factor in the regret bounds ) . The LinPHE algorithm in ( Kveton et al. , 2019 ) uses a single random regressor ’ s constant-probability anti-concentration to approximate the elliptical bonus . In work concurrent to ours , the main algorithm proposed by Ishfaq et al . ( 2021 ) also takes a maximum over random regressors , and plugs their analysis into downstream end-to-end results for linear MDPs . The algorithms presented in these works resemble the “ always-rerandomizing ” variant of ACB ( Algorithm 1 ) , which is still not suitable for large-scale deep RL . Our work introduces the “ lazily-rerandomizing ” and “ never-rerandomizing ” variants in an effort to close this gap , and presents corresponding open theoretical problems . Unlike the aforementioned works , we consider our primary contribution as empirical , with the deep learning variant of ACB ( Algorithm 2 ) offering performance comparable to commonly used deep RL bonuses on a wide array of Atari benchmarks without sacrificing theoretical transparency . The resulting algorithmic choices deviate somewhat from the bandit version ( as well as LinPHE/LSVIPHE ) , towards making ACB a viable drop-in replacement for typical bonuses used in deep RL . The use of ensembles in this work bears a resemblance to Monte Carlo techniques for posterior sampling ( Thompson , 1933 ; Agrawal & Goyal , 2013 ) . This is a starting point for many empiricallymotivated exploration algorithms , including for deep RL ( see below ) , but theory is limited . ( Lu & Van Roy , 2017 ) analyze an ensemble-based approximation of Thompson sampling ( without considering a max over the ensemble ) , and obtain a suboptimal regret bound scaling with A logA . Exploration in deep reinforcement learning . In deep reinforcement learning , most popular approaches use predictability as a surrogate for familiarity . The Intrinsic Curiosity Module ( ICM ) , for example , does this by training various neural machinery to predict proceeding states from current state-action pairs ( Pathak et al. , 2017 ) . The L2 error of this prediction is used as a bonus signal for the agent . The approach can be viewed as a modification to Intelligent Adaptive Curiosity , but relying on a representation that is trained to encourage retaining only causal information in transition dynamics ( Oudeyer et al. , 2007 ) . Stadie et al . ( 2015 ) instead use a representation learned by an autoencoder . A large-scale study of these “ curiosity-based ” approaches can be found in Burda et al . ( 2018a ) . Similar to these algorithms , Random Network Distillation ( RND ) relies on the inductive bias of a random and fixed network , where the exploration bonus is computed as the prediction error between this random network and a separate model trained to mimic its outputs ( Burda et al. , 2018b ) . In tabular settings , count-based bonuses are often used to encourage exploration ( Strehl & Littman , 2008 ) . This general approach has been extended to the deep setting as well , where states might be high-dimensional and infrequently visited ( Bellemare et al. , 2016 ) . Algorithms of this type usually rely on some notion of density estimation to group similar states ( Ostrovski et al. , 2017 ; Tang et al. , 2016 ; Martin et al. , 2017 ) . Other work proposes more traditional uncertainty metrics to guide the exploration process . For example , Variational Intrinsic Control ( Gregor et al. , 2016 ) uses a variational notion of uncertainty while Exploration via Disagreement ( Pathak et al. , 2019 ) and Bootstrapped DQN ( Osband et al. , 2016 ) model uncertainty over the predictive variance of an ensemble . More broadly , various approximations of Thompson sampling ( Thompson , 1933 ) have been used to encourage exploration in deep reinforcement learning ( Osband et al. , 2013 ; Guez et al. , 2012 ; Zhang et al. , 2020 ; Strens , 2000 ; Henaff et al. , 2019 ) . These methods have analogues in the related space of active learning , where ensemble and variational estimates of uncertainty are widely used ( Gal et al. , 2017 ; Beluch et al. , 2018 ) . Separate from these , there has been some work intended to more-directly deliver UCB-inspired bonuses to reinforcement learning ( Zhou et al. , 2020 ; Nabati et al. , 2021 ; Zahavy & Mannor , 2019 ; Bai et al. , 2021 ) . These efforts have various drawbacks , however , with many requiring matrix inversions , limiting their ability to scale , or simply not being competitive with more conventional deep RL approaches . ACB removes the covariance matrix inversion requirement , and as we demonstrate in Section A.2 , is competitive with RND and ICM on several Atari benchmarks . 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 Cu m ul at iv e Re gr et 1e2 OLS ensemble updates M=1 M=2 M=4 M=8 M=16 M=32 M=64 M=128 M=256 LinUCB 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 1e2 SGD ensemble updates Figure 2 : The cumulative regret for ACB ( incremental sampling ) with different ensemble sizes . We show a multi-armed bandit setting with 50 actions , comparing exact ordinary least squares ( left ) with SGD using Polyak averaging ( right ) . Up to a point , increasing ensemble size improves cumulative regret in both cases . 2 PRELIMINARIES . In this section , we provide a brief review and establish notation for the stochastic linear bandit setting and the LinUCB algorithm . For a more comprehensive treatment , see Agarwal et al . ( 2019 ) ; Lattimore & Szepesvári ( 2020 ) . At round t = 1 , . . . , T , the learner is given an action set At ⊆ A with features { xt , a ∈ Rd } a∈At , chooses an action at ∈ At , and receives reward rt ( at ) : = 〈xt , at , θ∗〉+ εt , where εt is a martingale difference sequence . We use A to denote maxt |At| . The performance of the learner is quantified by its regret , R ( T ) = T∑ t=1 〈 xt , a∗t , θ ∗〉− 〈xt , at , θ∗〉 , a∗t : = arg max a∈At 〈xt , a , θ∗〉 . This setting encompasses two commonly-considered special cases : • Fixed actions : the action sets At are the same for all t. • Multi-armed bandits : fixed actions , with At = [ d ] and xt , a = ea . Here , θ∗ is the vector of per-arm means . An OFU-based algorithm plays at round t at : = arg max a∈At { r̂t ( a ) + bonust ( a ) } , where r̂t ( a ) is an estimate for the reward rt ( a ) , and bonust ( a ) is selected to be a valid upper confidence bound for r̂t ( a ) , such that E [ rt ( a ) ] ≤ r̂t ( a ) + bonust ( a ) with high probability . The LinUCB algorithm uses r̂t ( a ) : = 〈 xt , a , θ̂t 〉 , where θ̂t = arg minθ∈Rd ∑t−1 τ=1 ( 〈xτ , aτ , θ〉 − ri ( ai ) ) 2 + λ‖θ‖2 is the 2-regularized least-squares regressor for the reward , and sets bonust ( a ) = β √ x > t , aΣ̃ −1 t xt , a , where Σ̃t : = λI + ∑t−1 τ=1 xt , atx > t , at . In an online learning context , this is known as the elliptical potential ( Cesa-Bianchi & Lugosi , 2006 ; Carpentier et al. , 2020 ) . We will quantify the theoretical performance of ACB by comparing it to LinUCB . Theorem 1 gives a high-probability regret bound for LinUCB , which is optimal up to logarithmic factors : Theorem 1 ( LinUCB regret bound ; Theorem 5.3 , ( Agarwal et al. , 2019 ) ) . If ||θ∗|| , ||xt , a|| ≤ O ( 1 ) , and each εt is O ( 1 ) -subgaussian , then there are choices of λ , β such that , with probability at least 1− δ , the regret of the LinUCB algorithm satisfies R ( T ) ≤ Õ ( d √ T ) . The Õ ( · ) suppresses factors polynomial in log ( 1/δ ) and log T . LinUCB can be implemented in O ( d2|At| ) time per iteration , by maintaining Σ̃−1t using rank-1 updates , and using this to compute the least-squares estimator θ̂t = Σ̃−1t ∑t−1 τ=1 xτ , aτ rτ ( aτ ) as well as bonust ( a ) . Algorithm 1 ACB for linear bandits Parameters : ensemble size M ; β , λ 1 : For all i = 1 , . . . , d , set warm-start features x−i+1 = √ λei and corresponding warm-start targets y ( j ) −i+1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 2 : for t = 1 , . . . , T : do 3 : Observe action features { xt , a } a∈At 4 : Update reward estimator : θ̂t : = arg min θ t−1∑ τ=1 ( 〈xτ , aτ , θ〉 − rτ ( aτ ) ) 2 + λ‖θ‖2 5 : Sample new random ensemble targets : ( re-randomized ) y ( j ) τ ∼ N ( 0 , 1 ) for each j ∈ [ M ] , τ ∈ { −d+ 1 , . . . , t− 1 } ( incremental ) y ( j ) t−1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 6 : Update bonus ensembles for each j ∈ [ M ] , w ( j ) t : = arg min w t−1∑ τ=−d+1 ( 〈xτ , aτ , w〉 − y ( j ) τ ) 2 7 : Compute per-arm bonuses bonust ( a ) : = β ·maxj∈ [ M ] ∣∣∣〈xt , a , w ( j ) t 〉∣∣∣ for each a ∈ At 8 : Choose action at : = arg maxa∈At〈xt , a , θ̂t〉+ bonust ( a ) 9 : Observe reward rt ( at ) = 〈xt , at , θ∗〉+ εt | This paper studies using bonus for guiding exploration in reinforcement learning with large action spaces. The paper focuses on RL algorithms using LinUCB-style exploration bonuses. LinUCB, developed originally for stochastic linear bandits, has been a theoretically successful algorithm for problems admitting a linear reward structure. However, using such bonuses entails computing a matrix inversion, which may not be tractable in high dimensional problems. The main contribution of the paper is to propose Anti-concentrated Confidence Bounds (ACB) with the aim of efficiently approximating the LinUCB bonus without matrix inversions. The main idea of ACB is that it maintains $M$ linear regressors trained to predict i.i.d. noise drawn from $\mathcal N(0,1)$. The algorithm then set the bonus proportional to the maximum deviation over the regressors from the mean. Two versions are considered: one for linear bandits and one for deep RL. For linear bandits, the authors prove a regret of $\tilde O(d\sqrt{T\log A})$ with high probability under mild assumptions (e.g., logarithmically in $T$ many regressors). The variant for deep RL, however, is examined through numerical experiments where the algorithm is shown to be competitive with state-of-the-art. | SP:66eecca536da749b5a25c2b5efd9d29a3d030b30 |
Anti-Concentrated Confidence Bonuses For Scalable Exploration | √ T ) regret bounds for poly ( d ) fixed actions . We develop a practical variant for deep reinforcement learning that is competitive with contemporary intrinsic reward heuristics on Atari benchmarks . 1 INTRODUCTION . Optimism in the face of uncertainty ( OFU ) is a ubiquitous algorithmic principle for online decisionmaking in bandit and reinforcement learning problems . Broadly , optimistic decision-making algorithms augment their reward models with a bonus ( or intrinsic reward ) proportional to their uncertainty about an action ’ s outcome , ideally balancing exploration and exploitation . A vast literature is dedicated to developing and analyzing the theoretical guarantees of these algorithms ( Lattimore & Szepesvári , 2020 ) . In fundamental settings such as stochastic multi-armed and linear bandits , optimistic algorithms are known to enjoy minimax-optimal regret bounds . In modern deep reinforcement learning , many approaches to exploration have been developed with the same principle of optimism , with most empirical successes coming from uncertainty-based intrinsic reward modules ( Burda et al. , 2018b ; Pathak et al. , 2017 ; Osband et al. , 2016 ) . Such bonuses can be very useful , with prior work demonstrating impressive results on a wide array of challenging exploration problems . Several of these methods draw inspiration from theoretical work on multiarmed bandits , using ideas like count-based exploration bonuses . However , a related body of work on linear bandits provides tools for extending exploration bonuses to large but structured action spaces , a paradigm which may be appropriate for deep reinforcement learning . The Linear UCB ( LinUCB ) algorithm ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Abbasi-Yadkori et al. , 2011 ) is attractive in this setting because it enjoys minimax-optimal statistical guarantees . To obtain these , LinUCB leverages a so-called elliptical bonus , the computation of which requires maintaining an inverse covariance matrix over action features . The principal challenge in generalizing the elliptical potential used in bandits to the deep setting lies in computing and storing this object . Due to the moving internal representation of the policy network , and the number of parameters used to compose it , a naive implementation of the LinUCB algorithm would require remembering all of the agent ’ s experience and constantly recomputing and inverting this matrix , which is likely extremely large . Clearly , such an approach is too computationally intensive to be useful . As we discuss in the next section , several works have used neural features for LinUCB-style bonuses , but all require an inversion of this sort , limiting their ability to scale to high dimensions . Towards bridging foundational algorithms with empirical frontiers , we develop a scalable strategy for computing LinUCB ’ s elliptical bonus , enabling us to investigate its effectiveness as an intrinsic reward in deep reinforcement learning . We use an ensemble of least-squares regressors to approximate these bonuses without explicitly maintaining the covariance matrix or its inverse . Our algorithm is both theoretically principled and computationally tractable , and we demonstrate that its empirical performance on Atari games is often competitive with popular baselines . 1.1 OUR CONTRIBUTIONS . We propose the use of anti-concentrated confidence bounds ( ACB ) to efficiently approximate the LinUCB bonus . ACB estimates per-action elliptical confidence intervals by regressing random targets on policy features . It anti-concentrates these bonuses by taking a maximum over the predictions from an ensemble of these regressors . First , we introduce ACB in the basic stochastic linear bandit setting . We show that these bonuses provably approximate LinUCB ’ s elliptical potential ; thus , optimistic exploration with ACB directly inherits standard analysis techniques for LinUCB . We derive near-optimal high-probability regret bounds for ACB , when the size of the action space is polynomial in the action feature dimension . We derive sufficient ensemble sizes for the special cases of multi-armed bandits and fixed actions , as well as the general case of changing actions . These follow from lower tail bounds for the maximum of independent Gaussians ; we conjecture that they are improvable using more sophisticated analytical tools . The main contribution of this work is empirical : we find that ACB provides a viable exploration bonus for deep reinforcement learning . After defining a suitable nonlinear analogue using action features from the policy network , we demonstrate that the intrinsic rewards produced by ACB are competitive with those from state-of-the-art algorithms in deep RL on a variety of Atari benchmarks ( Figure 1 ) . To the best of our knowledge , our work is the first to scalably study bonuses from the linear bandits literature in these deep reinforcement learning settings . 1.2 RELATED WORK . Linear bandits . Stochastic linear bandits were first introduced by Abe & Long ( 1999 ) . Optimistic algorithms are fundamental in this setting ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Rusmevichientong & Tsitsiklis , 2010 ; Abbasi-Yadkori et al. , 2011 ) , and provide minimax-optimal regret bounds . Several works are concerned with designing more scalable optimism-based algorithms , with a focus on empirical bandit settings ( as opposed to deep RL ) . Jun et al . ( 2017 ) consider streaming confidence bound estimates ( obtaining per-iteration update costs independent of t ) in the generalized linear bandits model , but still incur the cost of maintaining the inverse covariance matrix via online Newton step updates . Ding et al . ( 2021 ) give strong regret guarantees for epoch-batched SGD with Thompson sampling , under more stringent assumptions ( i.i.d . action features , and a “ diversity ” condition to induce strong convexity ) . Korda et al . ( 2015 ) demonstrate that variance-reduced algorithms succeed in practice for estimating the LinUCB bonus . Most closely related to our work , Kveton et al . ( 2019 ) ; Ishfaq et al . ( 2021 ) study perturbed regressions for exploration , obtaining similar regret bounds to ours ( including the suboptimal √ logA factor in the regret bounds ) . The LinPHE algorithm in ( Kveton et al. , 2019 ) uses a single random regressor ’ s constant-probability anti-concentration to approximate the elliptical bonus . In work concurrent to ours , the main algorithm proposed by Ishfaq et al . ( 2021 ) also takes a maximum over random regressors , and plugs their analysis into downstream end-to-end results for linear MDPs . The algorithms presented in these works resemble the “ always-rerandomizing ” variant of ACB ( Algorithm 1 ) , which is still not suitable for large-scale deep RL . Our work introduces the “ lazily-rerandomizing ” and “ never-rerandomizing ” variants in an effort to close this gap , and presents corresponding open theoretical problems . Unlike the aforementioned works , we consider our primary contribution as empirical , with the deep learning variant of ACB ( Algorithm 2 ) offering performance comparable to commonly used deep RL bonuses on a wide array of Atari benchmarks without sacrificing theoretical transparency . The resulting algorithmic choices deviate somewhat from the bandit version ( as well as LinPHE/LSVIPHE ) , towards making ACB a viable drop-in replacement for typical bonuses used in deep RL . The use of ensembles in this work bears a resemblance to Monte Carlo techniques for posterior sampling ( Thompson , 1933 ; Agrawal & Goyal , 2013 ) . This is a starting point for many empiricallymotivated exploration algorithms , including for deep RL ( see below ) , but theory is limited . ( Lu & Van Roy , 2017 ) analyze an ensemble-based approximation of Thompson sampling ( without considering a max over the ensemble ) , and obtain a suboptimal regret bound scaling with A logA . Exploration in deep reinforcement learning . In deep reinforcement learning , most popular approaches use predictability as a surrogate for familiarity . The Intrinsic Curiosity Module ( ICM ) , for example , does this by training various neural machinery to predict proceeding states from current state-action pairs ( Pathak et al. , 2017 ) . The L2 error of this prediction is used as a bonus signal for the agent . The approach can be viewed as a modification to Intelligent Adaptive Curiosity , but relying on a representation that is trained to encourage retaining only causal information in transition dynamics ( Oudeyer et al. , 2007 ) . Stadie et al . ( 2015 ) instead use a representation learned by an autoencoder . A large-scale study of these “ curiosity-based ” approaches can be found in Burda et al . ( 2018a ) . Similar to these algorithms , Random Network Distillation ( RND ) relies on the inductive bias of a random and fixed network , where the exploration bonus is computed as the prediction error between this random network and a separate model trained to mimic its outputs ( Burda et al. , 2018b ) . In tabular settings , count-based bonuses are often used to encourage exploration ( Strehl & Littman , 2008 ) . This general approach has been extended to the deep setting as well , where states might be high-dimensional and infrequently visited ( Bellemare et al. , 2016 ) . Algorithms of this type usually rely on some notion of density estimation to group similar states ( Ostrovski et al. , 2017 ; Tang et al. , 2016 ; Martin et al. , 2017 ) . Other work proposes more traditional uncertainty metrics to guide the exploration process . For example , Variational Intrinsic Control ( Gregor et al. , 2016 ) uses a variational notion of uncertainty while Exploration via Disagreement ( Pathak et al. , 2019 ) and Bootstrapped DQN ( Osband et al. , 2016 ) model uncertainty over the predictive variance of an ensemble . More broadly , various approximations of Thompson sampling ( Thompson , 1933 ) have been used to encourage exploration in deep reinforcement learning ( Osband et al. , 2013 ; Guez et al. , 2012 ; Zhang et al. , 2020 ; Strens , 2000 ; Henaff et al. , 2019 ) . These methods have analogues in the related space of active learning , where ensemble and variational estimates of uncertainty are widely used ( Gal et al. , 2017 ; Beluch et al. , 2018 ) . Separate from these , there has been some work intended to more-directly deliver UCB-inspired bonuses to reinforcement learning ( Zhou et al. , 2020 ; Nabati et al. , 2021 ; Zahavy & Mannor , 2019 ; Bai et al. , 2021 ) . These efforts have various drawbacks , however , with many requiring matrix inversions , limiting their ability to scale , or simply not being competitive with more conventional deep RL approaches . ACB removes the covariance matrix inversion requirement , and as we demonstrate in Section A.2 , is competitive with RND and ICM on several Atari benchmarks . 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 Cu m ul at iv e Re gr et 1e2 OLS ensemble updates M=1 M=2 M=4 M=8 M=16 M=32 M=64 M=128 M=256 LinUCB 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 1e2 SGD ensemble updates Figure 2 : The cumulative regret for ACB ( incremental sampling ) with different ensemble sizes . We show a multi-armed bandit setting with 50 actions , comparing exact ordinary least squares ( left ) with SGD using Polyak averaging ( right ) . Up to a point , increasing ensemble size improves cumulative regret in both cases . 2 PRELIMINARIES . In this section , we provide a brief review and establish notation for the stochastic linear bandit setting and the LinUCB algorithm . For a more comprehensive treatment , see Agarwal et al . ( 2019 ) ; Lattimore & Szepesvári ( 2020 ) . At round t = 1 , . . . , T , the learner is given an action set At ⊆ A with features { xt , a ∈ Rd } a∈At , chooses an action at ∈ At , and receives reward rt ( at ) : = 〈xt , at , θ∗〉+ εt , where εt is a martingale difference sequence . We use A to denote maxt |At| . The performance of the learner is quantified by its regret , R ( T ) = T∑ t=1 〈 xt , a∗t , θ ∗〉− 〈xt , at , θ∗〉 , a∗t : = arg max a∈At 〈xt , a , θ∗〉 . This setting encompasses two commonly-considered special cases : • Fixed actions : the action sets At are the same for all t. • Multi-armed bandits : fixed actions , with At = [ d ] and xt , a = ea . Here , θ∗ is the vector of per-arm means . An OFU-based algorithm plays at round t at : = arg max a∈At { r̂t ( a ) + bonust ( a ) } , where r̂t ( a ) is an estimate for the reward rt ( a ) , and bonust ( a ) is selected to be a valid upper confidence bound for r̂t ( a ) , such that E [ rt ( a ) ] ≤ r̂t ( a ) + bonust ( a ) with high probability . The LinUCB algorithm uses r̂t ( a ) : = 〈 xt , a , θ̂t 〉 , where θ̂t = arg minθ∈Rd ∑t−1 τ=1 ( 〈xτ , aτ , θ〉 − ri ( ai ) ) 2 + λ‖θ‖2 is the 2-regularized least-squares regressor for the reward , and sets bonust ( a ) = β √ x > t , aΣ̃ −1 t xt , a , where Σ̃t : = λI + ∑t−1 τ=1 xt , atx > t , at . In an online learning context , this is known as the elliptical potential ( Cesa-Bianchi & Lugosi , 2006 ; Carpentier et al. , 2020 ) . We will quantify the theoretical performance of ACB by comparing it to LinUCB . Theorem 1 gives a high-probability regret bound for LinUCB , which is optimal up to logarithmic factors : Theorem 1 ( LinUCB regret bound ; Theorem 5.3 , ( Agarwal et al. , 2019 ) ) . If ||θ∗|| , ||xt , a|| ≤ O ( 1 ) , and each εt is O ( 1 ) -subgaussian , then there are choices of λ , β such that , with probability at least 1− δ , the regret of the LinUCB algorithm satisfies R ( T ) ≤ Õ ( d √ T ) . The Õ ( · ) suppresses factors polynomial in log ( 1/δ ) and log T . LinUCB can be implemented in O ( d2|At| ) time per iteration , by maintaining Σ̃−1t using rank-1 updates , and using this to compute the least-squares estimator θ̂t = Σ̃−1t ∑t−1 τ=1 xτ , aτ rτ ( aτ ) as well as bonust ( a ) . Algorithm 1 ACB for linear bandits Parameters : ensemble size M ; β , λ 1 : For all i = 1 , . . . , d , set warm-start features x−i+1 = √ λei and corresponding warm-start targets y ( j ) −i+1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 2 : for t = 1 , . . . , T : do 3 : Observe action features { xt , a } a∈At 4 : Update reward estimator : θ̂t : = arg min θ t−1∑ τ=1 ( 〈xτ , aτ , θ〉 − rτ ( aτ ) ) 2 + λ‖θ‖2 5 : Sample new random ensemble targets : ( re-randomized ) y ( j ) τ ∼ N ( 0 , 1 ) for each j ∈ [ M ] , τ ∈ { −d+ 1 , . . . , t− 1 } ( incremental ) y ( j ) t−1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 6 : Update bonus ensembles for each j ∈ [ M ] , w ( j ) t : = arg min w t−1∑ τ=−d+1 ( 〈xτ , aτ , w〉 − y ( j ) τ ) 2 7 : Compute per-arm bonuses bonust ( a ) : = β ·maxj∈ [ M ] ∣∣∣〈xt , a , w ( j ) t 〉∣∣∣ for each a ∈ At 8 : Choose action at : = arg maxa∈At〈xt , a , θ̂t〉+ bonust ( a ) 9 : Observe reward rt ( at ) = 〈xt , at , θ∗〉+ εt | This paper proposes a new intrinsic reward method for continuous-action-space deep RL algorithms. The proposed algorithm is inspired by the bonus term of LinUCB. The proposed algorithm improves the efficiency of its reward bound’s computation by using a randomized variant of the original reward bonus. The authors theoretically justified the optimality of this ACB bonus term in the linear case, showing that this is a reasonable replacement of the LinUCB reward bonus. Finally, the authors add the ACB bound to deep RL algorithms. Although this algorithm comes with no theoretical guarantee, experiments show that the ACB intrinsic reward is competitive compared to adopted baselines. | SP:66eecca536da749b5a25c2b5efd9d29a3d030b30 |
Anti-Concentrated Confidence Bonuses For Scalable Exploration | √ T ) regret bounds for poly ( d ) fixed actions . We develop a practical variant for deep reinforcement learning that is competitive with contemporary intrinsic reward heuristics on Atari benchmarks . 1 INTRODUCTION . Optimism in the face of uncertainty ( OFU ) is a ubiquitous algorithmic principle for online decisionmaking in bandit and reinforcement learning problems . Broadly , optimistic decision-making algorithms augment their reward models with a bonus ( or intrinsic reward ) proportional to their uncertainty about an action ’ s outcome , ideally balancing exploration and exploitation . A vast literature is dedicated to developing and analyzing the theoretical guarantees of these algorithms ( Lattimore & Szepesvári , 2020 ) . In fundamental settings such as stochastic multi-armed and linear bandits , optimistic algorithms are known to enjoy minimax-optimal regret bounds . In modern deep reinforcement learning , many approaches to exploration have been developed with the same principle of optimism , with most empirical successes coming from uncertainty-based intrinsic reward modules ( Burda et al. , 2018b ; Pathak et al. , 2017 ; Osband et al. , 2016 ) . Such bonuses can be very useful , with prior work demonstrating impressive results on a wide array of challenging exploration problems . Several of these methods draw inspiration from theoretical work on multiarmed bandits , using ideas like count-based exploration bonuses . However , a related body of work on linear bandits provides tools for extending exploration bonuses to large but structured action spaces , a paradigm which may be appropriate for deep reinforcement learning . The Linear UCB ( LinUCB ) algorithm ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Abbasi-Yadkori et al. , 2011 ) is attractive in this setting because it enjoys minimax-optimal statistical guarantees . To obtain these , LinUCB leverages a so-called elliptical bonus , the computation of which requires maintaining an inverse covariance matrix over action features . The principal challenge in generalizing the elliptical potential used in bandits to the deep setting lies in computing and storing this object . Due to the moving internal representation of the policy network , and the number of parameters used to compose it , a naive implementation of the LinUCB algorithm would require remembering all of the agent ’ s experience and constantly recomputing and inverting this matrix , which is likely extremely large . Clearly , such an approach is too computationally intensive to be useful . As we discuss in the next section , several works have used neural features for LinUCB-style bonuses , but all require an inversion of this sort , limiting their ability to scale to high dimensions . Towards bridging foundational algorithms with empirical frontiers , we develop a scalable strategy for computing LinUCB ’ s elliptical bonus , enabling us to investigate its effectiveness as an intrinsic reward in deep reinforcement learning . We use an ensemble of least-squares regressors to approximate these bonuses without explicitly maintaining the covariance matrix or its inverse . Our algorithm is both theoretically principled and computationally tractable , and we demonstrate that its empirical performance on Atari games is often competitive with popular baselines . 1.1 OUR CONTRIBUTIONS . We propose the use of anti-concentrated confidence bounds ( ACB ) to efficiently approximate the LinUCB bonus . ACB estimates per-action elliptical confidence intervals by regressing random targets on policy features . It anti-concentrates these bonuses by taking a maximum over the predictions from an ensemble of these regressors . First , we introduce ACB in the basic stochastic linear bandit setting . We show that these bonuses provably approximate LinUCB ’ s elliptical potential ; thus , optimistic exploration with ACB directly inherits standard analysis techniques for LinUCB . We derive near-optimal high-probability regret bounds for ACB , when the size of the action space is polynomial in the action feature dimension . We derive sufficient ensemble sizes for the special cases of multi-armed bandits and fixed actions , as well as the general case of changing actions . These follow from lower tail bounds for the maximum of independent Gaussians ; we conjecture that they are improvable using more sophisticated analytical tools . The main contribution of this work is empirical : we find that ACB provides a viable exploration bonus for deep reinforcement learning . After defining a suitable nonlinear analogue using action features from the policy network , we demonstrate that the intrinsic rewards produced by ACB are competitive with those from state-of-the-art algorithms in deep RL on a variety of Atari benchmarks ( Figure 1 ) . To the best of our knowledge , our work is the first to scalably study bonuses from the linear bandits literature in these deep reinforcement learning settings . 1.2 RELATED WORK . Linear bandits . Stochastic linear bandits were first introduced by Abe & Long ( 1999 ) . Optimistic algorithms are fundamental in this setting ( Auer , 2002 ; Dani et al. , 2008 ; Li et al. , 2010 ; Rusmevichientong & Tsitsiklis , 2010 ; Abbasi-Yadkori et al. , 2011 ) , and provide minimax-optimal regret bounds . Several works are concerned with designing more scalable optimism-based algorithms , with a focus on empirical bandit settings ( as opposed to deep RL ) . Jun et al . ( 2017 ) consider streaming confidence bound estimates ( obtaining per-iteration update costs independent of t ) in the generalized linear bandits model , but still incur the cost of maintaining the inverse covariance matrix via online Newton step updates . Ding et al . ( 2021 ) give strong regret guarantees for epoch-batched SGD with Thompson sampling , under more stringent assumptions ( i.i.d . action features , and a “ diversity ” condition to induce strong convexity ) . Korda et al . ( 2015 ) demonstrate that variance-reduced algorithms succeed in practice for estimating the LinUCB bonus . Most closely related to our work , Kveton et al . ( 2019 ) ; Ishfaq et al . ( 2021 ) study perturbed regressions for exploration , obtaining similar regret bounds to ours ( including the suboptimal √ logA factor in the regret bounds ) . The LinPHE algorithm in ( Kveton et al. , 2019 ) uses a single random regressor ’ s constant-probability anti-concentration to approximate the elliptical bonus . In work concurrent to ours , the main algorithm proposed by Ishfaq et al . ( 2021 ) also takes a maximum over random regressors , and plugs their analysis into downstream end-to-end results for linear MDPs . The algorithms presented in these works resemble the “ always-rerandomizing ” variant of ACB ( Algorithm 1 ) , which is still not suitable for large-scale deep RL . Our work introduces the “ lazily-rerandomizing ” and “ never-rerandomizing ” variants in an effort to close this gap , and presents corresponding open theoretical problems . Unlike the aforementioned works , we consider our primary contribution as empirical , with the deep learning variant of ACB ( Algorithm 2 ) offering performance comparable to commonly used deep RL bonuses on a wide array of Atari benchmarks without sacrificing theoretical transparency . The resulting algorithmic choices deviate somewhat from the bandit version ( as well as LinPHE/LSVIPHE ) , towards making ACB a viable drop-in replacement for typical bonuses used in deep RL . The use of ensembles in this work bears a resemblance to Monte Carlo techniques for posterior sampling ( Thompson , 1933 ; Agrawal & Goyal , 2013 ) . This is a starting point for many empiricallymotivated exploration algorithms , including for deep RL ( see below ) , but theory is limited . ( Lu & Van Roy , 2017 ) analyze an ensemble-based approximation of Thompson sampling ( without considering a max over the ensemble ) , and obtain a suboptimal regret bound scaling with A logA . Exploration in deep reinforcement learning . In deep reinforcement learning , most popular approaches use predictability as a surrogate for familiarity . The Intrinsic Curiosity Module ( ICM ) , for example , does this by training various neural machinery to predict proceeding states from current state-action pairs ( Pathak et al. , 2017 ) . The L2 error of this prediction is used as a bonus signal for the agent . The approach can be viewed as a modification to Intelligent Adaptive Curiosity , but relying on a representation that is trained to encourage retaining only causal information in transition dynamics ( Oudeyer et al. , 2007 ) . Stadie et al . ( 2015 ) instead use a representation learned by an autoencoder . A large-scale study of these “ curiosity-based ” approaches can be found in Burda et al . ( 2018a ) . Similar to these algorithms , Random Network Distillation ( RND ) relies on the inductive bias of a random and fixed network , where the exploration bonus is computed as the prediction error between this random network and a separate model trained to mimic its outputs ( Burda et al. , 2018b ) . In tabular settings , count-based bonuses are often used to encourage exploration ( Strehl & Littman , 2008 ) . This general approach has been extended to the deep setting as well , where states might be high-dimensional and infrequently visited ( Bellemare et al. , 2016 ) . Algorithms of this type usually rely on some notion of density estimation to group similar states ( Ostrovski et al. , 2017 ; Tang et al. , 2016 ; Martin et al. , 2017 ) . Other work proposes more traditional uncertainty metrics to guide the exploration process . For example , Variational Intrinsic Control ( Gregor et al. , 2016 ) uses a variational notion of uncertainty while Exploration via Disagreement ( Pathak et al. , 2019 ) and Bootstrapped DQN ( Osband et al. , 2016 ) model uncertainty over the predictive variance of an ensemble . More broadly , various approximations of Thompson sampling ( Thompson , 1933 ) have been used to encourage exploration in deep reinforcement learning ( Osband et al. , 2013 ; Guez et al. , 2012 ; Zhang et al. , 2020 ; Strens , 2000 ; Henaff et al. , 2019 ) . These methods have analogues in the related space of active learning , where ensemble and variational estimates of uncertainty are widely used ( Gal et al. , 2017 ; Beluch et al. , 2018 ) . Separate from these , there has been some work intended to more-directly deliver UCB-inspired bonuses to reinforcement learning ( Zhou et al. , 2020 ; Nabati et al. , 2021 ; Zahavy & Mannor , 2019 ; Bai et al. , 2021 ) . These efforts have various drawbacks , however , with many requiring matrix inversions , limiting their ability to scale , or simply not being competitive with more conventional deep RL approaches . ACB removes the covariance matrix inversion requirement , and as we demonstrate in Section A.2 , is competitive with RND and ICM on several Atari benchmarks . 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 Cu m ul at iv e Re gr et 1e2 OLS ensemble updates M=1 M=2 M=4 M=8 M=16 M=32 M=64 M=128 M=256 LinUCB 0 1 2 3 4 5 Timesteps 1e3 0 1 2 3 4 5 6 1e2 SGD ensemble updates Figure 2 : The cumulative regret for ACB ( incremental sampling ) with different ensemble sizes . We show a multi-armed bandit setting with 50 actions , comparing exact ordinary least squares ( left ) with SGD using Polyak averaging ( right ) . Up to a point , increasing ensemble size improves cumulative regret in both cases . 2 PRELIMINARIES . In this section , we provide a brief review and establish notation for the stochastic linear bandit setting and the LinUCB algorithm . For a more comprehensive treatment , see Agarwal et al . ( 2019 ) ; Lattimore & Szepesvári ( 2020 ) . At round t = 1 , . . . , T , the learner is given an action set At ⊆ A with features { xt , a ∈ Rd } a∈At , chooses an action at ∈ At , and receives reward rt ( at ) : = 〈xt , at , θ∗〉+ εt , where εt is a martingale difference sequence . We use A to denote maxt |At| . The performance of the learner is quantified by its regret , R ( T ) = T∑ t=1 〈 xt , a∗t , θ ∗〉− 〈xt , at , θ∗〉 , a∗t : = arg max a∈At 〈xt , a , θ∗〉 . This setting encompasses two commonly-considered special cases : • Fixed actions : the action sets At are the same for all t. • Multi-armed bandits : fixed actions , with At = [ d ] and xt , a = ea . Here , θ∗ is the vector of per-arm means . An OFU-based algorithm plays at round t at : = arg max a∈At { r̂t ( a ) + bonust ( a ) } , where r̂t ( a ) is an estimate for the reward rt ( a ) , and bonust ( a ) is selected to be a valid upper confidence bound for r̂t ( a ) , such that E [ rt ( a ) ] ≤ r̂t ( a ) + bonust ( a ) with high probability . The LinUCB algorithm uses r̂t ( a ) : = 〈 xt , a , θ̂t 〉 , where θ̂t = arg minθ∈Rd ∑t−1 τ=1 ( 〈xτ , aτ , θ〉 − ri ( ai ) ) 2 + λ‖θ‖2 is the 2-regularized least-squares regressor for the reward , and sets bonust ( a ) = β √ x > t , aΣ̃ −1 t xt , a , where Σ̃t : = λI + ∑t−1 τ=1 xt , atx > t , at . In an online learning context , this is known as the elliptical potential ( Cesa-Bianchi & Lugosi , 2006 ; Carpentier et al. , 2020 ) . We will quantify the theoretical performance of ACB by comparing it to LinUCB . Theorem 1 gives a high-probability regret bound for LinUCB , which is optimal up to logarithmic factors : Theorem 1 ( LinUCB regret bound ; Theorem 5.3 , ( Agarwal et al. , 2019 ) ) . If ||θ∗|| , ||xt , a|| ≤ O ( 1 ) , and each εt is O ( 1 ) -subgaussian , then there are choices of λ , β such that , with probability at least 1− δ , the regret of the LinUCB algorithm satisfies R ( T ) ≤ Õ ( d √ T ) . The Õ ( · ) suppresses factors polynomial in log ( 1/δ ) and log T . LinUCB can be implemented in O ( d2|At| ) time per iteration , by maintaining Σ̃−1t using rank-1 updates , and using this to compute the least-squares estimator θ̂t = Σ̃−1t ∑t−1 τ=1 xτ , aτ rτ ( aτ ) as well as bonust ( a ) . Algorithm 1 ACB for linear bandits Parameters : ensemble size M ; β , λ 1 : For all i = 1 , . . . , d , set warm-start features x−i+1 = √ λei and corresponding warm-start targets y ( j ) −i+1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 2 : for t = 1 , . . . , T : do 3 : Observe action features { xt , a } a∈At 4 : Update reward estimator : θ̂t : = arg min θ t−1∑ τ=1 ( 〈xτ , aτ , θ〉 − rτ ( aτ ) ) 2 + λ‖θ‖2 5 : Sample new random ensemble targets : ( re-randomized ) y ( j ) τ ∼ N ( 0 , 1 ) for each j ∈ [ M ] , τ ∈ { −d+ 1 , . . . , t− 1 } ( incremental ) y ( j ) t−1 ∼ N ( 0 , 1 ) for each j ∈ [ M ] 6 : Update bonus ensembles for each j ∈ [ M ] , w ( j ) t : = arg min w t−1∑ τ=−d+1 ( 〈xτ , aτ , w〉 − y ( j ) τ ) 2 7 : Compute per-arm bonuses bonust ( a ) : = β ·maxj∈ [ M ] ∣∣∣〈xt , a , w ( j ) t 〉∣∣∣ for each a ∈ At 8 : Choose action at : = arg maxa∈At〈xt , a , θ̂t〉+ bonust ( a ) 9 : Observe reward rt ( at ) = 〈xt , at , θ∗〉+ εt | This paper proposes a novel exploration method called anti-concentrated confidence bounds (ACB) that provably approximates the elliptical exploration bonus of LinUCB by using an ensemble of least-squares regressors. ACB computes elliptical confidence intervals for each action by taking a maximum over the predictions of the ensemble. While doing this, ACB bypasses costly covariance matrix inversion, which can be problematic, especially for high-dimensional problems. It is shown that ACB enjoys near-optimal performance in linear stochastic bandits when the cardinality of the action set is polynomial in the action feature dimension. However, the main contribution of this work comes from extending ACB principle for computing exploration bonuses in deep RL. Comparison of ACB with state-of-the-art deep RL exploration methods on Atari benchmarks demonstrates the competitiveness of the proposed approach. | SP:66eecca536da749b5a25c2b5efd9d29a3d030b30 |
GIR Framework: Learning Graph Positional Embeddings with Anchor Indication and Path Encoding | 1 INTRODUCTION . Graph , as an important data structure , is a powerful tool to represent ubiquitous relationships in the real world . Learning vector representations for graph data , benefits many downstream tasks on the graph such as node classification ( Kipf & Welling , 2017 ) and link prediction ( Zhang & Chen , 2018 ) . Many graph representation learning methods have been proposed recently , among those , Graph Neural Networks ( GNNs ) , inheriting the merits of neural networks , have shown superior performance and become a much popular choice . Existing GNN models mainly follow the message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) pattern , which stacks message passing layers that aggregate information from neighborhoods and then update representations for each node . Typical MPNNs are limited by 1-Weisfeiler-Lehman test ( Xu et al. , 2019 ) , and lack of ability to capture the position information within the graph ( You et al. , 2019 ) , without distinguishable node/edge attributes , nodes in a different part of the graph with topologically equivalent neighborhood structures or even with different substructures may be embedded into the identical representation by typical MPNNs alone ( You et al. , 2019 ; Li et al. , 2020 ) , as shown in figure 1 ( b ) , A1 and B2 can not be distinguished with MPNNs and no distinguishable attributes ( when ignoring colored anchor nodes ) . Researchers have developed methods to alleviate this issue . Some earlier works adopt one-hot encodings as extended node attributes ( Kipf & Welling , 2017 ) . More recent methods utilize graph distance information to get position-aware embeddings . Anchor-based GNNs ( You et al. , 2019 ; Liu et al. , 2019 ) select anchor nodes as positioning bases , and use position information related to anchors to break the structural symmetry ( Figure 1 ( c ) ) . Distance encoding ( Li et al. , 2020 ) utilizes distance information to push typical MPNNs beyond the 1-Weisfeiler-Lehman test limitation ( Figure 1 d ) . Those existing position-aware GNN methods mainly explicitly pre-compute the distance between node pairs , utilizing them as node attributes or controlling of message passing steps , and then perform message passing encoding . Due to the design choices for what and how to utilize distance information , those existing methods consider graph structure and attributes information encoded by GNN propagation and position information in a relatively separate manner , potentially useful interaction between intermediate results of the distance computing and encoding stages may be ignored . In this paper , we follow the anchor-based GNN strategy and aim at performing a more flexible interaction with graph structure , positioning and attribute information . With limited fixed anchor positioning base selected , abundant position information could be assigned , boosting the performance of MPNNs in the position aware scenarios in a trackable way . Besides the explicit assigning strategy , here we mainly focus on conveying position information implicitly , in order to retain the potential possibility for more flexible usage of the graph data , as some information beyond pre-performed graph algorithms ( e.g . shortest path distance algorithm ) may potentially useful to be captured . Our motivation comes from the structural similarity between GNN message passing and distance relaxation process of the Bellman-Ford shortest path algorithm ( Bellman , 1958 ) , we show that with a simple indication of anchors and appropriate design for message passing functions , MPNNs can keep track of the shortest paths from anchors . Further , inspired by a relaxation order improved variant of Bellman-Ford algorithm ( Moore , 1959 ) , we propose a generalized MPNN architecture , termed Graph Inference Representation ( GIR ) , as a more specialized model for the position-aware scenario . The GIR model propagates messages from anchors along paths to each node , and outputs of the k-th layer encode k-step representations related to anchors . On an unweighted graph with no distinguishable node attributes , the proposed strategies provide natural ways to help break the structural symmetry as the previous anchor-based GNNs could ( Figure 1 ( b & e ) ) . Our contributions are summarized as follows : 1 . We propose a general anchor labeling strategy , enabling MPNNs for mimicking the Bellman-Ford algorithm and getting position-aware embeddings implicitly under anchorbased GNN pattern and discuss theoretical implications and experimental realizations . 2 . We propose the Graph Inference Representation ( GIR ) model that contains more specialized structure for learning position-aware embeddings . 3 . Empirically , we evaluate the performance of proposed methods for tasks in position-aware datasets , experimental results show that our position-aware GIRs achieve generally higher performance . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 introduces notations and definitions , theoretical implications are discussed . Section 4 details the proposed GIR framework . Section 5 presents the experiment and gives a discussion of the results . Finally , section 6 presents our conclusion . 2 RELATED WORKS . Our work follows the anchor-based GNN pattern from the position-aware GNN literature , with the design inspired by the Bellman-Ford algorithm . 2.1 POSITION-AWARE GNNS . Position-aware GNNs leverage distance information in the message propagating encoding process . Distance Encoding ( Li et al. , 2020 ) follows the MPNN propagation design and extends it with preassigned graph distance from the propagation target to each node ( Figure 1 , ( d ) ) . For each message propagation step on a target node v , only distance from v are utilized , potentially useful distance from other nodes are not considered . Anchor-based GNNs use selected anchor nodes as a positioning base , existing methods mainly follow the two-stage pattern : select anchor nodes first , and then encode the information related to anchors . Position-aware GNN ( PGNN ) ( You et al. , 2019 ) selects anchor node sets randomly before running every forward of the model to get a low distortion embedding capturing global position information , a PGNN layer directly propagates message from the selected anchor node set to each target node , weighted by the pairwise distance . The random anchor selecting strategy of PGNNs leads to unstable limitation , some more recent work uses fixed anchor nodes instead to overcome this issue . AGNN ( Liu et al. , 2019 ) pre-selects fixed anchors by minimum point cover nodes algorithm ; GraphReach ( Nishad et al. , 2020 ) follows the fix anchor setting and adopts random walk reachability estimations instead of the shortest path distance . Those methods adopt the strategy that ignores graph structure when performing message propagation . Our GIR framework follows the anchor-based GNN pattern and differs from previous works in the position information encoding and utilizing strategy ( depicted in figure 1 ) . GIRs are capable of encoding position information implicitly , taken intermediate results in computing shortest path distance into consideration , and under specific settings , corresponding distances related to anchors and the graph structure are utilized together . 2.2 BELLMAN-FORD ALGORITHM . The Bellman-Ford algorithm ( Bellman , 1958 ) computes the shortest path distance from a single source node to each node in a weighted digraph . For a graph G = ( V , E ) , source node s , the algorithm performs |V| − 1 relaxation iterations , maintaining the shortest path from s with at most i edges in the i-th iteration . A relaxation step iterate over all edges , correct distance to better ones . The relaxation of distance on i-th iteration and edge 〈u , v〉 with weight w is defined as , distiv = min ( dist i−1 v , dist i−1 u + w ) i > 0 ( 1 ) where dist0 is initialized as , dist0v = { 0 v = s ∞ otherwise ( 2 ) A variant of Bellman-Ford algorithm ( Moore , 1959 ) notices that if the distance value of node v has not been changed since its last relaxed , edges out of v are no need to perform relaxation . Learning graph algorithm including the Bellman-Ford algorithm with MPNN has been experimented in Velikovi et al . ( 2020 ) , they show the effectiveness of adopting max-pooling as aggregator , and propose to learn with intermediate results of graph algorithms . Our work goes further toward the implication from the Bellman-Ford algorithm , and proposes a more specialized message passing strategy beyond typical MPNN for this . In addition , experiment setting of Velikovi et al . ( 2020 ) focus on a single specific source node , and in the experiment on synthetic datasets , we generalize this to adapt the anchor-based GNN settings . 3 PRELIMINARIES . 3.1 NOTATIONS . A graph can be represented as G = ( V , E ) , where V = { v1 , · · · , vn } is the node set and E = { 〈vi , vj〉|vi , vj ∈ V } is the edge set . Nodes are augmented with the feature matrix X , which is either input attributes if available or placeholders . Edges may augmented with the optional weights W . In-neighborhoods of node v are represented as N ( v ) . Notations are summarized in table 1 . 3.2 POSITION-AWARE EMBEDDINGS . One goal of the anchor-based GNN model is to utilize anchors as bases to encode position-aware information for each node . To capture this intuition , PGNNs ( You et al. , 2019 ) view embeddings as position-aware if the shortest path distance between node pairs could be reconstructed from their embeddings , which is hard for models with fixed anchors to satisfy . Here we define position-aware embeddings related to anchors ( Definition 1 ) . Considering that the shorest path distance to a node set has different definitions , such as the shorest path distance to all anchor nodes or to any node in the anchor node set , or whether to focus on shorest path with limited hop . Here in the definition 1 , we focus on the limited hop shorest path distance ( for the alignment with MPNN ) to any node in specific node sets , for retaining a high generality , and the union of those node sets need to be the anchor node set , for consisting with the position-aware embeddings related to anchors definition . Definition 1 ( Position-aware Embeddings ) . For A ⊆ P ( A ) , ⋃ A = A , where P ( A ) is the power set of node set A , the node embedding Z = { zi = f ( vi ) |∀vi ∈ V } , where f is a graph encoder that maps a node to its embedding , is k-hop A -position-aware if there exists functions { gA′ ( · ) |∀A′ ∈ A } such that gA′ ( zi ) = dsp ( vi , A′ ) , where dsp ( vi , A′ ) is the k-hop shortest path distance between node vi and any node in the node set A′ in the graph G. If all elements in A are singleton , brakets of sets inner A could be omitted . As examples for definition 1 , we could reconstruct k-hop shorest path distance from any node in the anchor set A from k-hop { A } -position-aware embeddings , and k-hop shorest path distances from all anchor nodes from k-hop A-position-aware embeddings , these two settings will be discussed most commonly in following sections . 3.3 INDICATABILITY . Here we discuss the theoretical implicitly of our GIR framework design . We begin with our motivation of mimicking the Bellman-Ford algorithm with MPNNs , the concept of indicatability is introduced as an effective tool for the design of the GIR framework . A natural idea for an MPNN to mimic the Bellman-Ford algorithm is to perform neural relaxation functions and enable the capability of keeping track of the intermediate limited hop shortest path distances . The motivation of mimicking the Bellman-Ford algorithm and getting position-aware embeddings implies the capability for reconstructing k-hop shortest path distance from k-th layer . To capture this intuition , we introduce the concept of indicatability that implies the existence and constructibility of functions that reconstruct specific information related to a node set from a vector representation . Definition 2 ( Indicatability ) . For A′ ⊆ A , the function set f is A′-indicatable over function f if there exists a constructable function fA′ such that for all vi ∈ A , fA′ ( zi ) = f ( vi , A′ ) . The indicatability ( Definition 2 ) is defined over a pre-defined function f that maps a node vi and a node set A′ to a real value ( e.g . the multi-souce shortest path distance function ) , which could be mimicked by a neural network module that takes zi , the embedding of vi as input and could generate outputs include f ( zi , A′ ) , as the target neural network module f is capable for mimicking f over A′ , we say that f is A′-indicatable over f . Moreover , the k-hop A -position-aware definition ( Definition 1 ) can be restated as the existence of f-dist with A′-indicatability over k-hop limited multi-souce shorest path distance function , for all A′ ∈ A . | This paper proposes a new type of anchor-based GNN by implicitly exploiting node positioning within customized message passing steps of MPNN. The framework consists of an anchor labeling strategy and a specified propagation path with the utilization of Bellman-Ford algorithm, to enable its positional awareness. The empirical results on small synthetic and real datasets show the effectiveness of implicit positional encoding, and achieve comparable results against other anchor-based models. | SP:9c7e94505556c31a700e6234453fb5054f342b29 |
GIR Framework: Learning Graph Positional Embeddings with Anchor Indication and Path Encoding | 1 INTRODUCTION . Graph , as an important data structure , is a powerful tool to represent ubiquitous relationships in the real world . Learning vector representations for graph data , benefits many downstream tasks on the graph such as node classification ( Kipf & Welling , 2017 ) and link prediction ( Zhang & Chen , 2018 ) . Many graph representation learning methods have been proposed recently , among those , Graph Neural Networks ( GNNs ) , inheriting the merits of neural networks , have shown superior performance and become a much popular choice . Existing GNN models mainly follow the message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) pattern , which stacks message passing layers that aggregate information from neighborhoods and then update representations for each node . Typical MPNNs are limited by 1-Weisfeiler-Lehman test ( Xu et al. , 2019 ) , and lack of ability to capture the position information within the graph ( You et al. , 2019 ) , without distinguishable node/edge attributes , nodes in a different part of the graph with topologically equivalent neighborhood structures or even with different substructures may be embedded into the identical representation by typical MPNNs alone ( You et al. , 2019 ; Li et al. , 2020 ) , as shown in figure 1 ( b ) , A1 and B2 can not be distinguished with MPNNs and no distinguishable attributes ( when ignoring colored anchor nodes ) . Researchers have developed methods to alleviate this issue . Some earlier works adopt one-hot encodings as extended node attributes ( Kipf & Welling , 2017 ) . More recent methods utilize graph distance information to get position-aware embeddings . Anchor-based GNNs ( You et al. , 2019 ; Liu et al. , 2019 ) select anchor nodes as positioning bases , and use position information related to anchors to break the structural symmetry ( Figure 1 ( c ) ) . Distance encoding ( Li et al. , 2020 ) utilizes distance information to push typical MPNNs beyond the 1-Weisfeiler-Lehman test limitation ( Figure 1 d ) . Those existing position-aware GNN methods mainly explicitly pre-compute the distance between node pairs , utilizing them as node attributes or controlling of message passing steps , and then perform message passing encoding . Due to the design choices for what and how to utilize distance information , those existing methods consider graph structure and attributes information encoded by GNN propagation and position information in a relatively separate manner , potentially useful interaction between intermediate results of the distance computing and encoding stages may be ignored . In this paper , we follow the anchor-based GNN strategy and aim at performing a more flexible interaction with graph structure , positioning and attribute information . With limited fixed anchor positioning base selected , abundant position information could be assigned , boosting the performance of MPNNs in the position aware scenarios in a trackable way . Besides the explicit assigning strategy , here we mainly focus on conveying position information implicitly , in order to retain the potential possibility for more flexible usage of the graph data , as some information beyond pre-performed graph algorithms ( e.g . shortest path distance algorithm ) may potentially useful to be captured . Our motivation comes from the structural similarity between GNN message passing and distance relaxation process of the Bellman-Ford shortest path algorithm ( Bellman , 1958 ) , we show that with a simple indication of anchors and appropriate design for message passing functions , MPNNs can keep track of the shortest paths from anchors . Further , inspired by a relaxation order improved variant of Bellman-Ford algorithm ( Moore , 1959 ) , we propose a generalized MPNN architecture , termed Graph Inference Representation ( GIR ) , as a more specialized model for the position-aware scenario . The GIR model propagates messages from anchors along paths to each node , and outputs of the k-th layer encode k-step representations related to anchors . On an unweighted graph with no distinguishable node attributes , the proposed strategies provide natural ways to help break the structural symmetry as the previous anchor-based GNNs could ( Figure 1 ( b & e ) ) . Our contributions are summarized as follows : 1 . We propose a general anchor labeling strategy , enabling MPNNs for mimicking the Bellman-Ford algorithm and getting position-aware embeddings implicitly under anchorbased GNN pattern and discuss theoretical implications and experimental realizations . 2 . We propose the Graph Inference Representation ( GIR ) model that contains more specialized structure for learning position-aware embeddings . 3 . Empirically , we evaluate the performance of proposed methods for tasks in position-aware datasets , experimental results show that our position-aware GIRs achieve generally higher performance . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 introduces notations and definitions , theoretical implications are discussed . Section 4 details the proposed GIR framework . Section 5 presents the experiment and gives a discussion of the results . Finally , section 6 presents our conclusion . 2 RELATED WORKS . Our work follows the anchor-based GNN pattern from the position-aware GNN literature , with the design inspired by the Bellman-Ford algorithm . 2.1 POSITION-AWARE GNNS . Position-aware GNNs leverage distance information in the message propagating encoding process . Distance Encoding ( Li et al. , 2020 ) follows the MPNN propagation design and extends it with preassigned graph distance from the propagation target to each node ( Figure 1 , ( d ) ) . For each message propagation step on a target node v , only distance from v are utilized , potentially useful distance from other nodes are not considered . Anchor-based GNNs use selected anchor nodes as a positioning base , existing methods mainly follow the two-stage pattern : select anchor nodes first , and then encode the information related to anchors . Position-aware GNN ( PGNN ) ( You et al. , 2019 ) selects anchor node sets randomly before running every forward of the model to get a low distortion embedding capturing global position information , a PGNN layer directly propagates message from the selected anchor node set to each target node , weighted by the pairwise distance . The random anchor selecting strategy of PGNNs leads to unstable limitation , some more recent work uses fixed anchor nodes instead to overcome this issue . AGNN ( Liu et al. , 2019 ) pre-selects fixed anchors by minimum point cover nodes algorithm ; GraphReach ( Nishad et al. , 2020 ) follows the fix anchor setting and adopts random walk reachability estimations instead of the shortest path distance . Those methods adopt the strategy that ignores graph structure when performing message propagation . Our GIR framework follows the anchor-based GNN pattern and differs from previous works in the position information encoding and utilizing strategy ( depicted in figure 1 ) . GIRs are capable of encoding position information implicitly , taken intermediate results in computing shortest path distance into consideration , and under specific settings , corresponding distances related to anchors and the graph structure are utilized together . 2.2 BELLMAN-FORD ALGORITHM . The Bellman-Ford algorithm ( Bellman , 1958 ) computes the shortest path distance from a single source node to each node in a weighted digraph . For a graph G = ( V , E ) , source node s , the algorithm performs |V| − 1 relaxation iterations , maintaining the shortest path from s with at most i edges in the i-th iteration . A relaxation step iterate over all edges , correct distance to better ones . The relaxation of distance on i-th iteration and edge 〈u , v〉 with weight w is defined as , distiv = min ( dist i−1 v , dist i−1 u + w ) i > 0 ( 1 ) where dist0 is initialized as , dist0v = { 0 v = s ∞ otherwise ( 2 ) A variant of Bellman-Ford algorithm ( Moore , 1959 ) notices that if the distance value of node v has not been changed since its last relaxed , edges out of v are no need to perform relaxation . Learning graph algorithm including the Bellman-Ford algorithm with MPNN has been experimented in Velikovi et al . ( 2020 ) , they show the effectiveness of adopting max-pooling as aggregator , and propose to learn with intermediate results of graph algorithms . Our work goes further toward the implication from the Bellman-Ford algorithm , and proposes a more specialized message passing strategy beyond typical MPNN for this . In addition , experiment setting of Velikovi et al . ( 2020 ) focus on a single specific source node , and in the experiment on synthetic datasets , we generalize this to adapt the anchor-based GNN settings . 3 PRELIMINARIES . 3.1 NOTATIONS . A graph can be represented as G = ( V , E ) , where V = { v1 , · · · , vn } is the node set and E = { 〈vi , vj〉|vi , vj ∈ V } is the edge set . Nodes are augmented with the feature matrix X , which is either input attributes if available or placeholders . Edges may augmented with the optional weights W . In-neighborhoods of node v are represented as N ( v ) . Notations are summarized in table 1 . 3.2 POSITION-AWARE EMBEDDINGS . One goal of the anchor-based GNN model is to utilize anchors as bases to encode position-aware information for each node . To capture this intuition , PGNNs ( You et al. , 2019 ) view embeddings as position-aware if the shortest path distance between node pairs could be reconstructed from their embeddings , which is hard for models with fixed anchors to satisfy . Here we define position-aware embeddings related to anchors ( Definition 1 ) . Considering that the shorest path distance to a node set has different definitions , such as the shorest path distance to all anchor nodes or to any node in the anchor node set , or whether to focus on shorest path with limited hop . Here in the definition 1 , we focus on the limited hop shorest path distance ( for the alignment with MPNN ) to any node in specific node sets , for retaining a high generality , and the union of those node sets need to be the anchor node set , for consisting with the position-aware embeddings related to anchors definition . Definition 1 ( Position-aware Embeddings ) . For A ⊆ P ( A ) , ⋃ A = A , where P ( A ) is the power set of node set A , the node embedding Z = { zi = f ( vi ) |∀vi ∈ V } , where f is a graph encoder that maps a node to its embedding , is k-hop A -position-aware if there exists functions { gA′ ( · ) |∀A′ ∈ A } such that gA′ ( zi ) = dsp ( vi , A′ ) , where dsp ( vi , A′ ) is the k-hop shortest path distance between node vi and any node in the node set A′ in the graph G. If all elements in A are singleton , brakets of sets inner A could be omitted . As examples for definition 1 , we could reconstruct k-hop shorest path distance from any node in the anchor set A from k-hop { A } -position-aware embeddings , and k-hop shorest path distances from all anchor nodes from k-hop A-position-aware embeddings , these two settings will be discussed most commonly in following sections . 3.3 INDICATABILITY . Here we discuss the theoretical implicitly of our GIR framework design . We begin with our motivation of mimicking the Bellman-Ford algorithm with MPNNs , the concept of indicatability is introduced as an effective tool for the design of the GIR framework . A natural idea for an MPNN to mimic the Bellman-Ford algorithm is to perform neural relaxation functions and enable the capability of keeping track of the intermediate limited hop shortest path distances . The motivation of mimicking the Bellman-Ford algorithm and getting position-aware embeddings implies the capability for reconstructing k-hop shortest path distance from k-th layer . To capture this intuition , we introduce the concept of indicatability that implies the existence and constructibility of functions that reconstruct specific information related to a node set from a vector representation . Definition 2 ( Indicatability ) . For A′ ⊆ A , the function set f is A′-indicatable over function f if there exists a constructable function fA′ such that for all vi ∈ A , fA′ ( zi ) = f ( vi , A′ ) . The indicatability ( Definition 2 ) is defined over a pre-defined function f that maps a node vi and a node set A′ to a real value ( e.g . the multi-souce shortest path distance function ) , which could be mimicked by a neural network module that takes zi , the embedding of vi as input and could generate outputs include f ( zi , A′ ) , as the target neural network module f is capable for mimicking f over A′ , we say that f is A′-indicatable over f . Moreover , the k-hop A -position-aware definition ( Definition 1 ) can be restated as the existence of f-dist with A′-indicatability over k-hop limited multi-souce shorest path distance function , for all A′ ∈ A . | In this paper, the authors propose the anchor-based framework for position encoding. It is well known that the message-passing framework inherently has a limitation to encode graph structure and sometimes fails to discriminate isomorphic subgraphs. Graph Inference Representation exploits the distance relaxation process of the Bellman-Ford shortest path algorithm. The authors show that the MPNN framework can keep track of the shortest paths using anchors. To this end, the authors introduce the anchor labeling strategy for MPNNs mimicking the Bellman-Ford algorithm. It has a more specialized structure and outperforms baseline models. | SP:9c7e94505556c31a700e6234453fb5054f342b29 |
GIR Framework: Learning Graph Positional Embeddings with Anchor Indication and Path Encoding | 1 INTRODUCTION . Graph , as an important data structure , is a powerful tool to represent ubiquitous relationships in the real world . Learning vector representations for graph data , benefits many downstream tasks on the graph such as node classification ( Kipf & Welling , 2017 ) and link prediction ( Zhang & Chen , 2018 ) . Many graph representation learning methods have been proposed recently , among those , Graph Neural Networks ( GNNs ) , inheriting the merits of neural networks , have shown superior performance and become a much popular choice . Existing GNN models mainly follow the message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) pattern , which stacks message passing layers that aggregate information from neighborhoods and then update representations for each node . Typical MPNNs are limited by 1-Weisfeiler-Lehman test ( Xu et al. , 2019 ) , and lack of ability to capture the position information within the graph ( You et al. , 2019 ) , without distinguishable node/edge attributes , nodes in a different part of the graph with topologically equivalent neighborhood structures or even with different substructures may be embedded into the identical representation by typical MPNNs alone ( You et al. , 2019 ; Li et al. , 2020 ) , as shown in figure 1 ( b ) , A1 and B2 can not be distinguished with MPNNs and no distinguishable attributes ( when ignoring colored anchor nodes ) . Researchers have developed methods to alleviate this issue . Some earlier works adopt one-hot encodings as extended node attributes ( Kipf & Welling , 2017 ) . More recent methods utilize graph distance information to get position-aware embeddings . Anchor-based GNNs ( You et al. , 2019 ; Liu et al. , 2019 ) select anchor nodes as positioning bases , and use position information related to anchors to break the structural symmetry ( Figure 1 ( c ) ) . Distance encoding ( Li et al. , 2020 ) utilizes distance information to push typical MPNNs beyond the 1-Weisfeiler-Lehman test limitation ( Figure 1 d ) . Those existing position-aware GNN methods mainly explicitly pre-compute the distance between node pairs , utilizing them as node attributes or controlling of message passing steps , and then perform message passing encoding . Due to the design choices for what and how to utilize distance information , those existing methods consider graph structure and attributes information encoded by GNN propagation and position information in a relatively separate manner , potentially useful interaction between intermediate results of the distance computing and encoding stages may be ignored . In this paper , we follow the anchor-based GNN strategy and aim at performing a more flexible interaction with graph structure , positioning and attribute information . With limited fixed anchor positioning base selected , abundant position information could be assigned , boosting the performance of MPNNs in the position aware scenarios in a trackable way . Besides the explicit assigning strategy , here we mainly focus on conveying position information implicitly , in order to retain the potential possibility for more flexible usage of the graph data , as some information beyond pre-performed graph algorithms ( e.g . shortest path distance algorithm ) may potentially useful to be captured . Our motivation comes from the structural similarity between GNN message passing and distance relaxation process of the Bellman-Ford shortest path algorithm ( Bellman , 1958 ) , we show that with a simple indication of anchors and appropriate design for message passing functions , MPNNs can keep track of the shortest paths from anchors . Further , inspired by a relaxation order improved variant of Bellman-Ford algorithm ( Moore , 1959 ) , we propose a generalized MPNN architecture , termed Graph Inference Representation ( GIR ) , as a more specialized model for the position-aware scenario . The GIR model propagates messages from anchors along paths to each node , and outputs of the k-th layer encode k-step representations related to anchors . On an unweighted graph with no distinguishable node attributes , the proposed strategies provide natural ways to help break the structural symmetry as the previous anchor-based GNNs could ( Figure 1 ( b & e ) ) . Our contributions are summarized as follows : 1 . We propose a general anchor labeling strategy , enabling MPNNs for mimicking the Bellman-Ford algorithm and getting position-aware embeddings implicitly under anchorbased GNN pattern and discuss theoretical implications and experimental realizations . 2 . We propose the Graph Inference Representation ( GIR ) model that contains more specialized structure for learning position-aware embeddings . 3 . Empirically , we evaluate the performance of proposed methods for tasks in position-aware datasets , experimental results show that our position-aware GIRs achieve generally higher performance . The rest of the paper is organized as follows . Section 2 reviews related works . Section 3 introduces notations and definitions , theoretical implications are discussed . Section 4 details the proposed GIR framework . Section 5 presents the experiment and gives a discussion of the results . Finally , section 6 presents our conclusion . 2 RELATED WORKS . Our work follows the anchor-based GNN pattern from the position-aware GNN literature , with the design inspired by the Bellman-Ford algorithm . 2.1 POSITION-AWARE GNNS . Position-aware GNNs leverage distance information in the message propagating encoding process . Distance Encoding ( Li et al. , 2020 ) follows the MPNN propagation design and extends it with preassigned graph distance from the propagation target to each node ( Figure 1 , ( d ) ) . For each message propagation step on a target node v , only distance from v are utilized , potentially useful distance from other nodes are not considered . Anchor-based GNNs use selected anchor nodes as a positioning base , existing methods mainly follow the two-stage pattern : select anchor nodes first , and then encode the information related to anchors . Position-aware GNN ( PGNN ) ( You et al. , 2019 ) selects anchor node sets randomly before running every forward of the model to get a low distortion embedding capturing global position information , a PGNN layer directly propagates message from the selected anchor node set to each target node , weighted by the pairwise distance . The random anchor selecting strategy of PGNNs leads to unstable limitation , some more recent work uses fixed anchor nodes instead to overcome this issue . AGNN ( Liu et al. , 2019 ) pre-selects fixed anchors by minimum point cover nodes algorithm ; GraphReach ( Nishad et al. , 2020 ) follows the fix anchor setting and adopts random walk reachability estimations instead of the shortest path distance . Those methods adopt the strategy that ignores graph structure when performing message propagation . Our GIR framework follows the anchor-based GNN pattern and differs from previous works in the position information encoding and utilizing strategy ( depicted in figure 1 ) . GIRs are capable of encoding position information implicitly , taken intermediate results in computing shortest path distance into consideration , and under specific settings , corresponding distances related to anchors and the graph structure are utilized together . 2.2 BELLMAN-FORD ALGORITHM . The Bellman-Ford algorithm ( Bellman , 1958 ) computes the shortest path distance from a single source node to each node in a weighted digraph . For a graph G = ( V , E ) , source node s , the algorithm performs |V| − 1 relaxation iterations , maintaining the shortest path from s with at most i edges in the i-th iteration . A relaxation step iterate over all edges , correct distance to better ones . The relaxation of distance on i-th iteration and edge 〈u , v〉 with weight w is defined as , distiv = min ( dist i−1 v , dist i−1 u + w ) i > 0 ( 1 ) where dist0 is initialized as , dist0v = { 0 v = s ∞ otherwise ( 2 ) A variant of Bellman-Ford algorithm ( Moore , 1959 ) notices that if the distance value of node v has not been changed since its last relaxed , edges out of v are no need to perform relaxation . Learning graph algorithm including the Bellman-Ford algorithm with MPNN has been experimented in Velikovi et al . ( 2020 ) , they show the effectiveness of adopting max-pooling as aggregator , and propose to learn with intermediate results of graph algorithms . Our work goes further toward the implication from the Bellman-Ford algorithm , and proposes a more specialized message passing strategy beyond typical MPNN for this . In addition , experiment setting of Velikovi et al . ( 2020 ) focus on a single specific source node , and in the experiment on synthetic datasets , we generalize this to adapt the anchor-based GNN settings . 3 PRELIMINARIES . 3.1 NOTATIONS . A graph can be represented as G = ( V , E ) , where V = { v1 , · · · , vn } is the node set and E = { 〈vi , vj〉|vi , vj ∈ V } is the edge set . Nodes are augmented with the feature matrix X , which is either input attributes if available or placeholders . Edges may augmented with the optional weights W . In-neighborhoods of node v are represented as N ( v ) . Notations are summarized in table 1 . 3.2 POSITION-AWARE EMBEDDINGS . One goal of the anchor-based GNN model is to utilize anchors as bases to encode position-aware information for each node . To capture this intuition , PGNNs ( You et al. , 2019 ) view embeddings as position-aware if the shortest path distance between node pairs could be reconstructed from their embeddings , which is hard for models with fixed anchors to satisfy . Here we define position-aware embeddings related to anchors ( Definition 1 ) . Considering that the shorest path distance to a node set has different definitions , such as the shorest path distance to all anchor nodes or to any node in the anchor node set , or whether to focus on shorest path with limited hop . Here in the definition 1 , we focus on the limited hop shorest path distance ( for the alignment with MPNN ) to any node in specific node sets , for retaining a high generality , and the union of those node sets need to be the anchor node set , for consisting with the position-aware embeddings related to anchors definition . Definition 1 ( Position-aware Embeddings ) . For A ⊆ P ( A ) , ⋃ A = A , where P ( A ) is the power set of node set A , the node embedding Z = { zi = f ( vi ) |∀vi ∈ V } , where f is a graph encoder that maps a node to its embedding , is k-hop A -position-aware if there exists functions { gA′ ( · ) |∀A′ ∈ A } such that gA′ ( zi ) = dsp ( vi , A′ ) , where dsp ( vi , A′ ) is the k-hop shortest path distance between node vi and any node in the node set A′ in the graph G. If all elements in A are singleton , brakets of sets inner A could be omitted . As examples for definition 1 , we could reconstruct k-hop shorest path distance from any node in the anchor set A from k-hop { A } -position-aware embeddings , and k-hop shorest path distances from all anchor nodes from k-hop A-position-aware embeddings , these two settings will be discussed most commonly in following sections . 3.3 INDICATABILITY . Here we discuss the theoretical implicitly of our GIR framework design . We begin with our motivation of mimicking the Bellman-Ford algorithm with MPNNs , the concept of indicatability is introduced as an effective tool for the design of the GIR framework . A natural idea for an MPNN to mimic the Bellman-Ford algorithm is to perform neural relaxation functions and enable the capability of keeping track of the intermediate limited hop shortest path distances . The motivation of mimicking the Bellman-Ford algorithm and getting position-aware embeddings implies the capability for reconstructing k-hop shortest path distance from k-th layer . To capture this intuition , we introduce the concept of indicatability that implies the existence and constructibility of functions that reconstruct specific information related to a node set from a vector representation . Definition 2 ( Indicatability ) . For A′ ⊆ A , the function set f is A′-indicatable over function f if there exists a constructable function fA′ such that for all vi ∈ A , fA′ ( zi ) = f ( vi , A′ ) . The indicatability ( Definition 2 ) is defined over a pre-defined function f that maps a node vi and a node set A′ to a real value ( e.g . the multi-souce shortest path distance function ) , which could be mimicked by a neural network module that takes zi , the embedding of vi as input and could generate outputs include f ( zi , A′ ) , as the target neural network module f is capable for mimicking f over A′ , we say that f is A′-indicatable over f . Moreover , the k-hop A -position-aware definition ( Definition 1 ) can be restated as the existence of f-dist with A′-indicatability over k-hop limited multi-souce shorest path distance function , for all A′ ∈ A . | The paper proposes a GNN method (GIR) that incorporates the paths produced by the BFS algorithm in the message passing algorithm, such that it enables the method to mimic the shortest path algorithm. This way, the method is able to learn positional embeddings implicitly. The experiments are conducted both on synthetic and real-world datasets. | SP:9c7e94505556c31a700e6234453fb5054f342b29 |
Is Fairness Only Metric Deep? Evaluating and Addressing Subgroup Gaps in Deep Metric Learning | 1 INTRODUCTION . Deep metric learning ( DML ) extends standard metric learning to deep neural networks , where the goal is to learn metric spaces such that embedded data sample distance is connected to actual semantic similarities ( Globerson & Roweis , 2006 ; Weinberger et al. , 2006 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ) . The explicit optimization of similarity makes deep metric spaces well suited for usage in unseen classes , such as zero-shot image or video retrieval or facial re-identification ( Milbich et al. , 2021 ; Roth et al. , 2020c ; Musgrave et al. , 2020 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ; Schroff et al. , 2015 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Brattoli et al. , 2020 ; Hu et al. , 2014 ; Deng et al. , 2019 ; Liu et al. , 2017 ) . However , while DML is effective in establishing notions of similarity , work describing potential fairness issues is limited to individual fairness in standard metric learning ( Ilvento , 2020 ) , disregarding embedding models . Indeed , the impacts and metrics of fairness are well studied in machine learning ( ML ) generally , and representation learning specifically ( Dwork et al. , 2012 ; Mehrabi et al. , 2019 ; Locatello et al. , 2019b ) . This is especially true on high-risk tasks such as facial recognition and judicial decision-making ( Chouldechova , 2017 ; Berk , 2017 ) , where there are known risks to minoritized subgroups ( Samadi et al. , 2018 ) . Yet , relatively little work has been done in the domain of DML ( Rosenberg et al. , 2021 ) . It is crucial to address this knowledge gap – if DML embeddings are used to create upstream embeddings that facilitate downstream transfer tasks , biases may propagate unknowingly . To tackle this issue , this work first proposes a benchmark to characterize fairness in non-balanced DML - finDML . finDML introduces three subgroup fairness definitions based on feature space performance metrics – recall @ k , alignment and group uniformity . These metrics measure clustering ability and generalization performance via feature space uniformity . Thus , we select the metrics for our definitions to enforce independence between inclusion in a particular cluster or class , and a protected attribute ( given the ground-truth label ) . We leverage existing datasets with fairness limitations ( CelebA ( Liu et al. , 2015 ) and LFW ( Huang et al. , 2007 ) ) and induce imbalance in training data of standard DML benchmarks , CARS196 ( Krause et al. , 2013 ) and CUB200 ( Wah et al. , 2011 ) , in order to create an effective benchmark for fairness analysis in DML . Making use of finDML , we then perform an evaluation of 11 state-of-the-art ( SOTA ) DML methods representing frequently used losses and sampling strategies , including : ranking-based losses ( Wang et al. , 2014 ; Hoffer & Ailon , 2018 ) , proxy-based ( Kim et al. , 2020 ) losses , semi-hard sampling ( Schroff et al. , 2015 ) and distance-weighted sampling ( Wu et al. , 2018 ) . Our experiments suggest that imbalanced data during upstream embedding impacts the fairness of all benchmarks methods in both upstream embeddings ( subgroup gaps up to 21 % ) as well as downstream classifications ( subgroup gaps up to 45.9 % ) . This imbalance is significant even when downstream classifiers are given access to balanced training data , indicating that data can not naively be used to de-bias downstream classifiers from imbalanced embeddings . Finally , inspired by prior work in DML on multi-feature learning ( Milbich et al. , 2020 ) , we introduce PARtial Attribute DE-correlation ( PARADE ) . PARADE addresses imbalance by de-correlating two learned embeddings : one learnt to represent similarity in class labels , and one learnt to represent similarity in the values of a sensitive attribute , which is discarded at test-time . This creates a model in which the ultimate target class embeddings have been de-correlated from the sensitive attributes of the input . We note that as opposed to previous work on variational latent spaces , PARADE de-correlates a learned similarity metric . We find that PARADE reduces gaps of SOTA DML methods by up to 2 % downstream in finDML . In total , our contributions can be summarized as follows : 1 . We define finDML ; introducing three definitions of fairness in DML to capture multifaceted minoritized subgroup performance in upstream embeddings through focus on feature representation characteristics across subgroups , and five datasets for benchmarking . 2 . We analyze SOTA DML methods using finDML , and find that common DML approaches are significantly impacted by imbalanced data . We show empirically that learned embedding bias can not be overcome by naive inclusion of balanced data in downstream classifiers . 3 . We present PARADE , a novel a novel adaptation of previous zero-shot generalization techniques to enhance fairness guarantees through de-correlation of class discriminative features with sensitive attributes . 2 BACKGROUND . Deep Metric Learning DML extends standard metric learning by fusing feature extraction and learning a parametrized metric space into one end-to-end learnable setup . In this setting , a large convolutional network ψ provides the mapping to a feature space Ψ , while a small network f , usually a single linear layer , generates the final mapping to the metric or embedding space Φ . The overall mapping from the image space X is thus given by ϕ = f ◦ ψ . Generally , the embedding space is projected on the unit hypersphere SD−1 through normalization ( Weisstein , 2002 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Wang & Isola , 2020 ) to limit the volume of the representation space with increasing embedding dimensionality . The embedding network ϕ is then trained to provide a metric space Φ that operates well under some predefined , usually non-parametric metric such as the Euclidean or cosine distance defined over Φ . Typical objectives used to learn such metric spaces range from contrastive ranking-based training using tuples of data , such as pairwise ( Hadsell et al. , 2006 ) , triplet- ( Schroff et al. , 2015 ; Wu et al. , 2018 ) or higher-order tuple-based training ( Sohn , 2016 ; Wang et al. , 2020a ) , procedures to bring down the effective complexity of the tuple space ( Schroff et al. , 2015 ; Harwood et al. , 2017 ; Wu et al. , 2018 ) or the introduction of learnable tuple constituents ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020 ) . More recent work ( Milbich et al. , 2020 ; Roth et al. , 2020c ; Jacob et al. , 2019 ) extends standard DML training through incorporation of objectives going beyond just sole class label discrimination : e.g. , through the introduction of artificial samples ( Lin et al. , 2018 ; Duan et al. , 2018 ) , regularization of higher-order moments ( Jacob et al. , 2019 ) , curriculum learning ( Zheng et al. , 2019 ; Harwood et al. , 2017 ; Roth et al. , 2020a ) , knowledge distillation ( Roth et al. , 2020b ) or the inclusion of additional features ( DiVA ) to produce diverse and de-correlated representations ( Milbich et al. , 2020 ) . DML Evaluation Standard performance measures reflect the goal of DML : namely , optimizing an embedding space Φ for best transfer to new test classes via learning semantic similarities . As immediate applications are commonly found in zero-shot clustering or image retrieval , respective retrieval and clustering metrics are predominantly utilized for evaluation . Recall @ k ( Jegou et al. , 2011 ) or mean average precision measured on recall ( Roth et al. , 2020c ; Musgrave et al. , 2020 ) typically estimate retrieval performance . Normalized mutual information ( NMI ) on clustered embeddings ( Manning et al. , 2010 ) is used as a proxy for clustering quality ( see Supplemental for detailed definitions ) . We leverage these performance metrics to inform finDML and our experiments . Fairness in Classification Formalizing fairness in ML continues to be an open problem ( Mehrabi et al. , 2019 ; Chen et al. , 2018a ; Chouldechova , 2017 ; Berk , 2017 ; Locatello et al. , 2019b ; Chouldechova & Roth , 2018 ; Dwork et al. , 2012 ; Hardt et al. , 2016 ; Zafar et al. , 2017 ) . In classification , definitions for fairness such as demographic parity , equalized odds , and equality of opportunity , rely on model outputs across the random variables of protected attribute and ground-truth label ( Dwork et al. , 2012 ; Hardt et al. , 2016 ) . Fairness in Representations A more relevant family of fairness definitions for DML would be those explored in fairness for general representation learning ( Edwards & Storkey , 2015 ; Beutel et al. , 2017 ; Louizos et al. , 2015 ; Madras et al. , 2018 ) . Here , the goal is to learn a fair mapping from an original domain to a latent domain so that classifiers trained on these representations are more likely to be agnostic to the sensitive attribute in unknown downstream tasks . This assumption distinguishes our setting from previous fairness work in which the downstream tasks are known at train time ( Madras et al. , 2018 ; Edwards & Storkey , 2015 ; Moyer et al. , 2018 ; Song et al. , 2019 ; Jaiswal et al. , 2019 ) . DML differs from this form of representation learning as it aims to learn a mapping capturing semantic similarity , as opposed to latent space representation . Earlier works in fair representation learning intended to obfuscate any information about sensitive attributes to approximately satisfy demographic parity ( Zemel et al. , 2013 ) while a wealth of more recent works focus on using adversarial methods or feature disentanglement in latent spaces of VAEs ( Locatello et al. , 2019a ; Kingma & Welling , 2013 ; Gretton et al. , 2006 ; Louizos et al. , 2015 ; Amini et al. , 2019 ; Alemi et al. , 2018 ; Burgess et al. , 2018 ; Chen et al. , 2018b ; Kim & Mnih , 2018 ; Esmaeili et al. , 2019 ; Song et al. , 2019 ; Gitiaux & Rangwala , 2021 ; Rodríguez-Gálvez et al. , 2020 ; Sarhan et al. , 2020 ; Paul & Burlina , 2021 ; Chakraborty et al. , 2020 ) . In this setting , the literature has focused on optimizing on approximations of the mutual information between representations and sensitive attributes : maximum mean discrepancy ( Gretton et al. , 2006 ) for deterministic or variational ( Li et al. , 2014 ; Louizos et al. , 2015 ) autoencoders ( VAEs ) ; cross-entropy of an adversarial network that predicts sensitive attributes from the representations ( Edwards & Storkey , 2015 ; Xie et al. , 2017 ; Beutel et al. , 2017 ; Zhang et al. , 2018 ; Madras et al. , 2018 ; Adel et al. , 2019 ; Zhao & Gordon , 2019 ; Xu et al. , 2018 ) ; balanced error rate on both target loss and adversary loss ( Zhao et al. , 2019 ) ; Weak-Conditional InfoNCE for conditional contrastive learning ( Tsai et al. , 2021 ) . PARADE shares aspects of these previous methods in its choice of de-correlation or disentanglement . However , PARADE de-correlates the learned similarity metric as opposed to the latent space . In addition , with DML-specific criteria , PARADE learns similarities over the sensitive attribute while not directly removing all information about the sensitive attribute , as the sensitive attribute and target class embeddings share a base network . 3 EXTENDING FAIRNESS TO DML - finDML BENCHMARK To characterize fairness with finDML , this section introduces the key constituents – definitions to characterize fairness in embedding spaces and respective benchmark datasets . | This paper proposes three measures that evaluate the fairness of learned representations in multiple aspects. The authors empirically demonstrate that the existing metric learning approaches become less fair (i.e., shows larger performance gaps between attribute-based subgroups) when there is a class imbalance in the training data. Specifically, they propose a protocol that evaluates the fairness by manually adjusting the number of samples per class in the training set (finDML). In addition, they propose PARADE that de-correlates image embedding from auxiliary attibutes embedding via adversarial separation to improve fairness of the learned image embedding. In the experiments, the method shows overall improved fairness on five datasets. | SP:9b09eca150d67f3e0f261eb4f682fac6a30279a1 |
Is Fairness Only Metric Deep? Evaluating and Addressing Subgroup Gaps in Deep Metric Learning | 1 INTRODUCTION . Deep metric learning ( DML ) extends standard metric learning to deep neural networks , where the goal is to learn metric spaces such that embedded data sample distance is connected to actual semantic similarities ( Globerson & Roweis , 2006 ; Weinberger et al. , 2006 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ) . The explicit optimization of similarity makes deep metric spaces well suited for usage in unseen classes , such as zero-shot image or video retrieval or facial re-identification ( Milbich et al. , 2021 ; Roth et al. , 2020c ; Musgrave et al. , 2020 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ; Schroff et al. , 2015 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Brattoli et al. , 2020 ; Hu et al. , 2014 ; Deng et al. , 2019 ; Liu et al. , 2017 ) . However , while DML is effective in establishing notions of similarity , work describing potential fairness issues is limited to individual fairness in standard metric learning ( Ilvento , 2020 ) , disregarding embedding models . Indeed , the impacts and metrics of fairness are well studied in machine learning ( ML ) generally , and representation learning specifically ( Dwork et al. , 2012 ; Mehrabi et al. , 2019 ; Locatello et al. , 2019b ) . This is especially true on high-risk tasks such as facial recognition and judicial decision-making ( Chouldechova , 2017 ; Berk , 2017 ) , where there are known risks to minoritized subgroups ( Samadi et al. , 2018 ) . Yet , relatively little work has been done in the domain of DML ( Rosenberg et al. , 2021 ) . It is crucial to address this knowledge gap – if DML embeddings are used to create upstream embeddings that facilitate downstream transfer tasks , biases may propagate unknowingly . To tackle this issue , this work first proposes a benchmark to characterize fairness in non-balanced DML - finDML . finDML introduces three subgroup fairness definitions based on feature space performance metrics – recall @ k , alignment and group uniformity . These metrics measure clustering ability and generalization performance via feature space uniformity . Thus , we select the metrics for our definitions to enforce independence between inclusion in a particular cluster or class , and a protected attribute ( given the ground-truth label ) . We leverage existing datasets with fairness limitations ( CelebA ( Liu et al. , 2015 ) and LFW ( Huang et al. , 2007 ) ) and induce imbalance in training data of standard DML benchmarks , CARS196 ( Krause et al. , 2013 ) and CUB200 ( Wah et al. , 2011 ) , in order to create an effective benchmark for fairness analysis in DML . Making use of finDML , we then perform an evaluation of 11 state-of-the-art ( SOTA ) DML methods representing frequently used losses and sampling strategies , including : ranking-based losses ( Wang et al. , 2014 ; Hoffer & Ailon , 2018 ) , proxy-based ( Kim et al. , 2020 ) losses , semi-hard sampling ( Schroff et al. , 2015 ) and distance-weighted sampling ( Wu et al. , 2018 ) . Our experiments suggest that imbalanced data during upstream embedding impacts the fairness of all benchmarks methods in both upstream embeddings ( subgroup gaps up to 21 % ) as well as downstream classifications ( subgroup gaps up to 45.9 % ) . This imbalance is significant even when downstream classifiers are given access to balanced training data , indicating that data can not naively be used to de-bias downstream classifiers from imbalanced embeddings . Finally , inspired by prior work in DML on multi-feature learning ( Milbich et al. , 2020 ) , we introduce PARtial Attribute DE-correlation ( PARADE ) . PARADE addresses imbalance by de-correlating two learned embeddings : one learnt to represent similarity in class labels , and one learnt to represent similarity in the values of a sensitive attribute , which is discarded at test-time . This creates a model in which the ultimate target class embeddings have been de-correlated from the sensitive attributes of the input . We note that as opposed to previous work on variational latent spaces , PARADE de-correlates a learned similarity metric . We find that PARADE reduces gaps of SOTA DML methods by up to 2 % downstream in finDML . In total , our contributions can be summarized as follows : 1 . We define finDML ; introducing three definitions of fairness in DML to capture multifaceted minoritized subgroup performance in upstream embeddings through focus on feature representation characteristics across subgroups , and five datasets for benchmarking . 2 . We analyze SOTA DML methods using finDML , and find that common DML approaches are significantly impacted by imbalanced data . We show empirically that learned embedding bias can not be overcome by naive inclusion of balanced data in downstream classifiers . 3 . We present PARADE , a novel a novel adaptation of previous zero-shot generalization techniques to enhance fairness guarantees through de-correlation of class discriminative features with sensitive attributes . 2 BACKGROUND . Deep Metric Learning DML extends standard metric learning by fusing feature extraction and learning a parametrized metric space into one end-to-end learnable setup . In this setting , a large convolutional network ψ provides the mapping to a feature space Ψ , while a small network f , usually a single linear layer , generates the final mapping to the metric or embedding space Φ . The overall mapping from the image space X is thus given by ϕ = f ◦ ψ . Generally , the embedding space is projected on the unit hypersphere SD−1 through normalization ( Weisstein , 2002 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Wang & Isola , 2020 ) to limit the volume of the representation space with increasing embedding dimensionality . The embedding network ϕ is then trained to provide a metric space Φ that operates well under some predefined , usually non-parametric metric such as the Euclidean or cosine distance defined over Φ . Typical objectives used to learn such metric spaces range from contrastive ranking-based training using tuples of data , such as pairwise ( Hadsell et al. , 2006 ) , triplet- ( Schroff et al. , 2015 ; Wu et al. , 2018 ) or higher-order tuple-based training ( Sohn , 2016 ; Wang et al. , 2020a ) , procedures to bring down the effective complexity of the tuple space ( Schroff et al. , 2015 ; Harwood et al. , 2017 ; Wu et al. , 2018 ) or the introduction of learnable tuple constituents ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020 ) . More recent work ( Milbich et al. , 2020 ; Roth et al. , 2020c ; Jacob et al. , 2019 ) extends standard DML training through incorporation of objectives going beyond just sole class label discrimination : e.g. , through the introduction of artificial samples ( Lin et al. , 2018 ; Duan et al. , 2018 ) , regularization of higher-order moments ( Jacob et al. , 2019 ) , curriculum learning ( Zheng et al. , 2019 ; Harwood et al. , 2017 ; Roth et al. , 2020a ) , knowledge distillation ( Roth et al. , 2020b ) or the inclusion of additional features ( DiVA ) to produce diverse and de-correlated representations ( Milbich et al. , 2020 ) . DML Evaluation Standard performance measures reflect the goal of DML : namely , optimizing an embedding space Φ for best transfer to new test classes via learning semantic similarities . As immediate applications are commonly found in zero-shot clustering or image retrieval , respective retrieval and clustering metrics are predominantly utilized for evaluation . Recall @ k ( Jegou et al. , 2011 ) or mean average precision measured on recall ( Roth et al. , 2020c ; Musgrave et al. , 2020 ) typically estimate retrieval performance . Normalized mutual information ( NMI ) on clustered embeddings ( Manning et al. , 2010 ) is used as a proxy for clustering quality ( see Supplemental for detailed definitions ) . We leverage these performance metrics to inform finDML and our experiments . Fairness in Classification Formalizing fairness in ML continues to be an open problem ( Mehrabi et al. , 2019 ; Chen et al. , 2018a ; Chouldechova , 2017 ; Berk , 2017 ; Locatello et al. , 2019b ; Chouldechova & Roth , 2018 ; Dwork et al. , 2012 ; Hardt et al. , 2016 ; Zafar et al. , 2017 ) . In classification , definitions for fairness such as demographic parity , equalized odds , and equality of opportunity , rely on model outputs across the random variables of protected attribute and ground-truth label ( Dwork et al. , 2012 ; Hardt et al. , 2016 ) . Fairness in Representations A more relevant family of fairness definitions for DML would be those explored in fairness for general representation learning ( Edwards & Storkey , 2015 ; Beutel et al. , 2017 ; Louizos et al. , 2015 ; Madras et al. , 2018 ) . Here , the goal is to learn a fair mapping from an original domain to a latent domain so that classifiers trained on these representations are more likely to be agnostic to the sensitive attribute in unknown downstream tasks . This assumption distinguishes our setting from previous fairness work in which the downstream tasks are known at train time ( Madras et al. , 2018 ; Edwards & Storkey , 2015 ; Moyer et al. , 2018 ; Song et al. , 2019 ; Jaiswal et al. , 2019 ) . DML differs from this form of representation learning as it aims to learn a mapping capturing semantic similarity , as opposed to latent space representation . Earlier works in fair representation learning intended to obfuscate any information about sensitive attributes to approximately satisfy demographic parity ( Zemel et al. , 2013 ) while a wealth of more recent works focus on using adversarial methods or feature disentanglement in latent spaces of VAEs ( Locatello et al. , 2019a ; Kingma & Welling , 2013 ; Gretton et al. , 2006 ; Louizos et al. , 2015 ; Amini et al. , 2019 ; Alemi et al. , 2018 ; Burgess et al. , 2018 ; Chen et al. , 2018b ; Kim & Mnih , 2018 ; Esmaeili et al. , 2019 ; Song et al. , 2019 ; Gitiaux & Rangwala , 2021 ; Rodríguez-Gálvez et al. , 2020 ; Sarhan et al. , 2020 ; Paul & Burlina , 2021 ; Chakraborty et al. , 2020 ) . In this setting , the literature has focused on optimizing on approximations of the mutual information between representations and sensitive attributes : maximum mean discrepancy ( Gretton et al. , 2006 ) for deterministic or variational ( Li et al. , 2014 ; Louizos et al. , 2015 ) autoencoders ( VAEs ) ; cross-entropy of an adversarial network that predicts sensitive attributes from the representations ( Edwards & Storkey , 2015 ; Xie et al. , 2017 ; Beutel et al. , 2017 ; Zhang et al. , 2018 ; Madras et al. , 2018 ; Adel et al. , 2019 ; Zhao & Gordon , 2019 ; Xu et al. , 2018 ) ; balanced error rate on both target loss and adversary loss ( Zhao et al. , 2019 ) ; Weak-Conditional InfoNCE for conditional contrastive learning ( Tsai et al. , 2021 ) . PARADE shares aspects of these previous methods in its choice of de-correlation or disentanglement . However , PARADE de-correlates the learned similarity metric as opposed to the latent space . In addition , with DML-specific criteria , PARADE learns similarities over the sensitive attribute while not directly removing all information about the sensitive attribute , as the sensitive attribute and target class embeddings share a base network . 3 EXTENDING FAIRNESS TO DML - finDML BENCHMARK To characterize fairness with finDML , this section introduces the key constituents – definitions to characterize fairness in embedding spaces and respective benchmark datasets . | The paper presents a study on the effect of training dml techniques on imbalanced data and show the negative impact of learned representations on the downstream tasks. The fairness is analyzed through 3 properties of the representation space; a) inter-class alignment, b) intra-class alignment, c) uniformity showing that the bias in the upstream task (dml) is propagated to the downstream classification tasks even when the data for training the classifier (downstream task) is balanced. To address this, an objective (PARADE) that de-correlates the discriminative features from the sensitive attributes are learned during training. The experiments are conducted on 4 benchmark datasets. | SP:9b09eca150d67f3e0f261eb4f682fac6a30279a1 |
Is Fairness Only Metric Deep? Evaluating and Addressing Subgroup Gaps in Deep Metric Learning | 1 INTRODUCTION . Deep metric learning ( DML ) extends standard metric learning to deep neural networks , where the goal is to learn metric spaces such that embedded data sample distance is connected to actual semantic similarities ( Globerson & Roweis , 2006 ; Weinberger et al. , 2006 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ) . The explicit optimization of similarity makes deep metric spaces well suited for usage in unseen classes , such as zero-shot image or video retrieval or facial re-identification ( Milbich et al. , 2021 ; Roth et al. , 2020c ; Musgrave et al. , 2020 ; Hoffer & Ailon , 2018 ; Wang et al. , 2014 ; Schroff et al. , 2015 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Brattoli et al. , 2020 ; Hu et al. , 2014 ; Deng et al. , 2019 ; Liu et al. , 2017 ) . However , while DML is effective in establishing notions of similarity , work describing potential fairness issues is limited to individual fairness in standard metric learning ( Ilvento , 2020 ) , disregarding embedding models . Indeed , the impacts and metrics of fairness are well studied in machine learning ( ML ) generally , and representation learning specifically ( Dwork et al. , 2012 ; Mehrabi et al. , 2019 ; Locatello et al. , 2019b ) . This is especially true on high-risk tasks such as facial recognition and judicial decision-making ( Chouldechova , 2017 ; Berk , 2017 ) , where there are known risks to minoritized subgroups ( Samadi et al. , 2018 ) . Yet , relatively little work has been done in the domain of DML ( Rosenberg et al. , 2021 ) . It is crucial to address this knowledge gap – if DML embeddings are used to create upstream embeddings that facilitate downstream transfer tasks , biases may propagate unknowingly . To tackle this issue , this work first proposes a benchmark to characterize fairness in non-balanced DML - finDML . finDML introduces three subgroup fairness definitions based on feature space performance metrics – recall @ k , alignment and group uniformity . These metrics measure clustering ability and generalization performance via feature space uniformity . Thus , we select the metrics for our definitions to enforce independence between inclusion in a particular cluster or class , and a protected attribute ( given the ground-truth label ) . We leverage existing datasets with fairness limitations ( CelebA ( Liu et al. , 2015 ) and LFW ( Huang et al. , 2007 ) ) and induce imbalance in training data of standard DML benchmarks , CARS196 ( Krause et al. , 2013 ) and CUB200 ( Wah et al. , 2011 ) , in order to create an effective benchmark for fairness analysis in DML . Making use of finDML , we then perform an evaluation of 11 state-of-the-art ( SOTA ) DML methods representing frequently used losses and sampling strategies , including : ranking-based losses ( Wang et al. , 2014 ; Hoffer & Ailon , 2018 ) , proxy-based ( Kim et al. , 2020 ) losses , semi-hard sampling ( Schroff et al. , 2015 ) and distance-weighted sampling ( Wu et al. , 2018 ) . Our experiments suggest that imbalanced data during upstream embedding impacts the fairness of all benchmarks methods in both upstream embeddings ( subgroup gaps up to 21 % ) as well as downstream classifications ( subgroup gaps up to 45.9 % ) . This imbalance is significant even when downstream classifiers are given access to balanced training data , indicating that data can not naively be used to de-bias downstream classifiers from imbalanced embeddings . Finally , inspired by prior work in DML on multi-feature learning ( Milbich et al. , 2020 ) , we introduce PARtial Attribute DE-correlation ( PARADE ) . PARADE addresses imbalance by de-correlating two learned embeddings : one learnt to represent similarity in class labels , and one learnt to represent similarity in the values of a sensitive attribute , which is discarded at test-time . This creates a model in which the ultimate target class embeddings have been de-correlated from the sensitive attributes of the input . We note that as opposed to previous work on variational latent spaces , PARADE de-correlates a learned similarity metric . We find that PARADE reduces gaps of SOTA DML methods by up to 2 % downstream in finDML . In total , our contributions can be summarized as follows : 1 . We define finDML ; introducing three definitions of fairness in DML to capture multifaceted minoritized subgroup performance in upstream embeddings through focus on feature representation characteristics across subgroups , and five datasets for benchmarking . 2 . We analyze SOTA DML methods using finDML , and find that common DML approaches are significantly impacted by imbalanced data . We show empirically that learned embedding bias can not be overcome by naive inclusion of balanced data in downstream classifiers . 3 . We present PARADE , a novel a novel adaptation of previous zero-shot generalization techniques to enhance fairness guarantees through de-correlation of class discriminative features with sensitive attributes . 2 BACKGROUND . Deep Metric Learning DML extends standard metric learning by fusing feature extraction and learning a parametrized metric space into one end-to-end learnable setup . In this setting , a large convolutional network ψ provides the mapping to a feature space Ψ , while a small network f , usually a single linear layer , generates the final mapping to the metric or embedding space Φ . The overall mapping from the image space X is thus given by ϕ = f ◦ ψ . Generally , the embedding space is projected on the unit hypersphere SD−1 through normalization ( Weisstein , 2002 ; Wu et al. , 2018 ; Roth et al. , 2020c ; Wang & Isola , 2020 ) to limit the volume of the representation space with increasing embedding dimensionality . The embedding network ϕ is then trained to provide a metric space Φ that operates well under some predefined , usually non-parametric metric such as the Euclidean or cosine distance defined over Φ . Typical objectives used to learn such metric spaces range from contrastive ranking-based training using tuples of data , such as pairwise ( Hadsell et al. , 2006 ) , triplet- ( Schroff et al. , 2015 ; Wu et al. , 2018 ) or higher-order tuple-based training ( Sohn , 2016 ; Wang et al. , 2020a ) , procedures to bring down the effective complexity of the tuple space ( Schroff et al. , 2015 ; Harwood et al. , 2017 ; Wu et al. , 2018 ) or the introduction of learnable tuple constituents ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020 ) . More recent work ( Milbich et al. , 2020 ; Roth et al. , 2020c ; Jacob et al. , 2019 ) extends standard DML training through incorporation of objectives going beyond just sole class label discrimination : e.g. , through the introduction of artificial samples ( Lin et al. , 2018 ; Duan et al. , 2018 ) , regularization of higher-order moments ( Jacob et al. , 2019 ) , curriculum learning ( Zheng et al. , 2019 ; Harwood et al. , 2017 ; Roth et al. , 2020a ) , knowledge distillation ( Roth et al. , 2020b ) or the inclusion of additional features ( DiVA ) to produce diverse and de-correlated representations ( Milbich et al. , 2020 ) . DML Evaluation Standard performance measures reflect the goal of DML : namely , optimizing an embedding space Φ for best transfer to new test classes via learning semantic similarities . As immediate applications are commonly found in zero-shot clustering or image retrieval , respective retrieval and clustering metrics are predominantly utilized for evaluation . Recall @ k ( Jegou et al. , 2011 ) or mean average precision measured on recall ( Roth et al. , 2020c ; Musgrave et al. , 2020 ) typically estimate retrieval performance . Normalized mutual information ( NMI ) on clustered embeddings ( Manning et al. , 2010 ) is used as a proxy for clustering quality ( see Supplemental for detailed definitions ) . We leverage these performance metrics to inform finDML and our experiments . Fairness in Classification Formalizing fairness in ML continues to be an open problem ( Mehrabi et al. , 2019 ; Chen et al. , 2018a ; Chouldechova , 2017 ; Berk , 2017 ; Locatello et al. , 2019b ; Chouldechova & Roth , 2018 ; Dwork et al. , 2012 ; Hardt et al. , 2016 ; Zafar et al. , 2017 ) . In classification , definitions for fairness such as demographic parity , equalized odds , and equality of opportunity , rely on model outputs across the random variables of protected attribute and ground-truth label ( Dwork et al. , 2012 ; Hardt et al. , 2016 ) . Fairness in Representations A more relevant family of fairness definitions for DML would be those explored in fairness for general representation learning ( Edwards & Storkey , 2015 ; Beutel et al. , 2017 ; Louizos et al. , 2015 ; Madras et al. , 2018 ) . Here , the goal is to learn a fair mapping from an original domain to a latent domain so that classifiers trained on these representations are more likely to be agnostic to the sensitive attribute in unknown downstream tasks . This assumption distinguishes our setting from previous fairness work in which the downstream tasks are known at train time ( Madras et al. , 2018 ; Edwards & Storkey , 2015 ; Moyer et al. , 2018 ; Song et al. , 2019 ; Jaiswal et al. , 2019 ) . DML differs from this form of representation learning as it aims to learn a mapping capturing semantic similarity , as opposed to latent space representation . Earlier works in fair representation learning intended to obfuscate any information about sensitive attributes to approximately satisfy demographic parity ( Zemel et al. , 2013 ) while a wealth of more recent works focus on using adversarial methods or feature disentanglement in latent spaces of VAEs ( Locatello et al. , 2019a ; Kingma & Welling , 2013 ; Gretton et al. , 2006 ; Louizos et al. , 2015 ; Amini et al. , 2019 ; Alemi et al. , 2018 ; Burgess et al. , 2018 ; Chen et al. , 2018b ; Kim & Mnih , 2018 ; Esmaeili et al. , 2019 ; Song et al. , 2019 ; Gitiaux & Rangwala , 2021 ; Rodríguez-Gálvez et al. , 2020 ; Sarhan et al. , 2020 ; Paul & Burlina , 2021 ; Chakraborty et al. , 2020 ) . In this setting , the literature has focused on optimizing on approximations of the mutual information between representations and sensitive attributes : maximum mean discrepancy ( Gretton et al. , 2006 ) for deterministic or variational ( Li et al. , 2014 ; Louizos et al. , 2015 ) autoencoders ( VAEs ) ; cross-entropy of an adversarial network that predicts sensitive attributes from the representations ( Edwards & Storkey , 2015 ; Xie et al. , 2017 ; Beutel et al. , 2017 ; Zhang et al. , 2018 ; Madras et al. , 2018 ; Adel et al. , 2019 ; Zhao & Gordon , 2019 ; Xu et al. , 2018 ) ; balanced error rate on both target loss and adversary loss ( Zhao et al. , 2019 ) ; Weak-Conditional InfoNCE for conditional contrastive learning ( Tsai et al. , 2021 ) . PARADE shares aspects of these previous methods in its choice of de-correlation or disentanglement . However , PARADE de-correlates the learned similarity metric as opposed to the latent space . In addition , with DML-specific criteria , PARADE learns similarities over the sensitive attribute while not directly removing all information about the sensitive attribute , as the sensitive attribute and target class embeddings share a base network . 3 EXTENDING FAIRNESS TO DML - finDML BENCHMARK To characterize fairness with finDML , this section introduces the key constituents – definitions to characterize fairness in embedding spaces and respective benchmark datasets . | The paper investigates the fairness problem in the deep metric learning task, which is underexplored by the research community. The authors propose finDML to benchmark previous methods on multiple imbalanced datasets with three newly proposed metrics. The experimental results show that all previous deep metric learning methods have the fairness issue, i.e., larger performance gaps across different subgroups. The authors further propose PARADE to mitigate the biases, which has been shown to be effective by the experiments. | SP:9b09eca150d67f3e0f261eb4f682fac6a30279a1 |
ScheduleNet: Learn to solve multi-agent scheduling problems with reinforcement learning | 1 INTRODUCTION . Optimal assignments of multiple autonomous agents for sequential completion of distributed tasks are necessary to solve various types of scheduling problems in the logistics , transportation , and manufacturing industries . Examples of such scheduling problem include finding the optimal delivery plans for vaccines , customer pickup orders for ride-sharing services , and machine operation sequence in modern manufacturing facilities . As the size of the problems increases , solving largescale scheduling problems using mathematical programming becomes infeasible or ineffective due to the expensive computational cost . Furthermore , such optimization approaches can not solve realtime scheduling problems where the new tasks appear dynamically . Target Problem & Challenges . In this paper , we propose ScheduleNet , an RL-based decentralized constructive scheduler for coordinating multiple agents to finish tasks with minimum completion time . The objectives of the target problems and their associated technical challenges are as follows : • Min-Max vs Min-Sum : ScheduleNet seeks to minimize the total completion time ( i.e. , makespan ) for various time-critical distributed tasks ( e.g. , vaccine delivery ) . Most multi-agent scheduling problems are designed to minimize the total traveling distance of all agents , which often result in unbalanced task assignments among the agents ( Bakach et al. , 2021 ) . Although the makespan is the most direct and intuitive reward for inducing coordination , it is notoriously difficult to train the decentralized policy with this sparse and delayed reward due to the temporal and spatial credit assignment issues . • Construction Heuristic vs Improvement heuristic : ScheduleNet builds a solution sequentially by assigning an idle agent to one of the remaining tasks while considering the relationships among the remaining tasks and agents . This construction heuristic ensures that the learned policy can reschedule whenever a new event occurs ( i.e. , an agent finishes the assigned task or a new task appears ) . However , it is more challenging to find a better plan due to its sequential solution construction ; a wrong choice at the early stage can cause irreversible poor results at the end . • Decentralized vs Centralized : ScheduleNet allows each agent to choose its destination independently while using its local observations and incorporating other agents ’ assignments . This decentralization ensures that the learned policy can solve a large-scale problem without having to search over the joint action space for all agents . However , to make the independently-chosen scheduling decision produce an excellent global performance , a sophisticated coordination mechanism should be incorporated into decentralized policy implicitly . Proposed Decision-Making Scheme . We formulate the multi-agent scheduling problems ( mSPs ) as an event-based Markov decision process ( MDP ) with an episodic reward , and derive a decentralized decision-making policy using reinforcement learning . At every step , ScheduleNet accepts the MDP state as an input and assigns an idle agent to one of the feasible tasks . The decision-making procedure of ScheduleNet is as follows : • ScheduleNet first represents the MDP state as an agent-task graph , which captures the complex relationships among the entities effectively and is general enough to be applied to various mSPs . • ScheduleNet then employs the type-aware graph attention ( TGA ) to extract important relational features among the agents and tasks for making the best cooperative task assignment . • Lastly , ScheduleNet computes the agent-task assignment probability by utilizing the computed node embeddings . Training Method . Although the makespan ( shared team reward ) is the most direct and general reward design for solving mSPs , training a decentralized scheduling policy using this reward is extremely difficult due to the credit assignment issues ( Riedmiller et al. , 2018 ; Hare , 2019 ) . Additionally , makespan is highly volatile due to the combinatorial aspect of mSPs ’ solution space ; a slight change in the solution can drastically alter the outcome . To overcome these issues , we employ the Clip-REINFORCE algorithm with normalized reward to train the decentralized cooperative policy effectively . Novelties . The proposed method that derives the decentralized constructive schedulers to coordinate multiple agents has the following novelties and advantages : • Balance between Representability & Scalability : ScheduleNet can extract crucial features effectively using TGA and make the best cooperative task assignment ( representability ) in a computationally efficient manner . The computationally-efficient representation scheme and the constructive decision-making scheme allows ScheduleNet to solve large-scale scheduling problems . • Transferability & Generalizability : The type-aware graph representation allows the trained policy to solve problems with different numbers of agents and tasks ( size transferability ) . Furthermore , this general state representation with the universal reward signal ( i.e. , makespan ) allows ScheduleNet to be used to solve various multi-agent scheduling problems ( generalizability ) . We validate this by showing that ScheduleNet can learn to solve multiple traveling salesmen problem ( mTSP ) , as well as jop-shop scheduling problem ( JSP ) whose constraints are more complex than that of mTSP . 2 RELATED WORKS . RL approaches that solve vehicle routing problems . According to Mazyavkina et al . ( 2020 ) , the RL approaches that solve vehicle routing problems can be categorized into : ( 1 ) the improvement heuristics that rewrite the complete solution iteratively to obtain a better routing plan ( Wu et al. , 2020 ; da Costa et al. , 2020 ; Chen & Tian , 2019 ; Lu et al. , 2020 ) ; ( 2 ) the construction heuristics that construct the solution sequentially by assigning idle vehicles to unvisited cities until the complete routing plan ( sequence ) is constructed ( Bello et al. , 2016 ; Nazari et al. , 2018 ; Kool et al. , 2018 ; Khalil et al. , 2017 ) , and ( 3 ) the hybrid approaches that blend both approaches ( Joshi et al. , 2020 ; Fu et al. , 2021 ; Kool et al. , 2021 ; Ahn et al. , 2020 ) . Typically , the improvement heuristics show better performances than construction heuristics as they revise the complete plan iteratively . However , the construction heuristics are more effective for online vehicle routing problems , where the routes should be updated whenever a new customer appears . These RL approaches have exclusively focused on static planning in a single-agent perspective , which is far from the settings of real applications . RL approaches that solve min-max mTSP . There are only few RL approaches that solve min-max mTSP , which involves minimizing the makespan for multiple salesmen to visit all cities . Hu et al . ( 2020 ) applies RL to train the clustering algorithm that groups cities , and strong TSP heuristics ( e.g. , OR-Tool ) to optimize the sub-tours of the city clusters . This is fundamentally different from ScheduleNet , which derives a complete end-to-end learned heuristic that constructs a feasible solution from “ scratch ” without relying on any existing solvers . Cao et al . ( 2021 ) , which proposes a transformer-based construction policy to solve min-max mTSP , is the most similar approach to ScheduleNet . RL approaches that solve Job-shop scheduling problems . There are only few RL approaches that solve the JSPs , which involves minimizing the makespan for multiple machines to finish the sequence of operations that is required to finish their jobs . For example , Gabel & Riedmiller ( 2012 ) ; Lin et al . ( 2019 ) propose to learn a scheduling policy for each machine ; hence , it requires additional training to solve JSPs with a different number of machines . Recently , Park et al . ( 2021 ) ; Zhang et al . ( 2020 ) have proposed to learn a shared scheduling policy that can be used for all machines to minimize the makespan . Similar to ScheduleNet , these studies utilize the disjunctive graph representation of JSP . However , these methods utilize human-engineered dense reward , while ScheduleNet uses sparse and delayed reward ( i.e. , makespan ) to train a policy . 3 PROBLEM FORMULATION . We formulate mSP as a MDP with sparse reward , and aim to derive a decentralized scheduling decision-making policy that can be shared by all agents . The MDP is defined as : State . We define state sτ as the τ -th partial solution of mSP ( i.e. , the completed/uncompleted tasks , the status of agents , and the sequence of the past assignments ) . The initial s0 and terminal state sT are defined as an empty and a complete solution , respectively . Action . We define action aτ as the act of assigning an idle agent to one of the feasible tasks ( unassigned tasks ) . We refer to aτ as the agent-to-task assignment . When the multiple agents are idle at the same time t , we randomly choose one agent and assign an action to the agent . This is repeated until no agent is idle . Note that such randomness does not alter the resulting solutions , since the agents are considered to be homogeneous and the scheduling policy is shared . Transition . The proposed MDP is formulated with an event-based transition . An event is defined as the case where any agent finishes the assigned task ( e.g. , a salesman reaches the assigned city in mTSP ) . Whenever an event occurs , the idle agent is assigned to a new task , and the status of the agent and the target task are updated accordingly . We enumerate the event with τ to avoid confusion from the elapsed time of the problem ; t ( τ ) is a function that returns the time of event τ . Reward . The proposed MDP uses the negative makespan ( i.e . total completion time of tasks ) as the reward ( i.e. , r ( sT ) = −t ( T ) ) that is realized only at sT . 3.1 EXAMPLE : MDP FORMULATION OF MTSP . Let us consider the single-depot mTSP with two types of entities : m salesmen ( i.e. , m agents ) and N cities ( i.e. , N tasks ) . All salesmen start their journey from the depot , and come back to the depot after visiting all cities ( each city can be visited by only one salesman ) . The solution to mTSP is considered to be complete when all the cities have been visited , and all salesmen have returned to the depot . The MDP formulation for mTSP is similar to that of the general mSP . The specific definition of the state for mTSP is as follows : State . We define sτ = ( { siτ } N+mi=1 , senvτ ) , which is composed of two types of states : entity state siτ and environment state senvτ . • siτ = ( p i τ ,1 active τ ,1 assigned τ ) is the state of the i-th entity . piτ is the 2D Cartesian coordinate of the i-th entity at the τ -th event . 1activeτ indicates whether the i-th agent/task is active ( agent is working/ task is not visited ) . Similarly , 1assignedτ indicates whether agent/task is assigned . • senvτ contains the current time of the environment , and the sequences of cities visited by the salesmen . 4 SCHEDULENET . In this section , we explain how ScheduleNet recommends a scheduling action aτ of an idle agent from input sτ ( partial solution ) . This is done by ( 1 ) constructing the agent-task graph Gτ , ( 2 ) embedding Gτ using TGA , and ( 3 ) computing the assignment probabilities . Figure 1 illustrates the decision-making process of ScheduleNet . | This paper tries to solve traditional scheduling problems by using the deep reinforcement learning (RL) framework. To make the RL framework applicable to such problems, the authors model the problem states as an agent-task graph and encode the nodes in the graph utilizing a type-aware graph attention technique they proposed. The obtained node embeddings are next used to compute the final assignment probabilities. The authors use implementation tricks such as reward normalization and clip-loss to accelerate training or achieve better performance in the training process. The proposed method performs well in the traveling salesmen problem and the job-shop scheduling problem. | SP:eeb3aff7145ad0b096f6d7fbc7968536918ae164 |
ScheduleNet: Learn to solve multi-agent scheduling problems with reinforcement learning | 1 INTRODUCTION . Optimal assignments of multiple autonomous agents for sequential completion of distributed tasks are necessary to solve various types of scheduling problems in the logistics , transportation , and manufacturing industries . Examples of such scheduling problem include finding the optimal delivery plans for vaccines , customer pickup orders for ride-sharing services , and machine operation sequence in modern manufacturing facilities . As the size of the problems increases , solving largescale scheduling problems using mathematical programming becomes infeasible or ineffective due to the expensive computational cost . Furthermore , such optimization approaches can not solve realtime scheduling problems where the new tasks appear dynamically . Target Problem & Challenges . In this paper , we propose ScheduleNet , an RL-based decentralized constructive scheduler for coordinating multiple agents to finish tasks with minimum completion time . The objectives of the target problems and their associated technical challenges are as follows : • Min-Max vs Min-Sum : ScheduleNet seeks to minimize the total completion time ( i.e. , makespan ) for various time-critical distributed tasks ( e.g. , vaccine delivery ) . Most multi-agent scheduling problems are designed to minimize the total traveling distance of all agents , which often result in unbalanced task assignments among the agents ( Bakach et al. , 2021 ) . Although the makespan is the most direct and intuitive reward for inducing coordination , it is notoriously difficult to train the decentralized policy with this sparse and delayed reward due to the temporal and spatial credit assignment issues . • Construction Heuristic vs Improvement heuristic : ScheduleNet builds a solution sequentially by assigning an idle agent to one of the remaining tasks while considering the relationships among the remaining tasks and agents . This construction heuristic ensures that the learned policy can reschedule whenever a new event occurs ( i.e. , an agent finishes the assigned task or a new task appears ) . However , it is more challenging to find a better plan due to its sequential solution construction ; a wrong choice at the early stage can cause irreversible poor results at the end . • Decentralized vs Centralized : ScheduleNet allows each agent to choose its destination independently while using its local observations and incorporating other agents ’ assignments . This decentralization ensures that the learned policy can solve a large-scale problem without having to search over the joint action space for all agents . However , to make the independently-chosen scheduling decision produce an excellent global performance , a sophisticated coordination mechanism should be incorporated into decentralized policy implicitly . Proposed Decision-Making Scheme . We formulate the multi-agent scheduling problems ( mSPs ) as an event-based Markov decision process ( MDP ) with an episodic reward , and derive a decentralized decision-making policy using reinforcement learning . At every step , ScheduleNet accepts the MDP state as an input and assigns an idle agent to one of the feasible tasks . The decision-making procedure of ScheduleNet is as follows : • ScheduleNet first represents the MDP state as an agent-task graph , which captures the complex relationships among the entities effectively and is general enough to be applied to various mSPs . • ScheduleNet then employs the type-aware graph attention ( TGA ) to extract important relational features among the agents and tasks for making the best cooperative task assignment . • Lastly , ScheduleNet computes the agent-task assignment probability by utilizing the computed node embeddings . Training Method . Although the makespan ( shared team reward ) is the most direct and general reward design for solving mSPs , training a decentralized scheduling policy using this reward is extremely difficult due to the credit assignment issues ( Riedmiller et al. , 2018 ; Hare , 2019 ) . Additionally , makespan is highly volatile due to the combinatorial aspect of mSPs ’ solution space ; a slight change in the solution can drastically alter the outcome . To overcome these issues , we employ the Clip-REINFORCE algorithm with normalized reward to train the decentralized cooperative policy effectively . Novelties . The proposed method that derives the decentralized constructive schedulers to coordinate multiple agents has the following novelties and advantages : • Balance between Representability & Scalability : ScheduleNet can extract crucial features effectively using TGA and make the best cooperative task assignment ( representability ) in a computationally efficient manner . The computationally-efficient representation scheme and the constructive decision-making scheme allows ScheduleNet to solve large-scale scheduling problems . • Transferability & Generalizability : The type-aware graph representation allows the trained policy to solve problems with different numbers of agents and tasks ( size transferability ) . Furthermore , this general state representation with the universal reward signal ( i.e. , makespan ) allows ScheduleNet to be used to solve various multi-agent scheduling problems ( generalizability ) . We validate this by showing that ScheduleNet can learn to solve multiple traveling salesmen problem ( mTSP ) , as well as jop-shop scheduling problem ( JSP ) whose constraints are more complex than that of mTSP . 2 RELATED WORKS . RL approaches that solve vehicle routing problems . According to Mazyavkina et al . ( 2020 ) , the RL approaches that solve vehicle routing problems can be categorized into : ( 1 ) the improvement heuristics that rewrite the complete solution iteratively to obtain a better routing plan ( Wu et al. , 2020 ; da Costa et al. , 2020 ; Chen & Tian , 2019 ; Lu et al. , 2020 ) ; ( 2 ) the construction heuristics that construct the solution sequentially by assigning idle vehicles to unvisited cities until the complete routing plan ( sequence ) is constructed ( Bello et al. , 2016 ; Nazari et al. , 2018 ; Kool et al. , 2018 ; Khalil et al. , 2017 ) , and ( 3 ) the hybrid approaches that blend both approaches ( Joshi et al. , 2020 ; Fu et al. , 2021 ; Kool et al. , 2021 ; Ahn et al. , 2020 ) . Typically , the improvement heuristics show better performances than construction heuristics as they revise the complete plan iteratively . However , the construction heuristics are more effective for online vehicle routing problems , where the routes should be updated whenever a new customer appears . These RL approaches have exclusively focused on static planning in a single-agent perspective , which is far from the settings of real applications . RL approaches that solve min-max mTSP . There are only few RL approaches that solve min-max mTSP , which involves minimizing the makespan for multiple salesmen to visit all cities . Hu et al . ( 2020 ) applies RL to train the clustering algorithm that groups cities , and strong TSP heuristics ( e.g. , OR-Tool ) to optimize the sub-tours of the city clusters . This is fundamentally different from ScheduleNet , which derives a complete end-to-end learned heuristic that constructs a feasible solution from “ scratch ” without relying on any existing solvers . Cao et al . ( 2021 ) , which proposes a transformer-based construction policy to solve min-max mTSP , is the most similar approach to ScheduleNet . RL approaches that solve Job-shop scheduling problems . There are only few RL approaches that solve the JSPs , which involves minimizing the makespan for multiple machines to finish the sequence of operations that is required to finish their jobs . For example , Gabel & Riedmiller ( 2012 ) ; Lin et al . ( 2019 ) propose to learn a scheduling policy for each machine ; hence , it requires additional training to solve JSPs with a different number of machines . Recently , Park et al . ( 2021 ) ; Zhang et al . ( 2020 ) have proposed to learn a shared scheduling policy that can be used for all machines to minimize the makespan . Similar to ScheduleNet , these studies utilize the disjunctive graph representation of JSP . However , these methods utilize human-engineered dense reward , while ScheduleNet uses sparse and delayed reward ( i.e. , makespan ) to train a policy . 3 PROBLEM FORMULATION . We formulate mSP as a MDP with sparse reward , and aim to derive a decentralized scheduling decision-making policy that can be shared by all agents . The MDP is defined as : State . We define state sτ as the τ -th partial solution of mSP ( i.e. , the completed/uncompleted tasks , the status of agents , and the sequence of the past assignments ) . The initial s0 and terminal state sT are defined as an empty and a complete solution , respectively . Action . We define action aτ as the act of assigning an idle agent to one of the feasible tasks ( unassigned tasks ) . We refer to aτ as the agent-to-task assignment . When the multiple agents are idle at the same time t , we randomly choose one agent and assign an action to the agent . This is repeated until no agent is idle . Note that such randomness does not alter the resulting solutions , since the agents are considered to be homogeneous and the scheduling policy is shared . Transition . The proposed MDP is formulated with an event-based transition . An event is defined as the case where any agent finishes the assigned task ( e.g. , a salesman reaches the assigned city in mTSP ) . Whenever an event occurs , the idle agent is assigned to a new task , and the status of the agent and the target task are updated accordingly . We enumerate the event with τ to avoid confusion from the elapsed time of the problem ; t ( τ ) is a function that returns the time of event τ . Reward . The proposed MDP uses the negative makespan ( i.e . total completion time of tasks ) as the reward ( i.e. , r ( sT ) = −t ( T ) ) that is realized only at sT . 3.1 EXAMPLE : MDP FORMULATION OF MTSP . Let us consider the single-depot mTSP with two types of entities : m salesmen ( i.e. , m agents ) and N cities ( i.e. , N tasks ) . All salesmen start their journey from the depot , and come back to the depot after visiting all cities ( each city can be visited by only one salesman ) . The solution to mTSP is considered to be complete when all the cities have been visited , and all salesmen have returned to the depot . The MDP formulation for mTSP is similar to that of the general mSP . The specific definition of the state for mTSP is as follows : State . We define sτ = ( { siτ } N+mi=1 , senvτ ) , which is composed of two types of states : entity state siτ and environment state senvτ . • siτ = ( p i τ ,1 active τ ,1 assigned τ ) is the state of the i-th entity . piτ is the 2D Cartesian coordinate of the i-th entity at the τ -th event . 1activeτ indicates whether the i-th agent/task is active ( agent is working/ task is not visited ) . Similarly , 1assignedτ indicates whether agent/task is assigned . • senvτ contains the current time of the environment , and the sequences of cities visited by the salesmen . 4 SCHEDULENET . In this section , we explain how ScheduleNet recommends a scheduling action aτ of an idle agent from input sτ ( partial solution ) . This is done by ( 1 ) constructing the agent-task graph Gτ , ( 2 ) embedding Gτ using TGA , and ( 3 ) computing the assignment probabilities . Figure 1 illustrates the decision-making process of ScheduleNet . | The paper proposes a generic approach called ScheduleNet to solve combinatorial multi-agent scheduling problems using neural network and reinforcement learning. An agent-task relationship graph is first constructed through edge and node embedding (using message passing framework among neighbours). Message values for each node is computed using type-aware edge embedding value and then a node embedding is performed using the message values. Using these embedding values, ScheduleNet computes assignment probability between idle agent and active tasks. ScheduleNet is trained using reinforcement learning and two methods are proposed to improve training performance: (a) reward normalization and (b) adding clip parameter in REINFORCE algorithm training. Extensive experimental results are demonstrated on mTSP and job-shop scheduling problems. Through benchmarking against state-of-the-art OR heuristics and RL methods, and using ablation studies, it is shown that the ScheduleNet performs efficiently and generalizes well to unknown or online scenarios. | SP:eeb3aff7145ad0b096f6d7fbc7968536918ae164 |
ScheduleNet: Learn to solve multi-agent scheduling problems with reinforcement learning | 1 INTRODUCTION . Optimal assignments of multiple autonomous agents for sequential completion of distributed tasks are necessary to solve various types of scheduling problems in the logistics , transportation , and manufacturing industries . Examples of such scheduling problem include finding the optimal delivery plans for vaccines , customer pickup orders for ride-sharing services , and machine operation sequence in modern manufacturing facilities . As the size of the problems increases , solving largescale scheduling problems using mathematical programming becomes infeasible or ineffective due to the expensive computational cost . Furthermore , such optimization approaches can not solve realtime scheduling problems where the new tasks appear dynamically . Target Problem & Challenges . In this paper , we propose ScheduleNet , an RL-based decentralized constructive scheduler for coordinating multiple agents to finish tasks with minimum completion time . The objectives of the target problems and their associated technical challenges are as follows : • Min-Max vs Min-Sum : ScheduleNet seeks to minimize the total completion time ( i.e. , makespan ) for various time-critical distributed tasks ( e.g. , vaccine delivery ) . Most multi-agent scheduling problems are designed to minimize the total traveling distance of all agents , which often result in unbalanced task assignments among the agents ( Bakach et al. , 2021 ) . Although the makespan is the most direct and intuitive reward for inducing coordination , it is notoriously difficult to train the decentralized policy with this sparse and delayed reward due to the temporal and spatial credit assignment issues . • Construction Heuristic vs Improvement heuristic : ScheduleNet builds a solution sequentially by assigning an idle agent to one of the remaining tasks while considering the relationships among the remaining tasks and agents . This construction heuristic ensures that the learned policy can reschedule whenever a new event occurs ( i.e. , an agent finishes the assigned task or a new task appears ) . However , it is more challenging to find a better plan due to its sequential solution construction ; a wrong choice at the early stage can cause irreversible poor results at the end . • Decentralized vs Centralized : ScheduleNet allows each agent to choose its destination independently while using its local observations and incorporating other agents ’ assignments . This decentralization ensures that the learned policy can solve a large-scale problem without having to search over the joint action space for all agents . However , to make the independently-chosen scheduling decision produce an excellent global performance , a sophisticated coordination mechanism should be incorporated into decentralized policy implicitly . Proposed Decision-Making Scheme . We formulate the multi-agent scheduling problems ( mSPs ) as an event-based Markov decision process ( MDP ) with an episodic reward , and derive a decentralized decision-making policy using reinforcement learning . At every step , ScheduleNet accepts the MDP state as an input and assigns an idle agent to one of the feasible tasks . The decision-making procedure of ScheduleNet is as follows : • ScheduleNet first represents the MDP state as an agent-task graph , which captures the complex relationships among the entities effectively and is general enough to be applied to various mSPs . • ScheduleNet then employs the type-aware graph attention ( TGA ) to extract important relational features among the agents and tasks for making the best cooperative task assignment . • Lastly , ScheduleNet computes the agent-task assignment probability by utilizing the computed node embeddings . Training Method . Although the makespan ( shared team reward ) is the most direct and general reward design for solving mSPs , training a decentralized scheduling policy using this reward is extremely difficult due to the credit assignment issues ( Riedmiller et al. , 2018 ; Hare , 2019 ) . Additionally , makespan is highly volatile due to the combinatorial aspect of mSPs ’ solution space ; a slight change in the solution can drastically alter the outcome . To overcome these issues , we employ the Clip-REINFORCE algorithm with normalized reward to train the decentralized cooperative policy effectively . Novelties . The proposed method that derives the decentralized constructive schedulers to coordinate multiple agents has the following novelties and advantages : • Balance between Representability & Scalability : ScheduleNet can extract crucial features effectively using TGA and make the best cooperative task assignment ( representability ) in a computationally efficient manner . The computationally-efficient representation scheme and the constructive decision-making scheme allows ScheduleNet to solve large-scale scheduling problems . • Transferability & Generalizability : The type-aware graph representation allows the trained policy to solve problems with different numbers of agents and tasks ( size transferability ) . Furthermore , this general state representation with the universal reward signal ( i.e. , makespan ) allows ScheduleNet to be used to solve various multi-agent scheduling problems ( generalizability ) . We validate this by showing that ScheduleNet can learn to solve multiple traveling salesmen problem ( mTSP ) , as well as jop-shop scheduling problem ( JSP ) whose constraints are more complex than that of mTSP . 2 RELATED WORKS . RL approaches that solve vehicle routing problems . According to Mazyavkina et al . ( 2020 ) , the RL approaches that solve vehicle routing problems can be categorized into : ( 1 ) the improvement heuristics that rewrite the complete solution iteratively to obtain a better routing plan ( Wu et al. , 2020 ; da Costa et al. , 2020 ; Chen & Tian , 2019 ; Lu et al. , 2020 ) ; ( 2 ) the construction heuristics that construct the solution sequentially by assigning idle vehicles to unvisited cities until the complete routing plan ( sequence ) is constructed ( Bello et al. , 2016 ; Nazari et al. , 2018 ; Kool et al. , 2018 ; Khalil et al. , 2017 ) , and ( 3 ) the hybrid approaches that blend both approaches ( Joshi et al. , 2020 ; Fu et al. , 2021 ; Kool et al. , 2021 ; Ahn et al. , 2020 ) . Typically , the improvement heuristics show better performances than construction heuristics as they revise the complete plan iteratively . However , the construction heuristics are more effective for online vehicle routing problems , where the routes should be updated whenever a new customer appears . These RL approaches have exclusively focused on static planning in a single-agent perspective , which is far from the settings of real applications . RL approaches that solve min-max mTSP . There are only few RL approaches that solve min-max mTSP , which involves minimizing the makespan for multiple salesmen to visit all cities . Hu et al . ( 2020 ) applies RL to train the clustering algorithm that groups cities , and strong TSP heuristics ( e.g. , OR-Tool ) to optimize the sub-tours of the city clusters . This is fundamentally different from ScheduleNet , which derives a complete end-to-end learned heuristic that constructs a feasible solution from “ scratch ” without relying on any existing solvers . Cao et al . ( 2021 ) , which proposes a transformer-based construction policy to solve min-max mTSP , is the most similar approach to ScheduleNet . RL approaches that solve Job-shop scheduling problems . There are only few RL approaches that solve the JSPs , which involves minimizing the makespan for multiple machines to finish the sequence of operations that is required to finish their jobs . For example , Gabel & Riedmiller ( 2012 ) ; Lin et al . ( 2019 ) propose to learn a scheduling policy for each machine ; hence , it requires additional training to solve JSPs with a different number of machines . Recently , Park et al . ( 2021 ) ; Zhang et al . ( 2020 ) have proposed to learn a shared scheduling policy that can be used for all machines to minimize the makespan . Similar to ScheduleNet , these studies utilize the disjunctive graph representation of JSP . However , these methods utilize human-engineered dense reward , while ScheduleNet uses sparse and delayed reward ( i.e. , makespan ) to train a policy . 3 PROBLEM FORMULATION . We formulate mSP as a MDP with sparse reward , and aim to derive a decentralized scheduling decision-making policy that can be shared by all agents . The MDP is defined as : State . We define state sτ as the τ -th partial solution of mSP ( i.e. , the completed/uncompleted tasks , the status of agents , and the sequence of the past assignments ) . The initial s0 and terminal state sT are defined as an empty and a complete solution , respectively . Action . We define action aτ as the act of assigning an idle agent to one of the feasible tasks ( unassigned tasks ) . We refer to aτ as the agent-to-task assignment . When the multiple agents are idle at the same time t , we randomly choose one agent and assign an action to the agent . This is repeated until no agent is idle . Note that such randomness does not alter the resulting solutions , since the agents are considered to be homogeneous and the scheduling policy is shared . Transition . The proposed MDP is formulated with an event-based transition . An event is defined as the case where any agent finishes the assigned task ( e.g. , a salesman reaches the assigned city in mTSP ) . Whenever an event occurs , the idle agent is assigned to a new task , and the status of the agent and the target task are updated accordingly . We enumerate the event with τ to avoid confusion from the elapsed time of the problem ; t ( τ ) is a function that returns the time of event τ . Reward . The proposed MDP uses the negative makespan ( i.e . total completion time of tasks ) as the reward ( i.e. , r ( sT ) = −t ( T ) ) that is realized only at sT . 3.1 EXAMPLE : MDP FORMULATION OF MTSP . Let us consider the single-depot mTSP with two types of entities : m salesmen ( i.e. , m agents ) and N cities ( i.e. , N tasks ) . All salesmen start their journey from the depot , and come back to the depot after visiting all cities ( each city can be visited by only one salesman ) . The solution to mTSP is considered to be complete when all the cities have been visited , and all salesmen have returned to the depot . The MDP formulation for mTSP is similar to that of the general mSP . The specific definition of the state for mTSP is as follows : State . We define sτ = ( { siτ } N+mi=1 , senvτ ) , which is composed of two types of states : entity state siτ and environment state senvτ . • siτ = ( p i τ ,1 active τ ,1 assigned τ ) is the state of the i-th entity . piτ is the 2D Cartesian coordinate of the i-th entity at the τ -th event . 1activeτ indicates whether the i-th agent/task is active ( agent is working/ task is not visited ) . Similarly , 1assignedτ indicates whether agent/task is assigned . • senvτ contains the current time of the environment , and the sequences of cities visited by the salesmen . 4 SCHEDULENET . In this section , we explain how ScheduleNet recommends a scheduling action aτ of an idle agent from input sτ ( partial solution ) . This is done by ( 1 ) constructing the agent-task graph Gτ , ( 2 ) embedding Gτ using TGA , and ( 3 ) computing the assignment probabilities . Figure 1 illustrates the decision-making process of ScheduleNet . | This paper proposes a multi-agent reinforcement learning approach to solve scheduling problems (including mTSP and job-shop scheduling (JSP)), with the objective of makespan minimization. In the mTSP, the agent represents salesman, and in JSP, the agent represents machine. The core idea is to employ the type-aware graph attention mechanism to learn the assignment probability of agents to tasks. Experiments on mTSP and JSP simulations validate the strength of the proposed approach ScheduleNet. | SP:eeb3aff7145ad0b096f6d7fbc7968536918ae164 |
Denoising Likelihood Score Matching for Conditional Score-based Data Generation | 1 INTRODUCTION . Score-based generative models are probabilistic generative models that estimate score functions , i.e. , the gradients of the log density for some given data distribution . According to the definition of the pioneering work ( Hyvärinen , 2005 ) , the process of training score-based generative models is called Score Matching ( SM ) , in which a score-based generative model is iteratively updated to approximate the true score function . Such a process often incurs heavy computational burdens , since it requires scanning through every data sample in a dataset to perform an update in each training iteration . Therefore , a branch of study in this research domain ( Vincent , 2011 ; Martens et al. , 2012 ; Song et al. , 2020 ) resorts to reformulating the score-matching objective to reduce the training cost . Among these works , the author in ( Vincent , 2011 ) introduced the Denoising Score-Matching ( DSM ) method . This method facilitates the training process of score-based generative models , and thus lays the foundation for a number of subsequent researches . Recently , the authors in ( Song & Ermon , 2019 ) proposed an unified framework based on DSM , and achieved remarkable performance on Cifar-10 ( Krizhevsky et al. , 2009 ) . Their success inspired several succeeding works ( Song & Ermon , 2020 ; Ho et al. , 2020 ; Song et al. , 2021a ; b ; Dhariwal & Nichol , 2021 ) , which together contribute to making score-based generative models an attractive choice for contemporary image generation tasks . A favorable aspect of score-based generative models is its flexibility to be easily extended to their conditional variants . This characteristic comes from a research direction that utilizes Bayes ’ theorem to decompose a conditional score into a mixture of scores ( Nguyen et al. , 2017 ) . Recent endeavors followed this approach and further extended the concept of conditional score-based models to a number of application domains , including colorization ( Song et al. , 2021b ) , inpainting ( Song et al. , 2021b ) , and source separation ( Jayaram & Thickstun , 2020 ) . In particular , some recent researchers ( Song et al. , 2021b ; Dhariwal & Nichol , 2021 ) applied this method to the field of classconditional image generation tasks , and proposed the classifier-guidance method . Different from the classifier-guidance-free method adopted by ( Ho et al. , 2021 ) , they utilized a score model and a classifier to generate the posterior scores ( i.e. , the gradients of the log posterior density ) , with which the data samples of certain classes can be generated through the diffusion process . The authors in ( Dhariwal & Nichol , 2021 ) showed that the classifier guidance method is able to achieve improved performance on large image generation benchmarks . In spite of their success , our analysis indicates that the conditional generation methods utilizing a score model and a classifier may suffer from a score mismatch issue , which is the situation that the estimated posterior scores deviate from the true ones . This issue causes the samples to be guided by inaccurate scores during the diffusion process , and may result in a degraded sampling quality consequently . To resolve this problem , we first analyze the potential causes for the score mismatch issue through a motivational low-dimensional example . Then , we theoretically formulate a new loss function called Denoising Likelihood Score-Matching ( DLSM ) loss , and explain how it can be integrated into the current training method . Finally , we evaluate the proposed method under various configurations , and demonstrate its advantages in improving the sampling quality over the previous methods in terms of several evaluation metrics . 2 BACKGROUND . In this section , we introduce the essential background material for understanding the contents of this paper . We first introduce Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) for generating data samples x̃ ∈ Rd of a certain dimension d from an unknown probability density function ( pdf ) p ( x̃ ) using the score function∇x̃ log p ( x̃ ) . Next , we describe Parzen density estimation ( Parzen , 1962 ) and denoising score matching ( DSM ) ( Vincent , 2011 ) for approximating ∇x̃ log p ( x̃ ) with limited data samples . Finally , we elaborate on the conditional variant of the score function , i.e. , ∇x̃ log p ( x̃|ỹ ) , and explains how it can be decomposed into ∇x̃ log p ( x̃ ) and ∇x̃ log p ( ỹ|x̃ ) for some conditional variable ỹ ∈ Rc of dimension c . 2.1 LANGEVIN DIFFUSION . Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) can be used to generate data samples from an unknown data distribution p ( x̃ ) using only the score function ∇x̃ log p ( x̃ ) , which is said to be well-defined if p ( x̃ ) is everywhere non-zero and differentiable . Under the condition that ∇x̃ log p ( x̃ ) is well-defined , Langevin diffusion enables p ( x̃ ) to be approximated iteratively based on the following equation : x̃t = x̃t−1 + 2 2 ∇x̃ log p ( x̃t−1 ) + zt , ( 1 ) where x̃0 is sampled from an arbitrary distribution , is a fixed positive step size , and zt is a noise vector sampled from a normal distribution N ( 0 , Id×d ) for simulating a d-dimensional standard Brownian motion . Under suitable regularity conditions , when → 0 and T →∞ , x̃T is generated as if it is directly sampled from p ( x̃ ) ( Roberts & Tweedie , 1996 ; Welling & Teh , 2011 ) . In practice , however , the data samples are generated with > 0 and T < ∞ , which violates the convergence guarantee . Although it is possible to use Metropolized algorithms ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) to recover the convergence guarantee , we follow the assumption of the prior work ( Song & Ermon , 2019 ) and presume that the errors are sufficiently small to be negligible when is small and T is large . The sampling process introduced in Eq . ( 1 ) can be extended to a time-inhomogeneous variant by making p ( x̃t ) and dependent on t ( i.e. , pt ( x̃t ) and t ) . Such a time-inhomogeneous variant is commonly adopted by recent works on score-based generative models ( Song & Ermon , 2019 ; Song et al. , 2021b ) , as it provides flexibility in controlling pt ( x̃t ) and t. The experimental results in ( Song & Ermon , 2019 ; Song et al. , 2021b ) demonstrated that such a time-inhomogeneous sampling process can improve the sampling quality on real-world datasets . In Appendix A.6.1 , we offer a discussion on the detailed implementation of such a time-inhomogeneous sampling process in this work . 2.2 PARZEN DENSITY ESTIMATION . Given a true data distribution pdata , the empirical data distribution p0 ( x ) is constructed by sampling m independent and identically distributed data points { x ( i ) } mi=1 , and can be represented as a sum of Dirac functions 1m ∑m i=1 δ ( ‖x − x ( i ) ‖ ) . Such a discrete data distribution p0 ( x ) constructed from the dataset often violates the previous assumptions that everywhere is non-zero and is differentiable . Therefore , it is necessary to somehow adjust the empirical data distribution p0 ( x ) before applying Langevin diffusion in such cases . To deal with the above issue , a previous literature ( Vincent , 2011 ) utilized Parzen density estimation to replace the Dirac functions with isotropic Gaussian smoothing kernels pσ ( x̃|x ) = 1 ( 2π ) d/2σd e −1 2σ2 ‖x̃−x‖2 with variance σ2 . Specifically , Parzen density estimation enables the calculation of pσ ( x̃ ) = 1m ∑m i=1 pσ ( x̃|x ( i ) ) . When σ > 0 , the score function becomes well-defined and can thus be represented as the following : ∇x̃ log pσ ( x̃ ) = ∑m i=1 1 σ2 ( x ( i ) − x̃ ) pσ ( x̃|x ( i ) ) ∑m i=1 pσ ( x̃|x ( i ) ) . ( 2 ) The proof for Eq . ( 2 ) is provided in Appendix A.2 . This equation can be directly applied to Eq . ( 1 ) to generate samples with Langevin diffusion . Unfortunately , this requires summation over all m data points during every iteration , preventing it from scaling to large datasets due to the rapid growth in computational complexity . 2.3 DENOISING SCORE MATCHING . Score matching ( SM ) ( Hyvärinen , 2005 ) was proposed to estimate the score function with a model s ( x̃ ; φ ) , parameterized by φ . Given a trained score model s ( x̃ ; φ ) , the scores can be generated by a single forward pass , which reduces the computational complexity of Eq . ( 2 ) by a factor of m. To train such a score model , a straightforward approach is to use the Explicit Score-Matching ( ESM ) loss LESM , represented as : LESM ( φ ) = Epσ ( x̃ ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃ ) ‖2 ] . ( 3 ) This objective requires evaluating Eq . ( 2 ) for each training step , which also fails to scale well to large datasets . Based on Parzen density estimation , an efficient alternative , called Denoising ScoreMatching ( DSM ) loss ( Vincent , 2011 ) , is proposed to efficiently calculate the equivalent loss LDSM , expressed as : LDSM ( φ ) = Epσ ( x̃ , x ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃|x ) ‖2 ] . ( 4 ) where ∇x̃ log pσ ( x̃|x ) is simply 1σ2 ( x − x̃ ) . Since the computational cost of denoising score matching is relatively lower in comparison to other reformulation techniques ( Hyvärinen , 2005 ; Song et al. , 2020 ) , it is extensively adopted in recent score-based generative models ( Song & Ermon , 2019 ; 2020 ; Song et al. , 2021b ) . 2.4 CONDITIONAL SCORE DECOMPOSITION VIA BAYES ’ THEOREM . Score models can be extended to conditional models when conditioned on a certain label ỹ . Similar to x̃ , the smoothing kernels with variance τ2 can be applied on y to meet the requirement that the pdf is everywhere non-zero and differentiable . Typically , τ is assumed to be sufficiently small so that pτ ( ỹ ) ≈ p ( y ) . A popular approach adopted by researchers utilizes Bayes ’ theorem pσ , τ ( x̃|ỹ ) = pσ , τ ( ỹ|x̃ ) pσ ( x̃ ) /pτ ( ỹ ) to decompose the conditional score ∇x̃ log pσ , τ ( x̃|ỹ ) into a mixture of scores ( Nguyen et al. , 2017 ) , which enables conditional data generation . Following the assumptions in the previous study ( Song et al. , 2021b ) , the decomposition can be achieved by taking the loggradient on both sides of the equation , expressed as follows : ∇x̃ log pσ , τ ( x̃|ỹ ) = ∇x̃ log pσ , τ ( ỹ|x̃ ) +∇x̃ log pσ ( x̃ ) −∇x̃ log pτ ( ỹ ) ︸ ︷︷ ︸ =0 , ( 5 ) where ∇x̃ log pσ , τ ( x̃|ỹ ) is the posterior score , ∇x̃ log pσ , τ ( ỹ|x̃ ) is the likelihood score , and ∇x̃ log pσ ( x̃ ) is the prior score . Base on Eq . ( 5 ) , a conditional score model ∇x̃ log p ( x̃|ỹ ; φ , θ ) can be represented as the combination of the log-gradient of a differentiable classifier p ( ỹ|x̃ ; θ ) and a prior score model s ( x̃ ; φ ) : ∇x̃ log p ( x̃|ỹ ; θ , φ ) = ∇x̃ log p ( ỹ|x̃ ; θ ) + s ( x̃ ; φ ) . ( 6 ) This formulation enables conditional data generation using a classifier p ( ỹ|x̃ ; θ ) trained with crossentropy loss LCE ( θ ) , Epσ , τ ( x̃ , ỹ ) [ − log p ( ỹ|x̃ ; θ ) ] , and a score model s ( x̃ ; φ ) trained with denoising score matching loss LDSM ( φ ) . Unfortunately , a few previous studies ( Nguyen et al. , 2017 ; Dhariwal & Nichol , 2021 ) have noticed that the approximation of∇x̃ log p ( x̃|ỹ ; θ , φ ) is empirically inaccurate ( referred to as the score mismatch issue in this work ) , and leveraged a scaling factor α > 0 to adjust the likelihood score ∇x̃ log p ( ỹ|x̃ ; θ ) . Such a scaling factor is a hyperparameter that controls the amount of conditional information incorporated during the sampling process ( see Appendix A.3 ) . However , this usually causes the diversity of generated data samples to degrade noticeably ( Dhariwal & Nichol , 2021 ) , which is later discussed in Section 5.2 . In this work , we examine and investigate the score mismatch issue from a different perspective . We first offer a motivational example to show that the issue remains even with the scaling technique . Then , we theoretically formulate a new loss term that enables a classifier p ( ỹ|x̃ ; θ ) to produce better likelihood score estimation . | The authors suggest how to apply the idea of score matching to the problem of conditional generation. They introduce a new loss, which is essentially a score matching loss for the conditional distribution p(y| x). They demonstrate how to effectively calculate it without calculating p(y|x) explicitly, which seems to be the main contribution of the paper. Then the authors demonstrate how to train the model for the conditional generation in practice: it is necessary to add to the proposed loss the usual cross-entropy loss, because the loss that they came up with is noisy (this can be seen in Figure 5). They got better results compared to baselines for cifar-10 and cifar-100. | SP:107ee010443de3f372607fbb6ff39c887f8b2c27 |
Denoising Likelihood Score Matching for Conditional Score-based Data Generation | 1 INTRODUCTION . Score-based generative models are probabilistic generative models that estimate score functions , i.e. , the gradients of the log density for some given data distribution . According to the definition of the pioneering work ( Hyvärinen , 2005 ) , the process of training score-based generative models is called Score Matching ( SM ) , in which a score-based generative model is iteratively updated to approximate the true score function . Such a process often incurs heavy computational burdens , since it requires scanning through every data sample in a dataset to perform an update in each training iteration . Therefore , a branch of study in this research domain ( Vincent , 2011 ; Martens et al. , 2012 ; Song et al. , 2020 ) resorts to reformulating the score-matching objective to reduce the training cost . Among these works , the author in ( Vincent , 2011 ) introduced the Denoising Score-Matching ( DSM ) method . This method facilitates the training process of score-based generative models , and thus lays the foundation for a number of subsequent researches . Recently , the authors in ( Song & Ermon , 2019 ) proposed an unified framework based on DSM , and achieved remarkable performance on Cifar-10 ( Krizhevsky et al. , 2009 ) . Their success inspired several succeeding works ( Song & Ermon , 2020 ; Ho et al. , 2020 ; Song et al. , 2021a ; b ; Dhariwal & Nichol , 2021 ) , which together contribute to making score-based generative models an attractive choice for contemporary image generation tasks . A favorable aspect of score-based generative models is its flexibility to be easily extended to their conditional variants . This characteristic comes from a research direction that utilizes Bayes ’ theorem to decompose a conditional score into a mixture of scores ( Nguyen et al. , 2017 ) . Recent endeavors followed this approach and further extended the concept of conditional score-based models to a number of application domains , including colorization ( Song et al. , 2021b ) , inpainting ( Song et al. , 2021b ) , and source separation ( Jayaram & Thickstun , 2020 ) . In particular , some recent researchers ( Song et al. , 2021b ; Dhariwal & Nichol , 2021 ) applied this method to the field of classconditional image generation tasks , and proposed the classifier-guidance method . Different from the classifier-guidance-free method adopted by ( Ho et al. , 2021 ) , they utilized a score model and a classifier to generate the posterior scores ( i.e. , the gradients of the log posterior density ) , with which the data samples of certain classes can be generated through the diffusion process . The authors in ( Dhariwal & Nichol , 2021 ) showed that the classifier guidance method is able to achieve improved performance on large image generation benchmarks . In spite of their success , our analysis indicates that the conditional generation methods utilizing a score model and a classifier may suffer from a score mismatch issue , which is the situation that the estimated posterior scores deviate from the true ones . This issue causes the samples to be guided by inaccurate scores during the diffusion process , and may result in a degraded sampling quality consequently . To resolve this problem , we first analyze the potential causes for the score mismatch issue through a motivational low-dimensional example . Then , we theoretically formulate a new loss function called Denoising Likelihood Score-Matching ( DLSM ) loss , and explain how it can be integrated into the current training method . Finally , we evaluate the proposed method under various configurations , and demonstrate its advantages in improving the sampling quality over the previous methods in terms of several evaluation metrics . 2 BACKGROUND . In this section , we introduce the essential background material for understanding the contents of this paper . We first introduce Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) for generating data samples x̃ ∈ Rd of a certain dimension d from an unknown probability density function ( pdf ) p ( x̃ ) using the score function∇x̃ log p ( x̃ ) . Next , we describe Parzen density estimation ( Parzen , 1962 ) and denoising score matching ( DSM ) ( Vincent , 2011 ) for approximating ∇x̃ log p ( x̃ ) with limited data samples . Finally , we elaborate on the conditional variant of the score function , i.e. , ∇x̃ log p ( x̃|ỹ ) , and explains how it can be decomposed into ∇x̃ log p ( x̃ ) and ∇x̃ log p ( ỹ|x̃ ) for some conditional variable ỹ ∈ Rc of dimension c . 2.1 LANGEVIN DIFFUSION . Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) can be used to generate data samples from an unknown data distribution p ( x̃ ) using only the score function ∇x̃ log p ( x̃ ) , which is said to be well-defined if p ( x̃ ) is everywhere non-zero and differentiable . Under the condition that ∇x̃ log p ( x̃ ) is well-defined , Langevin diffusion enables p ( x̃ ) to be approximated iteratively based on the following equation : x̃t = x̃t−1 + 2 2 ∇x̃ log p ( x̃t−1 ) + zt , ( 1 ) where x̃0 is sampled from an arbitrary distribution , is a fixed positive step size , and zt is a noise vector sampled from a normal distribution N ( 0 , Id×d ) for simulating a d-dimensional standard Brownian motion . Under suitable regularity conditions , when → 0 and T →∞ , x̃T is generated as if it is directly sampled from p ( x̃ ) ( Roberts & Tweedie , 1996 ; Welling & Teh , 2011 ) . In practice , however , the data samples are generated with > 0 and T < ∞ , which violates the convergence guarantee . Although it is possible to use Metropolized algorithms ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) to recover the convergence guarantee , we follow the assumption of the prior work ( Song & Ermon , 2019 ) and presume that the errors are sufficiently small to be negligible when is small and T is large . The sampling process introduced in Eq . ( 1 ) can be extended to a time-inhomogeneous variant by making p ( x̃t ) and dependent on t ( i.e. , pt ( x̃t ) and t ) . Such a time-inhomogeneous variant is commonly adopted by recent works on score-based generative models ( Song & Ermon , 2019 ; Song et al. , 2021b ) , as it provides flexibility in controlling pt ( x̃t ) and t. The experimental results in ( Song & Ermon , 2019 ; Song et al. , 2021b ) demonstrated that such a time-inhomogeneous sampling process can improve the sampling quality on real-world datasets . In Appendix A.6.1 , we offer a discussion on the detailed implementation of such a time-inhomogeneous sampling process in this work . 2.2 PARZEN DENSITY ESTIMATION . Given a true data distribution pdata , the empirical data distribution p0 ( x ) is constructed by sampling m independent and identically distributed data points { x ( i ) } mi=1 , and can be represented as a sum of Dirac functions 1m ∑m i=1 δ ( ‖x − x ( i ) ‖ ) . Such a discrete data distribution p0 ( x ) constructed from the dataset often violates the previous assumptions that everywhere is non-zero and is differentiable . Therefore , it is necessary to somehow adjust the empirical data distribution p0 ( x ) before applying Langevin diffusion in such cases . To deal with the above issue , a previous literature ( Vincent , 2011 ) utilized Parzen density estimation to replace the Dirac functions with isotropic Gaussian smoothing kernels pσ ( x̃|x ) = 1 ( 2π ) d/2σd e −1 2σ2 ‖x̃−x‖2 with variance σ2 . Specifically , Parzen density estimation enables the calculation of pσ ( x̃ ) = 1m ∑m i=1 pσ ( x̃|x ( i ) ) . When σ > 0 , the score function becomes well-defined and can thus be represented as the following : ∇x̃ log pσ ( x̃ ) = ∑m i=1 1 σ2 ( x ( i ) − x̃ ) pσ ( x̃|x ( i ) ) ∑m i=1 pσ ( x̃|x ( i ) ) . ( 2 ) The proof for Eq . ( 2 ) is provided in Appendix A.2 . This equation can be directly applied to Eq . ( 1 ) to generate samples with Langevin diffusion . Unfortunately , this requires summation over all m data points during every iteration , preventing it from scaling to large datasets due to the rapid growth in computational complexity . 2.3 DENOISING SCORE MATCHING . Score matching ( SM ) ( Hyvärinen , 2005 ) was proposed to estimate the score function with a model s ( x̃ ; φ ) , parameterized by φ . Given a trained score model s ( x̃ ; φ ) , the scores can be generated by a single forward pass , which reduces the computational complexity of Eq . ( 2 ) by a factor of m. To train such a score model , a straightforward approach is to use the Explicit Score-Matching ( ESM ) loss LESM , represented as : LESM ( φ ) = Epσ ( x̃ ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃ ) ‖2 ] . ( 3 ) This objective requires evaluating Eq . ( 2 ) for each training step , which also fails to scale well to large datasets . Based on Parzen density estimation , an efficient alternative , called Denoising ScoreMatching ( DSM ) loss ( Vincent , 2011 ) , is proposed to efficiently calculate the equivalent loss LDSM , expressed as : LDSM ( φ ) = Epσ ( x̃ , x ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃|x ) ‖2 ] . ( 4 ) where ∇x̃ log pσ ( x̃|x ) is simply 1σ2 ( x − x̃ ) . Since the computational cost of denoising score matching is relatively lower in comparison to other reformulation techniques ( Hyvärinen , 2005 ; Song et al. , 2020 ) , it is extensively adopted in recent score-based generative models ( Song & Ermon , 2019 ; 2020 ; Song et al. , 2021b ) . 2.4 CONDITIONAL SCORE DECOMPOSITION VIA BAYES ’ THEOREM . Score models can be extended to conditional models when conditioned on a certain label ỹ . Similar to x̃ , the smoothing kernels with variance τ2 can be applied on y to meet the requirement that the pdf is everywhere non-zero and differentiable . Typically , τ is assumed to be sufficiently small so that pτ ( ỹ ) ≈ p ( y ) . A popular approach adopted by researchers utilizes Bayes ’ theorem pσ , τ ( x̃|ỹ ) = pσ , τ ( ỹ|x̃ ) pσ ( x̃ ) /pτ ( ỹ ) to decompose the conditional score ∇x̃ log pσ , τ ( x̃|ỹ ) into a mixture of scores ( Nguyen et al. , 2017 ) , which enables conditional data generation . Following the assumptions in the previous study ( Song et al. , 2021b ) , the decomposition can be achieved by taking the loggradient on both sides of the equation , expressed as follows : ∇x̃ log pσ , τ ( x̃|ỹ ) = ∇x̃ log pσ , τ ( ỹ|x̃ ) +∇x̃ log pσ ( x̃ ) −∇x̃ log pτ ( ỹ ) ︸ ︷︷ ︸ =0 , ( 5 ) where ∇x̃ log pσ , τ ( x̃|ỹ ) is the posterior score , ∇x̃ log pσ , τ ( ỹ|x̃ ) is the likelihood score , and ∇x̃ log pσ ( x̃ ) is the prior score . Base on Eq . ( 5 ) , a conditional score model ∇x̃ log p ( x̃|ỹ ; φ , θ ) can be represented as the combination of the log-gradient of a differentiable classifier p ( ỹ|x̃ ; θ ) and a prior score model s ( x̃ ; φ ) : ∇x̃ log p ( x̃|ỹ ; θ , φ ) = ∇x̃ log p ( ỹ|x̃ ; θ ) + s ( x̃ ; φ ) . ( 6 ) This formulation enables conditional data generation using a classifier p ( ỹ|x̃ ; θ ) trained with crossentropy loss LCE ( θ ) , Epσ , τ ( x̃ , ỹ ) [ − log p ( ỹ|x̃ ; θ ) ] , and a score model s ( x̃ ; φ ) trained with denoising score matching loss LDSM ( φ ) . Unfortunately , a few previous studies ( Nguyen et al. , 2017 ; Dhariwal & Nichol , 2021 ) have noticed that the approximation of∇x̃ log p ( x̃|ỹ ; θ , φ ) is empirically inaccurate ( referred to as the score mismatch issue in this work ) , and leveraged a scaling factor α > 0 to adjust the likelihood score ∇x̃ log p ( ỹ|x̃ ; θ ) . Such a scaling factor is a hyperparameter that controls the amount of conditional information incorporated during the sampling process ( see Appendix A.3 ) . However , this usually causes the diversity of generated data samples to degrade noticeably ( Dhariwal & Nichol , 2021 ) , which is later discussed in Section 5.2 . In this work , we examine and investigate the score mismatch issue from a different perspective . We first offer a motivational example to show that the issue remains even with the scaling technique . Then , we theoretically formulate a new loss term that enables a classifier p ( ỹ|x̃ ; θ ) to produce better likelihood score estimation . | The paper points up a previously underappreciated problem in training classifiers in the context of conditional generations of diffusion-based generative models. The authors propose a novel objective for training classifiers to tackle the problems. Informally, the generation process of the diffusion-based generative models can be described by repeatedly applying an update rule with initial values: $\tilde{x} ← \tilde{x} + \nabla_{\tilde{x}} \log p_{\textrm{model}}(\tilde{x}) + \sigma \epsilon$ where $\epsilon \sim N(0,I)$ and the initial points are sampled from a prior distribution such as standard Normal distributions. Similarly to unconditional generations, one can perform conditional generations, e.g., $p(\tilde{x} | y)$ by using the following update rule: $\tilde{x} ← \tilde{x} + \nabla_{\tilde{x}} \log p_{\textrm{model}}(\tilde{x}) + \nabla_{\tilde{x}} \log p_{\textrm{model}}(y | \tilde{x}) + \sigma \epsilon$. Note that $\nabla_{\tilde{x}} \log p(\tilde{x} | y) = \nabla_{\tilde{x}} \log p_{\textrm{model}}(\tilde{x}) + \nabla_{\tilde{x}} \log p_{\textrm{model}}(y | \tilde{x})$. Thus, for a given pre-trained generative model, one needs to learn $\log p_{\textrm{model}}(y | \tilde{x})$ (or its gradient wrt $\tilde{x}$. Maximum likelihood training (MLE), i.e., minimizing cross-entropy loss, is commonly used. Inevitably, the qualities of the gradient $\nabla_{\tilde{x}} \log p_{\textrm{model}}(y | \tilde{x})$ will determine the qualities of the conditional generations. First, the paper emphasizes that MLE-training of classifiers results in non-smooth gradient landscape wrt input; thus, the resulting gradients negatively affect the generation qualities. More precisely, with MLE, the learned $\log p_{\textrm{model}} (y|\tilde{x})$ is high, while its gradient wrt $\tilde{x}$ isn't necessarily close to the ground truth. In the paper, the authors refer to this phenomenon as *a score mismatch issue.* The authors analyze the mismatch issue with toy experiments and demonstrate its negative effects on generation qualities compared to the ground truth. Second, to resolve the *score mismatch issue*, the paper proposes a new objective function, called Explicit Likelihood Score-Matching loss (ELSM), in which the mean squared errors between $\nabla_{\tilde{x}} \log p_{\textrm{model}} (y|\tilde{x})$ and $\nabla_{\tilde{x}} \log p_{\textrm{data}} (y|\tilde{x})$ is minimized. Here, due to the inaccessibility $\nabla_{\tilde{x}} \log p_{\textrm{data}} (y|\tilde{x})$, the authors reduces the ELSM loss to another objective function, named *Denoising Likelihood Score-Matching* (DLSM), similarly to denoising score matching derivation. In DLSM, $\nabla_{\tilde{x}} \log p_{\textrm{model}} (y|\tilde{x})$ is trained to match to $\nabla_{\tilde{x}} \log p_{\textrm{data}} (\tilde{x}) - \nabla_{\tilde{x}} \log p_{\textrm{data}} (\tilde{x} | x)$. Acknowledging that $\nabla_{\tilde{x}} \log p_{\textrm{data}} (\tilde{x})$ is still unattainable, the authors propose to minimize approximate DLSM loss, where $\nabla_{\tilde{x}} \log p_{\textrm{data}} (\tilde{x})$ is substituted by the pre-trained scores $\nabla_{\tilde{x}} \log p_{\textrm{model}} (\tilde{x})$. Then, the authors demonstrate that by toy experiments, training classifiers with the approximate DLSM improves the conditional generation qualities compared to MLE-based training. Moreover, the authors mention that approximate DLSM-based training can be unstable in high-dimensional datasets and show that training classifiers by minimizing combined loss of approximate DLSM and cross-entropy can further improve the generation qualities. Lastly, the paper demonstrates the effectiveness of the proposed methods by evaluating conditional generation qualities on CIFAR-10 and CIFAR-100 datasets. | SP:107ee010443de3f372607fbb6ff39c887f8b2c27 |
Denoising Likelihood Score Matching for Conditional Score-based Data Generation | 1 INTRODUCTION . Score-based generative models are probabilistic generative models that estimate score functions , i.e. , the gradients of the log density for some given data distribution . According to the definition of the pioneering work ( Hyvärinen , 2005 ) , the process of training score-based generative models is called Score Matching ( SM ) , in which a score-based generative model is iteratively updated to approximate the true score function . Such a process often incurs heavy computational burdens , since it requires scanning through every data sample in a dataset to perform an update in each training iteration . Therefore , a branch of study in this research domain ( Vincent , 2011 ; Martens et al. , 2012 ; Song et al. , 2020 ) resorts to reformulating the score-matching objective to reduce the training cost . Among these works , the author in ( Vincent , 2011 ) introduced the Denoising Score-Matching ( DSM ) method . This method facilitates the training process of score-based generative models , and thus lays the foundation for a number of subsequent researches . Recently , the authors in ( Song & Ermon , 2019 ) proposed an unified framework based on DSM , and achieved remarkable performance on Cifar-10 ( Krizhevsky et al. , 2009 ) . Their success inspired several succeeding works ( Song & Ermon , 2020 ; Ho et al. , 2020 ; Song et al. , 2021a ; b ; Dhariwal & Nichol , 2021 ) , which together contribute to making score-based generative models an attractive choice for contemporary image generation tasks . A favorable aspect of score-based generative models is its flexibility to be easily extended to their conditional variants . This characteristic comes from a research direction that utilizes Bayes ’ theorem to decompose a conditional score into a mixture of scores ( Nguyen et al. , 2017 ) . Recent endeavors followed this approach and further extended the concept of conditional score-based models to a number of application domains , including colorization ( Song et al. , 2021b ) , inpainting ( Song et al. , 2021b ) , and source separation ( Jayaram & Thickstun , 2020 ) . In particular , some recent researchers ( Song et al. , 2021b ; Dhariwal & Nichol , 2021 ) applied this method to the field of classconditional image generation tasks , and proposed the classifier-guidance method . Different from the classifier-guidance-free method adopted by ( Ho et al. , 2021 ) , they utilized a score model and a classifier to generate the posterior scores ( i.e. , the gradients of the log posterior density ) , with which the data samples of certain classes can be generated through the diffusion process . The authors in ( Dhariwal & Nichol , 2021 ) showed that the classifier guidance method is able to achieve improved performance on large image generation benchmarks . In spite of their success , our analysis indicates that the conditional generation methods utilizing a score model and a classifier may suffer from a score mismatch issue , which is the situation that the estimated posterior scores deviate from the true ones . This issue causes the samples to be guided by inaccurate scores during the diffusion process , and may result in a degraded sampling quality consequently . To resolve this problem , we first analyze the potential causes for the score mismatch issue through a motivational low-dimensional example . Then , we theoretically formulate a new loss function called Denoising Likelihood Score-Matching ( DLSM ) loss , and explain how it can be integrated into the current training method . Finally , we evaluate the proposed method under various configurations , and demonstrate its advantages in improving the sampling quality over the previous methods in terms of several evaluation metrics . 2 BACKGROUND . In this section , we introduce the essential background material for understanding the contents of this paper . We first introduce Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) for generating data samples x̃ ∈ Rd of a certain dimension d from an unknown probability density function ( pdf ) p ( x̃ ) using the score function∇x̃ log p ( x̃ ) . Next , we describe Parzen density estimation ( Parzen , 1962 ) and denoising score matching ( DSM ) ( Vincent , 2011 ) for approximating ∇x̃ log p ( x̃ ) with limited data samples . Finally , we elaborate on the conditional variant of the score function , i.e. , ∇x̃ log p ( x̃|ỹ ) , and explains how it can be decomposed into ∇x̃ log p ( x̃ ) and ∇x̃ log p ( ỹ|x̃ ) for some conditional variable ỹ ∈ Rc of dimension c . 2.1 LANGEVIN DIFFUSION . Langevin diffusion ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) can be used to generate data samples from an unknown data distribution p ( x̃ ) using only the score function ∇x̃ log p ( x̃ ) , which is said to be well-defined if p ( x̃ ) is everywhere non-zero and differentiable . Under the condition that ∇x̃ log p ( x̃ ) is well-defined , Langevin diffusion enables p ( x̃ ) to be approximated iteratively based on the following equation : x̃t = x̃t−1 + 2 2 ∇x̃ log p ( x̃t−1 ) + zt , ( 1 ) where x̃0 is sampled from an arbitrary distribution , is a fixed positive step size , and zt is a noise vector sampled from a normal distribution N ( 0 , Id×d ) for simulating a d-dimensional standard Brownian motion . Under suitable regularity conditions , when → 0 and T →∞ , x̃T is generated as if it is directly sampled from p ( x̃ ) ( Roberts & Tweedie , 1996 ; Welling & Teh , 2011 ) . In practice , however , the data samples are generated with > 0 and T < ∞ , which violates the convergence guarantee . Although it is possible to use Metropolized algorithms ( Roberts & Tweedie , 1996 ; Roberts & Rosenthal , 1998 ) to recover the convergence guarantee , we follow the assumption of the prior work ( Song & Ermon , 2019 ) and presume that the errors are sufficiently small to be negligible when is small and T is large . The sampling process introduced in Eq . ( 1 ) can be extended to a time-inhomogeneous variant by making p ( x̃t ) and dependent on t ( i.e. , pt ( x̃t ) and t ) . Such a time-inhomogeneous variant is commonly adopted by recent works on score-based generative models ( Song & Ermon , 2019 ; Song et al. , 2021b ) , as it provides flexibility in controlling pt ( x̃t ) and t. The experimental results in ( Song & Ermon , 2019 ; Song et al. , 2021b ) demonstrated that such a time-inhomogeneous sampling process can improve the sampling quality on real-world datasets . In Appendix A.6.1 , we offer a discussion on the detailed implementation of such a time-inhomogeneous sampling process in this work . 2.2 PARZEN DENSITY ESTIMATION . Given a true data distribution pdata , the empirical data distribution p0 ( x ) is constructed by sampling m independent and identically distributed data points { x ( i ) } mi=1 , and can be represented as a sum of Dirac functions 1m ∑m i=1 δ ( ‖x − x ( i ) ‖ ) . Such a discrete data distribution p0 ( x ) constructed from the dataset often violates the previous assumptions that everywhere is non-zero and is differentiable . Therefore , it is necessary to somehow adjust the empirical data distribution p0 ( x ) before applying Langevin diffusion in such cases . To deal with the above issue , a previous literature ( Vincent , 2011 ) utilized Parzen density estimation to replace the Dirac functions with isotropic Gaussian smoothing kernels pσ ( x̃|x ) = 1 ( 2π ) d/2σd e −1 2σ2 ‖x̃−x‖2 with variance σ2 . Specifically , Parzen density estimation enables the calculation of pσ ( x̃ ) = 1m ∑m i=1 pσ ( x̃|x ( i ) ) . When σ > 0 , the score function becomes well-defined and can thus be represented as the following : ∇x̃ log pσ ( x̃ ) = ∑m i=1 1 σ2 ( x ( i ) − x̃ ) pσ ( x̃|x ( i ) ) ∑m i=1 pσ ( x̃|x ( i ) ) . ( 2 ) The proof for Eq . ( 2 ) is provided in Appendix A.2 . This equation can be directly applied to Eq . ( 1 ) to generate samples with Langevin diffusion . Unfortunately , this requires summation over all m data points during every iteration , preventing it from scaling to large datasets due to the rapid growth in computational complexity . 2.3 DENOISING SCORE MATCHING . Score matching ( SM ) ( Hyvärinen , 2005 ) was proposed to estimate the score function with a model s ( x̃ ; φ ) , parameterized by φ . Given a trained score model s ( x̃ ; φ ) , the scores can be generated by a single forward pass , which reduces the computational complexity of Eq . ( 2 ) by a factor of m. To train such a score model , a straightforward approach is to use the Explicit Score-Matching ( ESM ) loss LESM , represented as : LESM ( φ ) = Epσ ( x̃ ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃ ) ‖2 ] . ( 3 ) This objective requires evaluating Eq . ( 2 ) for each training step , which also fails to scale well to large datasets . Based on Parzen density estimation , an efficient alternative , called Denoising ScoreMatching ( DSM ) loss ( Vincent , 2011 ) , is proposed to efficiently calculate the equivalent loss LDSM , expressed as : LDSM ( φ ) = Epσ ( x̃ , x ) [ 1 2 ‖s ( x̃ ; φ ) −∇x̃ log pσ ( x̃|x ) ‖2 ] . ( 4 ) where ∇x̃ log pσ ( x̃|x ) is simply 1σ2 ( x − x̃ ) . Since the computational cost of denoising score matching is relatively lower in comparison to other reformulation techniques ( Hyvärinen , 2005 ; Song et al. , 2020 ) , it is extensively adopted in recent score-based generative models ( Song & Ermon , 2019 ; 2020 ; Song et al. , 2021b ) . 2.4 CONDITIONAL SCORE DECOMPOSITION VIA BAYES ’ THEOREM . Score models can be extended to conditional models when conditioned on a certain label ỹ . Similar to x̃ , the smoothing kernels with variance τ2 can be applied on y to meet the requirement that the pdf is everywhere non-zero and differentiable . Typically , τ is assumed to be sufficiently small so that pτ ( ỹ ) ≈ p ( y ) . A popular approach adopted by researchers utilizes Bayes ’ theorem pσ , τ ( x̃|ỹ ) = pσ , τ ( ỹ|x̃ ) pσ ( x̃ ) /pτ ( ỹ ) to decompose the conditional score ∇x̃ log pσ , τ ( x̃|ỹ ) into a mixture of scores ( Nguyen et al. , 2017 ) , which enables conditional data generation . Following the assumptions in the previous study ( Song et al. , 2021b ) , the decomposition can be achieved by taking the loggradient on both sides of the equation , expressed as follows : ∇x̃ log pσ , τ ( x̃|ỹ ) = ∇x̃ log pσ , τ ( ỹ|x̃ ) +∇x̃ log pσ ( x̃ ) −∇x̃ log pτ ( ỹ ) ︸ ︷︷ ︸ =0 , ( 5 ) where ∇x̃ log pσ , τ ( x̃|ỹ ) is the posterior score , ∇x̃ log pσ , τ ( ỹ|x̃ ) is the likelihood score , and ∇x̃ log pσ ( x̃ ) is the prior score . Base on Eq . ( 5 ) , a conditional score model ∇x̃ log p ( x̃|ỹ ; φ , θ ) can be represented as the combination of the log-gradient of a differentiable classifier p ( ỹ|x̃ ; θ ) and a prior score model s ( x̃ ; φ ) : ∇x̃ log p ( x̃|ỹ ; θ , φ ) = ∇x̃ log p ( ỹ|x̃ ; θ ) + s ( x̃ ; φ ) . ( 6 ) This formulation enables conditional data generation using a classifier p ( ỹ|x̃ ; θ ) trained with crossentropy loss LCE ( θ ) , Epσ , τ ( x̃ , ỹ ) [ − log p ( ỹ|x̃ ; θ ) ] , and a score model s ( x̃ ; φ ) trained with denoising score matching loss LDSM ( φ ) . Unfortunately , a few previous studies ( Nguyen et al. , 2017 ; Dhariwal & Nichol , 2021 ) have noticed that the approximation of∇x̃ log p ( x̃|ỹ ; θ , φ ) is empirically inaccurate ( referred to as the score mismatch issue in this work ) , and leveraged a scaling factor α > 0 to adjust the likelihood score ∇x̃ log p ( ỹ|x̃ ; θ ) . Such a scaling factor is a hyperparameter that controls the amount of conditional information incorporated during the sampling process ( see Appendix A.3 ) . However , this usually causes the diversity of generated data samples to degrade noticeably ( Dhariwal & Nichol , 2021 ) , which is later discussed in Section 5.2 . In this work , we examine and investigate the score mismatch issue from a different perspective . We first offer a motivational example to show that the issue remains even with the scaling technique . Then , we theoretically formulate a new loss term that enables a classifier p ( ỹ|x̃ ; θ ) to produce better likelihood score estimation . | The authors present a new objective, denoising likelihood score-matching (DLSM), and training mechanism for conditional score-based data generation. The new method is motivated by poor conditional score estimates observed in low-dimensional examples for the standard, Bayes-theorem-based, conditional data generation procedure of score-based models. The new objective is equivalent to directly learning to parameterise the score of p(y|x) demonstrates is high-dimensional benchmark datasets also. FID and IS improve due to this method, with the largest improvements being class-wise, and there is an overall tendency to trade off generated data recall for precision. | SP:107ee010443de3f372607fbb6ff39c887f8b2c27 |
You May Need both Good-GAN and Bad-GAN for Anomaly Detection | 1 INTRODUCTION . Anomaly detection ( AD ) , a.k.a . outlier detection , refers to detecting uncommon samples ( usually heterogeneous ) out of inlier distribution ( ChandolaVarun et al. , 2009 ; Pang et al. , 2021a ) . AD can be performed either in an unsupervised manner when only inliers are involved during the training process ( Schlegl et al. , 2019 ; Ngo et al. , 2019 ; Ruff et al. , 2018 ) , or in a semi-supervised manner when few labeled anomalies are available ( Ruff et al. , 2020b ; Liznerski et al. , 2021 ) . Generative adversarial nets ( GAN ) ( Goodfellow et al. , 2014 ) are considered the most effective generative models nowadays , which have also been applied for AD ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Perera et al. , 2019 ) . Likewise , one-class classification and its variants are often used as the backbone of AD approaches ( Schölkopf et al. , 2001 ; Ruff et al. , 2018 ; Liznerski et al. , 2021 ; Wu et al. , 2019 ) . Recently , the adversarial training and one-class classification have been leveraged together to discriminate inlier/outlier in an end-to-end manner ( Zheng et al. , 2019 ; Ngo et al. , 2019 ) . Such efforts share a similar spirit with the work introduced in Dai et al . ( 2017 ) and here we call them Bad-GANs . Instead of generating samples to match the training data distribution as a conventional GAN ( Goodfellow et al. , 2014 ) that we refer as Good-GAN in this paper , a Bad-GAN pushes its generated samples towards the peripheral area of the training data distribution and considers them as pseudo anomalies . Rather than defining anomaly scores based on 1 ) the residual between reconstructed and original samples such as AnoGAN series ( Schlegl et al. , 2017 ; 2019 ) , or 2 ) existing one-class classification-based measures such as Deep SVDD ( Ruff et al. , 2018 ) and FCDD ( Liznerski et al. , 2021 ) , Bad-GANs directly leverage the learned discriminator to identify unseen anomalies from normal cases . Although Bad-GANs have shown great potentials , they suffer from several disadvantages . Dis1 : the generated samples can converge to limited patterns rather than being heterogeneous as real anomalies ; 1Taichi is a concept from traditional Chinese culture , which refers to the co-existence and well-balance of two components with different properties . We borrow this concept to indicate the relationship between “ Bad-GAN ” and “ Good-GAN ” in our model . Dis2 : it is hard to ensure generated samples to resemble real anomalies , while abundance of irrelevant pseudo anomalies may negatively affect the discrimination of real anomalies ; Dis3 : no application has been found to integrate labeled anomalies in prior-art Bad-GANs . In this work , we propose a new Taichi-GAN to address aforementioned disadvantages . First , based on a state-of-the-art Bad-GAN ( FenceGAN ( Ngo et al. , 2019 ) ) framework , an orthogonal loss is proposed to increase the angular diversity , which addresses Dis1 , and partially relieves Dis2 by increasing the overlap between generated pseudo anomalies and real anomalies . Second , we are the first to incorporate Good-GAN within a Bad-GAN framework , where the Good-GAN contributes to generating pseudo anomalies guided by few real anomalies , which addresses Dis2 and Dis3 . Our model is termed Taichi-GAN , as the Good-GAN and Bad-GAN are integrated in a competing yet balanced manner to generate pseudo anomalies towards better AD . We illustrate our ideas with 2D synthetic data and validate the proposed model with five datasets including clinical applications . 2 RELATED WORKS . Shallow AD models have their limitations in dealing with high-dimensional data and large-scale datasets ( Ruff et al. , 2020b ) . Here we focus on the most related deep AD approaches . Reconstruction-error-based ( REB ) Model . REB approaches have been widely applied to imagebased AD , where auto-encoder ( Sato et al. , 2018 ; Baur et al. , 2018 ; Chen & Konukoglu , 2018 ) or GAN ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Akcay et al. , 2018 ; Zenati et al. , 2018a ) is typically used for reconstruction . REB methods assume that anomalies would not be well reconstructed when the model is only trained with normal samples . Therefore , the reconstruction errors can be used to evaluate the abnormality . AnoGAN ( Schlegl et al. , 2017 ) is a representative REB approach which learns a manifold of anatomical variability and detects the anomalies with reconstruction errors mainly on pixel level . F-AnoGAN ( Schlegl et al. , 2019 ) follow the same framework as AnoGAN with improved processing speed . Han et al . ( 2021 ) ensemble multiple GANs for AD . However , REB approaches are mainly designed for data synthesis rather than AD , which may limit their comprehension for heterogeneous anomalies . One-class Classification-based Measure ( OCCBM ) . OCCBM approaches ( Ruff et al. , 2018 ; Wu et al. , 2019 ; Ruff et al. , 2020b ; Chalapathy et al. , 2018 ) learn one-class embedding from normal samples to measure the derivation of an unseen case from the inlier distribution , where the measurement is then served for AD purposes . Deep OCCBM models extend the classical one-class models , e.g. , one-class SVM ( Schölkopf et al. , 2001 ) and SVDD ( Tax & Duin , 2004 ) , by extracting features via deep nets ( Ruff et al. , 2018 ; Liznerski et al. , 2021 ) . OCCBM methods have been deployed to sophisticated applications , e.g. , detecting anomalous event in practical scenes ( Wu et al. , 2019 ) . Bad-GANs . The Bad-GAN idea ( Dai et al. , 2017 ) is introduced for semi-supervised learning in multi-class classification . Similar approaches are found in the scope of the AD such as Sabokrou et al . ( 2018 ) ; Lim et al . ( 2018 ) ; Zheng et al . ( 2019 ) ; Ngo et al . ( 2019 ) . Such techniques are termed as Bad-GANs in this paper . The key idea of Bad-GANs is to learn a classifier ( i.e. , the discriminator ) based on inliers and generated pseudo outliers during training so that it can distinguish unseen outliers and inliers during inference . Bad-GANs belong to the one-class classification family and can be trained end-to-end . In addition , it does not require a manually defined one-class classification measure as OCCBM models ( Pang et al. , 2021a ) ; the Bad-GAN discriminator handles the measure . AD Models Utilizing Real Anomalies . Deep SAD ( Ruff et al. , 2020b ) and ESAD ( Huang et al. , 2020 ) extend the Deep SVDD ( Ruff et al. , 2018 ) to take advantage of labeled anomalies . Siddiquee et al . ( 2019 ) propose a REB model for AD by considering normal and anomalies as two “ styles ” via image-to-image translation techniques . Few-shot learning and reinforcement learning are adapted to utilize limited label information , respectively ( Tian et al. , 2020 ; Pang et al. , 2021b ) . 3 METHOD . 3.1 BACKGROUND : GOOD-GAN AND BAD-GAN . GANs ( Goodfellow et al. , 2014 ) train generative models using a minimax game , which generate data instances from a noise distribution z ∼ pz to match the given data distribution pdata by iteratively optimizing a generator G and a discriminator D with the following objective : min G max D V ( D , G ) = Ex∼pdata [ logD ( x ) ] + Ez∼pz [ log ( 1−D ( G ( z ) ) ] ( 1 ) Dai et al . ( 2017 ) introduce the concept of the Bad-GAN that generates samples at the periphery of the training data . The generator is optimized by minimizing Ex∼pG log pdata ( x ) I [ pdata ( x ) > ] , where I [ x ] is an indicator function . With a threshold ∈ ( 0 , 1 ) , the training process penalizes the high-density samples and leaves the low-density ones unaffected , where the data distribution pdata of Dai et al . ( 2017 ) is estimated with an additional model PixelCNN++ ( Salimans et al. , 2017 ) . The more recent FenceGAN ( Ngo et al. , 2019 ) shares the similar spirit of Dai et al . ( 2017 ) , which generates samples at the boundary of a normal distribution . FenceGAN gets rid of the additional intensity estimation model as in Dai et al . ( 2017 ) , and thus formulates an end-to-end training process . The generator loss 2 on the batch with size N is defined as : LG = β ·N∑N i=1 ( ||G ( zi ) − µ ) || ) + BCE ( D ( G ( z ) ) , α ) ( 2 ) where BCE ( A , B ) is the binary cross-entropy between A and B . The first term is the dispersion loss which regularizes generated samples to be distant from their center µ . The hyperparameter α is a discriminative anomaly score that pushes generated pseudo anomalies on inlier distribution boundary and β is the so-called dispersion hyperparameter . The discriminator loss is defined as : LD = BCE ( D ( x ) ,0 ) + γBCE ( D ( G ( z ) ) ,1 ) ( 3 ) where γ ∈ ( 0 , 1 ] is the so-called anomaly hyperparameter . The discriminator is used to compute an anomaly score ranged ( 0,1 ) for each unseen case during the inference stage . 3.2 ORTHOGONAL LOSS . As anything not normal is defined as an anomaly and anomalies are heterogeneous ( Ruff et al. , 2020b ) , we hypothesize that generated pseudo anomalies in a Bad-GAN framework should have high diversity to cover as many abnormal patterns as possible . Dispersion loss ( Ngo et al. , 2019 ) ( Ld in Fig . 1 ) regularizes generated pseudo anomalies lying at boundary of inlier distribution . Here , we propose to push pseudo anomalies further distributed to evenly cover the entire angular space . ! # ! '' ! $ As verified in empirical experiments , the generated samples from a Bad-GAN can be prone to specific patterns , even with the Euclidean dispersion regularization of FenceGAN ( Ngo et al. , 2019 ) . We introduce an orthogonal loss Lorth to expand generated samples from the angular perspective . As depicted in Fig . 1 , paired samples with smaller angles ( left in Fig . 1 ) to each other can have a 2Equations are adapted from the official Github of FenceGAN , which have a different form with its paper . larger penalty given the orthogonal regularization . The orthogonal regularization has been used for weight initialization and optimized on deep features ( Brock et al. , 2017 ; Arjovsky et al. , 2015 ; Zhao et al. , 2016 ) . Here , we define our Lorth in a decentralized way and optimized on generated pseudo anomalies in an AD framework : Lorth = 1 N ( N − 1 ) N∑ i=1 ∑ j 6=i ( ( G ( zi ) − µ ) T ( G ( zj ) − µ ) ||G ( zi ) − µ|| · ||G ( zj ) − µ|| ) 2 ( 4 ) Instead of optimizing on the commonly used Euclidean distance and individual regularization ( e.g. , the dispersion term of Ngo et al . ( 2019 ) and the losses in OCCBM models ( Ruff et al. , 2018 ; 2020a ; b ) ) , our proposed orthogonal loss leverages Cosine distance and relational regularization3 to be complementary to the dispersion term in the Bad-GAN framework . | The authors of this paper propose a GAN-based method for the anomaly detection task. Their method relies on so-called Bad GANs (that uses the trained GAN discriminator to distinguish between inliers and pseudo-anomalies), a new orthogonal loss (that favorises generated samples to cover a larger angular space) and eventually a so-called Good GAN (which generator is shared with the Bad GAN; and discriminator is trained on "real" anomalies). The method is evaluated along a set of baselines in experiments that also include ablation studies. | SP:57f42822eeb0414bc7d470f31e68cdabb5002b0b |
You May Need both Good-GAN and Bad-GAN for Anomaly Detection | 1 INTRODUCTION . Anomaly detection ( AD ) , a.k.a . outlier detection , refers to detecting uncommon samples ( usually heterogeneous ) out of inlier distribution ( ChandolaVarun et al. , 2009 ; Pang et al. , 2021a ) . AD can be performed either in an unsupervised manner when only inliers are involved during the training process ( Schlegl et al. , 2019 ; Ngo et al. , 2019 ; Ruff et al. , 2018 ) , or in a semi-supervised manner when few labeled anomalies are available ( Ruff et al. , 2020b ; Liznerski et al. , 2021 ) . Generative adversarial nets ( GAN ) ( Goodfellow et al. , 2014 ) are considered the most effective generative models nowadays , which have also been applied for AD ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Perera et al. , 2019 ) . Likewise , one-class classification and its variants are often used as the backbone of AD approaches ( Schölkopf et al. , 2001 ; Ruff et al. , 2018 ; Liznerski et al. , 2021 ; Wu et al. , 2019 ) . Recently , the adversarial training and one-class classification have been leveraged together to discriminate inlier/outlier in an end-to-end manner ( Zheng et al. , 2019 ; Ngo et al. , 2019 ) . Such efforts share a similar spirit with the work introduced in Dai et al . ( 2017 ) and here we call them Bad-GANs . Instead of generating samples to match the training data distribution as a conventional GAN ( Goodfellow et al. , 2014 ) that we refer as Good-GAN in this paper , a Bad-GAN pushes its generated samples towards the peripheral area of the training data distribution and considers them as pseudo anomalies . Rather than defining anomaly scores based on 1 ) the residual between reconstructed and original samples such as AnoGAN series ( Schlegl et al. , 2017 ; 2019 ) , or 2 ) existing one-class classification-based measures such as Deep SVDD ( Ruff et al. , 2018 ) and FCDD ( Liznerski et al. , 2021 ) , Bad-GANs directly leverage the learned discriminator to identify unseen anomalies from normal cases . Although Bad-GANs have shown great potentials , they suffer from several disadvantages . Dis1 : the generated samples can converge to limited patterns rather than being heterogeneous as real anomalies ; 1Taichi is a concept from traditional Chinese culture , which refers to the co-existence and well-balance of two components with different properties . We borrow this concept to indicate the relationship between “ Bad-GAN ” and “ Good-GAN ” in our model . Dis2 : it is hard to ensure generated samples to resemble real anomalies , while abundance of irrelevant pseudo anomalies may negatively affect the discrimination of real anomalies ; Dis3 : no application has been found to integrate labeled anomalies in prior-art Bad-GANs . In this work , we propose a new Taichi-GAN to address aforementioned disadvantages . First , based on a state-of-the-art Bad-GAN ( FenceGAN ( Ngo et al. , 2019 ) ) framework , an orthogonal loss is proposed to increase the angular diversity , which addresses Dis1 , and partially relieves Dis2 by increasing the overlap between generated pseudo anomalies and real anomalies . Second , we are the first to incorporate Good-GAN within a Bad-GAN framework , where the Good-GAN contributes to generating pseudo anomalies guided by few real anomalies , which addresses Dis2 and Dis3 . Our model is termed Taichi-GAN , as the Good-GAN and Bad-GAN are integrated in a competing yet balanced manner to generate pseudo anomalies towards better AD . We illustrate our ideas with 2D synthetic data and validate the proposed model with five datasets including clinical applications . 2 RELATED WORKS . Shallow AD models have their limitations in dealing with high-dimensional data and large-scale datasets ( Ruff et al. , 2020b ) . Here we focus on the most related deep AD approaches . Reconstruction-error-based ( REB ) Model . REB approaches have been widely applied to imagebased AD , where auto-encoder ( Sato et al. , 2018 ; Baur et al. , 2018 ; Chen & Konukoglu , 2018 ) or GAN ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Akcay et al. , 2018 ; Zenati et al. , 2018a ) is typically used for reconstruction . REB methods assume that anomalies would not be well reconstructed when the model is only trained with normal samples . Therefore , the reconstruction errors can be used to evaluate the abnormality . AnoGAN ( Schlegl et al. , 2017 ) is a representative REB approach which learns a manifold of anatomical variability and detects the anomalies with reconstruction errors mainly on pixel level . F-AnoGAN ( Schlegl et al. , 2019 ) follow the same framework as AnoGAN with improved processing speed . Han et al . ( 2021 ) ensemble multiple GANs for AD . However , REB approaches are mainly designed for data synthesis rather than AD , which may limit their comprehension for heterogeneous anomalies . One-class Classification-based Measure ( OCCBM ) . OCCBM approaches ( Ruff et al. , 2018 ; Wu et al. , 2019 ; Ruff et al. , 2020b ; Chalapathy et al. , 2018 ) learn one-class embedding from normal samples to measure the derivation of an unseen case from the inlier distribution , where the measurement is then served for AD purposes . Deep OCCBM models extend the classical one-class models , e.g. , one-class SVM ( Schölkopf et al. , 2001 ) and SVDD ( Tax & Duin , 2004 ) , by extracting features via deep nets ( Ruff et al. , 2018 ; Liznerski et al. , 2021 ) . OCCBM methods have been deployed to sophisticated applications , e.g. , detecting anomalous event in practical scenes ( Wu et al. , 2019 ) . Bad-GANs . The Bad-GAN idea ( Dai et al. , 2017 ) is introduced for semi-supervised learning in multi-class classification . Similar approaches are found in the scope of the AD such as Sabokrou et al . ( 2018 ) ; Lim et al . ( 2018 ) ; Zheng et al . ( 2019 ) ; Ngo et al . ( 2019 ) . Such techniques are termed as Bad-GANs in this paper . The key idea of Bad-GANs is to learn a classifier ( i.e. , the discriminator ) based on inliers and generated pseudo outliers during training so that it can distinguish unseen outliers and inliers during inference . Bad-GANs belong to the one-class classification family and can be trained end-to-end . In addition , it does not require a manually defined one-class classification measure as OCCBM models ( Pang et al. , 2021a ) ; the Bad-GAN discriminator handles the measure . AD Models Utilizing Real Anomalies . Deep SAD ( Ruff et al. , 2020b ) and ESAD ( Huang et al. , 2020 ) extend the Deep SVDD ( Ruff et al. , 2018 ) to take advantage of labeled anomalies . Siddiquee et al . ( 2019 ) propose a REB model for AD by considering normal and anomalies as two “ styles ” via image-to-image translation techniques . Few-shot learning and reinforcement learning are adapted to utilize limited label information , respectively ( Tian et al. , 2020 ; Pang et al. , 2021b ) . 3 METHOD . 3.1 BACKGROUND : GOOD-GAN AND BAD-GAN . GANs ( Goodfellow et al. , 2014 ) train generative models using a minimax game , which generate data instances from a noise distribution z ∼ pz to match the given data distribution pdata by iteratively optimizing a generator G and a discriminator D with the following objective : min G max D V ( D , G ) = Ex∼pdata [ logD ( x ) ] + Ez∼pz [ log ( 1−D ( G ( z ) ) ] ( 1 ) Dai et al . ( 2017 ) introduce the concept of the Bad-GAN that generates samples at the periphery of the training data . The generator is optimized by minimizing Ex∼pG log pdata ( x ) I [ pdata ( x ) > ] , where I [ x ] is an indicator function . With a threshold ∈ ( 0 , 1 ) , the training process penalizes the high-density samples and leaves the low-density ones unaffected , where the data distribution pdata of Dai et al . ( 2017 ) is estimated with an additional model PixelCNN++ ( Salimans et al. , 2017 ) . The more recent FenceGAN ( Ngo et al. , 2019 ) shares the similar spirit of Dai et al . ( 2017 ) , which generates samples at the boundary of a normal distribution . FenceGAN gets rid of the additional intensity estimation model as in Dai et al . ( 2017 ) , and thus formulates an end-to-end training process . The generator loss 2 on the batch with size N is defined as : LG = β ·N∑N i=1 ( ||G ( zi ) − µ ) || ) + BCE ( D ( G ( z ) ) , α ) ( 2 ) where BCE ( A , B ) is the binary cross-entropy between A and B . The first term is the dispersion loss which regularizes generated samples to be distant from their center µ . The hyperparameter α is a discriminative anomaly score that pushes generated pseudo anomalies on inlier distribution boundary and β is the so-called dispersion hyperparameter . The discriminator loss is defined as : LD = BCE ( D ( x ) ,0 ) + γBCE ( D ( G ( z ) ) ,1 ) ( 3 ) where γ ∈ ( 0 , 1 ] is the so-called anomaly hyperparameter . The discriminator is used to compute an anomaly score ranged ( 0,1 ) for each unseen case during the inference stage . 3.2 ORTHOGONAL LOSS . As anything not normal is defined as an anomaly and anomalies are heterogeneous ( Ruff et al. , 2020b ) , we hypothesize that generated pseudo anomalies in a Bad-GAN framework should have high diversity to cover as many abnormal patterns as possible . Dispersion loss ( Ngo et al. , 2019 ) ( Ld in Fig . 1 ) regularizes generated pseudo anomalies lying at boundary of inlier distribution . Here , we propose to push pseudo anomalies further distributed to evenly cover the entire angular space . ! # ! '' ! $ As verified in empirical experiments , the generated samples from a Bad-GAN can be prone to specific patterns , even with the Euclidean dispersion regularization of FenceGAN ( Ngo et al. , 2019 ) . We introduce an orthogonal loss Lorth to expand generated samples from the angular perspective . As depicted in Fig . 1 , paired samples with smaller angles ( left in Fig . 1 ) to each other can have a 2Equations are adapted from the official Github of FenceGAN , which have a different form with its paper . larger penalty given the orthogonal regularization . The orthogonal regularization has been used for weight initialization and optimized on deep features ( Brock et al. , 2017 ; Arjovsky et al. , 2015 ; Zhao et al. , 2016 ) . Here , we define our Lorth in a decentralized way and optimized on generated pseudo anomalies in an AD framework : Lorth = 1 N ( N − 1 ) N∑ i=1 ∑ j 6=i ( ( G ( zi ) − µ ) T ( G ( zj ) − µ ) ||G ( zi ) − µ|| · ||G ( zj ) − µ|| ) 2 ( 4 ) Instead of optimizing on the commonly used Euclidean distance and individual regularization ( e.g. , the dispersion term of Ngo et al . ( 2019 ) and the losses in OCCBM models ( Ruff et al. , 2018 ; 2020a ; b ) ) , our proposed orthogonal loss leverages Cosine distance and relational regularization3 to be complementary to the dispersion term in the Bad-GAN framework . | In this paper the authors propose a method for image anomaly detection (AD) based on GANs. The use the GAN discriminator based on a method called "Bad GAN" where one trains a GAN to produce low likelihood samples (trained using the nominal data) and then use the discriminator, which has been generalized to a large class of samples, to determine if a test sample is anomalous. In the proposed method the authors include $L_{orth}$ to enforce angular diversity of generated samples, a "good" gan discriminator that is trained to correctly determine if a sample is generated, and a bad gan discriminator inducing the generator to make points near the boundary of the nominal set distribution. At test time the "bad" discriminator used to determine an anomaly score. The authors test their method experimentally on F/MNIST and some medical datasets. | SP:57f42822eeb0414bc7d470f31e68cdabb5002b0b |
You May Need both Good-GAN and Bad-GAN for Anomaly Detection | 1 INTRODUCTION . Anomaly detection ( AD ) , a.k.a . outlier detection , refers to detecting uncommon samples ( usually heterogeneous ) out of inlier distribution ( ChandolaVarun et al. , 2009 ; Pang et al. , 2021a ) . AD can be performed either in an unsupervised manner when only inliers are involved during the training process ( Schlegl et al. , 2019 ; Ngo et al. , 2019 ; Ruff et al. , 2018 ) , or in a semi-supervised manner when few labeled anomalies are available ( Ruff et al. , 2020b ; Liznerski et al. , 2021 ) . Generative adversarial nets ( GAN ) ( Goodfellow et al. , 2014 ) are considered the most effective generative models nowadays , which have also been applied for AD ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Perera et al. , 2019 ) . Likewise , one-class classification and its variants are often used as the backbone of AD approaches ( Schölkopf et al. , 2001 ; Ruff et al. , 2018 ; Liznerski et al. , 2021 ; Wu et al. , 2019 ) . Recently , the adversarial training and one-class classification have been leveraged together to discriminate inlier/outlier in an end-to-end manner ( Zheng et al. , 2019 ; Ngo et al. , 2019 ) . Such efforts share a similar spirit with the work introduced in Dai et al . ( 2017 ) and here we call them Bad-GANs . Instead of generating samples to match the training data distribution as a conventional GAN ( Goodfellow et al. , 2014 ) that we refer as Good-GAN in this paper , a Bad-GAN pushes its generated samples towards the peripheral area of the training data distribution and considers them as pseudo anomalies . Rather than defining anomaly scores based on 1 ) the residual between reconstructed and original samples such as AnoGAN series ( Schlegl et al. , 2017 ; 2019 ) , or 2 ) existing one-class classification-based measures such as Deep SVDD ( Ruff et al. , 2018 ) and FCDD ( Liznerski et al. , 2021 ) , Bad-GANs directly leverage the learned discriminator to identify unseen anomalies from normal cases . Although Bad-GANs have shown great potentials , they suffer from several disadvantages . Dis1 : the generated samples can converge to limited patterns rather than being heterogeneous as real anomalies ; 1Taichi is a concept from traditional Chinese culture , which refers to the co-existence and well-balance of two components with different properties . We borrow this concept to indicate the relationship between “ Bad-GAN ” and “ Good-GAN ” in our model . Dis2 : it is hard to ensure generated samples to resemble real anomalies , while abundance of irrelevant pseudo anomalies may negatively affect the discrimination of real anomalies ; Dis3 : no application has been found to integrate labeled anomalies in prior-art Bad-GANs . In this work , we propose a new Taichi-GAN to address aforementioned disadvantages . First , based on a state-of-the-art Bad-GAN ( FenceGAN ( Ngo et al. , 2019 ) ) framework , an orthogonal loss is proposed to increase the angular diversity , which addresses Dis1 , and partially relieves Dis2 by increasing the overlap between generated pseudo anomalies and real anomalies . Second , we are the first to incorporate Good-GAN within a Bad-GAN framework , where the Good-GAN contributes to generating pseudo anomalies guided by few real anomalies , which addresses Dis2 and Dis3 . Our model is termed Taichi-GAN , as the Good-GAN and Bad-GAN are integrated in a competing yet balanced manner to generate pseudo anomalies towards better AD . We illustrate our ideas with 2D synthetic data and validate the proposed model with five datasets including clinical applications . 2 RELATED WORKS . Shallow AD models have their limitations in dealing with high-dimensional data and large-scale datasets ( Ruff et al. , 2020b ) . Here we focus on the most related deep AD approaches . Reconstruction-error-based ( REB ) Model . REB approaches have been widely applied to imagebased AD , where auto-encoder ( Sato et al. , 2018 ; Baur et al. , 2018 ; Chen & Konukoglu , 2018 ) or GAN ( Schlegl et al. , 2017 ; 2019 ; Zenati et al. , 2018b ; Siddiquee et al. , 2019 ; Akcay et al. , 2018 ; Zenati et al. , 2018a ) is typically used for reconstruction . REB methods assume that anomalies would not be well reconstructed when the model is only trained with normal samples . Therefore , the reconstruction errors can be used to evaluate the abnormality . AnoGAN ( Schlegl et al. , 2017 ) is a representative REB approach which learns a manifold of anatomical variability and detects the anomalies with reconstruction errors mainly on pixel level . F-AnoGAN ( Schlegl et al. , 2019 ) follow the same framework as AnoGAN with improved processing speed . Han et al . ( 2021 ) ensemble multiple GANs for AD . However , REB approaches are mainly designed for data synthesis rather than AD , which may limit their comprehension for heterogeneous anomalies . One-class Classification-based Measure ( OCCBM ) . OCCBM approaches ( Ruff et al. , 2018 ; Wu et al. , 2019 ; Ruff et al. , 2020b ; Chalapathy et al. , 2018 ) learn one-class embedding from normal samples to measure the derivation of an unseen case from the inlier distribution , where the measurement is then served for AD purposes . Deep OCCBM models extend the classical one-class models , e.g. , one-class SVM ( Schölkopf et al. , 2001 ) and SVDD ( Tax & Duin , 2004 ) , by extracting features via deep nets ( Ruff et al. , 2018 ; Liznerski et al. , 2021 ) . OCCBM methods have been deployed to sophisticated applications , e.g. , detecting anomalous event in practical scenes ( Wu et al. , 2019 ) . Bad-GANs . The Bad-GAN idea ( Dai et al. , 2017 ) is introduced for semi-supervised learning in multi-class classification . Similar approaches are found in the scope of the AD such as Sabokrou et al . ( 2018 ) ; Lim et al . ( 2018 ) ; Zheng et al . ( 2019 ) ; Ngo et al . ( 2019 ) . Such techniques are termed as Bad-GANs in this paper . The key idea of Bad-GANs is to learn a classifier ( i.e. , the discriminator ) based on inliers and generated pseudo outliers during training so that it can distinguish unseen outliers and inliers during inference . Bad-GANs belong to the one-class classification family and can be trained end-to-end . In addition , it does not require a manually defined one-class classification measure as OCCBM models ( Pang et al. , 2021a ) ; the Bad-GAN discriminator handles the measure . AD Models Utilizing Real Anomalies . Deep SAD ( Ruff et al. , 2020b ) and ESAD ( Huang et al. , 2020 ) extend the Deep SVDD ( Ruff et al. , 2018 ) to take advantage of labeled anomalies . Siddiquee et al . ( 2019 ) propose a REB model for AD by considering normal and anomalies as two “ styles ” via image-to-image translation techniques . Few-shot learning and reinforcement learning are adapted to utilize limited label information , respectively ( Tian et al. , 2020 ; Pang et al. , 2021b ) . 3 METHOD . 3.1 BACKGROUND : GOOD-GAN AND BAD-GAN . GANs ( Goodfellow et al. , 2014 ) train generative models using a minimax game , which generate data instances from a noise distribution z ∼ pz to match the given data distribution pdata by iteratively optimizing a generator G and a discriminator D with the following objective : min G max D V ( D , G ) = Ex∼pdata [ logD ( x ) ] + Ez∼pz [ log ( 1−D ( G ( z ) ) ] ( 1 ) Dai et al . ( 2017 ) introduce the concept of the Bad-GAN that generates samples at the periphery of the training data . The generator is optimized by minimizing Ex∼pG log pdata ( x ) I [ pdata ( x ) > ] , where I [ x ] is an indicator function . With a threshold ∈ ( 0 , 1 ) , the training process penalizes the high-density samples and leaves the low-density ones unaffected , where the data distribution pdata of Dai et al . ( 2017 ) is estimated with an additional model PixelCNN++ ( Salimans et al. , 2017 ) . The more recent FenceGAN ( Ngo et al. , 2019 ) shares the similar spirit of Dai et al . ( 2017 ) , which generates samples at the boundary of a normal distribution . FenceGAN gets rid of the additional intensity estimation model as in Dai et al . ( 2017 ) , and thus formulates an end-to-end training process . The generator loss 2 on the batch with size N is defined as : LG = β ·N∑N i=1 ( ||G ( zi ) − µ ) || ) + BCE ( D ( G ( z ) ) , α ) ( 2 ) where BCE ( A , B ) is the binary cross-entropy between A and B . The first term is the dispersion loss which regularizes generated samples to be distant from their center µ . The hyperparameter α is a discriminative anomaly score that pushes generated pseudo anomalies on inlier distribution boundary and β is the so-called dispersion hyperparameter . The discriminator loss is defined as : LD = BCE ( D ( x ) ,0 ) + γBCE ( D ( G ( z ) ) ,1 ) ( 3 ) where γ ∈ ( 0 , 1 ] is the so-called anomaly hyperparameter . The discriminator is used to compute an anomaly score ranged ( 0,1 ) for each unseen case during the inference stage . 3.2 ORTHOGONAL LOSS . As anything not normal is defined as an anomaly and anomalies are heterogeneous ( Ruff et al. , 2020b ) , we hypothesize that generated pseudo anomalies in a Bad-GAN framework should have high diversity to cover as many abnormal patterns as possible . Dispersion loss ( Ngo et al. , 2019 ) ( Ld in Fig . 1 ) regularizes generated pseudo anomalies lying at boundary of inlier distribution . Here , we propose to push pseudo anomalies further distributed to evenly cover the entire angular space . ! # ! '' ! $ As verified in empirical experiments , the generated samples from a Bad-GAN can be prone to specific patterns , even with the Euclidean dispersion regularization of FenceGAN ( Ngo et al. , 2019 ) . We introduce an orthogonal loss Lorth to expand generated samples from the angular perspective . As depicted in Fig . 1 , paired samples with smaller angles ( left in Fig . 1 ) to each other can have a 2Equations are adapted from the official Github of FenceGAN , which have a different form with its paper . larger penalty given the orthogonal regularization . The orthogonal regularization has been used for weight initialization and optimized on deep features ( Brock et al. , 2017 ; Arjovsky et al. , 2015 ; Zhao et al. , 2016 ) . Here , we define our Lorth in a decentralized way and optimized on generated pseudo anomalies in an AD framework : Lorth = 1 N ( N − 1 ) N∑ i=1 ∑ j 6=i ( ( G ( zi ) − µ ) T ( G ( zj ) − µ ) ||G ( zi ) − µ|| · ||G ( zj ) − µ|| ) 2 ( 4 ) Instead of optimizing on the commonly used Euclidean distance and individual regularization ( e.g. , the dispersion term of Ngo et al . ( 2019 ) and the losses in OCCBM models ( Ruff et al. , 2018 ; 2020a ; b ) ) , our proposed orthogonal loss leverages Cosine distance and relational regularization3 to be complementary to the dispersion term in the Bad-GAN framework . | The paper proposes a new interesting method for anomaly detection. In particular, to overcome the limitations of existing Bad-GAN, the authors introduce the orthogonal loss to regularize the generation of anomaly samples to be distributed evenly at the periphery of the training data. Furthermore, in the scenario of available anomalies, the authors combine Bad-GAN and Good-GAN together, in which Good-GAN learns to generate the anomalies while Bad-GAN reguralizes the anomaly pseudo anomalies at the boundary of inlier distribution. | SP:57f42822eeb0414bc7d470f31e68cdabb5002b0b |
Learning to Guide and to be Guided in the Architect-Builder Problem | 1 INTRODUCTION . Humans are notoriously successful at teaching – and learning from – each others . This enables skills and knowledge to be shared and passed along generations , being progressively refined towards mankind ’ s current state of proficiency . People can teach and be taught in situations where there is no shared language and very little common ground , such as a parent teaching a baby how to stack blocks during play . Experimental Semiotics ( Galantucci & Garrod , 2011 ) , a line of work that ∗Equal contribution . †Work conducted while at Inria . ‡Canada CIFAR AI Chair . studies the forms of communication that people develop when they can not use pre-established ones , reveals that humans can even teach and learn without direct reinforcement signal , demonstrations or a shared communication protocol . Vollmer et al . ( 2014 ) for example investigate a co-construction ( CoCo ) game experiment where an architect must rely only on arbitrary instructions to guide a builder toward constructing a structure . In this experiment , both the task of building the structure and the meanings of the instructions – through which the architect guides the builder – are simultaneously learned throughout interactions . Such flexible teaching – and learning – capabilities are essential to autonomous artificial agents if they are to master an increasing number of skills without extensive human supervision . As a first step toward this research direction , we draw inspiration from the CoCo game and propose the Architect-Builder Problem ( ABP ) : an interactive learning setting that models agents ’ interactions with Markov Decision Processes ( Puterman , 2014 ) ( MDPs ) . In the ABP learning has to occur in a social context through observations and communication , in the absence of direct imitation or reinforcement ( Bandura & Walters , 1977 ) . Specifically , the constraints of the ABP are : ( 1 ) the builder has absolutely no knowledge about the task at hand ( no reward and no prior on the set of possible tasks ) , ( 2 ) the architect can only interact with the builder through communication signals ( can not interact with the environment or provide demonstrations ) , and ( 3 ) the communication signals have no pre-defined meanings ( nor belong to a set of known possible meanings ) . ( 1 ) sets this work apart from Reinforcement Learning ( RL ) and even Multi-Agent RL ( MARL ) where explicit rewards are available to all agents . ( 2 ) implies the absence of tele-operation or third-person demonstrations and thus distinguishes the ABP from Imitation and Inverse Reinforcement Learning ( IRL ) . Finally , ( 3 ) prevents the architect from relying on a fixed communication protocol since the meanings of instructions must be negotiated . These constraints make ABP an appealing setting to investigate Human-Robot Interaction ( HRI ) ( Goodrich & Schultz , 2008 ) problems where “ a learner tries to figure out what a teacher wants them to do ” ( Grizou et al. , 2013 ; Cederborg & Oudeyer , 2014 ) . Specifically , the challenge of Brain Computer Interfaces ( BCI ) , where users use brain signals to control virtual and robotic agents in sequential tasks ( Katyal et al. , 2014 ; deBettencourt et al. , 2015 ; Mishra & Gazzaley , 2015 ; Muñoz-Moldes & Cleeremans , 2020 ; Chiang et al. , 2021 ) , is well captured by the ABP . In BCIs , ( 3 ) is identified as the calibration problem and is usually tackled with supervised learning to learn a mapping between signals and meanings . As this calibration phase is often laborious and impractical for users , current approaches investigate calibration-free solutions where the mapping is learned interactively ( Grizou et al. , 2014 ; Xie et al. , 2021 ) . Yet , these works consider that the user ( i.e . the architect ) is fixed , in the sense that it does not adapt to the agent ( i.e . the builder ) and uses a set of pre-defined instructions ( or feedback ) meanings that the agent must learn to map to signals . In our ABP formulation however , the architect is dynamic and , as interactions unfold , must learn to best guide a learning builder by tuning the meanings of instructions according to the builder ’ s reactions . In that sense , ABP provides a more complete computational model of agent-agent or human-agent interaction . With all these constraints in mind , we propose Architect Builder Iterated Guiding ( ABIG ) , an algorithmic solution to ABP when both agents are AIs . ABIG is inspired by the field of experimental semiotics and relies on two high-level interaction priors : shared intent and interaction frames . Shared intent refers to the fact that , although the builder ignores the objective of the task to fulfill , it will assume that its objective is aligned with the architect ’ s . This assumption is characteristic of cooperative tasks and shown to be a necessary condition for the emergence of communication both in practice ( Foerster et al. , 2016 ; Cao et al. , 2018 ) and in theory ( Crawford & Sobel , 1982 ) . Specifically , the builder should assume that the architect is guiding it towards a shared objective . Knowing this , the builder must reinforce the behavior it displays when guided by the architect . We show that the builder can efficiently implement this by using imitation learning on its own guided behavior . Because the builder imitates itself , we call it self-imitation . The notion of interaction frames ( also called pragmatic frames ) states that agents that interact in sequence can more easily interpret the interaction history ( Bruner , 1985 ; Vollmer et al. , 2016 ) . In ABIG , we consider two distinct interaction frames . These are stationary which means that when one agent learns , the other agent ’ s behavior is fixed . During the first frame ( the modelling frame ) , the builder is fixed and the architect learns a model of the builder ’ s message-conditioned behavior . During the second frame ( the guiding frame ) , the architect is fixed and the builder learns to be guided via self-imitation learning . We show that ABIG results in a low-level , high-frequency , guiding communication protocol that not only enables an architect-builder pair to solve the task at hand , but can also be used to solve unseen tasks . Our contributions are : • The Architect-Builder Problem ( ABP ) , an interactive learning setting to study how artificial agents can simultaneously learn to solve a task and derive a communication protocol . • Architect-Builder Iterated Guiding ( ABIG ) , an algorithmic solution to the ABP . • An analysis of ABIG ’ s key learning mechanisms . • An evaluation of ABIG on a construction environment where we show that ABIG agents evolve communication protocols that generalize to unseen harder tasks . • A detailed analysis of ABIG ’ s learning dynamics and impact on the mutual information between messages and actions ( in the Supplementary Material ) . 2 PROBLEM DEFINITION . The Architect-Builder Problem . We consider a multi-agent setup composed of two agents : an architect and a builder . Both agents observe the environment state s but only the architect knows the goal at hand . The architect can not take actions in the environment but receives the environmental reward r whereas the builder does not receive any reward and has thus no knowledge about the task at hand . In this asymmetrical setup , the architect can only interact with the builder through a communication signal m sampled from its policy π A ( m|s ) . These messages , that have no a priori meanings , are received by the builder which acts according to its policy π B ( a|s , m ) . This makes the environment transition to a new state s′ sampled from P E ( s′|s , a ) and the architect receives reward r′ . Messages are sent at every time-step . The CoCo game that inspired ABP is sketched in Figure 1 ( a ) while the overall architect-builder-environment interaction diagram is given in Figure 1 ( b ) . The differences between the ABP setting and the MARL and IRL settings are illustrated in Figure 8 . BuildWorld . We conduct our experiments in BuildWorld . BuildWorld is a 2D construction gridworld of size ( w × h ) . At the beginning of an episode , the agent and Nb blocks are spawned at different random locations . The agent can navigate in this world and grasp blocks by activating its gripper while on a block . The action space A is discrete and include a “ do nothing ” action ( |A| = 6 ) . At each time step , the agent observes its position in the grid , its gripper state as well as the position of all the blocks and if they are grasped ( |S| = 3 + 3Nb ) . Tasks . BuildWorld contains 4 different training tasks : 1 ) ‘ Grasp ’ : The agent must grasp any of the blocks ; 2 ) ‘ Place ’ : The agent must place any block at a specified location in the grid ; 3/4 ) ‘ H-Line/Vline ’ : The agent must place all the blocks in a horizontal/vertical line configuration . BuildWorld also has a harder fifth testing task , ‘ 6-blocks-shapes ’ , that consists of more complex configurations and that is used to challenge an algorithm ’ s transfer abilities . For all tasks , rewards are sparse and only given when the task is completed . This environment encapsulates the interactive learning challenge of ABP while removing the need for complex perception or locomotion . In the RL setting , where the same agent acts and receives rewards , this environment would not be very impressive . However , it remains to be shown that the tasks can be solved in the setting of ABP ( with a reward-less builder and an action-less architect ) . Communication . The architect guides the builder by sending messages m which are one-hot vectors of size |V| ranging from 2 to 72 , see Suppl . Section B.3 for the impact of this parameter . Additional Assumptions . In order to focus on the architect-builder interactions and the learning of a shared communication protocol , the architect has access to P E ( s′|s , a ) and to the reward function r ( s , a ) of the goal at hand . This assumes that , if the architect were to act in the environment instead of the builder , it would be able to quickly figure out how to solve the task . This assumption is compatible with the CoCo game experiment ( Vollmer et al. , 2014 ) where humans participants , and in particular the architects , are known to have such world models . 3 ABIG : ARCHITECT-BUILDER ITERATED GUIDING . 3.1 ANALYTICAL DESCRIPTION . Agents-MDPs . In the Architect-Builder Problem , agents are operating in different , yet coupled , MDPs . Those MDPs depend on their respective point of view ( see Figure 2 ) . From the point of view of the architect , messages are actions that influence the next state as well as the reward ( see Figure 2 ( a ) ) . The architect knows the environment transition function P E ( s′|s , a ) and r ( s , a ) , the true reward function associated with the task that does not depend explicitly on messages . It can thus derive the effect of its messages on the builder ’ s actions that drive the reward and the next states ( see Figure 2 ( b ) ) . On the other hand , the builder ’ s state is composed of the environment state and the message , which makes estimating state transitions challenging as one must also capture the message dynamics ( see Figure 2 ( c ) ) . Yet , the builder can leverage its knowledge of the architect picking messages based on the current environment state . The equivalent transition and reward models , when available , are given below ( see derivations in Suppl . Section A ) . P A ( s′|s , m ) = ∑ a∈A π̃ B ( a|s , m ) P E ( s′|a , s ) r A ( s , m ) = ∑ a∈A π̃ B ( a|s , m ) r ( s , a ) with π̃B ( a|s , m ) ≜ P ( a|s , m ) ( 1 ) P B ( s′ , m′|s , m , a ) = π̃ A ( m′|s′ ) P E ( s′|s , a ) with π̃ A ( m′|s′ ) ≜ P ( m′|s′ ) ( 2 ) where subscripts A and B refer to the architect and the builder , respectively . x̃ denotes that x is unknown and must be approximated . From the builder ’ s point of view , the reward – denoted r̃ – is unknown . This prevents the use of classical RL algorithms . Shared Intent and Interaction Frames . It follows from Eq . ( 1 ) that , provided that it can approximate the builder ’ s behavior , the architect can compute the reward and transition models of its MDP . It can then use these to derive an optimal message policy π∗ A that would maximize its objective : π∗ A = argmax π A G A = argmax π A E [ ∑ t γtr A , t ] ( 3 ) γ ∈ [ 0,1 ] is a discount factor and the expectation can be thought of in terms of π A , P A and the initial state distribution . However , the expectation can also be though in terms of the corresponding trajectories τ ≜ { ( s , m , a , r ) t } generated by the architect-builder interactions . In other words , when using π∗ A to guide the builder , the architect-builder pair generates trajectories that maximizes G A . The builder has no reward signal to maximize , yet , it relies on a shared intent prior and assumes that its objective is the same as the architect ’ s one : G B = G A = Eτ [ ∑ t γtr A , t ] = Eτ [ ∑ t γtr̃t ] ( 4 ) where the expectations are taken with respect to trajectories τ of architect-builder interactions . Therefore , under the shared intent prior , architect-builder interactions where the architect uses π∗ A to maximize G A also maximize G B . This means that the builder can interpret these interaction trajectories as demonstrations that maximize its unknown reward function r̃ . Consequently , the builder can reinforce the desired behavior – towards which the architect guides it – by performing self-Imitation Learning1 on the interaction trajectories τ . Note that in Eq . ( 1 ) , the architect ’ s models can be interpreted as expectations with respect to the builder ’ s behavior . Similarly , the builder ’ s objective depends on the architect ’ s guiding behavior . This makes one agent ’ s MDP highly non-stationary and the agent must adapts its behavior if the other agent ’ s policy changes . To palliate to this , agents rely on interaction frames which means that , when one agent learns , the other agent ’ s policy is fixed to restore stationarity . The equivalent MDPs for the architect and the builder are respectively M A = ⟨S , V , P A , r A , γ⟩ and M B = ⟨S × V , A , P B , ∅ , γ⟩ . Finally , π A : S 7→ V , P A : S×V 7→ [ 0 , 1 ] , r A : S×V 7→ [ 0 , 1 ] , π B : S×V 7→ A and P B : S ×V ×A 7→ [ 0 , 1 ] where S , A and V are respectively the sets of states , actions and messages . | **After rebuttal**: I am keeping my current score. I am positive about this framework as it presents a better model for multi-agent communication, especially enriching the communication among agents over the fixed, restricted reward-based communication protocol in traditional RL. **Before rebuttal**: The paper proposes an architect-builder problem setting where the architecture guides the builder to accomplish a goal by sending messages. Only the architecture knows the goal and has access to rewards, whereas only the builder can act in the environment. This setting is distinct from traditional reinforcement learning and imitation learning. Drawing inspiration from cognitive science theories, the authors devise an algorithm for learning a communication protocol between the architect and the builder. On grid-world tasks, they show that learned the communication protocol can generalize to previously unseen tasks. | SP:3afae0ebdb91a5fc850f02a094d23d56970a3826 |
Learning to Guide and to be Guided in the Architect-Builder Problem | 1 INTRODUCTION . Humans are notoriously successful at teaching – and learning from – each others . This enables skills and knowledge to be shared and passed along generations , being progressively refined towards mankind ’ s current state of proficiency . People can teach and be taught in situations where there is no shared language and very little common ground , such as a parent teaching a baby how to stack blocks during play . Experimental Semiotics ( Galantucci & Garrod , 2011 ) , a line of work that ∗Equal contribution . †Work conducted while at Inria . ‡Canada CIFAR AI Chair . studies the forms of communication that people develop when they can not use pre-established ones , reveals that humans can even teach and learn without direct reinforcement signal , demonstrations or a shared communication protocol . Vollmer et al . ( 2014 ) for example investigate a co-construction ( CoCo ) game experiment where an architect must rely only on arbitrary instructions to guide a builder toward constructing a structure . In this experiment , both the task of building the structure and the meanings of the instructions – through which the architect guides the builder – are simultaneously learned throughout interactions . Such flexible teaching – and learning – capabilities are essential to autonomous artificial agents if they are to master an increasing number of skills without extensive human supervision . As a first step toward this research direction , we draw inspiration from the CoCo game and propose the Architect-Builder Problem ( ABP ) : an interactive learning setting that models agents ’ interactions with Markov Decision Processes ( Puterman , 2014 ) ( MDPs ) . In the ABP learning has to occur in a social context through observations and communication , in the absence of direct imitation or reinforcement ( Bandura & Walters , 1977 ) . Specifically , the constraints of the ABP are : ( 1 ) the builder has absolutely no knowledge about the task at hand ( no reward and no prior on the set of possible tasks ) , ( 2 ) the architect can only interact with the builder through communication signals ( can not interact with the environment or provide demonstrations ) , and ( 3 ) the communication signals have no pre-defined meanings ( nor belong to a set of known possible meanings ) . ( 1 ) sets this work apart from Reinforcement Learning ( RL ) and even Multi-Agent RL ( MARL ) where explicit rewards are available to all agents . ( 2 ) implies the absence of tele-operation or third-person demonstrations and thus distinguishes the ABP from Imitation and Inverse Reinforcement Learning ( IRL ) . Finally , ( 3 ) prevents the architect from relying on a fixed communication protocol since the meanings of instructions must be negotiated . These constraints make ABP an appealing setting to investigate Human-Robot Interaction ( HRI ) ( Goodrich & Schultz , 2008 ) problems where “ a learner tries to figure out what a teacher wants them to do ” ( Grizou et al. , 2013 ; Cederborg & Oudeyer , 2014 ) . Specifically , the challenge of Brain Computer Interfaces ( BCI ) , where users use brain signals to control virtual and robotic agents in sequential tasks ( Katyal et al. , 2014 ; deBettencourt et al. , 2015 ; Mishra & Gazzaley , 2015 ; Muñoz-Moldes & Cleeremans , 2020 ; Chiang et al. , 2021 ) , is well captured by the ABP . In BCIs , ( 3 ) is identified as the calibration problem and is usually tackled with supervised learning to learn a mapping between signals and meanings . As this calibration phase is often laborious and impractical for users , current approaches investigate calibration-free solutions where the mapping is learned interactively ( Grizou et al. , 2014 ; Xie et al. , 2021 ) . Yet , these works consider that the user ( i.e . the architect ) is fixed , in the sense that it does not adapt to the agent ( i.e . the builder ) and uses a set of pre-defined instructions ( or feedback ) meanings that the agent must learn to map to signals . In our ABP formulation however , the architect is dynamic and , as interactions unfold , must learn to best guide a learning builder by tuning the meanings of instructions according to the builder ’ s reactions . In that sense , ABP provides a more complete computational model of agent-agent or human-agent interaction . With all these constraints in mind , we propose Architect Builder Iterated Guiding ( ABIG ) , an algorithmic solution to ABP when both agents are AIs . ABIG is inspired by the field of experimental semiotics and relies on two high-level interaction priors : shared intent and interaction frames . Shared intent refers to the fact that , although the builder ignores the objective of the task to fulfill , it will assume that its objective is aligned with the architect ’ s . This assumption is characteristic of cooperative tasks and shown to be a necessary condition for the emergence of communication both in practice ( Foerster et al. , 2016 ; Cao et al. , 2018 ) and in theory ( Crawford & Sobel , 1982 ) . Specifically , the builder should assume that the architect is guiding it towards a shared objective . Knowing this , the builder must reinforce the behavior it displays when guided by the architect . We show that the builder can efficiently implement this by using imitation learning on its own guided behavior . Because the builder imitates itself , we call it self-imitation . The notion of interaction frames ( also called pragmatic frames ) states that agents that interact in sequence can more easily interpret the interaction history ( Bruner , 1985 ; Vollmer et al. , 2016 ) . In ABIG , we consider two distinct interaction frames . These are stationary which means that when one agent learns , the other agent ’ s behavior is fixed . During the first frame ( the modelling frame ) , the builder is fixed and the architect learns a model of the builder ’ s message-conditioned behavior . During the second frame ( the guiding frame ) , the architect is fixed and the builder learns to be guided via self-imitation learning . We show that ABIG results in a low-level , high-frequency , guiding communication protocol that not only enables an architect-builder pair to solve the task at hand , but can also be used to solve unseen tasks . Our contributions are : • The Architect-Builder Problem ( ABP ) , an interactive learning setting to study how artificial agents can simultaneously learn to solve a task and derive a communication protocol . • Architect-Builder Iterated Guiding ( ABIG ) , an algorithmic solution to the ABP . • An analysis of ABIG ’ s key learning mechanisms . • An evaluation of ABIG on a construction environment where we show that ABIG agents evolve communication protocols that generalize to unseen harder tasks . • A detailed analysis of ABIG ’ s learning dynamics and impact on the mutual information between messages and actions ( in the Supplementary Material ) . 2 PROBLEM DEFINITION . The Architect-Builder Problem . We consider a multi-agent setup composed of two agents : an architect and a builder . Both agents observe the environment state s but only the architect knows the goal at hand . The architect can not take actions in the environment but receives the environmental reward r whereas the builder does not receive any reward and has thus no knowledge about the task at hand . In this asymmetrical setup , the architect can only interact with the builder through a communication signal m sampled from its policy π A ( m|s ) . These messages , that have no a priori meanings , are received by the builder which acts according to its policy π B ( a|s , m ) . This makes the environment transition to a new state s′ sampled from P E ( s′|s , a ) and the architect receives reward r′ . Messages are sent at every time-step . The CoCo game that inspired ABP is sketched in Figure 1 ( a ) while the overall architect-builder-environment interaction diagram is given in Figure 1 ( b ) . The differences between the ABP setting and the MARL and IRL settings are illustrated in Figure 8 . BuildWorld . We conduct our experiments in BuildWorld . BuildWorld is a 2D construction gridworld of size ( w × h ) . At the beginning of an episode , the agent and Nb blocks are spawned at different random locations . The agent can navigate in this world and grasp blocks by activating its gripper while on a block . The action space A is discrete and include a “ do nothing ” action ( |A| = 6 ) . At each time step , the agent observes its position in the grid , its gripper state as well as the position of all the blocks and if they are grasped ( |S| = 3 + 3Nb ) . Tasks . BuildWorld contains 4 different training tasks : 1 ) ‘ Grasp ’ : The agent must grasp any of the blocks ; 2 ) ‘ Place ’ : The agent must place any block at a specified location in the grid ; 3/4 ) ‘ H-Line/Vline ’ : The agent must place all the blocks in a horizontal/vertical line configuration . BuildWorld also has a harder fifth testing task , ‘ 6-blocks-shapes ’ , that consists of more complex configurations and that is used to challenge an algorithm ’ s transfer abilities . For all tasks , rewards are sparse and only given when the task is completed . This environment encapsulates the interactive learning challenge of ABP while removing the need for complex perception or locomotion . In the RL setting , where the same agent acts and receives rewards , this environment would not be very impressive . However , it remains to be shown that the tasks can be solved in the setting of ABP ( with a reward-less builder and an action-less architect ) . Communication . The architect guides the builder by sending messages m which are one-hot vectors of size |V| ranging from 2 to 72 , see Suppl . Section B.3 for the impact of this parameter . Additional Assumptions . In order to focus on the architect-builder interactions and the learning of a shared communication protocol , the architect has access to P E ( s′|s , a ) and to the reward function r ( s , a ) of the goal at hand . This assumes that , if the architect were to act in the environment instead of the builder , it would be able to quickly figure out how to solve the task . This assumption is compatible with the CoCo game experiment ( Vollmer et al. , 2014 ) where humans participants , and in particular the architects , are known to have such world models . 3 ABIG : ARCHITECT-BUILDER ITERATED GUIDING . 3.1 ANALYTICAL DESCRIPTION . Agents-MDPs . In the Architect-Builder Problem , agents are operating in different , yet coupled , MDPs . Those MDPs depend on their respective point of view ( see Figure 2 ) . From the point of view of the architect , messages are actions that influence the next state as well as the reward ( see Figure 2 ( a ) ) . The architect knows the environment transition function P E ( s′|s , a ) and r ( s , a ) , the true reward function associated with the task that does not depend explicitly on messages . It can thus derive the effect of its messages on the builder ’ s actions that drive the reward and the next states ( see Figure 2 ( b ) ) . On the other hand , the builder ’ s state is composed of the environment state and the message , which makes estimating state transitions challenging as one must also capture the message dynamics ( see Figure 2 ( c ) ) . Yet , the builder can leverage its knowledge of the architect picking messages based on the current environment state . The equivalent transition and reward models , when available , are given below ( see derivations in Suppl . Section A ) . P A ( s′|s , m ) = ∑ a∈A π̃ B ( a|s , m ) P E ( s′|a , s ) r A ( s , m ) = ∑ a∈A π̃ B ( a|s , m ) r ( s , a ) with π̃B ( a|s , m ) ≜ P ( a|s , m ) ( 1 ) P B ( s′ , m′|s , m , a ) = π̃ A ( m′|s′ ) P E ( s′|s , a ) with π̃ A ( m′|s′ ) ≜ P ( m′|s′ ) ( 2 ) where subscripts A and B refer to the architect and the builder , respectively . x̃ denotes that x is unknown and must be approximated . From the builder ’ s point of view , the reward – denoted r̃ – is unknown . This prevents the use of classical RL algorithms . Shared Intent and Interaction Frames . It follows from Eq . ( 1 ) that , provided that it can approximate the builder ’ s behavior , the architect can compute the reward and transition models of its MDP . It can then use these to derive an optimal message policy π∗ A that would maximize its objective : π∗ A = argmax π A G A = argmax π A E [ ∑ t γtr A , t ] ( 3 ) γ ∈ [ 0,1 ] is a discount factor and the expectation can be thought of in terms of π A , P A and the initial state distribution . However , the expectation can also be though in terms of the corresponding trajectories τ ≜ { ( s , m , a , r ) t } generated by the architect-builder interactions . In other words , when using π∗ A to guide the builder , the architect-builder pair generates trajectories that maximizes G A . The builder has no reward signal to maximize , yet , it relies on a shared intent prior and assumes that its objective is the same as the architect ’ s one : G B = G A = Eτ [ ∑ t γtr A , t ] = Eτ [ ∑ t γtr̃t ] ( 4 ) where the expectations are taken with respect to trajectories τ of architect-builder interactions . Therefore , under the shared intent prior , architect-builder interactions where the architect uses π∗ A to maximize G A also maximize G B . This means that the builder can interpret these interaction trajectories as demonstrations that maximize its unknown reward function r̃ . Consequently , the builder can reinforce the desired behavior – towards which the architect guides it – by performing self-Imitation Learning1 on the interaction trajectories τ . Note that in Eq . ( 1 ) , the architect ’ s models can be interpreted as expectations with respect to the builder ’ s behavior . Similarly , the builder ’ s objective depends on the architect ’ s guiding behavior . This makes one agent ’ s MDP highly non-stationary and the agent must adapts its behavior if the other agent ’ s policy changes . To palliate to this , agents rely on interaction frames which means that , when one agent learns , the other agent ’ s policy is fixed to restore stationarity . The equivalent MDPs for the architect and the builder are respectively M A = ⟨S , V , P A , r A , γ⟩ and M B = ⟨S × V , A , P B , ∅ , γ⟩ . Finally , π A : S 7→ V , P A : S×V 7→ [ 0 , 1 ] , r A : S×V 7→ [ 0 , 1 ] , π B : S×V 7→ A and P B : S ×V ×A 7→ [ 0 , 1 ] where S , A and V are respectively the sets of states , actions and messages . | This paper presents an approach — Architect-Builder Iterated Guiding — a method that tackles what is presented as an “Architect-Builder” problem: a scenario in which two actors, an Architect, with knowledge of a high-level goal, or reward function, must communicate over a discrete channel with a Builder who can take actions in the environment based on the Architect’s message. In many ways this resembles a **hierarchical reinforcement learning** setup, specifically reminiscent of Feudal Reinforcement Learning (“Feudal Reinforcement Learning,” Dayan et. al. NeurIPS 1992). The paper presents a motivated, easy-to-understand algorithm for training both the Architect and the Builder, and evaluate on a series of “construction” based grid-world tasks (resembling GridLU, MiniGrid, or Mazebase). Namely, the proposed approach takes inspiration from Experimental Semiotics and separates learning into separate **interaction frames** (similar again to multi-phase approaches in the Hierarchical RL literature, e.g. in HIRO — “Data Efficient Hierarchical Reinforcement Learning,” Nachum et. al. 2018; https://arxiv.org/abs/1703.01161). These interaction frames consist of a modeling frame, in which the architect learns a model of the builder after “rolling out” and sending messages/watching the builder’s actions, followed by a guiding frame where the architect exploits its model of the builder to produce the “optimal” actions via a heuristic driven Monte Carlo Tree Search (rather than explicitly estimate a value function, which is costly and noisy). Making this all possible is that the architect has full knowledge of the high-level reward, **in addition to the ground-truth state transition function**. This lets the architect explicitly search over messages to send to the builder (as it fully observes the builder’s rollout), then improve the builder by “self-imitating” over this new data, mirroring a bi-phase optimization setup. The evaluation focuses on the proposed model, and two simple ablations: one where the architect has “no-intent” at training, sending random messages, and one in which the builder takes random actions. The paper also presents (in the main body and appendix) a meaningful, thoughtful intuitive explanation of the learning dynamics of the architecture and the builder — more papers should dedicate portions of the main body to explanations such as this! | SP:3afae0ebdb91a5fc850f02a094d23d56970a3826 |
Learning to Guide and to be Guided in the Architect-Builder Problem | 1 INTRODUCTION . Humans are notoriously successful at teaching – and learning from – each others . This enables skills and knowledge to be shared and passed along generations , being progressively refined towards mankind ’ s current state of proficiency . People can teach and be taught in situations where there is no shared language and very little common ground , such as a parent teaching a baby how to stack blocks during play . Experimental Semiotics ( Galantucci & Garrod , 2011 ) , a line of work that ∗Equal contribution . †Work conducted while at Inria . ‡Canada CIFAR AI Chair . studies the forms of communication that people develop when they can not use pre-established ones , reveals that humans can even teach and learn without direct reinforcement signal , demonstrations or a shared communication protocol . Vollmer et al . ( 2014 ) for example investigate a co-construction ( CoCo ) game experiment where an architect must rely only on arbitrary instructions to guide a builder toward constructing a structure . In this experiment , both the task of building the structure and the meanings of the instructions – through which the architect guides the builder – are simultaneously learned throughout interactions . Such flexible teaching – and learning – capabilities are essential to autonomous artificial agents if they are to master an increasing number of skills without extensive human supervision . As a first step toward this research direction , we draw inspiration from the CoCo game and propose the Architect-Builder Problem ( ABP ) : an interactive learning setting that models agents ’ interactions with Markov Decision Processes ( Puterman , 2014 ) ( MDPs ) . In the ABP learning has to occur in a social context through observations and communication , in the absence of direct imitation or reinforcement ( Bandura & Walters , 1977 ) . Specifically , the constraints of the ABP are : ( 1 ) the builder has absolutely no knowledge about the task at hand ( no reward and no prior on the set of possible tasks ) , ( 2 ) the architect can only interact with the builder through communication signals ( can not interact with the environment or provide demonstrations ) , and ( 3 ) the communication signals have no pre-defined meanings ( nor belong to a set of known possible meanings ) . ( 1 ) sets this work apart from Reinforcement Learning ( RL ) and even Multi-Agent RL ( MARL ) where explicit rewards are available to all agents . ( 2 ) implies the absence of tele-operation or third-person demonstrations and thus distinguishes the ABP from Imitation and Inverse Reinforcement Learning ( IRL ) . Finally , ( 3 ) prevents the architect from relying on a fixed communication protocol since the meanings of instructions must be negotiated . These constraints make ABP an appealing setting to investigate Human-Robot Interaction ( HRI ) ( Goodrich & Schultz , 2008 ) problems where “ a learner tries to figure out what a teacher wants them to do ” ( Grizou et al. , 2013 ; Cederborg & Oudeyer , 2014 ) . Specifically , the challenge of Brain Computer Interfaces ( BCI ) , where users use brain signals to control virtual and robotic agents in sequential tasks ( Katyal et al. , 2014 ; deBettencourt et al. , 2015 ; Mishra & Gazzaley , 2015 ; Muñoz-Moldes & Cleeremans , 2020 ; Chiang et al. , 2021 ) , is well captured by the ABP . In BCIs , ( 3 ) is identified as the calibration problem and is usually tackled with supervised learning to learn a mapping between signals and meanings . As this calibration phase is often laborious and impractical for users , current approaches investigate calibration-free solutions where the mapping is learned interactively ( Grizou et al. , 2014 ; Xie et al. , 2021 ) . Yet , these works consider that the user ( i.e . the architect ) is fixed , in the sense that it does not adapt to the agent ( i.e . the builder ) and uses a set of pre-defined instructions ( or feedback ) meanings that the agent must learn to map to signals . In our ABP formulation however , the architect is dynamic and , as interactions unfold , must learn to best guide a learning builder by tuning the meanings of instructions according to the builder ’ s reactions . In that sense , ABP provides a more complete computational model of agent-agent or human-agent interaction . With all these constraints in mind , we propose Architect Builder Iterated Guiding ( ABIG ) , an algorithmic solution to ABP when both agents are AIs . ABIG is inspired by the field of experimental semiotics and relies on two high-level interaction priors : shared intent and interaction frames . Shared intent refers to the fact that , although the builder ignores the objective of the task to fulfill , it will assume that its objective is aligned with the architect ’ s . This assumption is characteristic of cooperative tasks and shown to be a necessary condition for the emergence of communication both in practice ( Foerster et al. , 2016 ; Cao et al. , 2018 ) and in theory ( Crawford & Sobel , 1982 ) . Specifically , the builder should assume that the architect is guiding it towards a shared objective . Knowing this , the builder must reinforce the behavior it displays when guided by the architect . We show that the builder can efficiently implement this by using imitation learning on its own guided behavior . Because the builder imitates itself , we call it self-imitation . The notion of interaction frames ( also called pragmatic frames ) states that agents that interact in sequence can more easily interpret the interaction history ( Bruner , 1985 ; Vollmer et al. , 2016 ) . In ABIG , we consider two distinct interaction frames . These are stationary which means that when one agent learns , the other agent ’ s behavior is fixed . During the first frame ( the modelling frame ) , the builder is fixed and the architect learns a model of the builder ’ s message-conditioned behavior . During the second frame ( the guiding frame ) , the architect is fixed and the builder learns to be guided via self-imitation learning . We show that ABIG results in a low-level , high-frequency , guiding communication protocol that not only enables an architect-builder pair to solve the task at hand , but can also be used to solve unseen tasks . Our contributions are : • The Architect-Builder Problem ( ABP ) , an interactive learning setting to study how artificial agents can simultaneously learn to solve a task and derive a communication protocol . • Architect-Builder Iterated Guiding ( ABIG ) , an algorithmic solution to the ABP . • An analysis of ABIG ’ s key learning mechanisms . • An evaluation of ABIG on a construction environment where we show that ABIG agents evolve communication protocols that generalize to unseen harder tasks . • A detailed analysis of ABIG ’ s learning dynamics and impact on the mutual information between messages and actions ( in the Supplementary Material ) . 2 PROBLEM DEFINITION . The Architect-Builder Problem . We consider a multi-agent setup composed of two agents : an architect and a builder . Both agents observe the environment state s but only the architect knows the goal at hand . The architect can not take actions in the environment but receives the environmental reward r whereas the builder does not receive any reward and has thus no knowledge about the task at hand . In this asymmetrical setup , the architect can only interact with the builder through a communication signal m sampled from its policy π A ( m|s ) . These messages , that have no a priori meanings , are received by the builder which acts according to its policy π B ( a|s , m ) . This makes the environment transition to a new state s′ sampled from P E ( s′|s , a ) and the architect receives reward r′ . Messages are sent at every time-step . The CoCo game that inspired ABP is sketched in Figure 1 ( a ) while the overall architect-builder-environment interaction diagram is given in Figure 1 ( b ) . The differences between the ABP setting and the MARL and IRL settings are illustrated in Figure 8 . BuildWorld . We conduct our experiments in BuildWorld . BuildWorld is a 2D construction gridworld of size ( w × h ) . At the beginning of an episode , the agent and Nb blocks are spawned at different random locations . The agent can navigate in this world and grasp blocks by activating its gripper while on a block . The action space A is discrete and include a “ do nothing ” action ( |A| = 6 ) . At each time step , the agent observes its position in the grid , its gripper state as well as the position of all the blocks and if they are grasped ( |S| = 3 + 3Nb ) . Tasks . BuildWorld contains 4 different training tasks : 1 ) ‘ Grasp ’ : The agent must grasp any of the blocks ; 2 ) ‘ Place ’ : The agent must place any block at a specified location in the grid ; 3/4 ) ‘ H-Line/Vline ’ : The agent must place all the blocks in a horizontal/vertical line configuration . BuildWorld also has a harder fifth testing task , ‘ 6-blocks-shapes ’ , that consists of more complex configurations and that is used to challenge an algorithm ’ s transfer abilities . For all tasks , rewards are sparse and only given when the task is completed . This environment encapsulates the interactive learning challenge of ABP while removing the need for complex perception or locomotion . In the RL setting , where the same agent acts and receives rewards , this environment would not be very impressive . However , it remains to be shown that the tasks can be solved in the setting of ABP ( with a reward-less builder and an action-less architect ) . Communication . The architect guides the builder by sending messages m which are one-hot vectors of size |V| ranging from 2 to 72 , see Suppl . Section B.3 for the impact of this parameter . Additional Assumptions . In order to focus on the architect-builder interactions and the learning of a shared communication protocol , the architect has access to P E ( s′|s , a ) and to the reward function r ( s , a ) of the goal at hand . This assumes that , if the architect were to act in the environment instead of the builder , it would be able to quickly figure out how to solve the task . This assumption is compatible with the CoCo game experiment ( Vollmer et al. , 2014 ) where humans participants , and in particular the architects , are known to have such world models . 3 ABIG : ARCHITECT-BUILDER ITERATED GUIDING . 3.1 ANALYTICAL DESCRIPTION . Agents-MDPs . In the Architect-Builder Problem , agents are operating in different , yet coupled , MDPs . Those MDPs depend on their respective point of view ( see Figure 2 ) . From the point of view of the architect , messages are actions that influence the next state as well as the reward ( see Figure 2 ( a ) ) . The architect knows the environment transition function P E ( s′|s , a ) and r ( s , a ) , the true reward function associated with the task that does not depend explicitly on messages . It can thus derive the effect of its messages on the builder ’ s actions that drive the reward and the next states ( see Figure 2 ( b ) ) . On the other hand , the builder ’ s state is composed of the environment state and the message , which makes estimating state transitions challenging as one must also capture the message dynamics ( see Figure 2 ( c ) ) . Yet , the builder can leverage its knowledge of the architect picking messages based on the current environment state . The equivalent transition and reward models , when available , are given below ( see derivations in Suppl . Section A ) . P A ( s′|s , m ) = ∑ a∈A π̃ B ( a|s , m ) P E ( s′|a , s ) r A ( s , m ) = ∑ a∈A π̃ B ( a|s , m ) r ( s , a ) with π̃B ( a|s , m ) ≜ P ( a|s , m ) ( 1 ) P B ( s′ , m′|s , m , a ) = π̃ A ( m′|s′ ) P E ( s′|s , a ) with π̃ A ( m′|s′ ) ≜ P ( m′|s′ ) ( 2 ) where subscripts A and B refer to the architect and the builder , respectively . x̃ denotes that x is unknown and must be approximated . From the builder ’ s point of view , the reward – denoted r̃ – is unknown . This prevents the use of classical RL algorithms . Shared Intent and Interaction Frames . It follows from Eq . ( 1 ) that , provided that it can approximate the builder ’ s behavior , the architect can compute the reward and transition models of its MDP . It can then use these to derive an optimal message policy π∗ A that would maximize its objective : π∗ A = argmax π A G A = argmax π A E [ ∑ t γtr A , t ] ( 3 ) γ ∈ [ 0,1 ] is a discount factor and the expectation can be thought of in terms of π A , P A and the initial state distribution . However , the expectation can also be though in terms of the corresponding trajectories τ ≜ { ( s , m , a , r ) t } generated by the architect-builder interactions . In other words , when using π∗ A to guide the builder , the architect-builder pair generates trajectories that maximizes G A . The builder has no reward signal to maximize , yet , it relies on a shared intent prior and assumes that its objective is the same as the architect ’ s one : G B = G A = Eτ [ ∑ t γtr A , t ] = Eτ [ ∑ t γtr̃t ] ( 4 ) where the expectations are taken with respect to trajectories τ of architect-builder interactions . Therefore , under the shared intent prior , architect-builder interactions where the architect uses π∗ A to maximize G A also maximize G B . This means that the builder can interpret these interaction trajectories as demonstrations that maximize its unknown reward function r̃ . Consequently , the builder can reinforce the desired behavior – towards which the architect guides it – by performing self-Imitation Learning1 on the interaction trajectories τ . Note that in Eq . ( 1 ) , the architect ’ s models can be interpreted as expectations with respect to the builder ’ s behavior . Similarly , the builder ’ s objective depends on the architect ’ s guiding behavior . This makes one agent ’ s MDP highly non-stationary and the agent must adapts its behavior if the other agent ’ s policy changes . To palliate to this , agents rely on interaction frames which means that , when one agent learns , the other agent ’ s policy is fixed to restore stationarity . The equivalent MDPs for the architect and the builder are respectively M A = ⟨S , V , P A , r A , γ⟩ and M B = ⟨S × V , A , P B , ∅ , γ⟩ . Finally , π A : S 7→ V , P A : S×V 7→ [ 0 , 1 ] , r A : S×V 7→ [ 0 , 1 ] , π B : S×V 7→ A and P B : S ×V ×A 7→ [ 0 , 1 ] where S , A and V are respectively the sets of states , actions and messages . | The paper proposes an approach for interactive learning between a so-called architect and builder agent, which is a different, but related protocol to RL or imitation learning. Under the assumption that the architect knows the target dynamics and reward function, the authors focus on learning the communication between the two parties, such that the builder can solve the MDP. After formalizing the setting in the multi-agent paradigm, where two individual MDPs are defined, the authors propose an algorithm with so-called modelling- and guiding phases. In each phase, architect and builder gather datasets, from which policies are extracted via behaviour cloning and planning. The paper is evaluated on a proposed block environment for the problem and uses a random building agent and combination of random modelling phase with proposed guiding phase as baselines. The results show that the proposed approach is superior wrt the baselines for solving the block environment. In addition, experiments show that the learned communication channel can potentially be reused for solving other tasks. | SP:3afae0ebdb91a5fc850f02a094d23d56970a3826 |
Implicit Bias of MSE Gradient Optimization in Underparameterized Neural Networks | 1 INTRODUCTION . A surprising but well established empirical fact is that neural networks optimized by gradient descent can find solutions to the empirical risk minimization ( ERM ) problem that generalize . This is surprising from an optimization point-of-view because the ERM problem induced by neural networks is nonconvex ( Sontag & Sussmann , 1989 ; 1991 ) and can even be NP-Complete in certain cases ( Blum & Rivest , 1993 ) . Perhaps even more surprising is that the discovered solution can generalize even when the network is able to fit arbitrary labels ( Zhang et al. , 2017 ) , rendering traditional complexity measures such as Rademacher complexity inadequate . How does deep learning succeed in the face of pathological behavior by the standards of classical optimization and statistical learning theory ? Towards addressing generalization , a modern line of thought that has emerged is that gradient descent performs implicit regularization , limiting the solutions one encounters in practice to a favorable subset of the model ’ s full capacity ( see , e.g. , Neyshabur et al. , 2015 ; 2017 ; Gunasekar et al. , 2017 ; Wu et al. , 2017 ) . An empirical observation is that neural networks optimized by gradient descent tend to fit the low frequencies of the target function first , and only pick up the higher frequencies later in training ( Rahaman et al. , 2019 ; Ronen et al. , 2019 ; Basri et al. , 2020 ; Xu et al. , 2019 ) . A closely related theme is gradient descent ’ s bias towards smoothness for regression problems ( Williams et al. , 2019 ; Jin & Montúfar , 2021 ) . For classification problems , in suitable settings gradient descent provably selects max-margin solutions ( Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ) . Gradient descent is not impartial , thus understanding its bias is an important program in modern deep learning . Generalization concerns aside , the fact that gradient descent can succeed in a nonconvex optimization landscape warrants attention on its own . A brilliant insight made by Jacot et al . ( 2018 ) is that in function space the neural network follows a kernel gradient descent with respect to the “ Neural Tangent Kernel ” ( NTK ) . This kernel captures how the parameterization biases the trajectory in function space , an abstraction that allows one to largely ignore parameter space and its complications . This is a profitable point-of-view , but there is a caveat . The NTK still depends on the evolution of the network parameters throughout time , and thus is in general time-dependent and complicated to analyze . However , under appropriate scaling of the parameters in the infinite-width limit it remains constant ( Jacot et al. , 2018 ) . Once the NTK matrix has small enough deviations to remain strictly positive definite throughout training , the optimization dynamics start to become comparable to that of a linear model ( Lee et al. , 2019 ) . For wide networks ( quadratic or higher polynomial dependence on the number of training data samples n and other parameters ) this property holds and this has been used by a variety of works to prove global convergence guarantees for the optimization ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Dukler et al. , 2020 ) 1 and to characterize the solution throughout time ( Arora et al. , 2019 ; Basri et al. , 2020 ) . The NTK has been so heavily exploited in this setting that it has become synonymous with polynomially wide networks where the NTK is strictly positive definite throughout training . This begs the question , to what extent is the NTK informative outside this regime ? While the NTK has hitherto been associated with the heavily overparameterized regime , we demonstrate that refined analysis is possible in the underparameterized setting . Our theorems primarily concern a one-hidden layer network , however unlike many NTK results appearing in the literature our network has biases and both layers are trained . In fact , the machinery we build is strong enough to extend some existing results in the overparameterized regime appearing in the literature to the case of training both layers . 1.1 RELATED WORK . There has been a deluge of works on the Neural Tangent Kernel since it was introduced by Jacot et al . ( 2018 ) , and thus we do our best to provide a partial list . Global convergence guarantees for the optimization , and to a lesser extent generalization , for networks polynomially wide in the number of training samples n and other parameters has been addressed in several works ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Arora et al. , 2019 ) . To our knowledge , for the regression problem with arbitrary labels , quadratic overparameterization m & n2 is state-of-the art ( Oymak & Soltanolkotabi , 2020 ; Song & Yang , 2020 ; Nguyen & Mondelli , 2020 ) . E et al . ( 2020 ) gave a fairly comprehensive study of optimization and generalization of shallow networks trained under the standard parameterization . Under the standard parameterization , changes in the outer layer weights are more significant , whereas under the NTK parameterization both layers have roughly equal effect . Since we study the NTK parameterization in this work , we view the analysis as complementary . Our work is perhaps most closely connected with Arora et al . ( 2019 ) . In Theorem 4.1 in that work they showed that for a shallow network in the polynomially overparameterized regime m & n7 , the training error along eigendirections of the NTK matrix decay linearly at rates that correspond to their eigenvalues . Our main Theorem 3.5 can be viewed as an analogous statement for the actual risk ( not the empirical risk ) in the underparameterized regime : eigenfunctions of the NTK integral operator TK∞ are approximately learned linearly at rates that correspond to their eigenvalues . In contrast with Arora et al . ( 2019 ) , we have that the requirements on width m and number of samples n required to learn eigenfunctions with large eigenvalues are smaller compared to those with small eigenvalues . Surprisingly the machinery we build is also strong enough to prove in our setting the direct analog of Theorem 4.1 . Note that Arora et al . ( 2019 ) train the hidden layer of a ReLU network via gradient descent , whereas we are training both layers with biases for a network with smooth activations via gradient flow . Due to the different settings , the results are not directly comparable . This important detail notwithstanding , our overparameterization requirement ignoring logarithmic factors is smaller by a factor of n 2 dδ4 where n is the number of input samples , d is the input dimension , and δ is the failure probability . Basri et al . ( 2020 ) extended Theorem 4.1 in Arora et al . ( 2019 ) to deep ReLU networks without bias where the first and last layer are fixed , with a higher overparameterization requirement than the original ( Arora et al. , 2019 ) . Since the first and last layers are fixed this can not be specialized to get a guarantee for training both layers of a shallow network even with ReLU activations . Although it was not our focus , the tools to prove Theorem 3.5 are enough to prove analogs of Theorem 4 and Corollary 2 in the work of Su & Yang ( 2019 ) . Theorem 4 and Corollary 2 of Su & Yang ( 2019 ) are empirical risk guarantees that show that for target functions that participate mostly in the top eigendirections of the NTK integral operator TK∞ , moderate overparameterization is possible . Again in this work they train the hidden layer of a ReLU network via gradient descent , 1Not all these works explicitly use that the NTK is positive definite . However , they all operate in the regime where the weights do not vary much and thus are typically associated with the NTK regime . whereas we are training both layers with biases for a network with smooth activations via gradient flow . Again due to the different settings , we emphasize the results are not directly comparable . In our results the bounds and requirements are comparable to Su & Yang ( 2019 ) , with neither appearing better . Nevertheless we think it is important to demonstrate that these results hold for training both layers with biases , and we hope our “ Damped Deviations ” approach will simplify the interpretation of the aforementioned works . Cao et al . ( 2020 , Theorem 4.2 ) provide an analogous statement to our Theorem 3.5 if you replace our quantities with their empirical counterparts . While our statement concerns the projections of the test residual onto the eigenfunctions of an operator associated with the Neural Tangent Kernel , their statement concerns the inner products of the empirical residual with those eigenfunctions . Their work was a crucial step towards explaining the spectral bias from gradient descent , however we view the difference between tracking the empirical quantities versus the actual quantities to be highly nontrivial . Another difference is they consider a ReLU network whereas we consider smooth activations ; also they consider gradient descent versus we consider gradient flow . Due to the different settings we would like to emphasize that the scalings of the different parameters are not directly comparable , nevertheless the networks they consider are significantly wider . They require at least m ≥ Õ ( max { σ−14k , −6 } ) , where σk is a cutoff eigenvalue and is the error tolerance . By contrast in our work , to have the projection onto the top k eigenvectors be bounded by epsilon in L2 norm requires m = Ω̃ ( σ−4k −2 ) . Another detail is their network has no bias whereas ours does . 1.2 OUR CONTRIBUTIONS . The key idea for our work is the concept of “ Damped Deviatons ” , the fact that for the squared error deviations of the NTK are softened by a damping factor , with large eigendirections being damped the most . This enables the following results . • In Theorem 3.5 we characterize the bias of the neural network to learn the eigenfunctions of the integral operator TK∞ associated with the Neural Tangent Kernel ( NTK ) at rates proportional to the corresponding eigenvalues . • In Theorem 3.7 we show that in the overparameterized setting the training error along different directions can be sharply characterized , showing that Theorem 4.1 in Arora et al . ( 2019 ) holds for smooth activations when training both layers with a smaller overparameterization requirement . • In Theorem 3.8 and Corollary 3.9 we show that moderate overparameterization is sufficient for solving the ERM problem when the target function has a compact representation in terms of eigenfunctions of TK∞ . This extends the results in Su & Yang ( 2019 ) to the setting of training both layers with smooth activations . 2 GRADIENT DYNAMICS AND DAMPED DEVIATIONS . 2.1 NOTATIONS . We will use ‖•‖2 and 〈• , •〉2 to denote the L2 norm and inner product respectively ( for vectors or for functions depending on context ) . For a symmetric matrix A ∈ Rk×k , λi ( A ) denotes its ith largest eigenvalue , i.e . λ1 ( A ) ≥ λ2 ( A ) ≥ · · · ≥ λk ( A ) . For a matrix A , ‖A‖op : = sup‖x‖2≤1 ‖Ax‖2 is the operator norm induced by the Euclidean norm . We will let 〈• , •〉Rn denote the standard inner product on Rn normalized by 1n , namely 〈x , y〉Rn = 1 n 〈x , y〉2 = 1 n ∑n i=1 xiyi . We will let ‖x‖Rn = √ 〈x , x〉Rn be the associated norm . This normalized inner product has the convenient property that if v ∈ Rn such that vi = O ( 1 ) for each i then ‖v‖Rn = O ( 1 ) , where by contrast ‖v‖2 = O ( √ n ) . This is convenient as we will often consider what happens when n → ∞ . ‖•‖∞ will denote the supremum norm with associated space L∞ . We will use the standard big O and Ω notation with Õ and Ω̃ hiding logarithmic terms . | This work studies the implicit bias of optimizing underparametrized neural networks with MSE loss function and establishes upper-bounds on the training error. One of the takeaways of the paper is that under-parametrized neural networks first learn the most important eigenfunctions associated with the NTK integral operator. This is what the work posits as the implicit bias of gradient-descent in this setting. A key tool developed in the paper is the concept of damped deviations, where in the evolution of MSe w.r.t to one kernel is related to that of another kernel and the damped "distance" between these kernels. As a byproduct, the paper uses this tool to extend certain results in the literature in the over-parametrized setting. | SP:0eafd08b742945d320e4ece59ecc01a4cfc3afa9 |
Implicit Bias of MSE Gradient Optimization in Underparameterized Neural Networks | 1 INTRODUCTION . A surprising but well established empirical fact is that neural networks optimized by gradient descent can find solutions to the empirical risk minimization ( ERM ) problem that generalize . This is surprising from an optimization point-of-view because the ERM problem induced by neural networks is nonconvex ( Sontag & Sussmann , 1989 ; 1991 ) and can even be NP-Complete in certain cases ( Blum & Rivest , 1993 ) . Perhaps even more surprising is that the discovered solution can generalize even when the network is able to fit arbitrary labels ( Zhang et al. , 2017 ) , rendering traditional complexity measures such as Rademacher complexity inadequate . How does deep learning succeed in the face of pathological behavior by the standards of classical optimization and statistical learning theory ? Towards addressing generalization , a modern line of thought that has emerged is that gradient descent performs implicit regularization , limiting the solutions one encounters in practice to a favorable subset of the model ’ s full capacity ( see , e.g. , Neyshabur et al. , 2015 ; 2017 ; Gunasekar et al. , 2017 ; Wu et al. , 2017 ) . An empirical observation is that neural networks optimized by gradient descent tend to fit the low frequencies of the target function first , and only pick up the higher frequencies later in training ( Rahaman et al. , 2019 ; Ronen et al. , 2019 ; Basri et al. , 2020 ; Xu et al. , 2019 ) . A closely related theme is gradient descent ’ s bias towards smoothness for regression problems ( Williams et al. , 2019 ; Jin & Montúfar , 2021 ) . For classification problems , in suitable settings gradient descent provably selects max-margin solutions ( Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ) . Gradient descent is not impartial , thus understanding its bias is an important program in modern deep learning . Generalization concerns aside , the fact that gradient descent can succeed in a nonconvex optimization landscape warrants attention on its own . A brilliant insight made by Jacot et al . ( 2018 ) is that in function space the neural network follows a kernel gradient descent with respect to the “ Neural Tangent Kernel ” ( NTK ) . This kernel captures how the parameterization biases the trajectory in function space , an abstraction that allows one to largely ignore parameter space and its complications . This is a profitable point-of-view , but there is a caveat . The NTK still depends on the evolution of the network parameters throughout time , and thus is in general time-dependent and complicated to analyze . However , under appropriate scaling of the parameters in the infinite-width limit it remains constant ( Jacot et al. , 2018 ) . Once the NTK matrix has small enough deviations to remain strictly positive definite throughout training , the optimization dynamics start to become comparable to that of a linear model ( Lee et al. , 2019 ) . For wide networks ( quadratic or higher polynomial dependence on the number of training data samples n and other parameters ) this property holds and this has been used by a variety of works to prove global convergence guarantees for the optimization ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Dukler et al. , 2020 ) 1 and to characterize the solution throughout time ( Arora et al. , 2019 ; Basri et al. , 2020 ) . The NTK has been so heavily exploited in this setting that it has become synonymous with polynomially wide networks where the NTK is strictly positive definite throughout training . This begs the question , to what extent is the NTK informative outside this regime ? While the NTK has hitherto been associated with the heavily overparameterized regime , we demonstrate that refined analysis is possible in the underparameterized setting . Our theorems primarily concern a one-hidden layer network , however unlike many NTK results appearing in the literature our network has biases and both layers are trained . In fact , the machinery we build is strong enough to extend some existing results in the overparameterized regime appearing in the literature to the case of training both layers . 1.1 RELATED WORK . There has been a deluge of works on the Neural Tangent Kernel since it was introduced by Jacot et al . ( 2018 ) , and thus we do our best to provide a partial list . Global convergence guarantees for the optimization , and to a lesser extent generalization , for networks polynomially wide in the number of training samples n and other parameters has been addressed in several works ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Arora et al. , 2019 ) . To our knowledge , for the regression problem with arbitrary labels , quadratic overparameterization m & n2 is state-of-the art ( Oymak & Soltanolkotabi , 2020 ; Song & Yang , 2020 ; Nguyen & Mondelli , 2020 ) . E et al . ( 2020 ) gave a fairly comprehensive study of optimization and generalization of shallow networks trained under the standard parameterization . Under the standard parameterization , changes in the outer layer weights are more significant , whereas under the NTK parameterization both layers have roughly equal effect . Since we study the NTK parameterization in this work , we view the analysis as complementary . Our work is perhaps most closely connected with Arora et al . ( 2019 ) . In Theorem 4.1 in that work they showed that for a shallow network in the polynomially overparameterized regime m & n7 , the training error along eigendirections of the NTK matrix decay linearly at rates that correspond to their eigenvalues . Our main Theorem 3.5 can be viewed as an analogous statement for the actual risk ( not the empirical risk ) in the underparameterized regime : eigenfunctions of the NTK integral operator TK∞ are approximately learned linearly at rates that correspond to their eigenvalues . In contrast with Arora et al . ( 2019 ) , we have that the requirements on width m and number of samples n required to learn eigenfunctions with large eigenvalues are smaller compared to those with small eigenvalues . Surprisingly the machinery we build is also strong enough to prove in our setting the direct analog of Theorem 4.1 . Note that Arora et al . ( 2019 ) train the hidden layer of a ReLU network via gradient descent , whereas we are training both layers with biases for a network with smooth activations via gradient flow . Due to the different settings , the results are not directly comparable . This important detail notwithstanding , our overparameterization requirement ignoring logarithmic factors is smaller by a factor of n 2 dδ4 where n is the number of input samples , d is the input dimension , and δ is the failure probability . Basri et al . ( 2020 ) extended Theorem 4.1 in Arora et al . ( 2019 ) to deep ReLU networks without bias where the first and last layer are fixed , with a higher overparameterization requirement than the original ( Arora et al. , 2019 ) . Since the first and last layers are fixed this can not be specialized to get a guarantee for training both layers of a shallow network even with ReLU activations . Although it was not our focus , the tools to prove Theorem 3.5 are enough to prove analogs of Theorem 4 and Corollary 2 in the work of Su & Yang ( 2019 ) . Theorem 4 and Corollary 2 of Su & Yang ( 2019 ) are empirical risk guarantees that show that for target functions that participate mostly in the top eigendirections of the NTK integral operator TK∞ , moderate overparameterization is possible . Again in this work they train the hidden layer of a ReLU network via gradient descent , 1Not all these works explicitly use that the NTK is positive definite . However , they all operate in the regime where the weights do not vary much and thus are typically associated with the NTK regime . whereas we are training both layers with biases for a network with smooth activations via gradient flow . Again due to the different settings , we emphasize the results are not directly comparable . In our results the bounds and requirements are comparable to Su & Yang ( 2019 ) , with neither appearing better . Nevertheless we think it is important to demonstrate that these results hold for training both layers with biases , and we hope our “ Damped Deviations ” approach will simplify the interpretation of the aforementioned works . Cao et al . ( 2020 , Theorem 4.2 ) provide an analogous statement to our Theorem 3.5 if you replace our quantities with their empirical counterparts . While our statement concerns the projections of the test residual onto the eigenfunctions of an operator associated with the Neural Tangent Kernel , their statement concerns the inner products of the empirical residual with those eigenfunctions . Their work was a crucial step towards explaining the spectral bias from gradient descent , however we view the difference between tracking the empirical quantities versus the actual quantities to be highly nontrivial . Another difference is they consider a ReLU network whereas we consider smooth activations ; also they consider gradient descent versus we consider gradient flow . Due to the different settings we would like to emphasize that the scalings of the different parameters are not directly comparable , nevertheless the networks they consider are significantly wider . They require at least m ≥ Õ ( max { σ−14k , −6 } ) , where σk is a cutoff eigenvalue and is the error tolerance . By contrast in our work , to have the projection onto the top k eigenvectors be bounded by epsilon in L2 norm requires m = Ω̃ ( σ−4k −2 ) . Another detail is their network has no bias whereas ours does . 1.2 OUR CONTRIBUTIONS . The key idea for our work is the concept of “ Damped Deviatons ” , the fact that for the squared error deviations of the NTK are softened by a damping factor , with large eigendirections being damped the most . This enables the following results . • In Theorem 3.5 we characterize the bias of the neural network to learn the eigenfunctions of the integral operator TK∞ associated with the Neural Tangent Kernel ( NTK ) at rates proportional to the corresponding eigenvalues . • In Theorem 3.7 we show that in the overparameterized setting the training error along different directions can be sharply characterized , showing that Theorem 4.1 in Arora et al . ( 2019 ) holds for smooth activations when training both layers with a smaller overparameterization requirement . • In Theorem 3.8 and Corollary 3.9 we show that moderate overparameterization is sufficient for solving the ERM problem when the target function has a compact representation in terms of eigenfunctions of TK∞ . This extends the results in Su & Yang ( 2019 ) to the setting of training both layers with smooth activations . 2 GRADIENT DYNAMICS AND DAMPED DEVIATIONS . 2.1 NOTATIONS . We will use ‖•‖2 and 〈• , •〉2 to denote the L2 norm and inner product respectively ( for vectors or for functions depending on context ) . For a symmetric matrix A ∈ Rk×k , λi ( A ) denotes its ith largest eigenvalue , i.e . λ1 ( A ) ≥ λ2 ( A ) ≥ · · · ≥ λk ( A ) . For a matrix A , ‖A‖op : = sup‖x‖2≤1 ‖Ax‖2 is the operator norm induced by the Euclidean norm . We will let 〈• , •〉Rn denote the standard inner product on Rn normalized by 1n , namely 〈x , y〉Rn = 1 n 〈x , y〉2 = 1 n ∑n i=1 xiyi . We will let ‖x‖Rn = √ 〈x , x〉Rn be the associated norm . This normalized inner product has the convenient property that if v ∈ Rn such that vi = O ( 1 ) for each i then ‖v‖Rn = O ( 1 ) , where by contrast ‖v‖2 = O ( √ n ) . This is convenient as we will often consider what happens when n → ∞ . ‖•‖∞ will denote the supremum norm with associated space L∞ . We will use the standard big O and Ω notation with Õ and Ω̃ hiding logarithmic terms . | In this paper, the authors study gradient flow on the empirical squared loss. More specifically, they consider the evolution in function space of the residuals and show that it can be written as the sum of 1) the residual obtained by training with the NTK operator (infinite width and samples, no training of the kernel), and 2) damped deviations between time dependent kernel matrix and the NTK operator. Based on this decomposition and a uniform deviation bound on the NTK, they show that 1) in the underparametrized regime, GD at the beginning of the dynamics learn eigenfunctions of NTK at rates proportional to the corresponding eigenvalues; 2) in the overparametrized regime, they derive new bounds for the `kernel regime’ to appear; 3) in the overparametrized regime, if we further assume that the target function is aligned with the top eigenvectors of the NTK, then a milder overparametrization is required. | SP:0eafd08b742945d320e4ece59ecc01a4cfc3afa9 |
Implicit Bias of MSE Gradient Optimization in Underparameterized Neural Networks | 1 INTRODUCTION . A surprising but well established empirical fact is that neural networks optimized by gradient descent can find solutions to the empirical risk minimization ( ERM ) problem that generalize . This is surprising from an optimization point-of-view because the ERM problem induced by neural networks is nonconvex ( Sontag & Sussmann , 1989 ; 1991 ) and can even be NP-Complete in certain cases ( Blum & Rivest , 1993 ) . Perhaps even more surprising is that the discovered solution can generalize even when the network is able to fit arbitrary labels ( Zhang et al. , 2017 ) , rendering traditional complexity measures such as Rademacher complexity inadequate . How does deep learning succeed in the face of pathological behavior by the standards of classical optimization and statistical learning theory ? Towards addressing generalization , a modern line of thought that has emerged is that gradient descent performs implicit regularization , limiting the solutions one encounters in practice to a favorable subset of the model ’ s full capacity ( see , e.g. , Neyshabur et al. , 2015 ; 2017 ; Gunasekar et al. , 2017 ; Wu et al. , 2017 ) . An empirical observation is that neural networks optimized by gradient descent tend to fit the low frequencies of the target function first , and only pick up the higher frequencies later in training ( Rahaman et al. , 2019 ; Ronen et al. , 2019 ; Basri et al. , 2020 ; Xu et al. , 2019 ) . A closely related theme is gradient descent ’ s bias towards smoothness for regression problems ( Williams et al. , 2019 ; Jin & Montúfar , 2021 ) . For classification problems , in suitable settings gradient descent provably selects max-margin solutions ( Soudry et al. , 2018 ; Ji & Telgarsky , 2019 ) . Gradient descent is not impartial , thus understanding its bias is an important program in modern deep learning . Generalization concerns aside , the fact that gradient descent can succeed in a nonconvex optimization landscape warrants attention on its own . A brilliant insight made by Jacot et al . ( 2018 ) is that in function space the neural network follows a kernel gradient descent with respect to the “ Neural Tangent Kernel ” ( NTK ) . This kernel captures how the parameterization biases the trajectory in function space , an abstraction that allows one to largely ignore parameter space and its complications . This is a profitable point-of-view , but there is a caveat . The NTK still depends on the evolution of the network parameters throughout time , and thus is in general time-dependent and complicated to analyze . However , under appropriate scaling of the parameters in the infinite-width limit it remains constant ( Jacot et al. , 2018 ) . Once the NTK matrix has small enough deviations to remain strictly positive definite throughout training , the optimization dynamics start to become comparable to that of a linear model ( Lee et al. , 2019 ) . For wide networks ( quadratic or higher polynomial dependence on the number of training data samples n and other parameters ) this property holds and this has been used by a variety of works to prove global convergence guarantees for the optimization ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Dukler et al. , 2020 ) 1 and to characterize the solution throughout time ( Arora et al. , 2019 ; Basri et al. , 2020 ) . The NTK has been so heavily exploited in this setting that it has become synonymous with polynomially wide networks where the NTK is strictly positive definite throughout training . This begs the question , to what extent is the NTK informative outside this regime ? While the NTK has hitherto been associated with the heavily overparameterized regime , we demonstrate that refined analysis is possible in the underparameterized setting . Our theorems primarily concern a one-hidden layer network , however unlike many NTK results appearing in the literature our network has biases and both layers are trained . In fact , the machinery we build is strong enough to extend some existing results in the overparameterized regime appearing in the literature to the case of training both layers . 1.1 RELATED WORK . There has been a deluge of works on the Neural Tangent Kernel since it was introduced by Jacot et al . ( 2018 ) , and thus we do our best to provide a partial list . Global convergence guarantees for the optimization , and to a lesser extent generalization , for networks polynomially wide in the number of training samples n and other parameters has been addressed in several works ( Du et al. , 2019b ; Oymak & Soltanolkotabi , 2020 ; Du et al. , 2019a ; Allen-Zhu et al. , 2019a ; b ; Zou et al. , 2020 ; Zou & Gu , 2019 ; Song & Yang , 2020 ; Arora et al. , 2019 ) . To our knowledge , for the regression problem with arbitrary labels , quadratic overparameterization m & n2 is state-of-the art ( Oymak & Soltanolkotabi , 2020 ; Song & Yang , 2020 ; Nguyen & Mondelli , 2020 ) . E et al . ( 2020 ) gave a fairly comprehensive study of optimization and generalization of shallow networks trained under the standard parameterization . Under the standard parameterization , changes in the outer layer weights are more significant , whereas under the NTK parameterization both layers have roughly equal effect . Since we study the NTK parameterization in this work , we view the analysis as complementary . Our work is perhaps most closely connected with Arora et al . ( 2019 ) . In Theorem 4.1 in that work they showed that for a shallow network in the polynomially overparameterized regime m & n7 , the training error along eigendirections of the NTK matrix decay linearly at rates that correspond to their eigenvalues . Our main Theorem 3.5 can be viewed as an analogous statement for the actual risk ( not the empirical risk ) in the underparameterized regime : eigenfunctions of the NTK integral operator TK∞ are approximately learned linearly at rates that correspond to their eigenvalues . In contrast with Arora et al . ( 2019 ) , we have that the requirements on width m and number of samples n required to learn eigenfunctions with large eigenvalues are smaller compared to those with small eigenvalues . Surprisingly the machinery we build is also strong enough to prove in our setting the direct analog of Theorem 4.1 . Note that Arora et al . ( 2019 ) train the hidden layer of a ReLU network via gradient descent , whereas we are training both layers with biases for a network with smooth activations via gradient flow . Due to the different settings , the results are not directly comparable . This important detail notwithstanding , our overparameterization requirement ignoring logarithmic factors is smaller by a factor of n 2 dδ4 where n is the number of input samples , d is the input dimension , and δ is the failure probability . Basri et al . ( 2020 ) extended Theorem 4.1 in Arora et al . ( 2019 ) to deep ReLU networks without bias where the first and last layer are fixed , with a higher overparameterization requirement than the original ( Arora et al. , 2019 ) . Since the first and last layers are fixed this can not be specialized to get a guarantee for training both layers of a shallow network even with ReLU activations . Although it was not our focus , the tools to prove Theorem 3.5 are enough to prove analogs of Theorem 4 and Corollary 2 in the work of Su & Yang ( 2019 ) . Theorem 4 and Corollary 2 of Su & Yang ( 2019 ) are empirical risk guarantees that show that for target functions that participate mostly in the top eigendirections of the NTK integral operator TK∞ , moderate overparameterization is possible . Again in this work they train the hidden layer of a ReLU network via gradient descent , 1Not all these works explicitly use that the NTK is positive definite . However , they all operate in the regime where the weights do not vary much and thus are typically associated with the NTK regime . whereas we are training both layers with biases for a network with smooth activations via gradient flow . Again due to the different settings , we emphasize the results are not directly comparable . In our results the bounds and requirements are comparable to Su & Yang ( 2019 ) , with neither appearing better . Nevertheless we think it is important to demonstrate that these results hold for training both layers with biases , and we hope our “ Damped Deviations ” approach will simplify the interpretation of the aforementioned works . Cao et al . ( 2020 , Theorem 4.2 ) provide an analogous statement to our Theorem 3.5 if you replace our quantities with their empirical counterparts . While our statement concerns the projections of the test residual onto the eigenfunctions of an operator associated with the Neural Tangent Kernel , their statement concerns the inner products of the empirical residual with those eigenfunctions . Their work was a crucial step towards explaining the spectral bias from gradient descent , however we view the difference between tracking the empirical quantities versus the actual quantities to be highly nontrivial . Another difference is they consider a ReLU network whereas we consider smooth activations ; also they consider gradient descent versus we consider gradient flow . Due to the different settings we would like to emphasize that the scalings of the different parameters are not directly comparable , nevertheless the networks they consider are significantly wider . They require at least m ≥ Õ ( max { σ−14k , −6 } ) , where σk is a cutoff eigenvalue and is the error tolerance . By contrast in our work , to have the projection onto the top k eigenvectors be bounded by epsilon in L2 norm requires m = Ω̃ ( σ−4k −2 ) . Another detail is their network has no bias whereas ours does . 1.2 OUR CONTRIBUTIONS . The key idea for our work is the concept of “ Damped Deviatons ” , the fact that for the squared error deviations of the NTK are softened by a damping factor , with large eigendirections being damped the most . This enables the following results . • In Theorem 3.5 we characterize the bias of the neural network to learn the eigenfunctions of the integral operator TK∞ associated with the Neural Tangent Kernel ( NTK ) at rates proportional to the corresponding eigenvalues . • In Theorem 3.7 we show that in the overparameterized setting the training error along different directions can be sharply characterized , showing that Theorem 4.1 in Arora et al . ( 2019 ) holds for smooth activations when training both layers with a smaller overparameterization requirement . • In Theorem 3.8 and Corollary 3.9 we show that moderate overparameterization is sufficient for solving the ERM problem when the target function has a compact representation in terms of eigenfunctions of TK∞ . This extends the results in Su & Yang ( 2019 ) to the setting of training both layers with smooth activations . 2 GRADIENT DYNAMICS AND DAMPED DEVIATIONS . 2.1 NOTATIONS . We will use ‖•‖2 and 〈• , •〉2 to denote the L2 norm and inner product respectively ( for vectors or for functions depending on context ) . For a symmetric matrix A ∈ Rk×k , λi ( A ) denotes its ith largest eigenvalue , i.e . λ1 ( A ) ≥ λ2 ( A ) ≥ · · · ≥ λk ( A ) . For a matrix A , ‖A‖op : = sup‖x‖2≤1 ‖Ax‖2 is the operator norm induced by the Euclidean norm . We will let 〈• , •〉Rn denote the standard inner product on Rn normalized by 1n , namely 〈x , y〉Rn = 1 n 〈x , y〉2 = 1 n ∑n i=1 xiyi . We will let ‖x‖Rn = √ 〈x , x〉Rn be the associated norm . This normalized inner product has the convenient property that if v ∈ Rn such that vi = O ( 1 ) for each i then ‖v‖Rn = O ( 1 ) , where by contrast ‖v‖2 = O ( √ n ) . This is convenient as we will often consider what happens when n → ∞ . ‖•‖∞ will denote the supremum norm with associated space L∞ . We will use the standard big O and Ω notation with Õ and Ω̃ hiding logarithmic terms . | In the paper under review, the authors study the behaviour of gradient flow in the kernel regime of one hidden layer neural networks. More precisely, they show deviations bounds on the test error w.r.t. the true NTK gradient flow in the underparametrized regime and train error bounds in the overparametrized regime. | SP:0eafd08b742945d320e4ece59ecc01a4cfc3afa9 |
Generative Pseudo-Inverse Memory | 1 INTRODUCTION . Memory is central to intelligence by facilitating information compression , reconstruction , manipulation , and generation . The processing speed and storage capacity of the working memory are known to correlate with reasoning capacity ( Jensen and Munro , 1979 ; Kyllonen and Christal , 1990 ) . Recent work in machine learning has explored slot-based external memory to augment neural networks ( Graves et al. , 2016 ; Le et al. , 2019 ) in which memory reads and writes proceed sequentially through attention mechanism , making training and pattern retrieval difficult for very long sequences . Global self-attention techniques ( Ramsauer et al. , 2021 ) create short-cuts in information paths , hence are easier to train , but require large memory and computation for long sequences . Different from slot-based memories , Kanerva Machines ( Wu et al. , 2018a ; b ) are a class of generative memory inspired by Kanerva ’ s sparse distributed memory ( Kanerva , 1984 ) . Here memory update/retrieval and addressing mechanism are treated as Bayesian inference where posteriors are updated when a new data episode arrives . This iterative and dynamic inference handles noisy inputs better due to the convergence of the attractor dynamics to fixed points ( Wu et al. , 2018b ) . However , these models suffer from slow processing speed , which originates from the sequential writing mechanism . This slowness prevents the model to adapt to large batch of data , thus makes it difficult to conduct experiments on memory storage capacity . On the other side , one can not ensure theoretically how well those models retrieve information . This creates an obstacle for theoretical research on the efficiency of memory models . To overcome these challenges we propose a new model called Generative Pseudo-Inverse Memory ( GPM ) , which is illustrated in Fig . 1 . GPM reformulates the Bayesian updates of memory and address as finding least-square solutions to linear systems . Among these solutions , the smallest norm is found through applying the Moore-Penrose pseudo-inverse of matrices ( Ben-Israel and Greville , 2001 ) . This helps us achieve rapid and accurate memory read/write . Moreover , our model is able to not only store and retrieve information perfectly under ideal conditions but also generate new samples based on written data . This coincides with recent inspiring results from functional neuroimaging ( Addis et al. , 2007 ; Okuda et al. , 2003 ; Schacter et al. , 2012 ) , which showed that memory not only helps us memorize but also supports imagining . We derive an energy function for GPM and show that its updates seek to locate local minima of the energy . This dynamic enables GPM to perform iterative reading to improve sample quality during denoising and generating . Finally , GPM can store a large amount of data ( up to a dataset ) while still maintaining key capabilities . We validate these theoretical insights through a comprehensive suite of experiments on binarized MNIST ( LeCun et al. , 2010 ) , binarized Omniglot ( Burda et al. , 2016 ) , FashionMNIST ( Xiao et al. , 2017 ) , CIFAR10 & CIFAR100 ( Krizhevsky , 2009 ) and CelebA ( Liu et al. , 2015 ) , demonstrating superior results . 2 MODEL . Consider a data episode of length T and let X denote the episode data matrix of T rows , where the i-th row of X is the i-th item of the episode . Throughout this paper , we refer to the episode as its associated episode matrix . We aim to compress the episode into a fixed-size memory for later reconstruction and generation processes . We maintain a memory matrix M , which is a deterministic real matrix of size K × C with trainable initialization M0 . For convention , M0 may be considered as the common prior memory containing information of the whole dataset while M is the posterior memory dependent on the episode . Remark . In this paper , we reuse classical terms `` prior memory '' and `` posterior memory '' , which are frequently used in prior works where the memory is modeled as a distribution . In this paper , however , we only consider deterministic memories with an exception when we introduce the optimization problem corresponding to the Bayesian inference ( Eq . ( 3 ) ) . Hence , “ prior memory ” and “ posterior memory ” should be interpreted as the memory before and after data arrive , respectively . In order to write to and read from the memory , we additionally define the writing weight matrix W0 and reading weight matrix1 W , both of size T ×K . We treat the reading weight W as a random variable , hence inducing the generative capability of the model . For simplicity , the prior p ( vec ( W ) ) of W is the standard Gaussian N ( 0 , IT×K ) while the posterior q ( vec ( W ) ) is N ( W , σ2WIT×K ) , where the mean W is adapted to each episode and σW is a learnable parameter . Read-outs from the memory are matrix products between the reading weight and the posterior memory . Let eθ ( . ) be the ( neural ) encoder and dθ ( . ) be the decoder parameterized by θ . In the following we drop the explicit subscript θ for clarity . We further let Z denote the T × C encoding matrix of the episode X , i.e . Z = e ( X ) where e ( . ) is applied to each row of X . During training , the model can only observe a noisy version of Z , which we denote by Zξ . Specifically , Zξ=Z + ξ , where ξ∼ N ( 0 , σ2ξI ) is the observation noise . We assume that the observed data Zξ depends linearly on the 1We note that weights here are dynamic and unrelated to neural network parameters . The term “ dynamic ” means the writing/reading weights of an input not only depend on its own but also the episode it belongs to . weights and the memories : Zξ = W0M0 and Zξ = WM , which we refer as linear assumptions over Zξ . 2.1 OBJECTIVE FUNCTION . Given the memory M , we aim to maximize the conditional log-likelihood ln p ( X|M ) . It is difficult to maximize ln p ( X|M ) directly , so we instead maximize its evidence lower bound L , where L = Eq ( W ) ln p ( X|W , M ) −DKL ( q ( W ) ||p ( W ) ) . ( 1 ) The first term in L is usually called the negative reconstruction loss , while the second term is the Kullback-Leibler divergence between the posterior q ( W ) and the prior p ( W ) of the reading weight . Details of derivation will be given in Appendix I . In our model , we use the encoding matrix Z as the data to be written to the memory instead of the original episode X . Therefore , we would like Z to be a “ good ” representation of X . We quantify this goodness by the usual auto-encoder loss LAE = EX∼data ln p ( d ( e ( X ) ) ) . Thus during training , we will maximize the objective function : O = L+ LAE . ( 2 ) 2.2 GENERATIVE PSEUDO-INVERSE MEMORY . In our model , the posterior memory , the writing weight and the reading weight are all dynamic ( i.e . depending on the data episode ) . Hence it is necessary to understand the motivations and computation methods as introduced in the following . Intuition Only in this part , we will consider probabilistic memories to have unified settings with previous Bayesian-based works such as the Kanerva Machines ( Wu et al. , 2018a ; b ; Marblestone et al. , 2020 ) . When the observed data Zξ arrive , the Kanerva Machines apply the Bayesian inference process to obtain the posterior memory from a given ( trainable ) prior distribution . It is well-known that the posterior mean is the Bayes estimator with respect to the squared error risk ( Jaynes , 2003 ) . Formally , given the observed data Zξ and the writing weight W0 , the posterior memory mean M is the solution of the optimization problem min M E ( ‖M−M0‖2F ∣∣∣∣Zξ , W0 ) , ( 3 ) where ‖.‖F is the Frobenius norm . With the linear assumption over Zξ and an additional linear assumption over M , Eq . ( 3 ) has a unique and explicit solution ( see Appendix H ) . The solution M of Eq . ( 3 ) tends to preserve information from M0 . However , in practice , what appears in the prior memory might be blurry information . Forcing the short-term memory M to be close to M0 may prevent M from storing sufficient information , leading to incorrect read-out . Memory inference From now on , we will only consider deterministic memories . We propose a weighted version of the optimization problem ( 3 ) to help improve read-out accuracy . Our proposed optimization problem is min M ‖W0 ( M−M0 ) ‖2F . ( 4 ) Intuitively , if M is a solution of Eq . ( 4 ) , then W0M is close to W0M0 , which is equal to Zξ due to the linear assumption over Zξ . In other words , the read-out after writing ( i.e . W0M ) is similar to the data written to the memory ( i.e . Zξ ) . Substitute W0M0 = Zξ , Eq . ( 4 ) becomes min M ‖W0M− Zξ‖2F . ( 5 ) Any solution of Eq . ( 5 ) is called the least-square solution of the linear system W0M = Zξ . However , Eq . ( 5 ) may admit more than one least-square solution , thus we are interested in the least-square solution that has the smallest norm , i.e . the minimum-norm least-square solution . The minimumnorm condition may help to regularize in the sense that the posterior memory should contain as Algorithm 1 Single training step of Generative Pseudo-Inverse Memory Sample an episode X of length T . Writing 1 . Compute episode embedding Z = e ( X ) . 2 . Randomize noise ξ from N ( 0 , σ2ξI ) . // simulate observed data 3 . Compute weight W0 = ZξM+0 . // dynamic addressing 4 . Compute posterior memory M = W+0 Zξ . // complete writing phase Reading 1 . Compute episode embedding Z = e ( X ) . // similar role with Zq in Figure 1b 2 . Compute weight mean W = ZM+ . // dynamic addressing 3 . Sample W ∼ N ( W , σ2WI ) . // variational schema for generating samples4 . Compute read-out Zread-out = WM . // similar role with Zr in Figure 1b 5 . Compute reconstruction X̂ = d ( Zread-out ) . // complete reading phase , no iterative reading Updating model parameters 1 . Compute the objective O = L+ LAE using obtained terms from previous steps . 2 . Update parameters via gradient ascent to maximize O. little redundant information as possible . It can be proved that M = W+0 Zξ is the minimum-norm least-square solution of the system W0M = Zξ ( Ben-Israel and Greville , 2001 ) , where W+0 is the pseudo-inverse of W0 . The pseudo-inverse of matrix is applicable to classical associative memory which involves finding a linear mapping from input to output ( Stiles and Denq , 1985 ; Yen and Michel , 1991 ) . Readers are referred to Appendix D for more mathematical properties of the pseudo-inverse . Computing writing and reading weights ( dynamic addressing ) The discussion so far is about seeking the posterior memory M given the data Z and the writing weight W0 . In our settings , all weights are dynamic and they depend on either the prior memory and data ( during writing ) or the posterior memory and the query ( during reading ) . Formally written , we need to determine the writing weight W0 ( given prior memory M0 and noisy data Zξ ) and reading weight W ( given posterior memory M and query Z ) 2 . Ideally , W0 and W should satisfy W0M0 = Zξ and WM = Zξ ≈ Z , according to the linear assumptions over Zξ . The minimumnorm least-square solutions of those linear systems are W0 = ZξM+0 and W = ZM + , where M+0 and M + are pseudo-inverses of M0 and M , respectively . While least-square condition is obvious since we would like to find solutions W0 and W that best fit the systems , explanation for the minimum-norm condition will be given in Appendix J. Computing pseudo-inverses We do not always have an explicit formula for the pseudo-inverse , and even in such cases , the formula may consist of inverse matrices which are expensive to compute . Ben-Israel and Cohen ( 1966 ) provide us with an iterative way to approximate the pseudo-inverse , as stated in the following theorem : Theorem 2.1 . ( Ben-Cohen algorithm ) Given a real matrix D and an initial matrix D0 of the same size with the transpose D > . The sequence { Di } i≥0 defined recursively as Di+1 = 2Di −DiDDi will converge to the pseudo-inverse of D. With appropriate D0 , the sequence will converge quadratically . Ben-Cohen algorithm allows us to compute the matrix pseudo-inverse efficiently with nearly O ( 1 ) time complexity in practice ( see Section 3.5 for experimental results ) . For simplicity , we set the initial term D0 = αD > , where α is a hyper-parameter dependent on the dataset . Deeper analysis of the initial condition for Ben-Cohen algorithm will be given in Appendix G. Algorithm We are now ready to present the Generative Pseudo-Inverse Memory ( GPM ) in full . Assume that the observation noise ξ is sampled from N ( 0 , σ2ξI ) . Algorithm 1 illustrates a single training step of GPM . All pseudo-inverses are approximated by the Ben-Cohen algorithm . 2In general case ( e.g . when the query is a noisy version of Z ) , the same dynamic addressing holds . | The authors propose Generative Pseudo-Inverse Memory (GPM), a family of generative models that offer read and write operations of constant time complexity. Encoding new memories and decoding data from memories are postulated as Bayesian updates for which an equivalent minimization problem is proposed. This minimization problem essentially amounts to solving a linear system of equations, which can be efficiently done via computing matrix pseudo inverses. The authors demonstrate the utility of GPM on a variety of applications such as image denoising, image generation, and storage retrieval. | SP:77dfa645597ebdcbe712e37b37accb85d9592e0b |
Generative Pseudo-Inverse Memory | 1 INTRODUCTION . Memory is central to intelligence by facilitating information compression , reconstruction , manipulation , and generation . The processing speed and storage capacity of the working memory are known to correlate with reasoning capacity ( Jensen and Munro , 1979 ; Kyllonen and Christal , 1990 ) . Recent work in machine learning has explored slot-based external memory to augment neural networks ( Graves et al. , 2016 ; Le et al. , 2019 ) in which memory reads and writes proceed sequentially through attention mechanism , making training and pattern retrieval difficult for very long sequences . Global self-attention techniques ( Ramsauer et al. , 2021 ) create short-cuts in information paths , hence are easier to train , but require large memory and computation for long sequences . Different from slot-based memories , Kanerva Machines ( Wu et al. , 2018a ; b ) are a class of generative memory inspired by Kanerva ’ s sparse distributed memory ( Kanerva , 1984 ) . Here memory update/retrieval and addressing mechanism are treated as Bayesian inference where posteriors are updated when a new data episode arrives . This iterative and dynamic inference handles noisy inputs better due to the convergence of the attractor dynamics to fixed points ( Wu et al. , 2018b ) . However , these models suffer from slow processing speed , which originates from the sequential writing mechanism . This slowness prevents the model to adapt to large batch of data , thus makes it difficult to conduct experiments on memory storage capacity . On the other side , one can not ensure theoretically how well those models retrieve information . This creates an obstacle for theoretical research on the efficiency of memory models . To overcome these challenges we propose a new model called Generative Pseudo-Inverse Memory ( GPM ) , which is illustrated in Fig . 1 . GPM reformulates the Bayesian updates of memory and address as finding least-square solutions to linear systems . Among these solutions , the smallest norm is found through applying the Moore-Penrose pseudo-inverse of matrices ( Ben-Israel and Greville , 2001 ) . This helps us achieve rapid and accurate memory read/write . Moreover , our model is able to not only store and retrieve information perfectly under ideal conditions but also generate new samples based on written data . This coincides with recent inspiring results from functional neuroimaging ( Addis et al. , 2007 ; Okuda et al. , 2003 ; Schacter et al. , 2012 ) , which showed that memory not only helps us memorize but also supports imagining . We derive an energy function for GPM and show that its updates seek to locate local minima of the energy . This dynamic enables GPM to perform iterative reading to improve sample quality during denoising and generating . Finally , GPM can store a large amount of data ( up to a dataset ) while still maintaining key capabilities . We validate these theoretical insights through a comprehensive suite of experiments on binarized MNIST ( LeCun et al. , 2010 ) , binarized Omniglot ( Burda et al. , 2016 ) , FashionMNIST ( Xiao et al. , 2017 ) , CIFAR10 & CIFAR100 ( Krizhevsky , 2009 ) and CelebA ( Liu et al. , 2015 ) , demonstrating superior results . 2 MODEL . Consider a data episode of length T and let X denote the episode data matrix of T rows , where the i-th row of X is the i-th item of the episode . Throughout this paper , we refer to the episode as its associated episode matrix . We aim to compress the episode into a fixed-size memory for later reconstruction and generation processes . We maintain a memory matrix M , which is a deterministic real matrix of size K × C with trainable initialization M0 . For convention , M0 may be considered as the common prior memory containing information of the whole dataset while M is the posterior memory dependent on the episode . Remark . In this paper , we reuse classical terms `` prior memory '' and `` posterior memory '' , which are frequently used in prior works where the memory is modeled as a distribution . In this paper , however , we only consider deterministic memories with an exception when we introduce the optimization problem corresponding to the Bayesian inference ( Eq . ( 3 ) ) . Hence , “ prior memory ” and “ posterior memory ” should be interpreted as the memory before and after data arrive , respectively . In order to write to and read from the memory , we additionally define the writing weight matrix W0 and reading weight matrix1 W , both of size T ×K . We treat the reading weight W as a random variable , hence inducing the generative capability of the model . For simplicity , the prior p ( vec ( W ) ) of W is the standard Gaussian N ( 0 , IT×K ) while the posterior q ( vec ( W ) ) is N ( W , σ2WIT×K ) , where the mean W is adapted to each episode and σW is a learnable parameter . Read-outs from the memory are matrix products between the reading weight and the posterior memory . Let eθ ( . ) be the ( neural ) encoder and dθ ( . ) be the decoder parameterized by θ . In the following we drop the explicit subscript θ for clarity . We further let Z denote the T × C encoding matrix of the episode X , i.e . Z = e ( X ) where e ( . ) is applied to each row of X . During training , the model can only observe a noisy version of Z , which we denote by Zξ . Specifically , Zξ=Z + ξ , where ξ∼ N ( 0 , σ2ξI ) is the observation noise . We assume that the observed data Zξ depends linearly on the 1We note that weights here are dynamic and unrelated to neural network parameters . The term “ dynamic ” means the writing/reading weights of an input not only depend on its own but also the episode it belongs to . weights and the memories : Zξ = W0M0 and Zξ = WM , which we refer as linear assumptions over Zξ . 2.1 OBJECTIVE FUNCTION . Given the memory M , we aim to maximize the conditional log-likelihood ln p ( X|M ) . It is difficult to maximize ln p ( X|M ) directly , so we instead maximize its evidence lower bound L , where L = Eq ( W ) ln p ( X|W , M ) −DKL ( q ( W ) ||p ( W ) ) . ( 1 ) The first term in L is usually called the negative reconstruction loss , while the second term is the Kullback-Leibler divergence between the posterior q ( W ) and the prior p ( W ) of the reading weight . Details of derivation will be given in Appendix I . In our model , we use the encoding matrix Z as the data to be written to the memory instead of the original episode X . Therefore , we would like Z to be a “ good ” representation of X . We quantify this goodness by the usual auto-encoder loss LAE = EX∼data ln p ( d ( e ( X ) ) ) . Thus during training , we will maximize the objective function : O = L+ LAE . ( 2 ) 2.2 GENERATIVE PSEUDO-INVERSE MEMORY . In our model , the posterior memory , the writing weight and the reading weight are all dynamic ( i.e . depending on the data episode ) . Hence it is necessary to understand the motivations and computation methods as introduced in the following . Intuition Only in this part , we will consider probabilistic memories to have unified settings with previous Bayesian-based works such as the Kanerva Machines ( Wu et al. , 2018a ; b ; Marblestone et al. , 2020 ) . When the observed data Zξ arrive , the Kanerva Machines apply the Bayesian inference process to obtain the posterior memory from a given ( trainable ) prior distribution . It is well-known that the posterior mean is the Bayes estimator with respect to the squared error risk ( Jaynes , 2003 ) . Formally , given the observed data Zξ and the writing weight W0 , the posterior memory mean M is the solution of the optimization problem min M E ( ‖M−M0‖2F ∣∣∣∣Zξ , W0 ) , ( 3 ) where ‖.‖F is the Frobenius norm . With the linear assumption over Zξ and an additional linear assumption over M , Eq . ( 3 ) has a unique and explicit solution ( see Appendix H ) . The solution M of Eq . ( 3 ) tends to preserve information from M0 . However , in practice , what appears in the prior memory might be blurry information . Forcing the short-term memory M to be close to M0 may prevent M from storing sufficient information , leading to incorrect read-out . Memory inference From now on , we will only consider deterministic memories . We propose a weighted version of the optimization problem ( 3 ) to help improve read-out accuracy . Our proposed optimization problem is min M ‖W0 ( M−M0 ) ‖2F . ( 4 ) Intuitively , if M is a solution of Eq . ( 4 ) , then W0M is close to W0M0 , which is equal to Zξ due to the linear assumption over Zξ . In other words , the read-out after writing ( i.e . W0M ) is similar to the data written to the memory ( i.e . Zξ ) . Substitute W0M0 = Zξ , Eq . ( 4 ) becomes min M ‖W0M− Zξ‖2F . ( 5 ) Any solution of Eq . ( 5 ) is called the least-square solution of the linear system W0M = Zξ . However , Eq . ( 5 ) may admit more than one least-square solution , thus we are interested in the least-square solution that has the smallest norm , i.e . the minimum-norm least-square solution . The minimumnorm condition may help to regularize in the sense that the posterior memory should contain as Algorithm 1 Single training step of Generative Pseudo-Inverse Memory Sample an episode X of length T . Writing 1 . Compute episode embedding Z = e ( X ) . 2 . Randomize noise ξ from N ( 0 , σ2ξI ) . // simulate observed data 3 . Compute weight W0 = ZξM+0 . // dynamic addressing 4 . Compute posterior memory M = W+0 Zξ . // complete writing phase Reading 1 . Compute episode embedding Z = e ( X ) . // similar role with Zq in Figure 1b 2 . Compute weight mean W = ZM+ . // dynamic addressing 3 . Sample W ∼ N ( W , σ2WI ) . // variational schema for generating samples4 . Compute read-out Zread-out = WM . // similar role with Zr in Figure 1b 5 . Compute reconstruction X̂ = d ( Zread-out ) . // complete reading phase , no iterative reading Updating model parameters 1 . Compute the objective O = L+ LAE using obtained terms from previous steps . 2 . Update parameters via gradient ascent to maximize O. little redundant information as possible . It can be proved that M = W+0 Zξ is the minimum-norm least-square solution of the system W0M = Zξ ( Ben-Israel and Greville , 2001 ) , where W+0 is the pseudo-inverse of W0 . The pseudo-inverse of matrix is applicable to classical associative memory which involves finding a linear mapping from input to output ( Stiles and Denq , 1985 ; Yen and Michel , 1991 ) . Readers are referred to Appendix D for more mathematical properties of the pseudo-inverse . Computing writing and reading weights ( dynamic addressing ) The discussion so far is about seeking the posterior memory M given the data Z and the writing weight W0 . In our settings , all weights are dynamic and they depend on either the prior memory and data ( during writing ) or the posterior memory and the query ( during reading ) . Formally written , we need to determine the writing weight W0 ( given prior memory M0 and noisy data Zξ ) and reading weight W ( given posterior memory M and query Z ) 2 . Ideally , W0 and W should satisfy W0M0 = Zξ and WM = Zξ ≈ Z , according to the linear assumptions over Zξ . The minimumnorm least-square solutions of those linear systems are W0 = ZξM+0 and W = ZM + , where M+0 and M + are pseudo-inverses of M0 and M , respectively . While least-square condition is obvious since we would like to find solutions W0 and W that best fit the systems , explanation for the minimum-norm condition will be given in Appendix J. Computing pseudo-inverses We do not always have an explicit formula for the pseudo-inverse , and even in such cases , the formula may consist of inverse matrices which are expensive to compute . Ben-Israel and Cohen ( 1966 ) provide us with an iterative way to approximate the pseudo-inverse , as stated in the following theorem : Theorem 2.1 . ( Ben-Cohen algorithm ) Given a real matrix D and an initial matrix D0 of the same size with the transpose D > . The sequence { Di } i≥0 defined recursively as Di+1 = 2Di −DiDDi will converge to the pseudo-inverse of D. With appropriate D0 , the sequence will converge quadratically . Ben-Cohen algorithm allows us to compute the matrix pseudo-inverse efficiently with nearly O ( 1 ) time complexity in practice ( see Section 3.5 for experimental results ) . For simplicity , we set the initial term D0 = αD > , where α is a hyper-parameter dependent on the dataset . Deeper analysis of the initial condition for Ben-Cohen algorithm will be given in Appendix G. Algorithm We are now ready to present the Generative Pseudo-Inverse Memory ( GPM ) in full . Assume that the observation noise ξ is sampled from N ( 0 , σ2ξI ) . Algorithm 1 illustrates a single training step of GPM . All pseudo-inverses are approximated by the Ben-Cohen algorithm . 2In general case ( e.g . when the query is a noisy version of Z ) , the same dynamic addressing holds . | The paper proposes a new memory model following the research line of Kanerva Machine, DKM, and Kanerva++. The proposed model reformulates the Bayesian updates of memory and address as finding least-square solution to linear systems. This requires matrix inversion operations and the authors proposed to approximate it iteratively by using Ben-Cohen algorithm for pseudo-inverse matrix. It results in a memory read/write system that is rapid/accurate and can store large batch of data. The evaluation is performed thoroughly on various datasets including binarized MNIST, binarized Omniglot, Fashion MNIST, CIFAR10/100, CelebA. It shows the superiority of the proposed method in negative ELBO of test likelihood, denoising success rate and hamming error, generation, memory capacity, and run-time per iteration. | SP:77dfa645597ebdcbe712e37b37accb85d9592e0b |
Generative Pseudo-Inverse Memory | 1 INTRODUCTION . Memory is central to intelligence by facilitating information compression , reconstruction , manipulation , and generation . The processing speed and storage capacity of the working memory are known to correlate with reasoning capacity ( Jensen and Munro , 1979 ; Kyllonen and Christal , 1990 ) . Recent work in machine learning has explored slot-based external memory to augment neural networks ( Graves et al. , 2016 ; Le et al. , 2019 ) in which memory reads and writes proceed sequentially through attention mechanism , making training and pattern retrieval difficult for very long sequences . Global self-attention techniques ( Ramsauer et al. , 2021 ) create short-cuts in information paths , hence are easier to train , but require large memory and computation for long sequences . Different from slot-based memories , Kanerva Machines ( Wu et al. , 2018a ; b ) are a class of generative memory inspired by Kanerva ’ s sparse distributed memory ( Kanerva , 1984 ) . Here memory update/retrieval and addressing mechanism are treated as Bayesian inference where posteriors are updated when a new data episode arrives . This iterative and dynamic inference handles noisy inputs better due to the convergence of the attractor dynamics to fixed points ( Wu et al. , 2018b ) . However , these models suffer from slow processing speed , which originates from the sequential writing mechanism . This slowness prevents the model to adapt to large batch of data , thus makes it difficult to conduct experiments on memory storage capacity . On the other side , one can not ensure theoretically how well those models retrieve information . This creates an obstacle for theoretical research on the efficiency of memory models . To overcome these challenges we propose a new model called Generative Pseudo-Inverse Memory ( GPM ) , which is illustrated in Fig . 1 . GPM reformulates the Bayesian updates of memory and address as finding least-square solutions to linear systems . Among these solutions , the smallest norm is found through applying the Moore-Penrose pseudo-inverse of matrices ( Ben-Israel and Greville , 2001 ) . This helps us achieve rapid and accurate memory read/write . Moreover , our model is able to not only store and retrieve information perfectly under ideal conditions but also generate new samples based on written data . This coincides with recent inspiring results from functional neuroimaging ( Addis et al. , 2007 ; Okuda et al. , 2003 ; Schacter et al. , 2012 ) , which showed that memory not only helps us memorize but also supports imagining . We derive an energy function for GPM and show that its updates seek to locate local minima of the energy . This dynamic enables GPM to perform iterative reading to improve sample quality during denoising and generating . Finally , GPM can store a large amount of data ( up to a dataset ) while still maintaining key capabilities . We validate these theoretical insights through a comprehensive suite of experiments on binarized MNIST ( LeCun et al. , 2010 ) , binarized Omniglot ( Burda et al. , 2016 ) , FashionMNIST ( Xiao et al. , 2017 ) , CIFAR10 & CIFAR100 ( Krizhevsky , 2009 ) and CelebA ( Liu et al. , 2015 ) , demonstrating superior results . 2 MODEL . Consider a data episode of length T and let X denote the episode data matrix of T rows , where the i-th row of X is the i-th item of the episode . Throughout this paper , we refer to the episode as its associated episode matrix . We aim to compress the episode into a fixed-size memory for later reconstruction and generation processes . We maintain a memory matrix M , which is a deterministic real matrix of size K × C with trainable initialization M0 . For convention , M0 may be considered as the common prior memory containing information of the whole dataset while M is the posterior memory dependent on the episode . Remark . In this paper , we reuse classical terms `` prior memory '' and `` posterior memory '' , which are frequently used in prior works where the memory is modeled as a distribution . In this paper , however , we only consider deterministic memories with an exception when we introduce the optimization problem corresponding to the Bayesian inference ( Eq . ( 3 ) ) . Hence , “ prior memory ” and “ posterior memory ” should be interpreted as the memory before and after data arrive , respectively . In order to write to and read from the memory , we additionally define the writing weight matrix W0 and reading weight matrix1 W , both of size T ×K . We treat the reading weight W as a random variable , hence inducing the generative capability of the model . For simplicity , the prior p ( vec ( W ) ) of W is the standard Gaussian N ( 0 , IT×K ) while the posterior q ( vec ( W ) ) is N ( W , σ2WIT×K ) , where the mean W is adapted to each episode and σW is a learnable parameter . Read-outs from the memory are matrix products between the reading weight and the posterior memory . Let eθ ( . ) be the ( neural ) encoder and dθ ( . ) be the decoder parameterized by θ . In the following we drop the explicit subscript θ for clarity . We further let Z denote the T × C encoding matrix of the episode X , i.e . Z = e ( X ) where e ( . ) is applied to each row of X . During training , the model can only observe a noisy version of Z , which we denote by Zξ . Specifically , Zξ=Z + ξ , where ξ∼ N ( 0 , σ2ξI ) is the observation noise . We assume that the observed data Zξ depends linearly on the 1We note that weights here are dynamic and unrelated to neural network parameters . The term “ dynamic ” means the writing/reading weights of an input not only depend on its own but also the episode it belongs to . weights and the memories : Zξ = W0M0 and Zξ = WM , which we refer as linear assumptions over Zξ . 2.1 OBJECTIVE FUNCTION . Given the memory M , we aim to maximize the conditional log-likelihood ln p ( X|M ) . It is difficult to maximize ln p ( X|M ) directly , so we instead maximize its evidence lower bound L , where L = Eq ( W ) ln p ( X|W , M ) −DKL ( q ( W ) ||p ( W ) ) . ( 1 ) The first term in L is usually called the negative reconstruction loss , while the second term is the Kullback-Leibler divergence between the posterior q ( W ) and the prior p ( W ) of the reading weight . Details of derivation will be given in Appendix I . In our model , we use the encoding matrix Z as the data to be written to the memory instead of the original episode X . Therefore , we would like Z to be a “ good ” representation of X . We quantify this goodness by the usual auto-encoder loss LAE = EX∼data ln p ( d ( e ( X ) ) ) . Thus during training , we will maximize the objective function : O = L+ LAE . ( 2 ) 2.2 GENERATIVE PSEUDO-INVERSE MEMORY . In our model , the posterior memory , the writing weight and the reading weight are all dynamic ( i.e . depending on the data episode ) . Hence it is necessary to understand the motivations and computation methods as introduced in the following . Intuition Only in this part , we will consider probabilistic memories to have unified settings with previous Bayesian-based works such as the Kanerva Machines ( Wu et al. , 2018a ; b ; Marblestone et al. , 2020 ) . When the observed data Zξ arrive , the Kanerva Machines apply the Bayesian inference process to obtain the posterior memory from a given ( trainable ) prior distribution . It is well-known that the posterior mean is the Bayes estimator with respect to the squared error risk ( Jaynes , 2003 ) . Formally , given the observed data Zξ and the writing weight W0 , the posterior memory mean M is the solution of the optimization problem min M E ( ‖M−M0‖2F ∣∣∣∣Zξ , W0 ) , ( 3 ) where ‖.‖F is the Frobenius norm . With the linear assumption over Zξ and an additional linear assumption over M , Eq . ( 3 ) has a unique and explicit solution ( see Appendix H ) . The solution M of Eq . ( 3 ) tends to preserve information from M0 . However , in practice , what appears in the prior memory might be blurry information . Forcing the short-term memory M to be close to M0 may prevent M from storing sufficient information , leading to incorrect read-out . Memory inference From now on , we will only consider deterministic memories . We propose a weighted version of the optimization problem ( 3 ) to help improve read-out accuracy . Our proposed optimization problem is min M ‖W0 ( M−M0 ) ‖2F . ( 4 ) Intuitively , if M is a solution of Eq . ( 4 ) , then W0M is close to W0M0 , which is equal to Zξ due to the linear assumption over Zξ . In other words , the read-out after writing ( i.e . W0M ) is similar to the data written to the memory ( i.e . Zξ ) . Substitute W0M0 = Zξ , Eq . ( 4 ) becomes min M ‖W0M− Zξ‖2F . ( 5 ) Any solution of Eq . ( 5 ) is called the least-square solution of the linear system W0M = Zξ . However , Eq . ( 5 ) may admit more than one least-square solution , thus we are interested in the least-square solution that has the smallest norm , i.e . the minimum-norm least-square solution . The minimumnorm condition may help to regularize in the sense that the posterior memory should contain as Algorithm 1 Single training step of Generative Pseudo-Inverse Memory Sample an episode X of length T . Writing 1 . Compute episode embedding Z = e ( X ) . 2 . Randomize noise ξ from N ( 0 , σ2ξI ) . // simulate observed data 3 . Compute weight W0 = ZξM+0 . // dynamic addressing 4 . Compute posterior memory M = W+0 Zξ . // complete writing phase Reading 1 . Compute episode embedding Z = e ( X ) . // similar role with Zq in Figure 1b 2 . Compute weight mean W = ZM+ . // dynamic addressing 3 . Sample W ∼ N ( W , σ2WI ) . // variational schema for generating samples4 . Compute read-out Zread-out = WM . // similar role with Zr in Figure 1b 5 . Compute reconstruction X̂ = d ( Zread-out ) . // complete reading phase , no iterative reading Updating model parameters 1 . Compute the objective O = L+ LAE using obtained terms from previous steps . 2 . Update parameters via gradient ascent to maximize O. little redundant information as possible . It can be proved that M = W+0 Zξ is the minimum-norm least-square solution of the system W0M = Zξ ( Ben-Israel and Greville , 2001 ) , where W+0 is the pseudo-inverse of W0 . The pseudo-inverse of matrix is applicable to classical associative memory which involves finding a linear mapping from input to output ( Stiles and Denq , 1985 ; Yen and Michel , 1991 ) . Readers are referred to Appendix D for more mathematical properties of the pseudo-inverse . Computing writing and reading weights ( dynamic addressing ) The discussion so far is about seeking the posterior memory M given the data Z and the writing weight W0 . In our settings , all weights are dynamic and they depend on either the prior memory and data ( during writing ) or the posterior memory and the query ( during reading ) . Formally written , we need to determine the writing weight W0 ( given prior memory M0 and noisy data Zξ ) and reading weight W ( given posterior memory M and query Z ) 2 . Ideally , W0 and W should satisfy W0M0 = Zξ and WM = Zξ ≈ Z , according to the linear assumptions over Zξ . The minimumnorm least-square solutions of those linear systems are W0 = ZξM+0 and W = ZM + , where M+0 and M + are pseudo-inverses of M0 and M , respectively . While least-square condition is obvious since we would like to find solutions W0 and W that best fit the systems , explanation for the minimum-norm condition will be given in Appendix J. Computing pseudo-inverses We do not always have an explicit formula for the pseudo-inverse , and even in such cases , the formula may consist of inverse matrices which are expensive to compute . Ben-Israel and Cohen ( 1966 ) provide us with an iterative way to approximate the pseudo-inverse , as stated in the following theorem : Theorem 2.1 . ( Ben-Cohen algorithm ) Given a real matrix D and an initial matrix D0 of the same size with the transpose D > . The sequence { Di } i≥0 defined recursively as Di+1 = 2Di −DiDDi will converge to the pseudo-inverse of D. With appropriate D0 , the sequence will converge quadratically . Ben-Cohen algorithm allows us to compute the matrix pseudo-inverse efficiently with nearly O ( 1 ) time complexity in practice ( see Section 3.5 for experimental results ) . For simplicity , we set the initial term D0 = αD > , where α is a hyper-parameter dependent on the dataset . Deeper analysis of the initial condition for Ben-Cohen algorithm will be given in Appendix G. Algorithm We are now ready to present the Generative Pseudo-Inverse Memory ( GPM ) in full . Assume that the observation noise ξ is sampled from N ( 0 , σ2ξI ) . Algorithm 1 illustrates a single training step of GPM . All pseudo-inverses are approximated by the Ben-Cohen algorithm . 2In general case ( e.g . when the query is a noisy version of Z ) , the same dynamic addressing holds . | The authors propose a novel deep generative memory model called Generative Pseudo-inverse Memory (GPM) that extends Dynamic Kanerva Machines (DKM, [1]). These models are both deep generative models that maintain a hidden state similar to recurrent neural networks called memory and have ways of writing into and reading from this memory. A key limitation of DKMs is that the time complexity of updating the memory scales cubically in the memory dimensionality and linearly in the episode length. The authors observe that by slightly altering the optimization objective that GPM has to solve, under mild assumptions the memory update can be performed much more efficiently, allowing them to write entire datasets into the memory of the GPM with little computational cost. The authors perform some experiments on some toy datasets to validate their method and obtain good results against related methods. [1] Y. Wu, G. Wayne, K. Gregor, and T. Lillicrap. Learning attractor dynamics for generative memory. NeurIPS 2018 | SP:77dfa645597ebdcbe712e37b37accb85d9592e0b |
Learning to Generalize Compositionally by Transferring Across Semantic Parsing Tasks | 1 INTRODUCTION . Recent work has spotlighted significant shortcomings of neural network approaches to NLP in coping with compositional generalization ( CG ) ( Lake & Baroni , 2018 ; Finegan-Dollak et al. , 2018 ; Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Shaw et al. , 2021 ) . In those studies , the test set combines in unfamiliar ways linguistic elements that may themselves be familiar from the training set ; for example , sentences in the test set may be longer than those observed in training , or may use familiar words in syntactic roles in which they did not occur in training . The performance of popular neural architectures in contemporary NLP models such as Transformers drops considerably when they are expected to generalize compositionally . Several approaches have been proposed to address this issue , including specialized architectures with compositional inductive biases ( Furrer et al . 2020 ) and compositional data augmentation ( Andreas , 2020 ) , but as of yet the problem is far from solved . In this paper , we study this challenge from the perspective of transferability of compositional generalization skills : is possible for a neural model to transfer compositional generalization skills acquired from one task to another task that also requires compositional generalization skills ? We ground our inquiries with the semantic parsing tasks on three very different datasets : GeoQuery ( Zelle , 1995 ) , COGS ( Kim & Linzen , 2020 ) and SCAN ( Lake & Baroni , 2018 ) . For each task , we use existing compositional training/test splits or create new ones . We propose a learning algorithm that can extract a compositional inductive bias from one task — a stage we refer to as pre-finetuning1 — and transfers that bias to a target task , improving the models ’ compositional generalization behavior on that task . To extract the inductive bias so as to transfer , we introduce a new training algorithm DUEL . In summary ( cf . Fig 1 ) , DUEL is designed to be compatible with pre-trained neural encoder-decoder models , such as T5 ( Raffel et al. , 2020 ) . We view the encoder as learning a representation for the inputs and the decoder as “ a task head ” that is specialized to different tasks . In pre-finetuing , framing the task ’ s two ( compositional ) splits as deriving representation from one split for zero-shot learning to the other split , DUEL trains the encoder and the decoder using different splits . In contrast to 1We borrow this terminology from the NLP research community . A large number of research papers have explored the idea of transfer learning , starting from a pre-trained language model , followed by training on a set of pre-finetuning tasks , and then fine-tuning on the target or downstream tasks ( Vu et al. , 2020 ; Gururangan et al. , 2020 ; Pruksachatkun et al. , 2020 ; Chen et al. , 2020a ; Aghajanyan et al. , 2021 ) . using standard supervised learning over both splits as a whole for pre-finetuning , DUEL encourages the encoder to learn to represent the input texts in a way that facilitates greater compositional generalization , and that this transfers across domains and persists through fine-tuning on the target task , as shown by our empirical studies . The rest of the paper is organized as follows . In §2 , we detail our setup . We describe our approach in §4 , followed by empirical studies §5 . We discuss related work in §6 and conclude in §7 . 2 PROBLEM SETUP . Our neural learner is given a pre-finetuning task and a target task . For the pre-finetuning task , we have a training data distribution s and a test/eval data distribution s̃ that may deviate from s. Likewise , for the target task , we have q and q̃ . In the case of compositional generalization , the difference between s and s̃ ( or q versus q̃ ) is defined in compositional terms : the ways in which elements combine differ systematically between the two parts of each datasets ( Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Lake & Baroni , 2018 ; Hupkes et al. , 2020 ) . Our goal is to train a neural model on ( s , s̃ ) and then fine-tune it on q so that the final model performs well on q̃ , namely , attaining strong compositional generalization performance on the target task . Our assumption is that the difference between s and s̃ is similar to the difference between q and q̃ , such that an inductive bias acquired from ( s , s̃ ) can be transferred to the target task . A motivating example is that s̃ contains longer texts than s and so does q̃ than q : in this case , we would investigate whether learning to generalize from short to long texts is a transferrable skill . 3 TASK , DATA SETS AND THEIR COMPOSITIONAL SPLITS . Data Splits In this work , we focus on semantic parsing , the task of translating a natural language text into a formal representation of its semantics . Standard data splits for supervised learning partition a dataset randomly into a training set and testing set . As such , the examples in both portions are drawn from the same distribution . By contrast , compositional splits partition a dataset in a way that creates a distributional discrepancy between the training and the test set , such that strong performance on the test set requires compositional generalization from the training set . Compositional splits are straightforward to create for datasets that are generated from grammars or templates , such as SCAN ( Lake & Baroni , 2018 ) and COGS ( Kim & Linzen , 2020 ) , described in detail in the next section . For instance , the templates used for the test set can include specific words in syntactic roles they did not appear in in the training set , or they can nest syntactic constituents more deeply than in the training set , creating differences in lengths of the input texts . An alternative mechanism creates—based on an existing dataset for which the generative process is not available ( for example , real-world user queries ) —test sets that require compositional generalization by on splitting the dataset so as to obtain the maximum compound divergence ( MCD ) between the training and test examples ( Keysers et al. , 2020 ) . Here , compounds are complex expressions formed by composing atoms , and compound divergence is computed as DC ( V ‖W ) = 1 − C0.1 ( FC ( V ) ‖FC ( W ) ) where F is the distribution over compounds , and Cα ( P‖Q ) = ∑ k p α k q 1−α k . The intuition behind this method is that given an existing dataset it is difficult to limit the test examples to compounds that are completely absent from the training set , but by making the compound distributions as distinct as possible , we are primarily measuring the model ’ s performance on compounds are at least very infrequent in training . We use the MCD split generated for SCAN from Keysers et al . ( 2020 ) and the Target Maximum Compound Divergence ( TMCD ) splits generated for GeoQuery from Shaw et al . ( 2021 ) . TMCD splits extend the MCD methodology to create compositional splits of non-synthetic datasets and define atoms and compounds based on the known syntactic structure of the output logical forms . Datasets and Tasks Table 1 summarizes the 5 compositional splits we use in this paper . We also compared with standard splits ( std ) where the training and test come from the same distribution . As an example for our setting in §2 , taking COGS as our pre-finetuning task and GeoQuery as our target task , we learn from the CG General split of COGS and transfer to the CG General split of GeoQuery . In this example , COGS BASE is the distribution s and COGS CG is the distribution s̃ . GEO TMCD1 is our fine-tuning distribution q and GEO TMCD2 is our final test distribution q̃ . COGS ( Kim & Linzen , 2020 ) is a synthetic semantic parsing dataset generated from templates . The inputs are English sentences and the outputs are corresponding logical forms inspired by λ-calculus , e.g. , A dog ate the cake→ * cake ( x4 ) ; dog ( x1 ) AND eat.agent ( x2 , x1 ) AND eat.theme ( x2 , x4 ) . COGS has two components : a training dataset , which we refer to as COGS BASE , and a compositional generalization ( CG ) dataset COGS CG . Kim & Linzen ( 2020 ) show that the performance of neural models trained on COGS BASE degrades significantly when they are applied to COGS CG . COGS CG includes two kinds of CG challenges : lexical and structural . In lexical CG , familiar words need to be interpreted in new syntactic positions ; for example , in COGS BASE the word hedgehog may occur only in the subject position , in COGS CG it would need to be interpreted as as object . By contrast , structural CG involves new combinations of familiar syntactic structures . For example , in COGS BASE , prepositional phrases only modify objects ( Noah ate the cake on the plate ) , whereas in COGS CG they modify subjects ( The cake on the plate burned ) . Likewise , in COGS BASE prepositional phrases can only be nested once ( Ava saw the ball in the bottle on the table ) , but in COGS CG they are nested multiple times ( Ava saw the ball in the bottle on the table on the floor ) , creating longer sentences . COGS BASE has 24,155 examples and COGS CG has 21,000 examples , of which 18,000 are instances of lexical CG and 3,000 are instances of structural CG . The GeoQuery ( Zelle , 1995 ; Tang & Mooney , 2001 ) is an annotated semantic parsing dataset contains 880 natural language questions about US geography ( e.g. , What states border Texas ? ) . We use the same pre-processing as in Shaw et al . ( 2021 ) , replacing entity mentions with placeholders in the Functional Query Language ( FunQL ; Kate et al . 2005 ) output representations . The input what states border m0 , for example , is associated with the output answer ( intersection ( state , next_to_2 ( m0 ) ) ) . Atoms and compounds are defined over the FunQL expressions . We adopt the length and TMCD splits from Shaw et al . ( 2021 ) . For the length split GEO len , the training set GEO SHORT consists of examples with shorter inputs than the test set GEO LONG . We refer to the training and test set for the TMCD split as GEO TMCD1 and GEO TMCD2 . Both splits divide GeoQuery equally into two sets of 440 examples . The SCAN dataset ( Lake & Baroni , 2018 ) consists of over 20,000 natural language navigation commands and corresponding “ action sequences ” , e.g . jump twice→ JUMP JUMP . SCAN is not a semantic parsing dataset but is commonly used as a diagnostic dataset for evaluating compositional generalization . We adopt the length split ( SCAN len ) and MCD split ( SCAN cd ) introduced by Keysers et al . ( 2020 ) . 4 PROPOSED METHOD . Intuition and Main Idea As mentioned in §2 , our goal is to improve compositional generalization on our target task , where the training distribution is q and the evaluation distribution q̃ . The challenge is to leverage the information in s and s̃ during the pre-finetuning stage such that the model , when fine-tuned on q , generalizes better on q̃ . This contrasts with a standard supervised learning approach , which would collapse together the examples from s and s̃ during pre-finetuning , discarding the information about how examples are divided between s and s̃—information that , we hypothesize , can be useful for encouraging compositional generalization on the target task . We assume a neural encoder-decoder architecture ( Cho et al. , 2014 ) . Our proposed method , DUEL , iteratively updates the parameters of the encoder on examples from s̃ , while keeping the decoder fixed , and then updates the decoder parameters on examples from s , while keeping the encoder fixed . The encoder updates are then retained prior to fine-tuning on q , while the decoder updates are discarded ( as the pre-finetuning and the target tasks are different ) . In contrast to standard fine-tuning , DUEL encourages the encoder to learn to represent the input sequences in a way that facilitates compositional generalization , which we hypothesize will transfer across domains and persist through fine-tuning . Details For encoder-decoder architectures , the model ’ s parameters naturally partition into two sets , θ for the encoder and φ for the decoder , where θ parametrizes the representation f ( x ; θ ) of the input x and φ parametrizes the “ task head ” g ( · ) , which uses that representation to accomplish a task such as classification or semantic parsing . Taken together , the model ’ s output is p ( y|x ; θ , φ ) = g ( f ( x ; θ ) ; φ ) . Given a pre-finetuning task where both s and s̃ are given , our goal is to drive the learner to learn the optimal representation and task head parameters ( θ∗ , φ∗ ) such that g ( f ( x ; θ∗ ) ; φ∗ ) performs the best on both distributions . To achieve this , we design an iterative dueling game that the learner plays with the two distributions . Suppose the learner ’ s parameters are currently ( θ , φ ) . To perform optimally on s̃ , we would like to use the task head g ( · ; φ ) without further training it , i.e. , perform well in an “ zero-shot ” setting ; this setting directly anticipates how learning would proceed for the target task , where we will be training only on q , without exposure to q̃ . Since we are holding the task head g ( · ; φ ) fixed , we need to optimize the representation f ( · ; θ ) such that it models s̃ appropriately . To achieve this desiderata , we update the representation parameters iteratively for at most Tinner steps , according to θ ← θ + α 1 N ∇θ ∑ ( x , y ) ∈Bs̃ log p ( y|x ; θ , φ ) ( 1 ) where B s̃ is a batch of N samples from s̃ and α is the step size.2 Updates to φ follow the reverse logic . The representation function that results from updating θ defines a prior on how s should be represented . When updating the task head parameters φ , our goal is to have the task head perform optimally conditioned on this prior . Concretely , we hold θ fixed and apply iteratively at most Tinner steps to φ : φ← φ+ α 1 N ∇φ ∑ ( x , y ) ∈Bs log p ( y|x ; θ , φ ) ( 2 ) where Bs is a batch of samples from s. Crucially , we alternate between these two types of updates , such that s̃ informs the learner about the compositional inductive bias that should be incorporated into the representation f , and s teaches the learner how to use that representation to perform the task ( here semantic parsing ) . 2Eqns . ( 1-3 ) only aim at illustrating the computation of gradient . We use the Adam optimizer in the implementation . Algorithm 1 : DUEL Require : Data sets s , s̃ ; Learning rate α ; Batch size N ; Outer loop iterations Touter ; Inner loop iterations Tinner ; Inner loop early stopping criteria Tpatience ; Outer loop early stopping criteria Tmin ; Initialize model parameters θ , φ i← 0 while i < Touter do j ← 0 while j < Tinner do Sample a batch Bs from s Compute loss : L ( θ , φ , Bs ) = 1N ∑ ( x , y ) ∈Bs − log p ( y | x ; θ , φ ) Update parameters : φ← φ− α · ∇φL ( θ , φ , Bs ) j ← j + 1 if AccuracyDecreases ( θ , φ , s̃ , Tpatience ) then Early stop : break end end k ← 0 while k < Tinner do Sample a batch Bs̃ from s̃ Compute loss : L ( θ , φ , Bs̃ ) = 1N ∑ ( x , y ) ∈Bs̃ − log p ( y | x ; θ , φ ) Update parameters : θ ← θ − α · ∇θL ( θ , φ , Bs̃ ) k ← k + 1 if AccuracyDecreases ( θ , φ , s , Tpatience ) then Early stop : break end end if k < Tmin then Early stop outer loop : break end i← i+ 1 end Return : Model parameters θ , φ We contrast our approach with the standard supervised learning approach , where the two distributions are merged together as s ∪ s̃ , ignoring the compositional split : ( θ , φ ) ← ( θ , φ ) + η 1 N ∇ ( θ , φ ) ∑ ( x , y ) ∼Bs∪s̃ log p ( y|x ; θ , φ ) ( 3 ) DUEL is used for pre-finetuning . When fine-tuning the model on the target task q , we retain the representation component f ( · ; θ ) and re-initialize the task head g ( · ; φ ) . Both θ and φ are then updated , as is standard , to optimize the loss function on q. DUEL is illustrated schematically in the pre-finetuning panel of Fig . 1 . The pseudocode is listed in Algorithm 1 . The algorithm contains one outer loop for Touter rounds ( with possible early stopping ) , which alternates between inner loops updating θ and φ . The early-stopping monitoring function AccuracyDecreases takes as arguments the current model parameters θ and φ , a data distribution to use for evaluation ( s or s̃ ) , and the maximum patience Tpatience for early-stopping . This function returns true if accuracy on the dataset in question has not improved for Tpatience consecutive steps . To terminate the outer loop ( thus , the algorithm ) , we keep track how many steps the inner update for θ take . If the number steps is smaller than a preset threshold Tmin , we conclude that the algorithm has converged to the desired representation since the difference in representing s and s̃ is small , requiring little adaptation . We do not use the same logic to limit how long it takes to optimize the task head parameters φ , conditioned on the representation , as the goal is to use the derived representation to arrive at a strong performance . | This paper proposes a training procedure for encoder--decoder models (applied to semantic parsing) which aims to improve the models' ability to compositionally generalize (successfully handle novel combinations of words and structures, where combinations were not seen in training). The approach relies on pre-finetuning: training a model on a different dataset than the target dataset that also the requires the same sort of compositional generalization as the target dataset, before then training on the training set of the target dataset and then evaluating zero-shot on the compositional set of the target dataset, in the standard way. In pre-finetuning, the decoder is only updated on the training set while the encoder is updated on the compositional generalization set. The approach is evaluated using two different pre-trained encoder--decoder transformer architectures on three different semantic parsing compositional generalization datasets from past work, where it obtains consistent (albiet somewhat small) improvements over a baseline that pre-finetunes all model parameters, and outperforms a past state-of-the-art model on one dataset. | SP:340b7f636b900c3110c59392ff7b9c308d3300d2 |
Learning to Generalize Compositionally by Transferring Across Semantic Parsing Tasks | 1 INTRODUCTION . Recent work has spotlighted significant shortcomings of neural network approaches to NLP in coping with compositional generalization ( CG ) ( Lake & Baroni , 2018 ; Finegan-Dollak et al. , 2018 ; Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Shaw et al. , 2021 ) . In those studies , the test set combines in unfamiliar ways linguistic elements that may themselves be familiar from the training set ; for example , sentences in the test set may be longer than those observed in training , or may use familiar words in syntactic roles in which they did not occur in training . The performance of popular neural architectures in contemporary NLP models such as Transformers drops considerably when they are expected to generalize compositionally . Several approaches have been proposed to address this issue , including specialized architectures with compositional inductive biases ( Furrer et al . 2020 ) and compositional data augmentation ( Andreas , 2020 ) , but as of yet the problem is far from solved . In this paper , we study this challenge from the perspective of transferability of compositional generalization skills : is possible for a neural model to transfer compositional generalization skills acquired from one task to another task that also requires compositional generalization skills ? We ground our inquiries with the semantic parsing tasks on three very different datasets : GeoQuery ( Zelle , 1995 ) , COGS ( Kim & Linzen , 2020 ) and SCAN ( Lake & Baroni , 2018 ) . For each task , we use existing compositional training/test splits or create new ones . We propose a learning algorithm that can extract a compositional inductive bias from one task — a stage we refer to as pre-finetuning1 — and transfers that bias to a target task , improving the models ’ compositional generalization behavior on that task . To extract the inductive bias so as to transfer , we introduce a new training algorithm DUEL . In summary ( cf . Fig 1 ) , DUEL is designed to be compatible with pre-trained neural encoder-decoder models , such as T5 ( Raffel et al. , 2020 ) . We view the encoder as learning a representation for the inputs and the decoder as “ a task head ” that is specialized to different tasks . In pre-finetuing , framing the task ’ s two ( compositional ) splits as deriving representation from one split for zero-shot learning to the other split , DUEL trains the encoder and the decoder using different splits . In contrast to 1We borrow this terminology from the NLP research community . A large number of research papers have explored the idea of transfer learning , starting from a pre-trained language model , followed by training on a set of pre-finetuning tasks , and then fine-tuning on the target or downstream tasks ( Vu et al. , 2020 ; Gururangan et al. , 2020 ; Pruksachatkun et al. , 2020 ; Chen et al. , 2020a ; Aghajanyan et al. , 2021 ) . using standard supervised learning over both splits as a whole for pre-finetuning , DUEL encourages the encoder to learn to represent the input texts in a way that facilitates greater compositional generalization , and that this transfers across domains and persists through fine-tuning on the target task , as shown by our empirical studies . The rest of the paper is organized as follows . In §2 , we detail our setup . We describe our approach in §4 , followed by empirical studies §5 . We discuss related work in §6 and conclude in §7 . 2 PROBLEM SETUP . Our neural learner is given a pre-finetuning task and a target task . For the pre-finetuning task , we have a training data distribution s and a test/eval data distribution s̃ that may deviate from s. Likewise , for the target task , we have q and q̃ . In the case of compositional generalization , the difference between s and s̃ ( or q versus q̃ ) is defined in compositional terms : the ways in which elements combine differ systematically between the two parts of each datasets ( Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Lake & Baroni , 2018 ; Hupkes et al. , 2020 ) . Our goal is to train a neural model on ( s , s̃ ) and then fine-tune it on q so that the final model performs well on q̃ , namely , attaining strong compositional generalization performance on the target task . Our assumption is that the difference between s and s̃ is similar to the difference between q and q̃ , such that an inductive bias acquired from ( s , s̃ ) can be transferred to the target task . A motivating example is that s̃ contains longer texts than s and so does q̃ than q : in this case , we would investigate whether learning to generalize from short to long texts is a transferrable skill . 3 TASK , DATA SETS AND THEIR COMPOSITIONAL SPLITS . Data Splits In this work , we focus on semantic parsing , the task of translating a natural language text into a formal representation of its semantics . Standard data splits for supervised learning partition a dataset randomly into a training set and testing set . As such , the examples in both portions are drawn from the same distribution . By contrast , compositional splits partition a dataset in a way that creates a distributional discrepancy between the training and the test set , such that strong performance on the test set requires compositional generalization from the training set . Compositional splits are straightforward to create for datasets that are generated from grammars or templates , such as SCAN ( Lake & Baroni , 2018 ) and COGS ( Kim & Linzen , 2020 ) , described in detail in the next section . For instance , the templates used for the test set can include specific words in syntactic roles they did not appear in in the training set , or they can nest syntactic constituents more deeply than in the training set , creating differences in lengths of the input texts . An alternative mechanism creates—based on an existing dataset for which the generative process is not available ( for example , real-world user queries ) —test sets that require compositional generalization by on splitting the dataset so as to obtain the maximum compound divergence ( MCD ) between the training and test examples ( Keysers et al. , 2020 ) . Here , compounds are complex expressions formed by composing atoms , and compound divergence is computed as DC ( V ‖W ) = 1 − C0.1 ( FC ( V ) ‖FC ( W ) ) where F is the distribution over compounds , and Cα ( P‖Q ) = ∑ k p α k q 1−α k . The intuition behind this method is that given an existing dataset it is difficult to limit the test examples to compounds that are completely absent from the training set , but by making the compound distributions as distinct as possible , we are primarily measuring the model ’ s performance on compounds are at least very infrequent in training . We use the MCD split generated for SCAN from Keysers et al . ( 2020 ) and the Target Maximum Compound Divergence ( TMCD ) splits generated for GeoQuery from Shaw et al . ( 2021 ) . TMCD splits extend the MCD methodology to create compositional splits of non-synthetic datasets and define atoms and compounds based on the known syntactic structure of the output logical forms . Datasets and Tasks Table 1 summarizes the 5 compositional splits we use in this paper . We also compared with standard splits ( std ) where the training and test come from the same distribution . As an example for our setting in §2 , taking COGS as our pre-finetuning task and GeoQuery as our target task , we learn from the CG General split of COGS and transfer to the CG General split of GeoQuery . In this example , COGS BASE is the distribution s and COGS CG is the distribution s̃ . GEO TMCD1 is our fine-tuning distribution q and GEO TMCD2 is our final test distribution q̃ . COGS ( Kim & Linzen , 2020 ) is a synthetic semantic parsing dataset generated from templates . The inputs are English sentences and the outputs are corresponding logical forms inspired by λ-calculus , e.g. , A dog ate the cake→ * cake ( x4 ) ; dog ( x1 ) AND eat.agent ( x2 , x1 ) AND eat.theme ( x2 , x4 ) . COGS has two components : a training dataset , which we refer to as COGS BASE , and a compositional generalization ( CG ) dataset COGS CG . Kim & Linzen ( 2020 ) show that the performance of neural models trained on COGS BASE degrades significantly when they are applied to COGS CG . COGS CG includes two kinds of CG challenges : lexical and structural . In lexical CG , familiar words need to be interpreted in new syntactic positions ; for example , in COGS BASE the word hedgehog may occur only in the subject position , in COGS CG it would need to be interpreted as as object . By contrast , structural CG involves new combinations of familiar syntactic structures . For example , in COGS BASE , prepositional phrases only modify objects ( Noah ate the cake on the plate ) , whereas in COGS CG they modify subjects ( The cake on the plate burned ) . Likewise , in COGS BASE prepositional phrases can only be nested once ( Ava saw the ball in the bottle on the table ) , but in COGS CG they are nested multiple times ( Ava saw the ball in the bottle on the table on the floor ) , creating longer sentences . COGS BASE has 24,155 examples and COGS CG has 21,000 examples , of which 18,000 are instances of lexical CG and 3,000 are instances of structural CG . The GeoQuery ( Zelle , 1995 ; Tang & Mooney , 2001 ) is an annotated semantic parsing dataset contains 880 natural language questions about US geography ( e.g. , What states border Texas ? ) . We use the same pre-processing as in Shaw et al . ( 2021 ) , replacing entity mentions with placeholders in the Functional Query Language ( FunQL ; Kate et al . 2005 ) output representations . The input what states border m0 , for example , is associated with the output answer ( intersection ( state , next_to_2 ( m0 ) ) ) . Atoms and compounds are defined over the FunQL expressions . We adopt the length and TMCD splits from Shaw et al . ( 2021 ) . For the length split GEO len , the training set GEO SHORT consists of examples with shorter inputs than the test set GEO LONG . We refer to the training and test set for the TMCD split as GEO TMCD1 and GEO TMCD2 . Both splits divide GeoQuery equally into two sets of 440 examples . The SCAN dataset ( Lake & Baroni , 2018 ) consists of over 20,000 natural language navigation commands and corresponding “ action sequences ” , e.g . jump twice→ JUMP JUMP . SCAN is not a semantic parsing dataset but is commonly used as a diagnostic dataset for evaluating compositional generalization . We adopt the length split ( SCAN len ) and MCD split ( SCAN cd ) introduced by Keysers et al . ( 2020 ) . 4 PROPOSED METHOD . Intuition and Main Idea As mentioned in §2 , our goal is to improve compositional generalization on our target task , where the training distribution is q and the evaluation distribution q̃ . The challenge is to leverage the information in s and s̃ during the pre-finetuning stage such that the model , when fine-tuned on q , generalizes better on q̃ . This contrasts with a standard supervised learning approach , which would collapse together the examples from s and s̃ during pre-finetuning , discarding the information about how examples are divided between s and s̃—information that , we hypothesize , can be useful for encouraging compositional generalization on the target task . We assume a neural encoder-decoder architecture ( Cho et al. , 2014 ) . Our proposed method , DUEL , iteratively updates the parameters of the encoder on examples from s̃ , while keeping the decoder fixed , and then updates the decoder parameters on examples from s , while keeping the encoder fixed . The encoder updates are then retained prior to fine-tuning on q , while the decoder updates are discarded ( as the pre-finetuning and the target tasks are different ) . In contrast to standard fine-tuning , DUEL encourages the encoder to learn to represent the input sequences in a way that facilitates compositional generalization , which we hypothesize will transfer across domains and persist through fine-tuning . Details For encoder-decoder architectures , the model ’ s parameters naturally partition into two sets , θ for the encoder and φ for the decoder , where θ parametrizes the representation f ( x ; θ ) of the input x and φ parametrizes the “ task head ” g ( · ) , which uses that representation to accomplish a task such as classification or semantic parsing . Taken together , the model ’ s output is p ( y|x ; θ , φ ) = g ( f ( x ; θ ) ; φ ) . Given a pre-finetuning task where both s and s̃ are given , our goal is to drive the learner to learn the optimal representation and task head parameters ( θ∗ , φ∗ ) such that g ( f ( x ; θ∗ ) ; φ∗ ) performs the best on both distributions . To achieve this , we design an iterative dueling game that the learner plays with the two distributions . Suppose the learner ’ s parameters are currently ( θ , φ ) . To perform optimally on s̃ , we would like to use the task head g ( · ; φ ) without further training it , i.e. , perform well in an “ zero-shot ” setting ; this setting directly anticipates how learning would proceed for the target task , where we will be training only on q , without exposure to q̃ . Since we are holding the task head g ( · ; φ ) fixed , we need to optimize the representation f ( · ; θ ) such that it models s̃ appropriately . To achieve this desiderata , we update the representation parameters iteratively for at most Tinner steps , according to θ ← θ + α 1 N ∇θ ∑ ( x , y ) ∈Bs̃ log p ( y|x ; θ , φ ) ( 1 ) where B s̃ is a batch of N samples from s̃ and α is the step size.2 Updates to φ follow the reverse logic . The representation function that results from updating θ defines a prior on how s should be represented . When updating the task head parameters φ , our goal is to have the task head perform optimally conditioned on this prior . Concretely , we hold θ fixed and apply iteratively at most Tinner steps to φ : φ← φ+ α 1 N ∇φ ∑ ( x , y ) ∈Bs log p ( y|x ; θ , φ ) ( 2 ) where Bs is a batch of samples from s. Crucially , we alternate between these two types of updates , such that s̃ informs the learner about the compositional inductive bias that should be incorporated into the representation f , and s teaches the learner how to use that representation to perform the task ( here semantic parsing ) . 2Eqns . ( 1-3 ) only aim at illustrating the computation of gradient . We use the Adam optimizer in the implementation . Algorithm 1 : DUEL Require : Data sets s , s̃ ; Learning rate α ; Batch size N ; Outer loop iterations Touter ; Inner loop iterations Tinner ; Inner loop early stopping criteria Tpatience ; Outer loop early stopping criteria Tmin ; Initialize model parameters θ , φ i← 0 while i < Touter do j ← 0 while j < Tinner do Sample a batch Bs from s Compute loss : L ( θ , φ , Bs ) = 1N ∑ ( x , y ) ∈Bs − log p ( y | x ; θ , φ ) Update parameters : φ← φ− α · ∇φL ( θ , φ , Bs ) j ← j + 1 if AccuracyDecreases ( θ , φ , s̃ , Tpatience ) then Early stop : break end end k ← 0 while k < Tinner do Sample a batch Bs̃ from s̃ Compute loss : L ( θ , φ , Bs̃ ) = 1N ∑ ( x , y ) ∈Bs̃ − log p ( y | x ; θ , φ ) Update parameters : θ ← θ − α · ∇θL ( θ , φ , Bs̃ ) k ← k + 1 if AccuracyDecreases ( θ , φ , s , Tpatience ) then Early stop : break end end if k < Tmin then Early stop outer loop : break end i← i+ 1 end Return : Model parameters θ , φ We contrast our approach with the standard supervised learning approach , where the two distributions are merged together as s ∪ s̃ , ignoring the compositional split : ( θ , φ ) ← ( θ , φ ) + η 1 N ∇ ( θ , φ ) ∑ ( x , y ) ∼Bs∪s̃ log p ( y|x ; θ , φ ) ( 3 ) DUEL is used for pre-finetuning . When fine-tuning the model on the target task q , we retain the representation component f ( · ; θ ) and re-initialize the task head g ( · ; φ ) . Both θ and φ are then updated , as is standard , to optimize the loss function on q. DUEL is illustrated schematically in the pre-finetuning panel of Fig . 1 . The pseudocode is listed in Algorithm 1 . The algorithm contains one outer loop for Touter rounds ( with possible early stopping ) , which alternates between inner loops updating θ and φ . The early-stopping monitoring function AccuracyDecreases takes as arguments the current model parameters θ and φ , a data distribution to use for evaluation ( s or s̃ ) , and the maximum patience Tpatience for early-stopping . This function returns true if accuracy on the dataset in question has not improved for Tpatience consecutive steps . To terminate the outer loop ( thus , the algorithm ) , we keep track how many steps the inner update for θ take . If the number steps is smaller than a preset threshold Tmin , we conclude that the algorithm has converged to the desired representation since the difference in representing s and s̃ is small , requiring little adaptation . We do not use the same logic to limit how long it takes to optimize the task head parameters φ , conditioned on the representation , as the goal is to use the derived representation to arrive at a strong performance . | This paper presents a transfer learning strategy for improving compositional generalization of semantic parsers based on pre-trained language models. Before fine-tuning the model on data from the target domain, the authors propose a pre-finetuning step, where models are trained on compositional splits of data from another source domain, with the goal to transfer the model's learned knowledge about language compositionality during this pre-finetuning step to the final learning stage on the target domain, therefore improving compositional generalization. To this end, the authors propose a pre-finetuning method which encourages the model to discover representations of natural language that are invariant against its compositional structures. This is achieved by iteratively freezing the encoder or decoder modules during pre-finetuning, and training the encoder and decoder modules on compositionally disjoint splits of the source data, such that the encoder learns representations that are robust against distributional shift of language compositionality. | SP:340b7f636b900c3110c59392ff7b9c308d3300d2 |
Learning to Generalize Compositionally by Transferring Across Semantic Parsing Tasks | 1 INTRODUCTION . Recent work has spotlighted significant shortcomings of neural network approaches to NLP in coping with compositional generalization ( CG ) ( Lake & Baroni , 2018 ; Finegan-Dollak et al. , 2018 ; Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Shaw et al. , 2021 ) . In those studies , the test set combines in unfamiliar ways linguistic elements that may themselves be familiar from the training set ; for example , sentences in the test set may be longer than those observed in training , or may use familiar words in syntactic roles in which they did not occur in training . The performance of popular neural architectures in contemporary NLP models such as Transformers drops considerably when they are expected to generalize compositionally . Several approaches have been proposed to address this issue , including specialized architectures with compositional inductive biases ( Furrer et al . 2020 ) and compositional data augmentation ( Andreas , 2020 ) , but as of yet the problem is far from solved . In this paper , we study this challenge from the perspective of transferability of compositional generalization skills : is possible for a neural model to transfer compositional generalization skills acquired from one task to another task that also requires compositional generalization skills ? We ground our inquiries with the semantic parsing tasks on three very different datasets : GeoQuery ( Zelle , 1995 ) , COGS ( Kim & Linzen , 2020 ) and SCAN ( Lake & Baroni , 2018 ) . For each task , we use existing compositional training/test splits or create new ones . We propose a learning algorithm that can extract a compositional inductive bias from one task — a stage we refer to as pre-finetuning1 — and transfers that bias to a target task , improving the models ’ compositional generalization behavior on that task . To extract the inductive bias so as to transfer , we introduce a new training algorithm DUEL . In summary ( cf . Fig 1 ) , DUEL is designed to be compatible with pre-trained neural encoder-decoder models , such as T5 ( Raffel et al. , 2020 ) . We view the encoder as learning a representation for the inputs and the decoder as “ a task head ” that is specialized to different tasks . In pre-finetuing , framing the task ’ s two ( compositional ) splits as deriving representation from one split for zero-shot learning to the other split , DUEL trains the encoder and the decoder using different splits . In contrast to 1We borrow this terminology from the NLP research community . A large number of research papers have explored the idea of transfer learning , starting from a pre-trained language model , followed by training on a set of pre-finetuning tasks , and then fine-tuning on the target or downstream tasks ( Vu et al. , 2020 ; Gururangan et al. , 2020 ; Pruksachatkun et al. , 2020 ; Chen et al. , 2020a ; Aghajanyan et al. , 2021 ) . using standard supervised learning over both splits as a whole for pre-finetuning , DUEL encourages the encoder to learn to represent the input texts in a way that facilitates greater compositional generalization , and that this transfers across domains and persists through fine-tuning on the target task , as shown by our empirical studies . The rest of the paper is organized as follows . In §2 , we detail our setup . We describe our approach in §4 , followed by empirical studies §5 . We discuss related work in §6 and conclude in §7 . 2 PROBLEM SETUP . Our neural learner is given a pre-finetuning task and a target task . For the pre-finetuning task , we have a training data distribution s and a test/eval data distribution s̃ that may deviate from s. Likewise , for the target task , we have q and q̃ . In the case of compositional generalization , the difference between s and s̃ ( or q versus q̃ ) is defined in compositional terms : the ways in which elements combine differ systematically between the two parts of each datasets ( Keysers et al. , 2020 ; Kim & Linzen , 2020 ; Lake & Baroni , 2018 ; Hupkes et al. , 2020 ) . Our goal is to train a neural model on ( s , s̃ ) and then fine-tune it on q so that the final model performs well on q̃ , namely , attaining strong compositional generalization performance on the target task . Our assumption is that the difference between s and s̃ is similar to the difference between q and q̃ , such that an inductive bias acquired from ( s , s̃ ) can be transferred to the target task . A motivating example is that s̃ contains longer texts than s and so does q̃ than q : in this case , we would investigate whether learning to generalize from short to long texts is a transferrable skill . 3 TASK , DATA SETS AND THEIR COMPOSITIONAL SPLITS . Data Splits In this work , we focus on semantic parsing , the task of translating a natural language text into a formal representation of its semantics . Standard data splits for supervised learning partition a dataset randomly into a training set and testing set . As such , the examples in both portions are drawn from the same distribution . By contrast , compositional splits partition a dataset in a way that creates a distributional discrepancy between the training and the test set , such that strong performance on the test set requires compositional generalization from the training set . Compositional splits are straightforward to create for datasets that are generated from grammars or templates , such as SCAN ( Lake & Baroni , 2018 ) and COGS ( Kim & Linzen , 2020 ) , described in detail in the next section . For instance , the templates used for the test set can include specific words in syntactic roles they did not appear in in the training set , or they can nest syntactic constituents more deeply than in the training set , creating differences in lengths of the input texts . An alternative mechanism creates—based on an existing dataset for which the generative process is not available ( for example , real-world user queries ) —test sets that require compositional generalization by on splitting the dataset so as to obtain the maximum compound divergence ( MCD ) between the training and test examples ( Keysers et al. , 2020 ) . Here , compounds are complex expressions formed by composing atoms , and compound divergence is computed as DC ( V ‖W ) = 1 − C0.1 ( FC ( V ) ‖FC ( W ) ) where F is the distribution over compounds , and Cα ( P‖Q ) = ∑ k p α k q 1−α k . The intuition behind this method is that given an existing dataset it is difficult to limit the test examples to compounds that are completely absent from the training set , but by making the compound distributions as distinct as possible , we are primarily measuring the model ’ s performance on compounds are at least very infrequent in training . We use the MCD split generated for SCAN from Keysers et al . ( 2020 ) and the Target Maximum Compound Divergence ( TMCD ) splits generated for GeoQuery from Shaw et al . ( 2021 ) . TMCD splits extend the MCD methodology to create compositional splits of non-synthetic datasets and define atoms and compounds based on the known syntactic structure of the output logical forms . Datasets and Tasks Table 1 summarizes the 5 compositional splits we use in this paper . We also compared with standard splits ( std ) where the training and test come from the same distribution . As an example for our setting in §2 , taking COGS as our pre-finetuning task and GeoQuery as our target task , we learn from the CG General split of COGS and transfer to the CG General split of GeoQuery . In this example , COGS BASE is the distribution s and COGS CG is the distribution s̃ . GEO TMCD1 is our fine-tuning distribution q and GEO TMCD2 is our final test distribution q̃ . COGS ( Kim & Linzen , 2020 ) is a synthetic semantic parsing dataset generated from templates . The inputs are English sentences and the outputs are corresponding logical forms inspired by λ-calculus , e.g. , A dog ate the cake→ * cake ( x4 ) ; dog ( x1 ) AND eat.agent ( x2 , x1 ) AND eat.theme ( x2 , x4 ) . COGS has two components : a training dataset , which we refer to as COGS BASE , and a compositional generalization ( CG ) dataset COGS CG . Kim & Linzen ( 2020 ) show that the performance of neural models trained on COGS BASE degrades significantly when they are applied to COGS CG . COGS CG includes two kinds of CG challenges : lexical and structural . In lexical CG , familiar words need to be interpreted in new syntactic positions ; for example , in COGS BASE the word hedgehog may occur only in the subject position , in COGS CG it would need to be interpreted as as object . By contrast , structural CG involves new combinations of familiar syntactic structures . For example , in COGS BASE , prepositional phrases only modify objects ( Noah ate the cake on the plate ) , whereas in COGS CG they modify subjects ( The cake on the plate burned ) . Likewise , in COGS BASE prepositional phrases can only be nested once ( Ava saw the ball in the bottle on the table ) , but in COGS CG they are nested multiple times ( Ava saw the ball in the bottle on the table on the floor ) , creating longer sentences . COGS BASE has 24,155 examples and COGS CG has 21,000 examples , of which 18,000 are instances of lexical CG and 3,000 are instances of structural CG . The GeoQuery ( Zelle , 1995 ; Tang & Mooney , 2001 ) is an annotated semantic parsing dataset contains 880 natural language questions about US geography ( e.g. , What states border Texas ? ) . We use the same pre-processing as in Shaw et al . ( 2021 ) , replacing entity mentions with placeholders in the Functional Query Language ( FunQL ; Kate et al . 2005 ) output representations . The input what states border m0 , for example , is associated with the output answer ( intersection ( state , next_to_2 ( m0 ) ) ) . Atoms and compounds are defined over the FunQL expressions . We adopt the length and TMCD splits from Shaw et al . ( 2021 ) . For the length split GEO len , the training set GEO SHORT consists of examples with shorter inputs than the test set GEO LONG . We refer to the training and test set for the TMCD split as GEO TMCD1 and GEO TMCD2 . Both splits divide GeoQuery equally into two sets of 440 examples . The SCAN dataset ( Lake & Baroni , 2018 ) consists of over 20,000 natural language navigation commands and corresponding “ action sequences ” , e.g . jump twice→ JUMP JUMP . SCAN is not a semantic parsing dataset but is commonly used as a diagnostic dataset for evaluating compositional generalization . We adopt the length split ( SCAN len ) and MCD split ( SCAN cd ) introduced by Keysers et al . ( 2020 ) . 4 PROPOSED METHOD . Intuition and Main Idea As mentioned in §2 , our goal is to improve compositional generalization on our target task , where the training distribution is q and the evaluation distribution q̃ . The challenge is to leverage the information in s and s̃ during the pre-finetuning stage such that the model , when fine-tuned on q , generalizes better on q̃ . This contrasts with a standard supervised learning approach , which would collapse together the examples from s and s̃ during pre-finetuning , discarding the information about how examples are divided between s and s̃—information that , we hypothesize , can be useful for encouraging compositional generalization on the target task . We assume a neural encoder-decoder architecture ( Cho et al. , 2014 ) . Our proposed method , DUEL , iteratively updates the parameters of the encoder on examples from s̃ , while keeping the decoder fixed , and then updates the decoder parameters on examples from s , while keeping the encoder fixed . The encoder updates are then retained prior to fine-tuning on q , while the decoder updates are discarded ( as the pre-finetuning and the target tasks are different ) . In contrast to standard fine-tuning , DUEL encourages the encoder to learn to represent the input sequences in a way that facilitates compositional generalization , which we hypothesize will transfer across domains and persist through fine-tuning . Details For encoder-decoder architectures , the model ’ s parameters naturally partition into two sets , θ for the encoder and φ for the decoder , where θ parametrizes the representation f ( x ; θ ) of the input x and φ parametrizes the “ task head ” g ( · ) , which uses that representation to accomplish a task such as classification or semantic parsing . Taken together , the model ’ s output is p ( y|x ; θ , φ ) = g ( f ( x ; θ ) ; φ ) . Given a pre-finetuning task where both s and s̃ are given , our goal is to drive the learner to learn the optimal representation and task head parameters ( θ∗ , φ∗ ) such that g ( f ( x ; θ∗ ) ; φ∗ ) performs the best on both distributions . To achieve this , we design an iterative dueling game that the learner plays with the two distributions . Suppose the learner ’ s parameters are currently ( θ , φ ) . To perform optimally on s̃ , we would like to use the task head g ( · ; φ ) without further training it , i.e. , perform well in an “ zero-shot ” setting ; this setting directly anticipates how learning would proceed for the target task , where we will be training only on q , without exposure to q̃ . Since we are holding the task head g ( · ; φ ) fixed , we need to optimize the representation f ( · ; θ ) such that it models s̃ appropriately . To achieve this desiderata , we update the representation parameters iteratively for at most Tinner steps , according to θ ← θ + α 1 N ∇θ ∑ ( x , y ) ∈Bs̃ log p ( y|x ; θ , φ ) ( 1 ) where B s̃ is a batch of N samples from s̃ and α is the step size.2 Updates to φ follow the reverse logic . The representation function that results from updating θ defines a prior on how s should be represented . When updating the task head parameters φ , our goal is to have the task head perform optimally conditioned on this prior . Concretely , we hold θ fixed and apply iteratively at most Tinner steps to φ : φ← φ+ α 1 N ∇φ ∑ ( x , y ) ∈Bs log p ( y|x ; θ , φ ) ( 2 ) where Bs is a batch of samples from s. Crucially , we alternate between these two types of updates , such that s̃ informs the learner about the compositional inductive bias that should be incorporated into the representation f , and s teaches the learner how to use that representation to perform the task ( here semantic parsing ) . 2Eqns . ( 1-3 ) only aim at illustrating the computation of gradient . We use the Adam optimizer in the implementation . Algorithm 1 : DUEL Require : Data sets s , s̃ ; Learning rate α ; Batch size N ; Outer loop iterations Touter ; Inner loop iterations Tinner ; Inner loop early stopping criteria Tpatience ; Outer loop early stopping criteria Tmin ; Initialize model parameters θ , φ i← 0 while i < Touter do j ← 0 while j < Tinner do Sample a batch Bs from s Compute loss : L ( θ , φ , Bs ) = 1N ∑ ( x , y ) ∈Bs − log p ( y | x ; θ , φ ) Update parameters : φ← φ− α · ∇φL ( θ , φ , Bs ) j ← j + 1 if AccuracyDecreases ( θ , φ , s̃ , Tpatience ) then Early stop : break end end k ← 0 while k < Tinner do Sample a batch Bs̃ from s̃ Compute loss : L ( θ , φ , Bs̃ ) = 1N ∑ ( x , y ) ∈Bs̃ − log p ( y | x ; θ , φ ) Update parameters : θ ← θ − α · ∇θL ( θ , φ , Bs̃ ) k ← k + 1 if AccuracyDecreases ( θ , φ , s , Tpatience ) then Early stop : break end end if k < Tmin then Early stop outer loop : break end i← i+ 1 end Return : Model parameters θ , φ We contrast our approach with the standard supervised learning approach , where the two distributions are merged together as s ∪ s̃ , ignoring the compositional split : ( θ , φ ) ← ( θ , φ ) + η 1 N ∇ ( θ , φ ) ∑ ( x , y ) ∼Bs∪s̃ log p ( y|x ; θ , φ ) ( 3 ) DUEL is used for pre-finetuning . When fine-tuning the model on the target task q , we retain the representation component f ( · ; θ ) and re-initialize the task head g ( · ; φ ) . Both θ and φ are then updated , as is standard , to optimize the loss function on q. DUEL is illustrated schematically in the pre-finetuning panel of Fig . 1 . The pseudocode is listed in Algorithm 1 . The algorithm contains one outer loop for Touter rounds ( with possible early stopping ) , which alternates between inner loops updating θ and φ . The early-stopping monitoring function AccuracyDecreases takes as arguments the current model parameters θ and φ , a data distribution to use for evaluation ( s or s̃ ) , and the maximum patience Tpatience for early-stopping . This function returns true if accuracy on the dataset in question has not improved for Tpatience consecutive steps . To terminate the outer loop ( thus , the algorithm ) , we keep track how many steps the inner update for θ take . If the number steps is smaller than a preset threshold Tmin , we conclude that the algorithm has converged to the desired representation since the difference in representing s and s̃ is small , requiring little adaptation . We do not use the same logic to limit how long it takes to optimize the task head parameters φ , conditioned on the representation , as the goal is to use the derived representation to arrive at a strong performance . | This paper is focused on the problem of compositional generalization in semantic parsing, and introduces a method called "DUEL", which involves "pre-finetuning" iteratively on compositional train-test splits from other datasets, before transferring to fine-tuning on the training data from the target dataset. The method involves using the compositional train/test split from one dataset, and training their encoder-decoder model iteratively such that the encoder parameters are updated based on the test data from that dataset, and the decoder parameters are updated based on the training data from that dataset. After this "pre-finetuning", the model is fine-tuned on the training data from the target dataset. They find that their model outperforms baselines involving 1) fine-tuning on the target task only, and 2) pre-finetuning on the merged data from the other dataset, without the encoder/decoder split. They find that their method largely does not help with the extremely low numbers on COGS structural items, but the margins of improvement are larger for GeoQuery data and SCAN data, with the authors claiming a new SOTA result on one of the splits for GeoQuery. | SP:340b7f636b900c3110c59392ff7b9c308d3300d2 |
An Experimental Design Perspective on Exploration in Reinforcement Learning | 1 INTRODUCTION . Reinforcement learning ( RL ) has suffered for years from a curse of poor sample complexity . State-ofthe-art model-free reinforcement learning algorithms routinely take tens of thousands of sampled transitions to solve very simple tasks and millions to solve moderately complex ones ( Haarnoja et al. , 2018 ; Lillicrap et al. , 2015 ) . The current best model-based reinforcement learning ( MBRL ) algorithms are better , requiring thousands of samples for simple problems and hundreds of thousands of samples for harder ones ( Chua et al. , 2018 ) . In settings where each sample is expensive , even this smaller cost can be prohibitive for the practical application of RL . For example , in the physical sciences many simulators require the solution of computationally demanding spatial PDEs in plasma control ( Breslau et al. , 2018 ) or aerodynamics applications ( Jameson & Fatica , 2006 ) . In robotics , due to the difficulty of simulating more complicated objects ( Heiden et al. , 2021 ) , typical RL methods operate on fast but limited rigid-body simulators ( Todorov et al. , 2012 ) . These costly transition functions prompt the question : “ If we were to collect one additional datapoint from anywhere in the state-action space to best improve our solution to the task , which one would it be ? ” An answer to this question can be used to guide data collection in RL . Across the fields of black-box optimization and experimental design , techniques have been developed which choose data to collect that are particularly useful in improving the value of the objective function of the problem . For example , Bayesian optimization ( BO ) focuses on maximizing a function for which only a black-box model is available and queries are expensive ( Frazier , 2018 ; Shahriari et al. , 2015 ) . More generally , Bayesian optimal experimental design ( BOED ) aims to choose data to collect which are maximally informative about the value of some derived quantity ( Chaloner & Verdinelli , 1995 ) . We aim to leverage these ideas for data-efficiency in reinforcement learning . Along these lines , several works in the realm of Bayesian RL address this problem in the sequential setting . Bayes-adaptive MDP ( Ross et al. , 2007 ) constructs a modified MDP by augmenting it using the posterior of the MDP , leading to a policy that can optimally trade off between acquiring more information and exploiting the knowledge it already has . However such an MDP is intractable to exactly solve in large spaces so approximations and heuristics have been developed for the solution ( Smith , 2007 ; Guez et al. , 2012 ) . A particularly relevant heuristic is the value of perfect information ( VPI ) from Dearden et al . ( 1998 ) , which attempts to capture the potential change in value of a state if the value of a particular action at that state was perfectly known , specifically in a tabular setting . However , VPI doesn ’ t attempt to distinguish between states that are visited during the execution of the optimal policy and those that aren ’ t . This is a critical distinction when evaluating data to collect in continuous spaces as otherwise queries would be wasted learning the optimal policy in irrelevant parts of the state space . Motivated by our opening question , in this paper we study the setting where the agent collects data by sequentially making queries to the transition function with free choice of both the initial state and the action . We refer to this setting as transition-query reinforcement learning ( TQRL ) and formally define it in Section 3.1 . An effective algorithm for this setting would need to choose informative initial states as well as actions , which to the best of our knowledge has not been studied in the continuous MDP literature . In this work , we draw a connection between MBRL and the world of BOED by deriving an acquisition function that quantifies how much information a state-action pair would provide about the optimal solution to a MDP . Like the techniques in Bayesian RL , our acquisition function is able to determine which state-action pairs are worth acquiring in a way which takes into account the reward function and the uncertainty in the dynamics . However , like the full Bayes-Adaptive MDP and unlike the VPI heuristic , this function takes into account the current estimates of which states the optimal policy will actually visit and values potential queries accordingly . It is also scalable enough to apply to multidimensional continuous control problems . In particular , our acquisition function is the expected information gain ( EIG ) about the trajectory taken by an optimal policy in the MDP that would be achieved if we were to query the transition function at a given state-action pair . Finally , we assess the performance of our acquisition function as a data selection strategy in the TQRL setting . Using this method we are able to solve several continuous reinforcement learning tasks ( including a nuclear fusion example ) using orders of magnitude less data than a variety of competitor methods . In summary , the contributions of our paper are : • We construct a novel acquisition function that quantifies how much information a stateaction pair would provide about the optimal solution to a continuous MDP if the next state were observed from the ground truth transition function . Our function is able to select relevant datapoints for control purposes leading to much-improved data efficiency . • We propose a practical algorithm for computing this acquisition function and use it to solve continuous MDPs in the TQRL setting . • We evaluate the algorithm on five widely varying control tasks , where it is often orders of magnitude more sample-efficient than competitor methods and reaches similar asymptotic performance . 2 RELATED WORK . Transition Query Reinforcement Learning In many RL algorithms , data is collected by initializing a policy at a start state and executing actions in the environment in an episodic manner . Kearns et al . ( 2002 ) introduced the setting where the agent collects data by sampling transitions in a sequential manner from the ground truth transition model by querying at a state and action of its choice , which they refer to as RL with access to a generative model . We refer to this setting for brevity as TQRL . This setting is relevant in a variety of real-world applications where there is a simulator of the transition model available . We in particular see the setting in nuclear fusion research , where plasma dynamics are modeled by solving large partial differential equations where 200ms of plasma time can take up to an hour in simulation ( Breslau et al. , 2018 ) . There is substantial theoretical work on TQRL for finite MDPs . In particular , Azar et al . ( 2013 ) give matching log-linear upper and lower PAC sample complexity bounds , a substantial speedup to the upper bound for the standard problem which is quadratic in state size ( Kakade , 2003 ) . This is achieved simply by the naive algorithm of learning a transition model by uniformly sampling the space and then performing value iteration on the estimate of the MDP for an optimal policy . More recently , the bound for this setting was tightened to hold for smaller numbers of samples by Li et al . ( 2020 ) , meaning that for any dataset size in a continuous problem , the PAC performance can be quantified . Finally , Agarwal et al . ( 2020 ) show that the naive ‘ plug-in ’ estimator used in the previous works is minimax optimal for this setting . In summary , this setting is thoroughly understood for finite MDPs and it gives a sample complexity reduction from quadratic to linear in the state space size . To our knowledge there do not exist works specifically solving the TQRL setting , though every standard RL algorithm can be applied in this setting by continuing to collect data in an online manner . In this work , we give an algorithm specifically designed for this setting in continuous MDPs . Our work empirically shows sample complexity benefits reminiscent of those theoretically shown in the tabular setting . Exploration in Reinforcement Learning To encourage exploration in RL , agents often use an - greedy approach ( Mnih et al. , 2013 ) , upper confidence bounds ( UCB ) ( Chen et al. , 2017 ) , Thompson sampling ( Osband et al. , 2016 ) , added Ornstein-Uhlenbeck action noise ( Lillicrap et al. , 2015 ) , or entropy bonuses ( Haarnoja et al. , 2018 ) to add noise to a policy which is otherwise optimizing the RL objective . Though UCB , Thompson Sampling , and an entropy bonus all try to explore in a way which can adapt to the problem , they all tackle which action to take from a predetermined state and don ’ t explicitly consider which states would be good to acquire data from . As we mentioned , an ideal method of exploration would be to solve the intractable Bayes-adaptive MDP ( Ross et al. , 2007 ) , giving an optimal tradeoff between exploration and exploitation . Kolter & Ng ( 2009 ) ; Guez et al . ( 2012 ) show that even approximating these techniques in the sequential setting can result in substantial theoretical reductions in sample complexity compared to frequentist PACMDP bounds as in Kakade ( 2003 ) . Other methods stemming from Dearden et al . ( 1998 ; 1999 ) address this by using the myopic Value of Perfect Information as a heuristic for similar Bayesian exploration . These methods don ’ t scale to continuous problems and don ’ t give any method of choosing at which states to query , only actions given a current state . These methods were further extended with the development of Knowledge Gradient policies ( Ryzhov et al. , 2019 ; Ryzhov & Powell , 2011 ) , which approximate the value function of the Bayes-adaptive MDP , and Information-Directed Sampling ( Russo & Van Roy , 2014 ) , which takes actions based on minimizing the ratio between squared regret and information gain over dynamics . This was extended to continuous-state finite-action settings in Nikolov et al . ( 2019 ) . However , this work doesn ’ t solve fully continuous problems , operates in the rollout setting rather than TQRL , and computes the information gain with respect to the dynamics rather than some notion of the optimal policy . A tutorial on Bayesian methods can be found in Ghavamzadeh et al . ( 2016 ) for further reference . Separate from the techniques used in RL for a particular task , several methods tackle the problem of unsupervised exploration ( Schmidhuber , 1991 ) , where the goal is to learn as much as possible about the transition model without a task or reward function . One approach synthesizes a reward from modeling errors ( Pathak et al. , 2017 ) . Another estimates learning progress by estimating model accuracy ( Lopes et al. , 2012 ) . Others use an information gain-motivated formulation of model disagreement ( Pathak et al. , 2019 ; Shyam et al. , 2019 ) as a reward . Other methods incentivize the policy to explore regions it hasn ’ t been before using hash-based counts ( Tang et al. , 2017 ) , predictions mimicking a randomly initialized network ( Burda et al. , 2019 ) , or a density estimate ( Bellemare et al. , 2016 ) . However , these methods all assume that there is no reward function and would be inefficient if used in that setting as they spend time exploring areas of state space which can be quickly determined to be bad for maximizing reward on a task . Bayesian Algorithm Execution and BOED Recently , a flexible framework known as Bayesian algorithm execution ( BAX ) ( Neiswanger et al. , 2021 ) has been proposed for efficiently estimating properties of expensive black-box functions , which builds off of a large literature from Bayesian Optimal Experiment Design ( Chaloner & Verdinelli , 1995 ) . The BAX framework gives a general procedure for sampling points which are informative about the future execution of an algorithm . In this paper , we extend this framework to the setting of model-predictive control , when we have expensive dynamics ( i.e . transition function ) which we treat as a black-box function in the BAX framework . Via this strategy , we are able to use similar techniques to develop acquisition functions for data collection in reinforcement learning . Gaussian Processes ( GPs ) in Reinforcement Learning There has been substantial prior work using GPs in reinforcement learning . Most well-known is PILCO ( Deisenroth & Rasmussen , 2011 ) , which computes approximate analytic gradients of policy parameters through the GP dynamics model while accounting for uncertainty . Most related to our eventual MPC method is ( Kamthe & Deisenroth , 2018 ) , which gives a principled probabilistic model-predictive control algorithm for GPs . | This paper considers the very relevant (in my opinion) problem of data-efficient RL and is potentially applicable in nearly all situations where RL is to be applied in the real-world rather than a simulator. The authors propose an acquisition function based on expected information gain (EIG) approach. The overall framework consists of a (1) Gaussian process model of the transition dynamics, (2) an MPC approximation of the optimal policy, (3) the EIG acquisition function where the target variable is the sequence of states visited by the optimal policy. Empirical results are shown for a number of continuous control domains. | SP:38fa2711673e506fcd00103d7fccdaef7a74554a |
An Experimental Design Perspective on Exploration in Reinforcement Learning | 1 INTRODUCTION . Reinforcement learning ( RL ) has suffered for years from a curse of poor sample complexity . State-ofthe-art model-free reinforcement learning algorithms routinely take tens of thousands of sampled transitions to solve very simple tasks and millions to solve moderately complex ones ( Haarnoja et al. , 2018 ; Lillicrap et al. , 2015 ) . The current best model-based reinforcement learning ( MBRL ) algorithms are better , requiring thousands of samples for simple problems and hundreds of thousands of samples for harder ones ( Chua et al. , 2018 ) . In settings where each sample is expensive , even this smaller cost can be prohibitive for the practical application of RL . For example , in the physical sciences many simulators require the solution of computationally demanding spatial PDEs in plasma control ( Breslau et al. , 2018 ) or aerodynamics applications ( Jameson & Fatica , 2006 ) . In robotics , due to the difficulty of simulating more complicated objects ( Heiden et al. , 2021 ) , typical RL methods operate on fast but limited rigid-body simulators ( Todorov et al. , 2012 ) . These costly transition functions prompt the question : “ If we were to collect one additional datapoint from anywhere in the state-action space to best improve our solution to the task , which one would it be ? ” An answer to this question can be used to guide data collection in RL . Across the fields of black-box optimization and experimental design , techniques have been developed which choose data to collect that are particularly useful in improving the value of the objective function of the problem . For example , Bayesian optimization ( BO ) focuses on maximizing a function for which only a black-box model is available and queries are expensive ( Frazier , 2018 ; Shahriari et al. , 2015 ) . More generally , Bayesian optimal experimental design ( BOED ) aims to choose data to collect which are maximally informative about the value of some derived quantity ( Chaloner & Verdinelli , 1995 ) . We aim to leverage these ideas for data-efficiency in reinforcement learning . Along these lines , several works in the realm of Bayesian RL address this problem in the sequential setting . Bayes-adaptive MDP ( Ross et al. , 2007 ) constructs a modified MDP by augmenting it using the posterior of the MDP , leading to a policy that can optimally trade off between acquiring more information and exploiting the knowledge it already has . However such an MDP is intractable to exactly solve in large spaces so approximations and heuristics have been developed for the solution ( Smith , 2007 ; Guez et al. , 2012 ) . A particularly relevant heuristic is the value of perfect information ( VPI ) from Dearden et al . ( 1998 ) , which attempts to capture the potential change in value of a state if the value of a particular action at that state was perfectly known , specifically in a tabular setting . However , VPI doesn ’ t attempt to distinguish between states that are visited during the execution of the optimal policy and those that aren ’ t . This is a critical distinction when evaluating data to collect in continuous spaces as otherwise queries would be wasted learning the optimal policy in irrelevant parts of the state space . Motivated by our opening question , in this paper we study the setting where the agent collects data by sequentially making queries to the transition function with free choice of both the initial state and the action . We refer to this setting as transition-query reinforcement learning ( TQRL ) and formally define it in Section 3.1 . An effective algorithm for this setting would need to choose informative initial states as well as actions , which to the best of our knowledge has not been studied in the continuous MDP literature . In this work , we draw a connection between MBRL and the world of BOED by deriving an acquisition function that quantifies how much information a state-action pair would provide about the optimal solution to a MDP . Like the techniques in Bayesian RL , our acquisition function is able to determine which state-action pairs are worth acquiring in a way which takes into account the reward function and the uncertainty in the dynamics . However , like the full Bayes-Adaptive MDP and unlike the VPI heuristic , this function takes into account the current estimates of which states the optimal policy will actually visit and values potential queries accordingly . It is also scalable enough to apply to multidimensional continuous control problems . In particular , our acquisition function is the expected information gain ( EIG ) about the trajectory taken by an optimal policy in the MDP that would be achieved if we were to query the transition function at a given state-action pair . Finally , we assess the performance of our acquisition function as a data selection strategy in the TQRL setting . Using this method we are able to solve several continuous reinforcement learning tasks ( including a nuclear fusion example ) using orders of magnitude less data than a variety of competitor methods . In summary , the contributions of our paper are : • We construct a novel acquisition function that quantifies how much information a stateaction pair would provide about the optimal solution to a continuous MDP if the next state were observed from the ground truth transition function . Our function is able to select relevant datapoints for control purposes leading to much-improved data efficiency . • We propose a practical algorithm for computing this acquisition function and use it to solve continuous MDPs in the TQRL setting . • We evaluate the algorithm on five widely varying control tasks , where it is often orders of magnitude more sample-efficient than competitor methods and reaches similar asymptotic performance . 2 RELATED WORK . Transition Query Reinforcement Learning In many RL algorithms , data is collected by initializing a policy at a start state and executing actions in the environment in an episodic manner . Kearns et al . ( 2002 ) introduced the setting where the agent collects data by sampling transitions in a sequential manner from the ground truth transition model by querying at a state and action of its choice , which they refer to as RL with access to a generative model . We refer to this setting for brevity as TQRL . This setting is relevant in a variety of real-world applications where there is a simulator of the transition model available . We in particular see the setting in nuclear fusion research , where plasma dynamics are modeled by solving large partial differential equations where 200ms of plasma time can take up to an hour in simulation ( Breslau et al. , 2018 ) . There is substantial theoretical work on TQRL for finite MDPs . In particular , Azar et al . ( 2013 ) give matching log-linear upper and lower PAC sample complexity bounds , a substantial speedup to the upper bound for the standard problem which is quadratic in state size ( Kakade , 2003 ) . This is achieved simply by the naive algorithm of learning a transition model by uniformly sampling the space and then performing value iteration on the estimate of the MDP for an optimal policy . More recently , the bound for this setting was tightened to hold for smaller numbers of samples by Li et al . ( 2020 ) , meaning that for any dataset size in a continuous problem , the PAC performance can be quantified . Finally , Agarwal et al . ( 2020 ) show that the naive ‘ plug-in ’ estimator used in the previous works is minimax optimal for this setting . In summary , this setting is thoroughly understood for finite MDPs and it gives a sample complexity reduction from quadratic to linear in the state space size . To our knowledge there do not exist works specifically solving the TQRL setting , though every standard RL algorithm can be applied in this setting by continuing to collect data in an online manner . In this work , we give an algorithm specifically designed for this setting in continuous MDPs . Our work empirically shows sample complexity benefits reminiscent of those theoretically shown in the tabular setting . Exploration in Reinforcement Learning To encourage exploration in RL , agents often use an - greedy approach ( Mnih et al. , 2013 ) , upper confidence bounds ( UCB ) ( Chen et al. , 2017 ) , Thompson sampling ( Osband et al. , 2016 ) , added Ornstein-Uhlenbeck action noise ( Lillicrap et al. , 2015 ) , or entropy bonuses ( Haarnoja et al. , 2018 ) to add noise to a policy which is otherwise optimizing the RL objective . Though UCB , Thompson Sampling , and an entropy bonus all try to explore in a way which can adapt to the problem , they all tackle which action to take from a predetermined state and don ’ t explicitly consider which states would be good to acquire data from . As we mentioned , an ideal method of exploration would be to solve the intractable Bayes-adaptive MDP ( Ross et al. , 2007 ) , giving an optimal tradeoff between exploration and exploitation . Kolter & Ng ( 2009 ) ; Guez et al . ( 2012 ) show that even approximating these techniques in the sequential setting can result in substantial theoretical reductions in sample complexity compared to frequentist PACMDP bounds as in Kakade ( 2003 ) . Other methods stemming from Dearden et al . ( 1998 ; 1999 ) address this by using the myopic Value of Perfect Information as a heuristic for similar Bayesian exploration . These methods don ’ t scale to continuous problems and don ’ t give any method of choosing at which states to query , only actions given a current state . These methods were further extended with the development of Knowledge Gradient policies ( Ryzhov et al. , 2019 ; Ryzhov & Powell , 2011 ) , which approximate the value function of the Bayes-adaptive MDP , and Information-Directed Sampling ( Russo & Van Roy , 2014 ) , which takes actions based on minimizing the ratio between squared regret and information gain over dynamics . This was extended to continuous-state finite-action settings in Nikolov et al . ( 2019 ) . However , this work doesn ’ t solve fully continuous problems , operates in the rollout setting rather than TQRL , and computes the information gain with respect to the dynamics rather than some notion of the optimal policy . A tutorial on Bayesian methods can be found in Ghavamzadeh et al . ( 2016 ) for further reference . Separate from the techniques used in RL for a particular task , several methods tackle the problem of unsupervised exploration ( Schmidhuber , 1991 ) , where the goal is to learn as much as possible about the transition model without a task or reward function . One approach synthesizes a reward from modeling errors ( Pathak et al. , 2017 ) . Another estimates learning progress by estimating model accuracy ( Lopes et al. , 2012 ) . Others use an information gain-motivated formulation of model disagreement ( Pathak et al. , 2019 ; Shyam et al. , 2019 ) as a reward . Other methods incentivize the policy to explore regions it hasn ’ t been before using hash-based counts ( Tang et al. , 2017 ) , predictions mimicking a randomly initialized network ( Burda et al. , 2019 ) , or a density estimate ( Bellemare et al. , 2016 ) . However , these methods all assume that there is no reward function and would be inefficient if used in that setting as they spend time exploring areas of state space which can be quickly determined to be bad for maximizing reward on a task . Bayesian Algorithm Execution and BOED Recently , a flexible framework known as Bayesian algorithm execution ( BAX ) ( Neiswanger et al. , 2021 ) has been proposed for efficiently estimating properties of expensive black-box functions , which builds off of a large literature from Bayesian Optimal Experiment Design ( Chaloner & Verdinelli , 1995 ) . The BAX framework gives a general procedure for sampling points which are informative about the future execution of an algorithm . In this paper , we extend this framework to the setting of model-predictive control , when we have expensive dynamics ( i.e . transition function ) which we treat as a black-box function in the BAX framework . Via this strategy , we are able to use similar techniques to develop acquisition functions for data collection in reinforcement learning . Gaussian Processes ( GPs ) in Reinforcement Learning There has been substantial prior work using GPs in reinforcement learning . Most well-known is PILCO ( Deisenroth & Rasmussen , 2011 ) , which computes approximate analytic gradients of policy parameters through the GP dynamics model while accounting for uncertainty . Most related to our eventual MPC method is ( Kamthe & Deisenroth , 2018 ) , which gives a principled probabilistic model-predictive control algorithm for GPs . | This paper proposes an active learning method for transition query RL (TQRL) in continous domains. In TQRL, an agent queries the dynamics of the transition function at arbitrary state-action pairs in order to estimate the system dynamics. The objective is to query pairs that are most useful in solving the underlying control problem. The paper formulates TQRL as an expected information gain (EIG) maximization given the current dataset of observed state transitions, and applies posterior function sampling to evaluate EIG. The method is empirically evaluated in five continuous control tasks, with improvements in empirical sample complexity. | SP:38fa2711673e506fcd00103d7fccdaef7a74554a |
An Experimental Design Perspective on Exploration in Reinforcement Learning | 1 INTRODUCTION . Reinforcement learning ( RL ) has suffered for years from a curse of poor sample complexity . State-ofthe-art model-free reinforcement learning algorithms routinely take tens of thousands of sampled transitions to solve very simple tasks and millions to solve moderately complex ones ( Haarnoja et al. , 2018 ; Lillicrap et al. , 2015 ) . The current best model-based reinforcement learning ( MBRL ) algorithms are better , requiring thousands of samples for simple problems and hundreds of thousands of samples for harder ones ( Chua et al. , 2018 ) . In settings where each sample is expensive , even this smaller cost can be prohibitive for the practical application of RL . For example , in the physical sciences many simulators require the solution of computationally demanding spatial PDEs in plasma control ( Breslau et al. , 2018 ) or aerodynamics applications ( Jameson & Fatica , 2006 ) . In robotics , due to the difficulty of simulating more complicated objects ( Heiden et al. , 2021 ) , typical RL methods operate on fast but limited rigid-body simulators ( Todorov et al. , 2012 ) . These costly transition functions prompt the question : “ If we were to collect one additional datapoint from anywhere in the state-action space to best improve our solution to the task , which one would it be ? ” An answer to this question can be used to guide data collection in RL . Across the fields of black-box optimization and experimental design , techniques have been developed which choose data to collect that are particularly useful in improving the value of the objective function of the problem . For example , Bayesian optimization ( BO ) focuses on maximizing a function for which only a black-box model is available and queries are expensive ( Frazier , 2018 ; Shahriari et al. , 2015 ) . More generally , Bayesian optimal experimental design ( BOED ) aims to choose data to collect which are maximally informative about the value of some derived quantity ( Chaloner & Verdinelli , 1995 ) . We aim to leverage these ideas for data-efficiency in reinforcement learning . Along these lines , several works in the realm of Bayesian RL address this problem in the sequential setting . Bayes-adaptive MDP ( Ross et al. , 2007 ) constructs a modified MDP by augmenting it using the posterior of the MDP , leading to a policy that can optimally trade off between acquiring more information and exploiting the knowledge it already has . However such an MDP is intractable to exactly solve in large spaces so approximations and heuristics have been developed for the solution ( Smith , 2007 ; Guez et al. , 2012 ) . A particularly relevant heuristic is the value of perfect information ( VPI ) from Dearden et al . ( 1998 ) , which attempts to capture the potential change in value of a state if the value of a particular action at that state was perfectly known , specifically in a tabular setting . However , VPI doesn ’ t attempt to distinguish between states that are visited during the execution of the optimal policy and those that aren ’ t . This is a critical distinction when evaluating data to collect in continuous spaces as otherwise queries would be wasted learning the optimal policy in irrelevant parts of the state space . Motivated by our opening question , in this paper we study the setting where the agent collects data by sequentially making queries to the transition function with free choice of both the initial state and the action . We refer to this setting as transition-query reinforcement learning ( TQRL ) and formally define it in Section 3.1 . An effective algorithm for this setting would need to choose informative initial states as well as actions , which to the best of our knowledge has not been studied in the continuous MDP literature . In this work , we draw a connection between MBRL and the world of BOED by deriving an acquisition function that quantifies how much information a state-action pair would provide about the optimal solution to a MDP . Like the techniques in Bayesian RL , our acquisition function is able to determine which state-action pairs are worth acquiring in a way which takes into account the reward function and the uncertainty in the dynamics . However , like the full Bayes-Adaptive MDP and unlike the VPI heuristic , this function takes into account the current estimates of which states the optimal policy will actually visit and values potential queries accordingly . It is also scalable enough to apply to multidimensional continuous control problems . In particular , our acquisition function is the expected information gain ( EIG ) about the trajectory taken by an optimal policy in the MDP that would be achieved if we were to query the transition function at a given state-action pair . Finally , we assess the performance of our acquisition function as a data selection strategy in the TQRL setting . Using this method we are able to solve several continuous reinforcement learning tasks ( including a nuclear fusion example ) using orders of magnitude less data than a variety of competitor methods . In summary , the contributions of our paper are : • We construct a novel acquisition function that quantifies how much information a stateaction pair would provide about the optimal solution to a continuous MDP if the next state were observed from the ground truth transition function . Our function is able to select relevant datapoints for control purposes leading to much-improved data efficiency . • We propose a practical algorithm for computing this acquisition function and use it to solve continuous MDPs in the TQRL setting . • We evaluate the algorithm on five widely varying control tasks , where it is often orders of magnitude more sample-efficient than competitor methods and reaches similar asymptotic performance . 2 RELATED WORK . Transition Query Reinforcement Learning In many RL algorithms , data is collected by initializing a policy at a start state and executing actions in the environment in an episodic manner . Kearns et al . ( 2002 ) introduced the setting where the agent collects data by sampling transitions in a sequential manner from the ground truth transition model by querying at a state and action of its choice , which they refer to as RL with access to a generative model . We refer to this setting for brevity as TQRL . This setting is relevant in a variety of real-world applications where there is a simulator of the transition model available . We in particular see the setting in nuclear fusion research , where plasma dynamics are modeled by solving large partial differential equations where 200ms of plasma time can take up to an hour in simulation ( Breslau et al. , 2018 ) . There is substantial theoretical work on TQRL for finite MDPs . In particular , Azar et al . ( 2013 ) give matching log-linear upper and lower PAC sample complexity bounds , a substantial speedup to the upper bound for the standard problem which is quadratic in state size ( Kakade , 2003 ) . This is achieved simply by the naive algorithm of learning a transition model by uniformly sampling the space and then performing value iteration on the estimate of the MDP for an optimal policy . More recently , the bound for this setting was tightened to hold for smaller numbers of samples by Li et al . ( 2020 ) , meaning that for any dataset size in a continuous problem , the PAC performance can be quantified . Finally , Agarwal et al . ( 2020 ) show that the naive ‘ plug-in ’ estimator used in the previous works is minimax optimal for this setting . In summary , this setting is thoroughly understood for finite MDPs and it gives a sample complexity reduction from quadratic to linear in the state space size . To our knowledge there do not exist works specifically solving the TQRL setting , though every standard RL algorithm can be applied in this setting by continuing to collect data in an online manner . In this work , we give an algorithm specifically designed for this setting in continuous MDPs . Our work empirically shows sample complexity benefits reminiscent of those theoretically shown in the tabular setting . Exploration in Reinforcement Learning To encourage exploration in RL , agents often use an - greedy approach ( Mnih et al. , 2013 ) , upper confidence bounds ( UCB ) ( Chen et al. , 2017 ) , Thompson sampling ( Osband et al. , 2016 ) , added Ornstein-Uhlenbeck action noise ( Lillicrap et al. , 2015 ) , or entropy bonuses ( Haarnoja et al. , 2018 ) to add noise to a policy which is otherwise optimizing the RL objective . Though UCB , Thompson Sampling , and an entropy bonus all try to explore in a way which can adapt to the problem , they all tackle which action to take from a predetermined state and don ’ t explicitly consider which states would be good to acquire data from . As we mentioned , an ideal method of exploration would be to solve the intractable Bayes-adaptive MDP ( Ross et al. , 2007 ) , giving an optimal tradeoff between exploration and exploitation . Kolter & Ng ( 2009 ) ; Guez et al . ( 2012 ) show that even approximating these techniques in the sequential setting can result in substantial theoretical reductions in sample complexity compared to frequentist PACMDP bounds as in Kakade ( 2003 ) . Other methods stemming from Dearden et al . ( 1998 ; 1999 ) address this by using the myopic Value of Perfect Information as a heuristic for similar Bayesian exploration . These methods don ’ t scale to continuous problems and don ’ t give any method of choosing at which states to query , only actions given a current state . These methods were further extended with the development of Knowledge Gradient policies ( Ryzhov et al. , 2019 ; Ryzhov & Powell , 2011 ) , which approximate the value function of the Bayes-adaptive MDP , and Information-Directed Sampling ( Russo & Van Roy , 2014 ) , which takes actions based on minimizing the ratio between squared regret and information gain over dynamics . This was extended to continuous-state finite-action settings in Nikolov et al . ( 2019 ) . However , this work doesn ’ t solve fully continuous problems , operates in the rollout setting rather than TQRL , and computes the information gain with respect to the dynamics rather than some notion of the optimal policy . A tutorial on Bayesian methods can be found in Ghavamzadeh et al . ( 2016 ) for further reference . Separate from the techniques used in RL for a particular task , several methods tackle the problem of unsupervised exploration ( Schmidhuber , 1991 ) , where the goal is to learn as much as possible about the transition model without a task or reward function . One approach synthesizes a reward from modeling errors ( Pathak et al. , 2017 ) . Another estimates learning progress by estimating model accuracy ( Lopes et al. , 2012 ) . Others use an information gain-motivated formulation of model disagreement ( Pathak et al. , 2019 ; Shyam et al. , 2019 ) as a reward . Other methods incentivize the policy to explore regions it hasn ’ t been before using hash-based counts ( Tang et al. , 2017 ) , predictions mimicking a randomly initialized network ( Burda et al. , 2019 ) , or a density estimate ( Bellemare et al. , 2016 ) . However , these methods all assume that there is no reward function and would be inefficient if used in that setting as they spend time exploring areas of state space which can be quickly determined to be bad for maximizing reward on a task . Bayesian Algorithm Execution and BOED Recently , a flexible framework known as Bayesian algorithm execution ( BAX ) ( Neiswanger et al. , 2021 ) has been proposed for efficiently estimating properties of expensive black-box functions , which builds off of a large literature from Bayesian Optimal Experiment Design ( Chaloner & Verdinelli , 1995 ) . The BAX framework gives a general procedure for sampling points which are informative about the future execution of an algorithm . In this paper , we extend this framework to the setting of model-predictive control , when we have expensive dynamics ( i.e . transition function ) which we treat as a black-box function in the BAX framework . Via this strategy , we are able to use similar techniques to develop acquisition functions for data collection in reinforcement learning . Gaussian Processes ( GPs ) in Reinforcement Learning There has been substantial prior work using GPs in reinforcement learning . Most well-known is PILCO ( Deisenroth & Rasmussen , 2011 ) , which computes approximate analytic gradients of policy parameters through the GP dynamics model while accounting for uncertainty . Most related to our eventual MPC method is ( Kamthe & Deisenroth , 2018 ) , which gives a principled probabilistic model-predictive control algorithm for GPs . | This paper uses insight from Bayesian optimal experimental design and define an *acquisition function* which quantifies information gain about an MDP's optimal solution given a state-action pair. Such an acquisition function would provide a mechanism for selecting which transitions to query from a ground truth model in model-based RL, in hopes to greatly improve sample efficiency of a learning algorithm. They propose a method for computing this acquisition function, and evaluate it empirically. | SP:38fa2711673e506fcd00103d7fccdaef7a74554a |
Non-Autoregressive Models are Better Multilingual Translators | 1 INTRODUCTION . Neural machine translation ( NMT ) is the current state-of-the-art approach ( Bahdanau et al. , 2014 ; Sutskever et al. , 2014 ) for machine translation in both academia ( Bojar et al. , 2017 ) and industry ( Hassan et al. , 2018 ) . Recent works ( Firat et al. , 2016 ; Johnson et al. , 2017 ; Aharoni et al. , 2019 ; Lin et al. , 2020 ) extend the approach to support multilingual translation , i.e . training a single model that can translate across multiple language directions . Multilingual models are appealing for several reasons . First , they can reduce the online translation service number , enabling simpler deployment ( Arivazhagan et al. , 2019 ) when plenty of translation directions are required . Additionally , multilingual training makes it possible to transfer knowledge from high-resource languages to low-resource ones , thus improving the translation quality of low-resource directions ( Zoph et al. , 2016 ; Johnson et al. , 2017 ; Wang & Neubig , 2019 ) . However , most multilingual NMT systems are built upon the autoregressive architecture , which translates from left to right and thus is not efficient enough in terms of translation speed . Such efficiency problem is more serious in multilingual setting because all translation directions suffer from this slow inference speed . A straightforward solution to improve the multilingual translation efficiency is to develop multilingual non-autoregressive translation ( NAT ) . NAT generates translation outputs in parallel ( Gu et al. , 2018 ) , which leads to significantly faster translation speed . Thanks to the recent progress of NAT ( Ghazvininejad et al. , 2019 ; Gu et al. , 2019 ; Deng & Rush , 2020 ) , current state-of-the-art NAT models have achieved comparable BLEU scores ( Li et al. , 2018 ; Wei et al. , 2019 ; Qian et al. , 2020 ) with their auto-regressive counterparts . Among them , the glancing transformer ( GLAT ) proposed by Qian et al . ( 2020 ) is a representative work , which even outperforms many strong autoregressive translation systems in BLEU score on German-English translation task of WMT21 ( Qian et al. , 2021 ) . In this paper , we argue that multilingual NAT models is not only superior in efficiency , but also can achieve better multilingual translation accuracy , due to its capability of generating high quality codeswitched translations ( Lin et al. , 2020 ; Yang et al. , 2020 ; Jose et al. , 2020 ) . In particular , we propose switch-GLAT , a carefully designed multilingual version of GLAT , which can outperform multilingual Transformer in both speed and translation quality . Generally , the main idea of switch-GLAT is to employ a code-switch decoder , which can generate contextual code-switched translations ( instead of using dictionary for replacement ) for a given source sentence , and then perform code-switch back-translation to boost the multilingual translation performance . In more details , the glancing sampling module in GLAT enables switch-GLAT to generate partial translation based on others . Then combined with its multilingual and non-autoregressive characteristics , switch-GLAT could output Encoder H ParallelDecoder Glancing Compute Distance H ' ParallelDecoder Sample words Replace Input H Compute Loss code-switched translations with the employment of token-level language tags instead of sentencelevel ones in auto-regressive models . Ultimately , switch-GLAT can generate contextual translated words at arbitrary positions of the target sentence in arbitrary languages . This greatly improves the multilingual translation performance when we reverse the pairs of source to contextual code-switched target sentences , for training in a back-translation fashion ( so called code-switch back-translation ) . We conduct extensive experiments on 3 merged translation datasets : WMT with four language pairs ( both close languages and distant ones ) and WMT with 10 language pairs . switch-GLAT shows consistent improvements over autoregressive multilingual baselines on all datasets , validating that switch-GLAT can achieve better multilingual translation performance simultaneously with a faster decoding speed . We further evaluated the cross-lingual representations through word induction and sentence retrieval tasks . The results demonstrated the proposed code-switch back-translation benefits better-aligned cross-lingual representations . 2 BACKGROUND . Multilingual Neural Machine Translation ( MNMT ) Given a source sentence X = { x1 , x2 , ... , xM } with length M and its target sentence Y = { y1 , y2 , ... , yN } with length N , MNMT leverages the standard bilingual neural machine translation models and extends the source and target inputs respectively with a source and target language token src and tgt . This results in X ′ = { src , x1 , x2 , ... , xM } and Y ′ = { tgt , y1 , y2 , ... , yN } . MNMT is generally modeled from X ′ to Y ′ with Transformer ( Vaswani et al. , 2017 ) . Transformer consists of stacked encoder and decoder layers , which are jointly trained to maximize the conditional probability of Y ′ given X ′ : P ( Y ′|X ′ ) = N∑ i=1 logP ( yi|y < i , X ′ , tgt ; θ ) ( 1 ) where θ are the trainable model parameters . Glancing Transformer prposed by Qian et al . ( 2020 ) is a NAT architecture which achieves top results in machine translation with 8x ∼ 15x speedup . It performs two-pass decoding in training but is still fully auto-regressive in inference . In the first decoding pass , given the encoder Fe and decoder Fd , H0d = { h01 , h02 , ... , h0N } is the decoder input either gathered from the encoder output using soft copy ( Wei et al. , 2019 ) or full mask ( Ghazvininejad et al. , 2019 ) , and then Y is predicted as : Ŷ = Fd ( H 0 d , Fe ( X ; θ ) ; θ ) ( 2 ) where θ are the trainable model parameters . Then glancing transformer ( GLAT ) adopts glancing sampling strategy to sample a subset of Y according to its distance with Ŷ , thus resulting inGS ( Y , Ŷ ) . Finally , GLAT predicts the target sequence Y based on this subset and source sentence X in the second decoding pass as follows : LGLAT = − ∑ yt∈GS ( Y , Ŷ ) logP ( yt|GS ( Y , Ŷ ) , X ; θ ) ( 3 ) where H0d is updated accordingly and GS ( Y , Ŷ ) denotes the remaining subset of Y after removing the sampled tokens . The overall architecture of GLAT is shown in Figure 1 . The twice decoding in training makes GLAT capable of predicting some partial translations based on others . Then combined with multilingual and non-autoregressive characteristics , GLAT has the potential to generate contextual code-switched outputs . In the next section , we will show how to modify the GLAT architecture to achieve this . 3 PROPOSED METHOD : switch-GLAT This section will detail the proposed switch-GLAT . The training objective can be factorized into two parts . One aims to make the model have multilingual translation ability , and the other to achieve better-aligned cross-lingual representations to boost translation performance , respectively denoted as Lmulti and Lcsbt . The overall objective can be formulated as follows : L = Lmulti + λ · Lcsbt ( 4 ) where λ plays the role of a “ temperature ” to schedule the importance of code-switch back-translation . As the training progresses , λ is gradually increased , which allows for more complex data instances to be involved , i.e . code-switched translations incorporating more languages and higher switching ratios . This process encourages model to align similar words from different languages into the same vector space , thus boosting machine translation performance . The overall architecture is shown in Figure 2 . 3.1 CODE-SWITCH DECODER . switch-GLAT leverages the general parallel decoder of GLAT and extends it into a code-switch decoder by employing the token-level language tag . The code-switch decoder first gains multilingual translation ability through multilingual training , and then it can generate code-switched translations in arbitrary languages with the help of token-level language tag . Specifically , given a multilingual corpora D = { Dl } Ll=1 consisting of L language pairs , the loss Lmulti is then defined as : Lmulti = ∑ Dl∈D ∑ ( Xlj , Y l j ) ∈D l { Ltag ( Y lj |Xlj ; θM ) + Lllen ( j ) } Lllen ( j ) = −P ( Llj ) log P̂ ( Llj | [ Fe ( Xlj ; θM ) ; Esrc ; Etgt ] ; θM ) ( 5 ) where Dl = { ( X lj , Y lj ) } Nl j=1 is a parallel corpus with size Nl and L l len ( j ) is the length prediction loss of the j-th pair . P ( Llj ) is the real length distribution of target sentence , and P̂ ( L l j ) is the predicted one based on the concatenation of encoder output as well as source and target language embeddings . θM are trainable model parameters . Ltag is the accordingly updated GLAT training loss ( Equation 3 ) incorporating the source and target language tags : Ltag ( Y l j |Xlj ; θM ) = − ∑ yt∈GS ( Y lj , Ŷ l j ) logP ( yt|GS ( Y lj , Ŷ lj ) , Xlj , src , tgt ; θM ) Ŷ lj = Fd ( H̃ 0 d , Fe ( X l j , src ; θ ) , tgt ; θM ) ( 6 ) To involve the indicative language tag , we add it to the first layer input and final layer output at each position of both encoder and decoder as follows : f̃0i = f 0 i + Esrc ; f̃ K i = f K i + Esrc h̃0j = h 0 j + Etgt ; h̃ K j = h K j + Etgt ( 7 ) where f0i denotes the first encoder layer input at position i and h 0 j denotes the first decoder layer input at position j . Correspondingly , fKi and h K j denote the last layer output . src and tgt are respectively the source and target individual tags , while Esrc and Etgt are their corresponding representations . The overall prediction process of pair ( X lj , Y l j ) is illustrated in the left module of Figure 2 . Through the multilingual training process , switch-GLAT can translate between different languages using the indicative language tags , of which the decoder is called code-switch decoder . It has the ability to generate contextual translated words in arbitrary languages due to its token-level characteristics . 3.2 CODE-SWITCH BACK-TRANSLATION . Thanks to the code-switch decoder , we can perform code-switch back-translation ( CSBT ) , which is critical because it encourages model to align the produced words and the original ones into the same vector space according to their similar context information . Better-aligned cross-lingual representations benefit better translation performance . Specifically , a subset DS = { ( Xi , Yi , lsrci , l tgt i ) } Si=1 of size S is first sampled , where lsrci and l tgt i are respectively source and target languages of i-th pair . Then , Yi is masked with a given rate PM , leading to Ỹi . Subsequently , the masked positions of Ỹi can be decoded into a third randomly sampled language by leveraging the token-level language tag . Thus , the final decoded sequence Ŷi consists of contextual tokens from mixed languages , which will in turn be taken as the source side input and the original source sentence as the target side input . This process results in a code-switch back-translation corpus DC = { ( Ŷi , Xi ) } Si=1 , which is illustrated in the middle module of Figure 2 . The dynamically generated code-switch translations can thus augment data instance distribution to enhance model training as illustrated in the right module of Figure 2 . Loss Lcsbt is defined as : Lcsbt = ∑ ( Ŷi , Xi ) ∈DC Ltag ( Xi|Ŷi ; θM ) ( 8 ) As the training continues , the masked rate PM and number of mixed languages are gradually increased . Specifically , the value of PM is iterated from 0.1 to 0.5 with step size 0.1 every 10 epochs . In the first iteration of PM , the number of mixed languages is set to 1 . Afterwards , it will be increased to one-third of the total . Through this process , abundant code-switched sentences can be generated , which helps to learn better-aligned cross-lingual representations . | The paper proposed a novel method for the multilingual non-autoregressive machine translation (NAT) model. The key idea is to modify the decoder module of glancing Transformer (GLAT), making it generate the contextual code-switched translations, then use them to perform code-switch back-translation. To incorporate with the generation of contextual code-switch translations, the authors proposed to add token-level language tags to the first layer and the final output layer at each position. The empirical results show that: 1) the inference speed is faster than the autoregressive baseline model (M-Transformer). 2) the translation performance outperforms the NAT baselines in terms of WMT-EDF, WMT-EFZ benchmarks. Although the performance is slightly worse than the GLAT model on the WMT-Many benchmark, the author claim that the reason is due to the limitation of model capacity. 3) Two cross-lingual experiments and the visualization of representation prove that the proposed method has better cross-lingual capability compared to other multilingual models. | SP:c947a995f713365cc3323116f27b67fbce2c8bf4 |
Non-Autoregressive Models are Better Multilingual Translators | 1 INTRODUCTION . Neural machine translation ( NMT ) is the current state-of-the-art approach ( Bahdanau et al. , 2014 ; Sutskever et al. , 2014 ) for machine translation in both academia ( Bojar et al. , 2017 ) and industry ( Hassan et al. , 2018 ) . Recent works ( Firat et al. , 2016 ; Johnson et al. , 2017 ; Aharoni et al. , 2019 ; Lin et al. , 2020 ) extend the approach to support multilingual translation , i.e . training a single model that can translate across multiple language directions . Multilingual models are appealing for several reasons . First , they can reduce the online translation service number , enabling simpler deployment ( Arivazhagan et al. , 2019 ) when plenty of translation directions are required . Additionally , multilingual training makes it possible to transfer knowledge from high-resource languages to low-resource ones , thus improving the translation quality of low-resource directions ( Zoph et al. , 2016 ; Johnson et al. , 2017 ; Wang & Neubig , 2019 ) . However , most multilingual NMT systems are built upon the autoregressive architecture , which translates from left to right and thus is not efficient enough in terms of translation speed . Such efficiency problem is more serious in multilingual setting because all translation directions suffer from this slow inference speed . A straightforward solution to improve the multilingual translation efficiency is to develop multilingual non-autoregressive translation ( NAT ) . NAT generates translation outputs in parallel ( Gu et al. , 2018 ) , which leads to significantly faster translation speed . Thanks to the recent progress of NAT ( Ghazvininejad et al. , 2019 ; Gu et al. , 2019 ; Deng & Rush , 2020 ) , current state-of-the-art NAT models have achieved comparable BLEU scores ( Li et al. , 2018 ; Wei et al. , 2019 ; Qian et al. , 2020 ) with their auto-regressive counterparts . Among them , the glancing transformer ( GLAT ) proposed by Qian et al . ( 2020 ) is a representative work , which even outperforms many strong autoregressive translation systems in BLEU score on German-English translation task of WMT21 ( Qian et al. , 2021 ) . In this paper , we argue that multilingual NAT models is not only superior in efficiency , but also can achieve better multilingual translation accuracy , due to its capability of generating high quality codeswitched translations ( Lin et al. , 2020 ; Yang et al. , 2020 ; Jose et al. , 2020 ) . In particular , we propose switch-GLAT , a carefully designed multilingual version of GLAT , which can outperform multilingual Transformer in both speed and translation quality . Generally , the main idea of switch-GLAT is to employ a code-switch decoder , which can generate contextual code-switched translations ( instead of using dictionary for replacement ) for a given source sentence , and then perform code-switch back-translation to boost the multilingual translation performance . In more details , the glancing sampling module in GLAT enables switch-GLAT to generate partial translation based on others . Then combined with its multilingual and non-autoregressive characteristics , switch-GLAT could output Encoder H ParallelDecoder Glancing Compute Distance H ' ParallelDecoder Sample words Replace Input H Compute Loss code-switched translations with the employment of token-level language tags instead of sentencelevel ones in auto-regressive models . Ultimately , switch-GLAT can generate contextual translated words at arbitrary positions of the target sentence in arbitrary languages . This greatly improves the multilingual translation performance when we reverse the pairs of source to contextual code-switched target sentences , for training in a back-translation fashion ( so called code-switch back-translation ) . We conduct extensive experiments on 3 merged translation datasets : WMT with four language pairs ( both close languages and distant ones ) and WMT with 10 language pairs . switch-GLAT shows consistent improvements over autoregressive multilingual baselines on all datasets , validating that switch-GLAT can achieve better multilingual translation performance simultaneously with a faster decoding speed . We further evaluated the cross-lingual representations through word induction and sentence retrieval tasks . The results demonstrated the proposed code-switch back-translation benefits better-aligned cross-lingual representations . 2 BACKGROUND . Multilingual Neural Machine Translation ( MNMT ) Given a source sentence X = { x1 , x2 , ... , xM } with length M and its target sentence Y = { y1 , y2 , ... , yN } with length N , MNMT leverages the standard bilingual neural machine translation models and extends the source and target inputs respectively with a source and target language token src and tgt . This results in X ′ = { src , x1 , x2 , ... , xM } and Y ′ = { tgt , y1 , y2 , ... , yN } . MNMT is generally modeled from X ′ to Y ′ with Transformer ( Vaswani et al. , 2017 ) . Transformer consists of stacked encoder and decoder layers , which are jointly trained to maximize the conditional probability of Y ′ given X ′ : P ( Y ′|X ′ ) = N∑ i=1 logP ( yi|y < i , X ′ , tgt ; θ ) ( 1 ) where θ are the trainable model parameters . Glancing Transformer prposed by Qian et al . ( 2020 ) is a NAT architecture which achieves top results in machine translation with 8x ∼ 15x speedup . It performs two-pass decoding in training but is still fully auto-regressive in inference . In the first decoding pass , given the encoder Fe and decoder Fd , H0d = { h01 , h02 , ... , h0N } is the decoder input either gathered from the encoder output using soft copy ( Wei et al. , 2019 ) or full mask ( Ghazvininejad et al. , 2019 ) , and then Y is predicted as : Ŷ = Fd ( H 0 d , Fe ( X ; θ ) ; θ ) ( 2 ) where θ are the trainable model parameters . Then glancing transformer ( GLAT ) adopts glancing sampling strategy to sample a subset of Y according to its distance with Ŷ , thus resulting inGS ( Y , Ŷ ) . Finally , GLAT predicts the target sequence Y based on this subset and source sentence X in the second decoding pass as follows : LGLAT = − ∑ yt∈GS ( Y , Ŷ ) logP ( yt|GS ( Y , Ŷ ) , X ; θ ) ( 3 ) where H0d is updated accordingly and GS ( Y , Ŷ ) denotes the remaining subset of Y after removing the sampled tokens . The overall architecture of GLAT is shown in Figure 1 . The twice decoding in training makes GLAT capable of predicting some partial translations based on others . Then combined with multilingual and non-autoregressive characteristics , GLAT has the potential to generate contextual code-switched outputs . In the next section , we will show how to modify the GLAT architecture to achieve this . 3 PROPOSED METHOD : switch-GLAT This section will detail the proposed switch-GLAT . The training objective can be factorized into two parts . One aims to make the model have multilingual translation ability , and the other to achieve better-aligned cross-lingual representations to boost translation performance , respectively denoted as Lmulti and Lcsbt . The overall objective can be formulated as follows : L = Lmulti + λ · Lcsbt ( 4 ) where λ plays the role of a “ temperature ” to schedule the importance of code-switch back-translation . As the training progresses , λ is gradually increased , which allows for more complex data instances to be involved , i.e . code-switched translations incorporating more languages and higher switching ratios . This process encourages model to align similar words from different languages into the same vector space , thus boosting machine translation performance . The overall architecture is shown in Figure 2 . 3.1 CODE-SWITCH DECODER . switch-GLAT leverages the general parallel decoder of GLAT and extends it into a code-switch decoder by employing the token-level language tag . The code-switch decoder first gains multilingual translation ability through multilingual training , and then it can generate code-switched translations in arbitrary languages with the help of token-level language tag . Specifically , given a multilingual corpora D = { Dl } Ll=1 consisting of L language pairs , the loss Lmulti is then defined as : Lmulti = ∑ Dl∈D ∑ ( Xlj , Y l j ) ∈D l { Ltag ( Y lj |Xlj ; θM ) + Lllen ( j ) } Lllen ( j ) = −P ( Llj ) log P̂ ( Llj | [ Fe ( Xlj ; θM ) ; Esrc ; Etgt ] ; θM ) ( 5 ) where Dl = { ( X lj , Y lj ) } Nl j=1 is a parallel corpus with size Nl and L l len ( j ) is the length prediction loss of the j-th pair . P ( Llj ) is the real length distribution of target sentence , and P̂ ( L l j ) is the predicted one based on the concatenation of encoder output as well as source and target language embeddings . θM are trainable model parameters . Ltag is the accordingly updated GLAT training loss ( Equation 3 ) incorporating the source and target language tags : Ltag ( Y l j |Xlj ; θM ) = − ∑ yt∈GS ( Y lj , Ŷ l j ) logP ( yt|GS ( Y lj , Ŷ lj ) , Xlj , src , tgt ; θM ) Ŷ lj = Fd ( H̃ 0 d , Fe ( X l j , src ; θ ) , tgt ; θM ) ( 6 ) To involve the indicative language tag , we add it to the first layer input and final layer output at each position of both encoder and decoder as follows : f̃0i = f 0 i + Esrc ; f̃ K i = f K i + Esrc h̃0j = h 0 j + Etgt ; h̃ K j = h K j + Etgt ( 7 ) where f0i denotes the first encoder layer input at position i and h 0 j denotes the first decoder layer input at position j . Correspondingly , fKi and h K j denote the last layer output . src and tgt are respectively the source and target individual tags , while Esrc and Etgt are their corresponding representations . The overall prediction process of pair ( X lj , Y l j ) is illustrated in the left module of Figure 2 . Through the multilingual training process , switch-GLAT can translate between different languages using the indicative language tags , of which the decoder is called code-switch decoder . It has the ability to generate contextual translated words in arbitrary languages due to its token-level characteristics . 3.2 CODE-SWITCH BACK-TRANSLATION . Thanks to the code-switch decoder , we can perform code-switch back-translation ( CSBT ) , which is critical because it encourages model to align the produced words and the original ones into the same vector space according to their similar context information . Better-aligned cross-lingual representations benefit better translation performance . Specifically , a subset DS = { ( Xi , Yi , lsrci , l tgt i ) } Si=1 of size S is first sampled , where lsrci and l tgt i are respectively source and target languages of i-th pair . Then , Yi is masked with a given rate PM , leading to Ỹi . Subsequently , the masked positions of Ỹi can be decoded into a third randomly sampled language by leveraging the token-level language tag . Thus , the final decoded sequence Ŷi consists of contextual tokens from mixed languages , which will in turn be taken as the source side input and the original source sentence as the target side input . This process results in a code-switch back-translation corpus DC = { ( Ŷi , Xi ) } Si=1 , which is illustrated in the middle module of Figure 2 . The dynamically generated code-switch translations can thus augment data instance distribution to enhance model training as illustrated in the right module of Figure 2 . Loss Lcsbt is defined as : Lcsbt = ∑ ( Ŷi , Xi ) ∈DC Ltag ( Xi|Ŷi ; θM ) ( 8 ) As the training continues , the masked rate PM and number of mixed languages are gradually increased . Specifically , the value of PM is iterated from 0.1 to 0.5 with step size 0.1 every 10 epochs . In the first iteration of PM , the number of mixed languages is set to 1 . Afterwards , it will be increased to one-third of the total . Through this process , abundant code-switched sentences can be generated , which helps to learn better-aligned cross-lingual representations . | This paper describes experiments in training a non-autoregressive Transformer (glancing Transformer, or GLAT) in a multilingual MT setting. The use of a non-autoregressive model, plus token-level language tags, enables a code-switching strategy where a source sentence in a given language can generate a target sentence containing words from multiple specified languages. This is used to augment the multilingual training corpus with back-translated data consisting of code-switched synthetic source sentences paired with original monolingual target sentences. A multilingual GLAT model trained with this strategy is shown to outperform many baselines including monolingual GLAT and several autoregressive multilingual models. Ablation studies demonstrate that code-switched back-translation is essential for achieving good performance. | SP:c947a995f713365cc3323116f27b67fbce2c8bf4 |
Non-Autoregressive Models are Better Multilingual Translators | 1 INTRODUCTION . Neural machine translation ( NMT ) is the current state-of-the-art approach ( Bahdanau et al. , 2014 ; Sutskever et al. , 2014 ) for machine translation in both academia ( Bojar et al. , 2017 ) and industry ( Hassan et al. , 2018 ) . Recent works ( Firat et al. , 2016 ; Johnson et al. , 2017 ; Aharoni et al. , 2019 ; Lin et al. , 2020 ) extend the approach to support multilingual translation , i.e . training a single model that can translate across multiple language directions . Multilingual models are appealing for several reasons . First , they can reduce the online translation service number , enabling simpler deployment ( Arivazhagan et al. , 2019 ) when plenty of translation directions are required . Additionally , multilingual training makes it possible to transfer knowledge from high-resource languages to low-resource ones , thus improving the translation quality of low-resource directions ( Zoph et al. , 2016 ; Johnson et al. , 2017 ; Wang & Neubig , 2019 ) . However , most multilingual NMT systems are built upon the autoregressive architecture , which translates from left to right and thus is not efficient enough in terms of translation speed . Such efficiency problem is more serious in multilingual setting because all translation directions suffer from this slow inference speed . A straightforward solution to improve the multilingual translation efficiency is to develop multilingual non-autoregressive translation ( NAT ) . NAT generates translation outputs in parallel ( Gu et al. , 2018 ) , which leads to significantly faster translation speed . Thanks to the recent progress of NAT ( Ghazvininejad et al. , 2019 ; Gu et al. , 2019 ; Deng & Rush , 2020 ) , current state-of-the-art NAT models have achieved comparable BLEU scores ( Li et al. , 2018 ; Wei et al. , 2019 ; Qian et al. , 2020 ) with their auto-regressive counterparts . Among them , the glancing transformer ( GLAT ) proposed by Qian et al . ( 2020 ) is a representative work , which even outperforms many strong autoregressive translation systems in BLEU score on German-English translation task of WMT21 ( Qian et al. , 2021 ) . In this paper , we argue that multilingual NAT models is not only superior in efficiency , but also can achieve better multilingual translation accuracy , due to its capability of generating high quality codeswitched translations ( Lin et al. , 2020 ; Yang et al. , 2020 ; Jose et al. , 2020 ) . In particular , we propose switch-GLAT , a carefully designed multilingual version of GLAT , which can outperform multilingual Transformer in both speed and translation quality . Generally , the main idea of switch-GLAT is to employ a code-switch decoder , which can generate contextual code-switched translations ( instead of using dictionary for replacement ) for a given source sentence , and then perform code-switch back-translation to boost the multilingual translation performance . In more details , the glancing sampling module in GLAT enables switch-GLAT to generate partial translation based on others . Then combined with its multilingual and non-autoregressive characteristics , switch-GLAT could output Encoder H ParallelDecoder Glancing Compute Distance H ' ParallelDecoder Sample words Replace Input H Compute Loss code-switched translations with the employment of token-level language tags instead of sentencelevel ones in auto-regressive models . Ultimately , switch-GLAT can generate contextual translated words at arbitrary positions of the target sentence in arbitrary languages . This greatly improves the multilingual translation performance when we reverse the pairs of source to contextual code-switched target sentences , for training in a back-translation fashion ( so called code-switch back-translation ) . We conduct extensive experiments on 3 merged translation datasets : WMT with four language pairs ( both close languages and distant ones ) and WMT with 10 language pairs . switch-GLAT shows consistent improvements over autoregressive multilingual baselines on all datasets , validating that switch-GLAT can achieve better multilingual translation performance simultaneously with a faster decoding speed . We further evaluated the cross-lingual representations through word induction and sentence retrieval tasks . The results demonstrated the proposed code-switch back-translation benefits better-aligned cross-lingual representations . 2 BACKGROUND . Multilingual Neural Machine Translation ( MNMT ) Given a source sentence X = { x1 , x2 , ... , xM } with length M and its target sentence Y = { y1 , y2 , ... , yN } with length N , MNMT leverages the standard bilingual neural machine translation models and extends the source and target inputs respectively with a source and target language token src and tgt . This results in X ′ = { src , x1 , x2 , ... , xM } and Y ′ = { tgt , y1 , y2 , ... , yN } . MNMT is generally modeled from X ′ to Y ′ with Transformer ( Vaswani et al. , 2017 ) . Transformer consists of stacked encoder and decoder layers , which are jointly trained to maximize the conditional probability of Y ′ given X ′ : P ( Y ′|X ′ ) = N∑ i=1 logP ( yi|y < i , X ′ , tgt ; θ ) ( 1 ) where θ are the trainable model parameters . Glancing Transformer prposed by Qian et al . ( 2020 ) is a NAT architecture which achieves top results in machine translation with 8x ∼ 15x speedup . It performs two-pass decoding in training but is still fully auto-regressive in inference . In the first decoding pass , given the encoder Fe and decoder Fd , H0d = { h01 , h02 , ... , h0N } is the decoder input either gathered from the encoder output using soft copy ( Wei et al. , 2019 ) or full mask ( Ghazvininejad et al. , 2019 ) , and then Y is predicted as : Ŷ = Fd ( H 0 d , Fe ( X ; θ ) ; θ ) ( 2 ) where θ are the trainable model parameters . Then glancing transformer ( GLAT ) adopts glancing sampling strategy to sample a subset of Y according to its distance with Ŷ , thus resulting inGS ( Y , Ŷ ) . Finally , GLAT predicts the target sequence Y based on this subset and source sentence X in the second decoding pass as follows : LGLAT = − ∑ yt∈GS ( Y , Ŷ ) logP ( yt|GS ( Y , Ŷ ) , X ; θ ) ( 3 ) where H0d is updated accordingly and GS ( Y , Ŷ ) denotes the remaining subset of Y after removing the sampled tokens . The overall architecture of GLAT is shown in Figure 1 . The twice decoding in training makes GLAT capable of predicting some partial translations based on others . Then combined with multilingual and non-autoregressive characteristics , GLAT has the potential to generate contextual code-switched outputs . In the next section , we will show how to modify the GLAT architecture to achieve this . 3 PROPOSED METHOD : switch-GLAT This section will detail the proposed switch-GLAT . The training objective can be factorized into two parts . One aims to make the model have multilingual translation ability , and the other to achieve better-aligned cross-lingual representations to boost translation performance , respectively denoted as Lmulti and Lcsbt . The overall objective can be formulated as follows : L = Lmulti + λ · Lcsbt ( 4 ) where λ plays the role of a “ temperature ” to schedule the importance of code-switch back-translation . As the training progresses , λ is gradually increased , which allows for more complex data instances to be involved , i.e . code-switched translations incorporating more languages and higher switching ratios . This process encourages model to align similar words from different languages into the same vector space , thus boosting machine translation performance . The overall architecture is shown in Figure 2 . 3.1 CODE-SWITCH DECODER . switch-GLAT leverages the general parallel decoder of GLAT and extends it into a code-switch decoder by employing the token-level language tag . The code-switch decoder first gains multilingual translation ability through multilingual training , and then it can generate code-switched translations in arbitrary languages with the help of token-level language tag . Specifically , given a multilingual corpora D = { Dl } Ll=1 consisting of L language pairs , the loss Lmulti is then defined as : Lmulti = ∑ Dl∈D ∑ ( Xlj , Y l j ) ∈D l { Ltag ( Y lj |Xlj ; θM ) + Lllen ( j ) } Lllen ( j ) = −P ( Llj ) log P̂ ( Llj | [ Fe ( Xlj ; θM ) ; Esrc ; Etgt ] ; θM ) ( 5 ) where Dl = { ( X lj , Y lj ) } Nl j=1 is a parallel corpus with size Nl and L l len ( j ) is the length prediction loss of the j-th pair . P ( Llj ) is the real length distribution of target sentence , and P̂ ( L l j ) is the predicted one based on the concatenation of encoder output as well as source and target language embeddings . θM are trainable model parameters . Ltag is the accordingly updated GLAT training loss ( Equation 3 ) incorporating the source and target language tags : Ltag ( Y l j |Xlj ; θM ) = − ∑ yt∈GS ( Y lj , Ŷ l j ) logP ( yt|GS ( Y lj , Ŷ lj ) , Xlj , src , tgt ; θM ) Ŷ lj = Fd ( H̃ 0 d , Fe ( X l j , src ; θ ) , tgt ; θM ) ( 6 ) To involve the indicative language tag , we add it to the first layer input and final layer output at each position of both encoder and decoder as follows : f̃0i = f 0 i + Esrc ; f̃ K i = f K i + Esrc h̃0j = h 0 j + Etgt ; h̃ K j = h K j + Etgt ( 7 ) where f0i denotes the first encoder layer input at position i and h 0 j denotes the first decoder layer input at position j . Correspondingly , fKi and h K j denote the last layer output . src and tgt are respectively the source and target individual tags , while Esrc and Etgt are their corresponding representations . The overall prediction process of pair ( X lj , Y l j ) is illustrated in the left module of Figure 2 . Through the multilingual training process , switch-GLAT can translate between different languages using the indicative language tags , of which the decoder is called code-switch decoder . It has the ability to generate contextual translated words in arbitrary languages due to its token-level characteristics . 3.2 CODE-SWITCH BACK-TRANSLATION . Thanks to the code-switch decoder , we can perform code-switch back-translation ( CSBT ) , which is critical because it encourages model to align the produced words and the original ones into the same vector space according to their similar context information . Better-aligned cross-lingual representations benefit better translation performance . Specifically , a subset DS = { ( Xi , Yi , lsrci , l tgt i ) } Si=1 of size S is first sampled , where lsrci and l tgt i are respectively source and target languages of i-th pair . Then , Yi is masked with a given rate PM , leading to Ỹi . Subsequently , the masked positions of Ỹi can be decoded into a third randomly sampled language by leveraging the token-level language tag . Thus , the final decoded sequence Ŷi consists of contextual tokens from mixed languages , which will in turn be taken as the source side input and the original source sentence as the target side input . This process results in a code-switch back-translation corpus DC = { ( Ŷi , Xi ) } Si=1 , which is illustrated in the middle module of Figure 2 . The dynamically generated code-switch translations can thus augment data instance distribution to enhance model training as illustrated in the right module of Figure 2 . Loss Lcsbt is defined as : Lcsbt = ∑ ( Ŷi , Xi ) ∈DC Ltag ( Xi|Ŷi ; θM ) ( 8 ) As the training continues , the masked rate PM and number of mixed languages are gradually increased . Specifically , the value of PM is iterated from 0.1 to 0.5 with step size 0.1 every 10 epochs . In the first iteration of PM , the number of mixed languages is set to 1 . Afterwards , it will be increased to one-third of the total . Through this process , abundant code-switched sentences can be generated , which helps to learn better-aligned cross-lingual representations . | This paper extends non-autoregressive NMT models, particularly the GLAT model, from bilingual translation to multilingual translation. To enable such extension, the authors proposed token-level language tags for the decoder, code-switch decoder paired with back-translation, and also scheduled training between the traditional MLE loss and the BT loss. Experiments on several multilingual tasks based on WMT corpus show that the proposed model obtains better supervised translation quality than its auto-regressive counterparts and delivers better cross-lingual representations. | SP:c947a995f713365cc3323116f27b67fbce2c8bf4 |
A new look at fairness in stochastic multi-armed bandit problems | 1 INTRODUCTION . The multi-armed bandit ( MAB ) problem is a classical framework for sequential decision-making in uncertain environments . Starting with the seminal work of Robbins ( 1952 ) , over the years , a significant body of work has been developed to address both theoretical aspects and practical applications of this problem . In a traditional stochastic multi-armed bandit ( MAB ) problem ( Lai & Robbins , 1985 ; Auer et al. , 2002 ; Vermorel & Mohri , 2005 ; Bubeck & Cesa-Bianchi , 2012 ) , a learner has access to K arms and pulling arm k generates a stochastic reward for the principal from an unknown distribution Fk with an unknown expected reward µk . If the mean rewards were known as prior information , the learner could just repeatedly pull the best arm given by k∗ = arg maxk µk . However , the learner has no such knowledge of the reward of each arm . Hence , one should use some learning algorithm π which operates in rounds , pulls arm πt ∈ { 1 , . . . , K } in round t , observes the stochastic reward generated from reward distribution Fπt , and uses that information to learn the best arm over time . The performance of learning algorithm π is evaluated based on its cumulative regret over time horizon T , defined as R̄π ( T ) = µk∗T − T∑ t=1 Eµπt . ( 1 ) To achieve the minimum regret , a good learner should make a balance between exploration ( pulling different arms to get more information of reward distribution of each arm ) and exploitation ( pulling the arm currently believed to have the highest reward ) . In addition to the above classical MAB problem , many variations of the MAB framework have been extensively studied in the literature recently . Various papers study MAB problems with additional constraints which include bandits with knapsack constraints ( Badanidiyuru et al. , 2013 ) , bandits with budget constraints ( Xia et al. , 2015 ) , sleeping bandits ( Kleinberg et al. , 2010 ; Chatterjee et al. , 2017 ) , etc . Except these , there is a huge research interest in fairness within machine learning field . Fairness has been a hot topic of many recent application tasks , including classification ( Zafar et al. , 2017a ; b ; Agarwal et al. , 2018 ; Roh et al. , 2021 ) , regression ( Berk et al. , 2017 ; Rezaei et al. , 2019 ) , recommendation ( Celis et al. , 2017 ; Singh & Joachims , 2018 ; Beutel et al. , 2019 ; Wang et al. , 2021 ) , resource allocation ( Baruah et al. , 1996 ; Talebi & Proutiere , 2018 ; Li et al. , 2020 ) , Markov decision process ( Khan & Goodridge , 2019 ) , etc . There are two popular definitions of fairness in the MAB literature . 1 ) . The fairness is introduced into the bandit learning framework by saying that it is unfair to preferentially choose one arm over another if the chosen arm has lower expected reward than the unchosen arm ( Joseph et al. , 2016 ) . In other words , the learning algorithm can not favor low-reward arms . 2 ) . The fairness is introduced such that the algorithm needs to ensure that uniformly ( i.e. , at the end of every round ) each arm is pulled at least a pre-specified fraction of times ( Patil et al. , 2020 ) . In other words , it imposes an additional constraint to prevent the algorithm from playing low-reward arms too few times . In this paper , we adopt a new perspective , e.g. , in addition to maximizing the cumulative expected reward , it also allows the user to specify how “ hard ” or how “ soft ” the fairness requirement on each arm is . In this view , it is not always easy even to formulate the problem and to introduce an appropriate notion of regret . We thus propose a new formulation of fairness MAB by introducing penalty termAk max ( τkT−Nk ( T ) , 0 ) , whereAk , τk are the penalty rate and fairness fraction for arm k and Nk ( T ) is the number of times pulling arm k. Hence it gives penalization when the algorithm fails to meet the fairness constraint and penalty term is proportional to the gap between pulling number and its required level . To solve this regularized MAB problem , we also propose a hard-threshold upper confidence bound ( UCB ) algorithm . It is similar to the classical UCB algorithm but adds an additional term to encourage the learner to favor those arms whose pulling numbers are below the required level at each round . The advantage of our approach is that it allows the user to distinguish , if desired , between arms for which is more important to sample an arm with required frequency and those arms for which it is less important to do so . To the best of our knowledge , there is no work on mathematical framework of fairness MAB with regularization term in the literature . In this paper , we provide a relatively complete theory for the fairness MAB . We rigorously formalize the penalized regret which can be used for evaluating the performance of learning algorithm under fairness constraints . On theoretical side , the hard-threshold UCB algorithm is proved to achieve asymptotic fairness when a large penalty rate is chosen . The algorithm is shown to obtain O ( log T ) regret when the sub-optimality gap is assumed to be fixed . Additionally , the characterization of fluctuation of non-fairness level , max1≤t≤T max ( τkt−Nk ( t ) , 0 ) is also given . Its magnitude is also shown to be O ( log T ) . Moreover , we establish a sub-optimal gap-free regret bound of proposed method and provide insights on how hard-threshold based UCB index works . We also point out that the analysis of proposed hard-threshold UCB algorithm is much harder than the classical UCB due to the existence of interventions between different sub-optimal arms . On numerical side , the experimental results confirm our theory and show that the performance of the proposed algorithm is better than other popular methods . Our method achieves a better trade-off between reward and fairness . Notations . For real number x , ( x ) + stands for max { 0 , x } ; bxc is the largest integer smaller or equal to x . For integer n , we use [ n ] to represent the set { 1 , . . . , n } . We say a = O ( b ) ; a = Ω ( b ) if there exists a constant C such that a ≤ Cb ; a ≥ b/C . The symbols E and P ( · ) denote generic expectation and probability under a probability measure that may be determined from the context . We let π be a generic policy / learning algorithm . 2 ACHIEVING FAIRNESS VIA PENALIZATION . Consider a stochastic multi-armed bandit problem with K arms and unknown expected rewards µ1 , . . . , µK associated with these arms . The notion of fairness we introduce consists of proportions τk ≥ 0 , k = 1 , . . . , K with τ1 + · · ·+ τK < 1 . We use T ∈ { 1 , 2 , . . . , } to denote the time horizon and Nk , π ( t ) to denote the number of times that arm k has been pulled by time t ∈ [ T ] using policy π . For notational simplicity , we may write Nk , π ( t ) as Nk ( t ) . It is desired to pull arm k at least at the uniform rate of τk , k = 1 , . . . , K. In other words , the learner should obey the constraint that Nk ( t ) ≥ τkt for any t ∈ [ T ] . Thus a good policy aims to solve the following optimization problem , arg max π E ∑ k µkNk , π ( T ) , subject to Nk , π ( t ) ≥ τkt for all k and t. ( 2 ) Instead of directly working with such a constrained bandit problem , we consider a penalization problem . That is , one gets penalized if the arm is not pulled sufficiently often . To reflect this , we introduce the following design problem . Let Sπ ( T ) be the sum of the rewards obtained by time t under policy π , i.e. , Sπ ( T ) = ∑T t=1 rπt where πt is the arm index chosen by policy π at time t ∈ [ T ] and rπt is the corresponding reward . Then the penalized total reward is defined as Spen , π ( T ) = Sπ ( T ) − K∑ k=1 Ak ( τkT −Nk , π ( T ) ) + , ( 3 ) where A1 , . . . , AK are known nonnegative penalty rates . Our goal is to design a learning algorithm to make the expectation of Spen , π ( T ) as large as possible . By taking the expectation , we have E [ Spen , π ( T ) ] = K∑ k=1 µkE [ Nk , π ( t ) ] − K∑ k=1 AkE [ ( τkT −Nk , π ( T ) ) + ] , ( 4 ) which is the penalized reward achieved by policy π and we would like to maximize it over π . Now we are ready to introduce the penalized regret function , which is the core for the regret analysis . To derive the new regret , we first note that maximizing E [ Spen , π ( T ) ] is the same as minimizing the following loss function , L ( T ) = µ∗T − E [ Spen , π ( T ) ] = K∑ k=1 [ ∆kE [ Nk ( t ) ] +AkE [ ( τkT −Nk ( T ) ) + ] ] , ( 5 ) where we denote µ∗ = max k=1 , ... , K µk , ∆k = µ ∗ − µk , k = 1 , . . . , K. In order to find the minimum possible value of L ( T ) , let us understand what a prophet ( who knows the expected rewards µ1 , . . . , µK ) would do . Clearly , a prophet ( who , in addition , is not constrained by integer value ) would solve the following optimization problem , min x1 , ... , xK K∑ k=1 [ ∆kxk +AkE ( τkT − xk ) + ] subject to K∑ k=1 xk = T , xk ≥ 0 , k = 1 , . . . , K , and pull arm k for xk times ( k = 1 , . . . , K ) . By denoting yk = xk/T , k ∈ [ K ] , we transform this problem into min y1 , ... , yK K∑ k=1 [ ∆kyk +Ak ( τk − yk ) + ] subject to K∑ k=1 yk = 1 , yk ≥ 0 , k = 1 , . . . , K. ( 6 ) We will solve the problem ( 6 ) by finding y1 , . . . , yK that satisfy the constraints and that minimize simultaneously each term in the objective function . It is not hard to observe the following facts . 1 . For A ≥ 0 , function y 7→ A ( τ − y ) + achieves its minimum value of 0 for y ≥ τ . 2 . For A ≥ ∆ > 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of ∆τ at y = τ . 3 . For ∆ > A ≥ 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of Aτ at y = 0 . As a result , we introduce the following three sets Aopt = { k ∈ [ K ] : µk = µ∗ } , Acr = { k ∈ [ K ] : Ak ≥ ∆k > 0 } , Anon−cr = { k ∈ [ K ] : ∆k > Ak } , where Aopt consists of all optimal arms , Acr consists of sub-optimal arms with penalty rate larger than ( or equal to ) the sub-optimal gap and Anon−cr includes sub-optimal arms with penalty rate smaller than the sub-optimal gap . Therefore an optimal solution to the problem ( 6 ) can be constructed as follows . Let k∗ be an arbitrary arm in Aopt , and choose yk = 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj , k = k ∗ , τk , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr . ( 7 ) Therefore , a prophet would choose ( modulo rounding ) in ( 5 ) Nk ( T ) = ( 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj ) T , k = k∗ , τkT , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr , ( 8 ) leading to the following optimal value of L ( T ) , L∗ ( T ) = ∑ k∈Acr ∆kτkT + ∑ k∈Anon−cr AkτkT = ( K∑ k=1 min ( ∆k , Ak ) τk ) T. ( 9 ) Given an arbitrary algorithm π , we can therefore define the penalized regret as Rπ ( T ) = Lπ ( T ) − L∗ ( T ) = ∑ k∈Aopt AkE ( τkT −Nk , π ( T ) ) + ( 10 ) + ∑ k∈Acr [ ∆kE ( Nk , π ( T ) − τkT ) +AkE ( τkT −Nk , π ( T ) ) + ] + ∑ k∈Anon−cr [ ∆kENk , π ( T ) +Ak ( E ( τkT −Nk , π ( T ) ) + − τkT ) ] . | The authors deal with the stochastic multi-armed bandit problem with constraints in the least number of arms pulls for fairness. They convert such a problem into the unconstrained but penalized version. Then, they propose the hard-threshold UCB algorithm with the analyses of its gap-dependent and -independent regrets. The lower bounds on these regrets of the present algorithm. | SP:4d5619045e8d9b9bfd895019d31b4b37b2a0e6b9 |
A new look at fairness in stochastic multi-armed bandit problems | 1 INTRODUCTION . The multi-armed bandit ( MAB ) problem is a classical framework for sequential decision-making in uncertain environments . Starting with the seminal work of Robbins ( 1952 ) , over the years , a significant body of work has been developed to address both theoretical aspects and practical applications of this problem . In a traditional stochastic multi-armed bandit ( MAB ) problem ( Lai & Robbins , 1985 ; Auer et al. , 2002 ; Vermorel & Mohri , 2005 ; Bubeck & Cesa-Bianchi , 2012 ) , a learner has access to K arms and pulling arm k generates a stochastic reward for the principal from an unknown distribution Fk with an unknown expected reward µk . If the mean rewards were known as prior information , the learner could just repeatedly pull the best arm given by k∗ = arg maxk µk . However , the learner has no such knowledge of the reward of each arm . Hence , one should use some learning algorithm π which operates in rounds , pulls arm πt ∈ { 1 , . . . , K } in round t , observes the stochastic reward generated from reward distribution Fπt , and uses that information to learn the best arm over time . The performance of learning algorithm π is evaluated based on its cumulative regret over time horizon T , defined as R̄π ( T ) = µk∗T − T∑ t=1 Eµπt . ( 1 ) To achieve the minimum regret , a good learner should make a balance between exploration ( pulling different arms to get more information of reward distribution of each arm ) and exploitation ( pulling the arm currently believed to have the highest reward ) . In addition to the above classical MAB problem , many variations of the MAB framework have been extensively studied in the literature recently . Various papers study MAB problems with additional constraints which include bandits with knapsack constraints ( Badanidiyuru et al. , 2013 ) , bandits with budget constraints ( Xia et al. , 2015 ) , sleeping bandits ( Kleinberg et al. , 2010 ; Chatterjee et al. , 2017 ) , etc . Except these , there is a huge research interest in fairness within machine learning field . Fairness has been a hot topic of many recent application tasks , including classification ( Zafar et al. , 2017a ; b ; Agarwal et al. , 2018 ; Roh et al. , 2021 ) , regression ( Berk et al. , 2017 ; Rezaei et al. , 2019 ) , recommendation ( Celis et al. , 2017 ; Singh & Joachims , 2018 ; Beutel et al. , 2019 ; Wang et al. , 2021 ) , resource allocation ( Baruah et al. , 1996 ; Talebi & Proutiere , 2018 ; Li et al. , 2020 ) , Markov decision process ( Khan & Goodridge , 2019 ) , etc . There are two popular definitions of fairness in the MAB literature . 1 ) . The fairness is introduced into the bandit learning framework by saying that it is unfair to preferentially choose one arm over another if the chosen arm has lower expected reward than the unchosen arm ( Joseph et al. , 2016 ) . In other words , the learning algorithm can not favor low-reward arms . 2 ) . The fairness is introduced such that the algorithm needs to ensure that uniformly ( i.e. , at the end of every round ) each arm is pulled at least a pre-specified fraction of times ( Patil et al. , 2020 ) . In other words , it imposes an additional constraint to prevent the algorithm from playing low-reward arms too few times . In this paper , we adopt a new perspective , e.g. , in addition to maximizing the cumulative expected reward , it also allows the user to specify how “ hard ” or how “ soft ” the fairness requirement on each arm is . In this view , it is not always easy even to formulate the problem and to introduce an appropriate notion of regret . We thus propose a new formulation of fairness MAB by introducing penalty termAk max ( τkT−Nk ( T ) , 0 ) , whereAk , τk are the penalty rate and fairness fraction for arm k and Nk ( T ) is the number of times pulling arm k. Hence it gives penalization when the algorithm fails to meet the fairness constraint and penalty term is proportional to the gap between pulling number and its required level . To solve this regularized MAB problem , we also propose a hard-threshold upper confidence bound ( UCB ) algorithm . It is similar to the classical UCB algorithm but adds an additional term to encourage the learner to favor those arms whose pulling numbers are below the required level at each round . The advantage of our approach is that it allows the user to distinguish , if desired , between arms for which is more important to sample an arm with required frequency and those arms for which it is less important to do so . To the best of our knowledge , there is no work on mathematical framework of fairness MAB with regularization term in the literature . In this paper , we provide a relatively complete theory for the fairness MAB . We rigorously formalize the penalized regret which can be used for evaluating the performance of learning algorithm under fairness constraints . On theoretical side , the hard-threshold UCB algorithm is proved to achieve asymptotic fairness when a large penalty rate is chosen . The algorithm is shown to obtain O ( log T ) regret when the sub-optimality gap is assumed to be fixed . Additionally , the characterization of fluctuation of non-fairness level , max1≤t≤T max ( τkt−Nk ( t ) , 0 ) is also given . Its magnitude is also shown to be O ( log T ) . Moreover , we establish a sub-optimal gap-free regret bound of proposed method and provide insights on how hard-threshold based UCB index works . We also point out that the analysis of proposed hard-threshold UCB algorithm is much harder than the classical UCB due to the existence of interventions between different sub-optimal arms . On numerical side , the experimental results confirm our theory and show that the performance of the proposed algorithm is better than other popular methods . Our method achieves a better trade-off between reward and fairness . Notations . For real number x , ( x ) + stands for max { 0 , x } ; bxc is the largest integer smaller or equal to x . For integer n , we use [ n ] to represent the set { 1 , . . . , n } . We say a = O ( b ) ; a = Ω ( b ) if there exists a constant C such that a ≤ Cb ; a ≥ b/C . The symbols E and P ( · ) denote generic expectation and probability under a probability measure that may be determined from the context . We let π be a generic policy / learning algorithm . 2 ACHIEVING FAIRNESS VIA PENALIZATION . Consider a stochastic multi-armed bandit problem with K arms and unknown expected rewards µ1 , . . . , µK associated with these arms . The notion of fairness we introduce consists of proportions τk ≥ 0 , k = 1 , . . . , K with τ1 + · · ·+ τK < 1 . We use T ∈ { 1 , 2 , . . . , } to denote the time horizon and Nk , π ( t ) to denote the number of times that arm k has been pulled by time t ∈ [ T ] using policy π . For notational simplicity , we may write Nk , π ( t ) as Nk ( t ) . It is desired to pull arm k at least at the uniform rate of τk , k = 1 , . . . , K. In other words , the learner should obey the constraint that Nk ( t ) ≥ τkt for any t ∈ [ T ] . Thus a good policy aims to solve the following optimization problem , arg max π E ∑ k µkNk , π ( T ) , subject to Nk , π ( t ) ≥ τkt for all k and t. ( 2 ) Instead of directly working with such a constrained bandit problem , we consider a penalization problem . That is , one gets penalized if the arm is not pulled sufficiently often . To reflect this , we introduce the following design problem . Let Sπ ( T ) be the sum of the rewards obtained by time t under policy π , i.e. , Sπ ( T ) = ∑T t=1 rπt where πt is the arm index chosen by policy π at time t ∈ [ T ] and rπt is the corresponding reward . Then the penalized total reward is defined as Spen , π ( T ) = Sπ ( T ) − K∑ k=1 Ak ( τkT −Nk , π ( T ) ) + , ( 3 ) where A1 , . . . , AK are known nonnegative penalty rates . Our goal is to design a learning algorithm to make the expectation of Spen , π ( T ) as large as possible . By taking the expectation , we have E [ Spen , π ( T ) ] = K∑ k=1 µkE [ Nk , π ( t ) ] − K∑ k=1 AkE [ ( τkT −Nk , π ( T ) ) + ] , ( 4 ) which is the penalized reward achieved by policy π and we would like to maximize it over π . Now we are ready to introduce the penalized regret function , which is the core for the regret analysis . To derive the new regret , we first note that maximizing E [ Spen , π ( T ) ] is the same as minimizing the following loss function , L ( T ) = µ∗T − E [ Spen , π ( T ) ] = K∑ k=1 [ ∆kE [ Nk ( t ) ] +AkE [ ( τkT −Nk ( T ) ) + ] ] , ( 5 ) where we denote µ∗ = max k=1 , ... , K µk , ∆k = µ ∗ − µk , k = 1 , . . . , K. In order to find the minimum possible value of L ( T ) , let us understand what a prophet ( who knows the expected rewards µ1 , . . . , µK ) would do . Clearly , a prophet ( who , in addition , is not constrained by integer value ) would solve the following optimization problem , min x1 , ... , xK K∑ k=1 [ ∆kxk +AkE ( τkT − xk ) + ] subject to K∑ k=1 xk = T , xk ≥ 0 , k = 1 , . . . , K , and pull arm k for xk times ( k = 1 , . . . , K ) . By denoting yk = xk/T , k ∈ [ K ] , we transform this problem into min y1 , ... , yK K∑ k=1 [ ∆kyk +Ak ( τk − yk ) + ] subject to K∑ k=1 yk = 1 , yk ≥ 0 , k = 1 , . . . , K. ( 6 ) We will solve the problem ( 6 ) by finding y1 , . . . , yK that satisfy the constraints and that minimize simultaneously each term in the objective function . It is not hard to observe the following facts . 1 . For A ≥ 0 , function y 7→ A ( τ − y ) + achieves its minimum value of 0 for y ≥ τ . 2 . For A ≥ ∆ > 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of ∆τ at y = τ . 3 . For ∆ > A ≥ 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of Aτ at y = 0 . As a result , we introduce the following three sets Aopt = { k ∈ [ K ] : µk = µ∗ } , Acr = { k ∈ [ K ] : Ak ≥ ∆k > 0 } , Anon−cr = { k ∈ [ K ] : ∆k > Ak } , where Aopt consists of all optimal arms , Acr consists of sub-optimal arms with penalty rate larger than ( or equal to ) the sub-optimal gap and Anon−cr includes sub-optimal arms with penalty rate smaller than the sub-optimal gap . Therefore an optimal solution to the problem ( 6 ) can be constructed as follows . Let k∗ be an arbitrary arm in Aopt , and choose yk = 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj , k = k ∗ , τk , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr . ( 7 ) Therefore , a prophet would choose ( modulo rounding ) in ( 5 ) Nk ( T ) = ( 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj ) T , k = k∗ , τkT , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr , ( 8 ) leading to the following optimal value of L ( T ) , L∗ ( T ) = ∑ k∈Acr ∆kτkT + ∑ k∈Anon−cr AkτkT = ( K∑ k=1 min ( ∆k , Ak ) τk ) T. ( 9 ) Given an arbitrary algorithm π , we can therefore define the penalized regret as Rπ ( T ) = Lπ ( T ) − L∗ ( T ) = ∑ k∈Aopt AkE ( τkT −Nk , π ( T ) ) + ( 10 ) + ∑ k∈Acr [ ∆kE ( Nk , π ( T ) − τkT ) +AkE ( τkT −Nk , π ( T ) ) + ] + ∑ k∈Anon−cr [ ∆kENk , π ( T ) +Ak ( E ( τkT −Nk , π ( T ) ) + − τkT ) ] . | The authors propose a new penalization framework for the stochastic multi-armed bandit problem with fairness constraints. They formalize the penalized regret to evaluate the performance of bandit algorithms under this setting. They propose a hard-threshold UCB algorithm and provide its gap-dependent/independent regret bounds. Experiments on synthetic data show its superiority over other existing methods. | SP:4d5619045e8d9b9bfd895019d31b4b37b2a0e6b9 |
A new look at fairness in stochastic multi-armed bandit problems | 1 INTRODUCTION . The multi-armed bandit ( MAB ) problem is a classical framework for sequential decision-making in uncertain environments . Starting with the seminal work of Robbins ( 1952 ) , over the years , a significant body of work has been developed to address both theoretical aspects and practical applications of this problem . In a traditional stochastic multi-armed bandit ( MAB ) problem ( Lai & Robbins , 1985 ; Auer et al. , 2002 ; Vermorel & Mohri , 2005 ; Bubeck & Cesa-Bianchi , 2012 ) , a learner has access to K arms and pulling arm k generates a stochastic reward for the principal from an unknown distribution Fk with an unknown expected reward µk . If the mean rewards were known as prior information , the learner could just repeatedly pull the best arm given by k∗ = arg maxk µk . However , the learner has no such knowledge of the reward of each arm . Hence , one should use some learning algorithm π which operates in rounds , pulls arm πt ∈ { 1 , . . . , K } in round t , observes the stochastic reward generated from reward distribution Fπt , and uses that information to learn the best arm over time . The performance of learning algorithm π is evaluated based on its cumulative regret over time horizon T , defined as R̄π ( T ) = µk∗T − T∑ t=1 Eµπt . ( 1 ) To achieve the minimum regret , a good learner should make a balance between exploration ( pulling different arms to get more information of reward distribution of each arm ) and exploitation ( pulling the arm currently believed to have the highest reward ) . In addition to the above classical MAB problem , many variations of the MAB framework have been extensively studied in the literature recently . Various papers study MAB problems with additional constraints which include bandits with knapsack constraints ( Badanidiyuru et al. , 2013 ) , bandits with budget constraints ( Xia et al. , 2015 ) , sleeping bandits ( Kleinberg et al. , 2010 ; Chatterjee et al. , 2017 ) , etc . Except these , there is a huge research interest in fairness within machine learning field . Fairness has been a hot topic of many recent application tasks , including classification ( Zafar et al. , 2017a ; b ; Agarwal et al. , 2018 ; Roh et al. , 2021 ) , regression ( Berk et al. , 2017 ; Rezaei et al. , 2019 ) , recommendation ( Celis et al. , 2017 ; Singh & Joachims , 2018 ; Beutel et al. , 2019 ; Wang et al. , 2021 ) , resource allocation ( Baruah et al. , 1996 ; Talebi & Proutiere , 2018 ; Li et al. , 2020 ) , Markov decision process ( Khan & Goodridge , 2019 ) , etc . There are two popular definitions of fairness in the MAB literature . 1 ) . The fairness is introduced into the bandit learning framework by saying that it is unfair to preferentially choose one arm over another if the chosen arm has lower expected reward than the unchosen arm ( Joseph et al. , 2016 ) . In other words , the learning algorithm can not favor low-reward arms . 2 ) . The fairness is introduced such that the algorithm needs to ensure that uniformly ( i.e. , at the end of every round ) each arm is pulled at least a pre-specified fraction of times ( Patil et al. , 2020 ) . In other words , it imposes an additional constraint to prevent the algorithm from playing low-reward arms too few times . In this paper , we adopt a new perspective , e.g. , in addition to maximizing the cumulative expected reward , it also allows the user to specify how “ hard ” or how “ soft ” the fairness requirement on each arm is . In this view , it is not always easy even to formulate the problem and to introduce an appropriate notion of regret . We thus propose a new formulation of fairness MAB by introducing penalty termAk max ( τkT−Nk ( T ) , 0 ) , whereAk , τk are the penalty rate and fairness fraction for arm k and Nk ( T ) is the number of times pulling arm k. Hence it gives penalization when the algorithm fails to meet the fairness constraint and penalty term is proportional to the gap between pulling number and its required level . To solve this regularized MAB problem , we also propose a hard-threshold upper confidence bound ( UCB ) algorithm . It is similar to the classical UCB algorithm but adds an additional term to encourage the learner to favor those arms whose pulling numbers are below the required level at each round . The advantage of our approach is that it allows the user to distinguish , if desired , between arms for which is more important to sample an arm with required frequency and those arms for which it is less important to do so . To the best of our knowledge , there is no work on mathematical framework of fairness MAB with regularization term in the literature . In this paper , we provide a relatively complete theory for the fairness MAB . We rigorously formalize the penalized regret which can be used for evaluating the performance of learning algorithm under fairness constraints . On theoretical side , the hard-threshold UCB algorithm is proved to achieve asymptotic fairness when a large penalty rate is chosen . The algorithm is shown to obtain O ( log T ) regret when the sub-optimality gap is assumed to be fixed . Additionally , the characterization of fluctuation of non-fairness level , max1≤t≤T max ( τkt−Nk ( t ) , 0 ) is also given . Its magnitude is also shown to be O ( log T ) . Moreover , we establish a sub-optimal gap-free regret bound of proposed method and provide insights on how hard-threshold based UCB index works . We also point out that the analysis of proposed hard-threshold UCB algorithm is much harder than the classical UCB due to the existence of interventions between different sub-optimal arms . On numerical side , the experimental results confirm our theory and show that the performance of the proposed algorithm is better than other popular methods . Our method achieves a better trade-off between reward and fairness . Notations . For real number x , ( x ) + stands for max { 0 , x } ; bxc is the largest integer smaller or equal to x . For integer n , we use [ n ] to represent the set { 1 , . . . , n } . We say a = O ( b ) ; a = Ω ( b ) if there exists a constant C such that a ≤ Cb ; a ≥ b/C . The symbols E and P ( · ) denote generic expectation and probability under a probability measure that may be determined from the context . We let π be a generic policy / learning algorithm . 2 ACHIEVING FAIRNESS VIA PENALIZATION . Consider a stochastic multi-armed bandit problem with K arms and unknown expected rewards µ1 , . . . , µK associated with these arms . The notion of fairness we introduce consists of proportions τk ≥ 0 , k = 1 , . . . , K with τ1 + · · ·+ τK < 1 . We use T ∈ { 1 , 2 , . . . , } to denote the time horizon and Nk , π ( t ) to denote the number of times that arm k has been pulled by time t ∈ [ T ] using policy π . For notational simplicity , we may write Nk , π ( t ) as Nk ( t ) . It is desired to pull arm k at least at the uniform rate of τk , k = 1 , . . . , K. In other words , the learner should obey the constraint that Nk ( t ) ≥ τkt for any t ∈ [ T ] . Thus a good policy aims to solve the following optimization problem , arg max π E ∑ k µkNk , π ( T ) , subject to Nk , π ( t ) ≥ τkt for all k and t. ( 2 ) Instead of directly working with such a constrained bandit problem , we consider a penalization problem . That is , one gets penalized if the arm is not pulled sufficiently often . To reflect this , we introduce the following design problem . Let Sπ ( T ) be the sum of the rewards obtained by time t under policy π , i.e. , Sπ ( T ) = ∑T t=1 rπt where πt is the arm index chosen by policy π at time t ∈ [ T ] and rπt is the corresponding reward . Then the penalized total reward is defined as Spen , π ( T ) = Sπ ( T ) − K∑ k=1 Ak ( τkT −Nk , π ( T ) ) + , ( 3 ) where A1 , . . . , AK are known nonnegative penalty rates . Our goal is to design a learning algorithm to make the expectation of Spen , π ( T ) as large as possible . By taking the expectation , we have E [ Spen , π ( T ) ] = K∑ k=1 µkE [ Nk , π ( t ) ] − K∑ k=1 AkE [ ( τkT −Nk , π ( T ) ) + ] , ( 4 ) which is the penalized reward achieved by policy π and we would like to maximize it over π . Now we are ready to introduce the penalized regret function , which is the core for the regret analysis . To derive the new regret , we first note that maximizing E [ Spen , π ( T ) ] is the same as minimizing the following loss function , L ( T ) = µ∗T − E [ Spen , π ( T ) ] = K∑ k=1 [ ∆kE [ Nk ( t ) ] +AkE [ ( τkT −Nk ( T ) ) + ] ] , ( 5 ) where we denote µ∗ = max k=1 , ... , K µk , ∆k = µ ∗ − µk , k = 1 , . . . , K. In order to find the minimum possible value of L ( T ) , let us understand what a prophet ( who knows the expected rewards µ1 , . . . , µK ) would do . Clearly , a prophet ( who , in addition , is not constrained by integer value ) would solve the following optimization problem , min x1 , ... , xK K∑ k=1 [ ∆kxk +AkE ( τkT − xk ) + ] subject to K∑ k=1 xk = T , xk ≥ 0 , k = 1 , . . . , K , and pull arm k for xk times ( k = 1 , . . . , K ) . By denoting yk = xk/T , k ∈ [ K ] , we transform this problem into min y1 , ... , yK K∑ k=1 [ ∆kyk +Ak ( τk − yk ) + ] subject to K∑ k=1 yk = 1 , yk ≥ 0 , k = 1 , . . . , K. ( 6 ) We will solve the problem ( 6 ) by finding y1 , . . . , yK that satisfy the constraints and that minimize simultaneously each term in the objective function . It is not hard to observe the following facts . 1 . For A ≥ 0 , function y 7→ A ( τ − y ) + achieves its minimum value of 0 for y ≥ τ . 2 . For A ≥ ∆ > 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of ∆τ at y = τ . 3 . For ∆ > A ≥ 0 , function y 7→ ∆y +A ( τ − y ) + achieves its minimum of Aτ at y = 0 . As a result , we introduce the following three sets Aopt = { k ∈ [ K ] : µk = µ∗ } , Acr = { k ∈ [ K ] : Ak ≥ ∆k > 0 } , Anon−cr = { k ∈ [ K ] : ∆k > Ak } , where Aopt consists of all optimal arms , Acr consists of sub-optimal arms with penalty rate larger than ( or equal to ) the sub-optimal gap and Anon−cr includes sub-optimal arms with penalty rate smaller than the sub-optimal gap . Therefore an optimal solution to the problem ( 6 ) can be constructed as follows . Let k∗ be an arbitrary arm in Aopt , and choose yk = 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj , k = k ∗ , τk , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr . ( 7 ) Therefore , a prophet would choose ( modulo rounding ) in ( 5 ) Nk ( T ) = ( 1− ∑ j∈Acr∪ ( Aopt\ { k∗ } ) τj ) T , k = k∗ , τkT , k ∈ Acr ∪ ( Aopt \ { k∗ } ) , 0 , k ∈ Anon−cr , ( 8 ) leading to the following optimal value of L ( T ) , L∗ ( T ) = ∑ k∈Acr ∆kτkT + ∑ k∈Anon−cr AkτkT = ( K∑ k=1 min ( ∆k , Ak ) τk ) T. ( 9 ) Given an arbitrary algorithm π , we can therefore define the penalized regret as Rπ ( T ) = Lπ ( T ) − L∗ ( T ) = ∑ k∈Aopt AkE ( τkT −Nk , π ( T ) ) + ( 10 ) + ∑ k∈Acr [ ∆kE ( Nk , π ( T ) − τkT ) +AkE ( τkT −Nk , π ( T ) ) + ] + ∑ k∈Anon−cr [ ∆kENk , π ( T ) +Ak ( E ( τkT −Nk , π ( T ) ) + − τkT ) ] . | This paper examines the problem of reward maximization in a Multi-Armed Bandit, with the additional fairness constraint that each arm should be pulled for at least a fraction of time. The authors propose and analyze an algorithm where the UCB index of an arm $i$ is increased by a specified amount (which is a parameter for the algorithm) $A_i$ for the time instances where the arm is lagging behind the fairness constraint. Results about the asymptotic satisfaction (or not) of the fairness constraints depending on the relationship between $A_i$ and the suboptimality gap of each arm are given, as well as results about the gap-dependent and gap-independent regret of the studied algorithm under a modified reward with the threshold (that is, a cost $A_i$ is given to all arms $i$ that do not satisfy the fairness constraints at time $t$). This algorithm is also compared with two recent state of the art algorithms for this problem in synthetic examples and illustrates superior performance. | SP:4d5619045e8d9b9bfd895019d31b4b37b2a0e6b9 |
CONTROLLING THE MEMORABILITY OF REAL AND UNREAL FACE IMAGES | 1 INTRODUCTION . In our everyday life , we are exposed to many pictures of scenes , objects and faces . Research has shown that all images do not have the same likelihood to be recalled later ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . Although different people have different abilities in memorizing visual contents ( image or video ) , it has been shown that memorability is an intrinsic feature of an image and it is consistent across different observers ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . In other words , memorability of an image is an attribute of that image which can be measured , predicted or manipulated ( Isola et al. , 2011 ) . So far there have been several studies that have attempted to understand , predict , and even modify image memorability . ( Khosla et al. , 2013a ; 2015 ; Goetschalckx & Wagemans , 2019 ; Fajtl et al . ; Needell & Bainbridge , 2021 ; Squalli-Houssaini et al. , 2018 ; Almog et al . ) , and a few work attempted to modify image memorability ( Khosla et al. , 2013b ; Siarohin et al. , 2017 ; Sidorov , 2019 ; Goetschalckx et al. , 2019 ) . However , for practical applications ( e.g. , education and advertisement ) , it is most important to have methods for memorability modifications . Moreover , such approaches will help understanding what constitute as image memorability , i.e . ” What makes an image memorable ? ” . This work proposes a new framework based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) for modifying face memorability as a facial attribute . Older approaches on modifying face memorability manually used face features ( Khosla et al. , 2013b ) , such as SIFT ( Lowe , 2004 ) , HOG2x2 ( Dalal & Triggs , 2005 ) , and Local Binary Pattern ( LBP ) ( Ojala et al. , 2002 ) . Recently , GANs have been used to modify the memorability of images . ( Goetschalckx et al. , 2019 ; Sidorov , 2019 ) . Goetschalckx et al . ( 2019 ) leverage latent vector modification to change the memorability of the fake food , scenes , and animal images generated by BigGAN ( Brock et al. , 2018 ) . This memorability modification affects several attributes of the image , such as size , color , and shape . In our work , we aim to modify memorability of face images of real people while keeping their identity , consequently , their method can not be used here . The largest dataset of the human faces with their memorability annotations is US 10k Face database ( Bainbridge et al. , 2013 ) , which includes 2222 face images with their memorability scores acquired from human observers in an experiment . StyleGANs are the state-of-the-art models for generating real-looking faces . Our utilization of StyleGANs is required to create a dataset of realistic-looking faces . Not only that , for modifying the memorability of real faces , we need StyleGANs to reconstruct real faces with high accuracy . To date , StyleGANs are the state-of-the-art models in reconstructing real-face images . StyleGANs provide an extended latent space which we leverage to derive a more accurate memorability hyperplane . Also , the face attributes of StyleGANs are especially disentangled in comparison to other GANs , which is required to accurately modify faces for memorability and study the attributes contributing to this . For this , we employed pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate 100k fake faces . Next , we adopted computational memorability models which we trained on the US 10k Face Database , to predict the memorability of the generated face images and organized them into faces with high or low memorability . Inspired by Shen et al . ( 2020 ) , we found a hyperplane in latent subspace to separate the highly-memorable and low-memorable faces . We showed that both latent space and extended latent space can be used for finding the separating hyperplane . After finding the hyperplane , we moved the latent vector of each image , in the positive or negative direction of the normal vector of that hyperplane and changed the distance of the latent vector from the separating hyperplane to manipulate the memorability of that image . We name the normal vector of this hyperplane , memorability modification vector . With this proposed approach , we could control the amount of change in memorability by using different weights for the memorability modification vector . In contrast to the method proposed by Sidorov ( 2019 ) , our method does not require training another auxiliary network for modifying face memorability and the amount of change in memorability is controlled by a hyperparameter . Since different hyperplanes for different facial attributes in StyleGAN latent space ( Shen et al. , 2020 ; Härkönen et al. , 2020 ) can be found , our method can be used to modify the memorability of the images conditionally . For example , we are able to change the memorability of the face while maintaining the length of the hair and the existence of eyeglasses . For this , we first find the corresponding hyperplanes for these attributes , and then leverage projection to those subspaces to have the desired attributes fixed while changing memorability . StyleGAN produces high quality real-looking images which are near impossible to differentiate from real images . To make sure our memorabilitymodified faces still look real , we considered the Frechet Inception Distance ( FID ) ( Heusel et al. , 2017 ) and Kernel Inception Distance ( KID ) ( Bińkowski et al. , 2018 ) scores of the generated faces from the StyleGAN as the baseline . Then by calculating the FID score and KID score of our memorability modified images , we showed that our modified faces still looked real . For real faces , we first embedded the face images into GAN latent space using Image2Style ( Abdal et al. , 2019 ) and the method provided by Karras et al . ( 2020 ) . After finding the image latent vector , we modified the real face memorability in the same way previously explained for synthetic faces . Figure 1 illustrates the general idea of our approach . Finally , we examined how different layers of extended latent space of StyleGAN affect the image of each face and its memorability . 1.1 RELATED WORKS . Image Memorability . People have different capabilities in memorizing different visual events ( Hunt et al. , 1981 ) . In spite of these differences , through a series of experiments , Isola et al . ( 2011 ) showed that people consistently remember some images and forget others . They designed an online memory game experiment and recruited a large number of participants through Amazon Mechanical Turk . In this experiment , participants observed a series of images presented in a sequence and were tasked to detect repetitive images in the sequence . Then Isola et al . ( 2011 ) measured a memorability score for each image , which corresponded to the rate of people remembering an image after single exposure to that image in the sequence . Khosla et al . ( 2015 ) created the largest annotated image memorability dataset ( LaMem ) , which consists of 60,000 images , mostly objects , scenes , and animals . Using this dataset , they introduced the first deep model for predicting image memorability . This model uses AlexNet ( Krizhevsky et al. , 2012 ) as its backbone architecture . Moreover , Needell & Bainbridge ( 2021 ) introduced new architectures based on residual networks ( He et al. , 2016 ) to improve the performance of memorability prediction . In addition to these models , Fajtl et al . leveraged Attention Maps to introduce AMNet for predicting memorability . Generative Adversarial Networks ( GANs ) . With the development of Generative Adversarial Networks ( Goodfellow et al. , 2014 ) , we are now capable of generating real-looking synthetic images that are indistinguishable from real images . Generally , these networks are composed of two parts ; a generative and a discriminative network . The goal of the generative network is to generate reallooking images to fool the discriminator and the goal of the discriminator is to learn to distinguish generated images from real images . These two networks are optimized through a minmax game where both sides compete to reach their specified goals . In recent years , there have been huge improvements in this area and many different GANs have been introduced to produce natural-looking images such as Progressive GAN ( Karras et al. , 2017 ) , DCGAN ( Radford et al. , 2015 ) , and CycleGAN ( Zhu et al. , 2017 ) . In this work , we used pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate real-looking faces . Modifying Image Memorability . While image memorability modification has many potential applications ( e.g . in education or advertisement ) , it has not been adequately investigated . Khosla et al . ( 2013b ) proposed a pioneering method for changing face memorability . It leveraged Active Appearance Models ( AAMs ( Cootes et al. , 2001 ) ) to represent faces by their shape and appearance . Then the loss function was defined based on the cost of modifying identity , modifying facial attributes , and memorability . As a result , in their method , the identity was fixed . Another approach ( Sidorov , 2019 ) used VAE/GAN ( Larsen et al. , 2016 ) , StarGAN ( Choi et al. , 2018 ) , and AttGAN ( He et al. , 2019 ) and trained them with three memorability levels ( poorly memorable , moderately memorable , and highly memorable ) of faces and modified the memorability of different faces to these three levels only . Additionally , Siarohin et al . ( 2017 ) utilized style transfer to increase the memorability of an input image . However , the added style adversely affected the realness of the modified images , such that it barely could be used in real-world applications . Most recently , Goetschalckx et al . ( 2019 ) trained a transformer network to change the memorability of each generated image by BigGAN ( Brock et al. , 2018 ) through modifying their latent vectors . Their method works on generated images of objects and scenes . 2 METHOD . The overview of our proposed method is depicted schematically in Figure 1 . Below we explain the approach step by step . 2.1 CREATING THE DATASET . For the purpose of analyzing the latent vectors of the GANs and their relation to memorability , we need a large dataset of face images with their memorability scores . The largest dataset available for face images is the 10k US Adult Faces Database ( Bainbridge et al. , 2013 ) . This database contains 10,168 natural human face images and 2,222 of these images are annotated with memorability scores . To create a larger dataset for face images with their corresponding memorability scores , we leveraged StyleGAN1 and StyleGAN2 , which are the state-of-the-art models for creating realisticlooking face images . These models were pre-trained on the FFHQ dataset ( Karras et al. , 2019 ) which consists of 70,000 high-quality face images with 1024 × 1024 resolution with variations in age , gender , and glasses . We created two different datasets with StyleGAN1 and StyleGAN2 . We randomly sampled 100k z ∈ R1×512 from a standard normal distribution with truncation to produce high-quality synthetic face images and saved their mappings in the extended latent space ( R18×512 ) of both GANs . | This work presents an approach to modify face memorability as a facial attribute using Generative Adversarial Networks (GANs). They essentially propose “memorability modification vector.” Their approach first determines the hyperplane and we can move the latent vector of each image, in the positive or negative direction of the normal vector of that hyperplane. They control the distance of the latent vector from the separating hyperplane to manipulate the memorability of that image. They conducted experiments with StyleGAN and StylyeGAN2 to demonstrate effectivness of their apporaching using FID and KID metrics. | SP:cf83543b309e52a857740d03b7f4929243cbc313 |
CONTROLLING THE MEMORABILITY OF REAL AND UNREAL FACE IMAGES | 1 INTRODUCTION . In our everyday life , we are exposed to many pictures of scenes , objects and faces . Research has shown that all images do not have the same likelihood to be recalled later ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . Although different people have different abilities in memorizing visual contents ( image or video ) , it has been shown that memorability is an intrinsic feature of an image and it is consistent across different observers ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . In other words , memorability of an image is an attribute of that image which can be measured , predicted or manipulated ( Isola et al. , 2011 ) . So far there have been several studies that have attempted to understand , predict , and even modify image memorability . ( Khosla et al. , 2013a ; 2015 ; Goetschalckx & Wagemans , 2019 ; Fajtl et al . ; Needell & Bainbridge , 2021 ; Squalli-Houssaini et al. , 2018 ; Almog et al . ) , and a few work attempted to modify image memorability ( Khosla et al. , 2013b ; Siarohin et al. , 2017 ; Sidorov , 2019 ; Goetschalckx et al. , 2019 ) . However , for practical applications ( e.g. , education and advertisement ) , it is most important to have methods for memorability modifications . Moreover , such approaches will help understanding what constitute as image memorability , i.e . ” What makes an image memorable ? ” . This work proposes a new framework based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) for modifying face memorability as a facial attribute . Older approaches on modifying face memorability manually used face features ( Khosla et al. , 2013b ) , such as SIFT ( Lowe , 2004 ) , HOG2x2 ( Dalal & Triggs , 2005 ) , and Local Binary Pattern ( LBP ) ( Ojala et al. , 2002 ) . Recently , GANs have been used to modify the memorability of images . ( Goetschalckx et al. , 2019 ; Sidorov , 2019 ) . Goetschalckx et al . ( 2019 ) leverage latent vector modification to change the memorability of the fake food , scenes , and animal images generated by BigGAN ( Brock et al. , 2018 ) . This memorability modification affects several attributes of the image , such as size , color , and shape . In our work , we aim to modify memorability of face images of real people while keeping their identity , consequently , their method can not be used here . The largest dataset of the human faces with their memorability annotations is US 10k Face database ( Bainbridge et al. , 2013 ) , which includes 2222 face images with their memorability scores acquired from human observers in an experiment . StyleGANs are the state-of-the-art models for generating real-looking faces . Our utilization of StyleGANs is required to create a dataset of realistic-looking faces . Not only that , for modifying the memorability of real faces , we need StyleGANs to reconstruct real faces with high accuracy . To date , StyleGANs are the state-of-the-art models in reconstructing real-face images . StyleGANs provide an extended latent space which we leverage to derive a more accurate memorability hyperplane . Also , the face attributes of StyleGANs are especially disentangled in comparison to other GANs , which is required to accurately modify faces for memorability and study the attributes contributing to this . For this , we employed pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate 100k fake faces . Next , we adopted computational memorability models which we trained on the US 10k Face Database , to predict the memorability of the generated face images and organized them into faces with high or low memorability . Inspired by Shen et al . ( 2020 ) , we found a hyperplane in latent subspace to separate the highly-memorable and low-memorable faces . We showed that both latent space and extended latent space can be used for finding the separating hyperplane . After finding the hyperplane , we moved the latent vector of each image , in the positive or negative direction of the normal vector of that hyperplane and changed the distance of the latent vector from the separating hyperplane to manipulate the memorability of that image . We name the normal vector of this hyperplane , memorability modification vector . With this proposed approach , we could control the amount of change in memorability by using different weights for the memorability modification vector . In contrast to the method proposed by Sidorov ( 2019 ) , our method does not require training another auxiliary network for modifying face memorability and the amount of change in memorability is controlled by a hyperparameter . Since different hyperplanes for different facial attributes in StyleGAN latent space ( Shen et al. , 2020 ; Härkönen et al. , 2020 ) can be found , our method can be used to modify the memorability of the images conditionally . For example , we are able to change the memorability of the face while maintaining the length of the hair and the existence of eyeglasses . For this , we first find the corresponding hyperplanes for these attributes , and then leverage projection to those subspaces to have the desired attributes fixed while changing memorability . StyleGAN produces high quality real-looking images which are near impossible to differentiate from real images . To make sure our memorabilitymodified faces still look real , we considered the Frechet Inception Distance ( FID ) ( Heusel et al. , 2017 ) and Kernel Inception Distance ( KID ) ( Bińkowski et al. , 2018 ) scores of the generated faces from the StyleGAN as the baseline . Then by calculating the FID score and KID score of our memorability modified images , we showed that our modified faces still looked real . For real faces , we first embedded the face images into GAN latent space using Image2Style ( Abdal et al. , 2019 ) and the method provided by Karras et al . ( 2020 ) . After finding the image latent vector , we modified the real face memorability in the same way previously explained for synthetic faces . Figure 1 illustrates the general idea of our approach . Finally , we examined how different layers of extended latent space of StyleGAN affect the image of each face and its memorability . 1.1 RELATED WORKS . Image Memorability . People have different capabilities in memorizing different visual events ( Hunt et al. , 1981 ) . In spite of these differences , through a series of experiments , Isola et al . ( 2011 ) showed that people consistently remember some images and forget others . They designed an online memory game experiment and recruited a large number of participants through Amazon Mechanical Turk . In this experiment , participants observed a series of images presented in a sequence and were tasked to detect repetitive images in the sequence . Then Isola et al . ( 2011 ) measured a memorability score for each image , which corresponded to the rate of people remembering an image after single exposure to that image in the sequence . Khosla et al . ( 2015 ) created the largest annotated image memorability dataset ( LaMem ) , which consists of 60,000 images , mostly objects , scenes , and animals . Using this dataset , they introduced the first deep model for predicting image memorability . This model uses AlexNet ( Krizhevsky et al. , 2012 ) as its backbone architecture . Moreover , Needell & Bainbridge ( 2021 ) introduced new architectures based on residual networks ( He et al. , 2016 ) to improve the performance of memorability prediction . In addition to these models , Fajtl et al . leveraged Attention Maps to introduce AMNet for predicting memorability . Generative Adversarial Networks ( GANs ) . With the development of Generative Adversarial Networks ( Goodfellow et al. , 2014 ) , we are now capable of generating real-looking synthetic images that are indistinguishable from real images . Generally , these networks are composed of two parts ; a generative and a discriminative network . The goal of the generative network is to generate reallooking images to fool the discriminator and the goal of the discriminator is to learn to distinguish generated images from real images . These two networks are optimized through a minmax game where both sides compete to reach their specified goals . In recent years , there have been huge improvements in this area and many different GANs have been introduced to produce natural-looking images such as Progressive GAN ( Karras et al. , 2017 ) , DCGAN ( Radford et al. , 2015 ) , and CycleGAN ( Zhu et al. , 2017 ) . In this work , we used pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate real-looking faces . Modifying Image Memorability . While image memorability modification has many potential applications ( e.g . in education or advertisement ) , it has not been adequately investigated . Khosla et al . ( 2013b ) proposed a pioneering method for changing face memorability . It leveraged Active Appearance Models ( AAMs ( Cootes et al. , 2001 ) ) to represent faces by their shape and appearance . Then the loss function was defined based on the cost of modifying identity , modifying facial attributes , and memorability . As a result , in their method , the identity was fixed . Another approach ( Sidorov , 2019 ) used VAE/GAN ( Larsen et al. , 2016 ) , StarGAN ( Choi et al. , 2018 ) , and AttGAN ( He et al. , 2019 ) and trained them with three memorability levels ( poorly memorable , moderately memorable , and highly memorable ) of faces and modified the memorability of different faces to these three levels only . Additionally , Siarohin et al . ( 2017 ) utilized style transfer to increase the memorability of an input image . However , the added style adversely affected the realness of the modified images , such that it barely could be used in real-world applications . Most recently , Goetschalckx et al . ( 2019 ) trained a transformer network to change the memorability of each generated image by BigGAN ( Brock et al. , 2018 ) through modifying their latent vectors . Their method works on generated images of objects and scenes . 2 METHOD . The overview of our proposed method is depicted schematically in Figure 1 . Below we explain the approach step by step . 2.1 CREATING THE DATASET . For the purpose of analyzing the latent vectors of the GANs and their relation to memorability , we need a large dataset of face images with their memorability scores . The largest dataset available for face images is the 10k US Adult Faces Database ( Bainbridge et al. , 2013 ) . This database contains 10,168 natural human face images and 2,222 of these images are annotated with memorability scores . To create a larger dataset for face images with their corresponding memorability scores , we leveraged StyleGAN1 and StyleGAN2 , which are the state-of-the-art models for creating realisticlooking face images . These models were pre-trained on the FFHQ dataset ( Karras et al. , 2019 ) which consists of 70,000 high-quality face images with 1024 × 1024 resolution with variations in age , gender , and glasses . We created two different datasets with StyleGAN1 and StyleGAN2 . We randomly sampled 100k z ∈ R1×512 from a standard normal distribution with truncation to produce high-quality synthetic face images and saved their mappings in the extended latent space ( R18×512 ) of both GANs . | This paper proposes to find the hyperplane to separate images with different memorability in the latent-vector spaces of StyleGAN1 and StyleGAN2, then they can move the latent-vectors along the normal vector of the hyperplane to control the memorability of the generated images. A SENet50 trained on the US 10k Face Database with memorability labels is used to find the hyperplane. The experimental results show that the proposed method can change the memorability of images measured by the scores of the SENet50, and this method can be extended to modify real facial images. | SP:cf83543b309e52a857740d03b7f4929243cbc313 |
CONTROLLING THE MEMORABILITY OF REAL AND UNREAL FACE IMAGES | 1 INTRODUCTION . In our everyday life , we are exposed to many pictures of scenes , objects and faces . Research has shown that all images do not have the same likelihood to be recalled later ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . Although different people have different abilities in memorizing visual contents ( image or video ) , it has been shown that memorability is an intrinsic feature of an image and it is consistent across different observers ( Isola et al. , 2011 ; Bainbridge et al. , 2013 ; Isola et al. , 2014 ) . In other words , memorability of an image is an attribute of that image which can be measured , predicted or manipulated ( Isola et al. , 2011 ) . So far there have been several studies that have attempted to understand , predict , and even modify image memorability . ( Khosla et al. , 2013a ; 2015 ; Goetschalckx & Wagemans , 2019 ; Fajtl et al . ; Needell & Bainbridge , 2021 ; Squalli-Houssaini et al. , 2018 ; Almog et al . ) , and a few work attempted to modify image memorability ( Khosla et al. , 2013b ; Siarohin et al. , 2017 ; Sidorov , 2019 ; Goetschalckx et al. , 2019 ) . However , for practical applications ( e.g. , education and advertisement ) , it is most important to have methods for memorability modifications . Moreover , such approaches will help understanding what constitute as image memorability , i.e . ” What makes an image memorable ? ” . This work proposes a new framework based on Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) for modifying face memorability as a facial attribute . Older approaches on modifying face memorability manually used face features ( Khosla et al. , 2013b ) , such as SIFT ( Lowe , 2004 ) , HOG2x2 ( Dalal & Triggs , 2005 ) , and Local Binary Pattern ( LBP ) ( Ojala et al. , 2002 ) . Recently , GANs have been used to modify the memorability of images . ( Goetschalckx et al. , 2019 ; Sidorov , 2019 ) . Goetschalckx et al . ( 2019 ) leverage latent vector modification to change the memorability of the fake food , scenes , and animal images generated by BigGAN ( Brock et al. , 2018 ) . This memorability modification affects several attributes of the image , such as size , color , and shape . In our work , we aim to modify memorability of face images of real people while keeping their identity , consequently , their method can not be used here . The largest dataset of the human faces with their memorability annotations is US 10k Face database ( Bainbridge et al. , 2013 ) , which includes 2222 face images with their memorability scores acquired from human observers in an experiment . StyleGANs are the state-of-the-art models for generating real-looking faces . Our utilization of StyleGANs is required to create a dataset of realistic-looking faces . Not only that , for modifying the memorability of real faces , we need StyleGANs to reconstruct real faces with high accuracy . To date , StyleGANs are the state-of-the-art models in reconstructing real-face images . StyleGANs provide an extended latent space which we leverage to derive a more accurate memorability hyperplane . Also , the face attributes of StyleGANs are especially disentangled in comparison to other GANs , which is required to accurately modify faces for memorability and study the attributes contributing to this . For this , we employed pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate 100k fake faces . Next , we adopted computational memorability models which we trained on the US 10k Face Database , to predict the memorability of the generated face images and organized them into faces with high or low memorability . Inspired by Shen et al . ( 2020 ) , we found a hyperplane in latent subspace to separate the highly-memorable and low-memorable faces . We showed that both latent space and extended latent space can be used for finding the separating hyperplane . After finding the hyperplane , we moved the latent vector of each image , in the positive or negative direction of the normal vector of that hyperplane and changed the distance of the latent vector from the separating hyperplane to manipulate the memorability of that image . We name the normal vector of this hyperplane , memorability modification vector . With this proposed approach , we could control the amount of change in memorability by using different weights for the memorability modification vector . In contrast to the method proposed by Sidorov ( 2019 ) , our method does not require training another auxiliary network for modifying face memorability and the amount of change in memorability is controlled by a hyperparameter . Since different hyperplanes for different facial attributes in StyleGAN latent space ( Shen et al. , 2020 ; Härkönen et al. , 2020 ) can be found , our method can be used to modify the memorability of the images conditionally . For example , we are able to change the memorability of the face while maintaining the length of the hair and the existence of eyeglasses . For this , we first find the corresponding hyperplanes for these attributes , and then leverage projection to those subspaces to have the desired attributes fixed while changing memorability . StyleGAN produces high quality real-looking images which are near impossible to differentiate from real images . To make sure our memorabilitymodified faces still look real , we considered the Frechet Inception Distance ( FID ) ( Heusel et al. , 2017 ) and Kernel Inception Distance ( KID ) ( Bińkowski et al. , 2018 ) scores of the generated faces from the StyleGAN as the baseline . Then by calculating the FID score and KID score of our memorability modified images , we showed that our modified faces still looked real . For real faces , we first embedded the face images into GAN latent space using Image2Style ( Abdal et al. , 2019 ) and the method provided by Karras et al . ( 2020 ) . After finding the image latent vector , we modified the real face memorability in the same way previously explained for synthetic faces . Figure 1 illustrates the general idea of our approach . Finally , we examined how different layers of extended latent space of StyleGAN affect the image of each face and its memorability . 1.1 RELATED WORKS . Image Memorability . People have different capabilities in memorizing different visual events ( Hunt et al. , 1981 ) . In spite of these differences , through a series of experiments , Isola et al . ( 2011 ) showed that people consistently remember some images and forget others . They designed an online memory game experiment and recruited a large number of participants through Amazon Mechanical Turk . In this experiment , participants observed a series of images presented in a sequence and were tasked to detect repetitive images in the sequence . Then Isola et al . ( 2011 ) measured a memorability score for each image , which corresponded to the rate of people remembering an image after single exposure to that image in the sequence . Khosla et al . ( 2015 ) created the largest annotated image memorability dataset ( LaMem ) , which consists of 60,000 images , mostly objects , scenes , and animals . Using this dataset , they introduced the first deep model for predicting image memorability . This model uses AlexNet ( Krizhevsky et al. , 2012 ) as its backbone architecture . Moreover , Needell & Bainbridge ( 2021 ) introduced new architectures based on residual networks ( He et al. , 2016 ) to improve the performance of memorability prediction . In addition to these models , Fajtl et al . leveraged Attention Maps to introduce AMNet for predicting memorability . Generative Adversarial Networks ( GANs ) . With the development of Generative Adversarial Networks ( Goodfellow et al. , 2014 ) , we are now capable of generating real-looking synthetic images that are indistinguishable from real images . Generally , these networks are composed of two parts ; a generative and a discriminative network . The goal of the generative network is to generate reallooking images to fool the discriminator and the goal of the discriminator is to learn to distinguish generated images from real images . These two networks are optimized through a minmax game where both sides compete to reach their specified goals . In recent years , there have been huge improvements in this area and many different GANs have been introduced to produce natural-looking images such as Progressive GAN ( Karras et al. , 2017 ) , DCGAN ( Radford et al. , 2015 ) , and CycleGAN ( Zhu et al. , 2017 ) . In this work , we used pre-trained StyleGAN1 ( Karras et al. , 2019 ) and StyleGAN2 ( Karras et al. , 2020 ) on the FFHQ dataset ( Karras et al. , 2019 ) to generate real-looking faces . Modifying Image Memorability . While image memorability modification has many potential applications ( e.g . in education or advertisement ) , it has not been adequately investigated . Khosla et al . ( 2013b ) proposed a pioneering method for changing face memorability . It leveraged Active Appearance Models ( AAMs ( Cootes et al. , 2001 ) ) to represent faces by their shape and appearance . Then the loss function was defined based on the cost of modifying identity , modifying facial attributes , and memorability . As a result , in their method , the identity was fixed . Another approach ( Sidorov , 2019 ) used VAE/GAN ( Larsen et al. , 2016 ) , StarGAN ( Choi et al. , 2018 ) , and AttGAN ( He et al. , 2019 ) and trained them with three memorability levels ( poorly memorable , moderately memorable , and highly memorable ) of faces and modified the memorability of different faces to these three levels only . Additionally , Siarohin et al . ( 2017 ) utilized style transfer to increase the memorability of an input image . However , the added style adversely affected the realness of the modified images , such that it barely could be used in real-world applications . Most recently , Goetschalckx et al . ( 2019 ) trained a transformer network to change the memorability of each generated image by BigGAN ( Brock et al. , 2018 ) through modifying their latent vectors . Their method works on generated images of objects and scenes . 2 METHOD . The overview of our proposed method is depicted schematically in Figure 1 . Below we explain the approach step by step . 2.1 CREATING THE DATASET . For the purpose of analyzing the latent vectors of the GANs and their relation to memorability , we need a large dataset of face images with their memorability scores . The largest dataset available for face images is the 10k US Adult Faces Database ( Bainbridge et al. , 2013 ) . This database contains 10,168 natural human face images and 2,222 of these images are annotated with memorability scores . To create a larger dataset for face images with their corresponding memorability scores , we leveraged StyleGAN1 and StyleGAN2 , which are the state-of-the-art models for creating realisticlooking face images . These models were pre-trained on the FFHQ dataset ( Karras et al. , 2019 ) which consists of 70,000 high-quality face images with 1024 × 1024 resolution with variations in age , gender , and glasses . We created two different datasets with StyleGAN1 and StyleGAN2 . We randomly sampled 100k z ∈ R1×512 from a standard normal distribution with truncation to produce high-quality synthetic face images and saved their mappings in the extended latent space ( R18×512 ) of both GANs . | This paper presents a method to control the memorability of face images in the latent subspace of GANs. The basic approach is similar to InterFaceGAN [Shen et al., 2020]. The authors first train a memorability assessor network on the 10k US Adult Faces Database and used the assessor to provide memorability scores on generated face images from StyleGANs pre-trained on the FFHQ dataset. They then find the hyperplane in the StyleGAN latent space to separate low-memorable and high-memorable images according to the memorability score. The memorability of faces is modified by changing the distance from the hyperplane. They demonstrated that their method can successfully control the memorability scores of generated images while keeping the realism as face images and show some qualitative examples and discussions about memorability-modified face images. | SP:cf83543b309e52a857740d03b7f4929243cbc313 |
Maximum Likelihood Training of Parametrized Diffusion Model | 1 INTRODUCTION . Diffusion models have recently achieved successes on a task of sample generations , and some researches claim the state-of-the-art performance over Generative Adversarial Networks ( GAN ) ( Karras et al. , 2019 ) . This success is highlighted particularly in the community of likelihood-based models , including normalizing flows ( Grcić et al. , 2021 ) , autoregressive models ( Parmar et al. , 2018 ) , and variational autoencoders ( VAE ) ( Vahdat and Kautz , 2020 ) . Moreover , this success is noteworthy because it is achieved merely using linear diffusing mechanisms , such as VESDEs ( Song and Ermon , 2020 ) and VPSDEs ( Ho et al. , 2020 ) . This paper expands these linear diffusing mechanisms of VE/VPSDE to a data-adaptive trainable nonlinear diffusion . To motivate the expansion , though there are structural similarities between diffusion models and VAEs , the forward diffusion in a diffusion model has not been trained in existing literature while its counterpart , which is the encoder of VAE , is trainable . Rather , the current diffusion models assume the linear diffusing mechanism to be fixed throughout training procedure . Because of this static nature of the diffusing mechanism , variational gap ( Cremer et al. , 2018 ) between the log-likelihood and the Evidence Lower BOund ( ELBO ) remains to be strictly positive unless the score perfectly estimates the data score . This variational gap prevents the score training from being Maximum Likelihood Estimation ( MLE ) . This gap is a fundamental motivation to develop a trainable encoder of the diffusion model , so that the gap can be tight . As we tighten variational gap by training a nonlinear forward diffusion , the biggest challenge comes from an intractable optimization loss . The denoising diffusion loss requires a transition probability to be closed-form in order to achieve fast optimization , but a nonlinear diffusing mechanism , in general , has no closed-form perturbation probability . Hence , our innovation becomes designing a diffusion model with a tractable loss while the diffusion is learnable and flexible , which we achieve by merging previous diffusion models and the tractable variable transformation . Our innovation concentrates on the theoretic and the practical aspects of a new diffusion , which is tractable , learnable , and flexible . Theoretically , we observe that a nonlinear diffusing mechanism can be transformed to a linear diffusion under an invertible transformation , and vice versa . In practice , we implement PDM by merging a normalizing flow model and a diffusion model , which constructs a tractable , learnable , and flexible nonlinear diffusing mechanism . From this construction , we prove that variational gap can be further tightened by training the forward diffusion , nonlinearly . Also , we demonstrate the state-of-the-art performance in CelebA on Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) . We summarize our key contributions , as below . • PDM expands the scope of a forward diffusion process from linear and fixed dynamics to nonlinear and trainable dynamics . • PDM minimizes variational gap between the log-likelihood and ELBO , lower than the gap of linear diffusion models because PDM learns a data-adaptive nonlinear diffusion . • PDM explicitly proves in Theorem 2 that the optimal generative distribution equals to the real distribution , which was not the case for a linear diffusion model . 2 PRELIMINARY . A diffusion model is constructed with bidirectional stochastic processes . The forward direction diffuses an input variable to a noise variable , and the reverse direction denoises the random noise to construct a realistic input data instance . The diffusion model learns this reverse direction ( generative process ) by estimating data score . We provide a brief summary of diffusion models , as below . Forward Diffusion At the beginning of model build-up , a diffusion process requires a diffusing mechanism on an input variable . This paper assumes that the diffusion process is governed by a SDE of dxt = f ( xt , t ) dt + G ( xt , t ) dωt with x0 ∼ pr , where pr is the distribution from a real-world dataset ; and xt is the solution of the SDE . Reverse Diffusion The theory of stochastic calculus guarantees that we could create an identical diffusion process , { xt } Tt=0 , by solving an associated reverse SDE backwards in time ( Anderson , 1982 ) . The associated reverse SDE is dxt = [ f ( xt , t ) −G ( xt , t ) GT ( xt , t ) ∇xt log pt ( xt ) ] dt+ G ( xt , t ) dω̄t , xT ∼ pT , ( 1 ) where ωt and ω̄t are standard Wiener processes with time flows forward and backward , respectively ; and pt is a probability law of xt . Generative Diffusion A diffusion model approximates the above SDE 1 to eventually yield an estimation on the data distribution of pr . In SDE 1 , previous literature setup that drift and diffusion terms , f and G , are determined a-priori in the forward diffusion . However , data score , ∇xt log pt ( xt ) , is intractable to compute , so we estimate this data score with a score network of sθ ( xt , t ) in order to mimic the reverse diffusion with our generative process . This score network approximates the reverse diffusion by plugging the estimated score in place of data score with the below generative process : dxθt = [ f ( xθt , t ) −G ( xθt , t ) GT ( xθt , t ) sθ ( xθt , t ) ] dt+ G ( xθt , t ) dω̄t , x θ T ∼ π . ( 2 ) The generative process starts from a prior distribution ( π ) , and it constructs time-continuous random variables xθt by solving a SDE 2 backwards in time . The generated stochastic process is denoted by { xθt } Tt=0 , and we omit θ in the superscript if no confusion arises . With this generative process , we define a generative distribution , xθ0 ∼ pθ , as the probability density of the generated random variable at time t = 0 . Score Estimation We train the score network by a variational bound of the log-likelihood , given by Ex0 [ − log pθ ( x0 ) ] ≤L ( { xt } Tt=0 , λ = g2 ; θ ) − ExT [ log π ( xT ) ] = ∫ T 0 g2 ( t ) Lt ( { xt } Tt=0 ; θ ) dt− ExT [ log π ( xT ) ] , ( 3 ) where Lt ( { xt } Tt=0 ; θ ) = Ex0 , xt [ ‖sθ ( xt , t ) − ∇xt log p0t ( xt|x0 ) ‖22 ] up to a constant , where p0t ( xt|x0 ) is a transition probability from x0 to xt . Here , λ is a weighting function that determines the level of contribution for each diffusion time on the overall diffusion loss , L ( { xt } Tt=0 , λ ; θ ) ( Song et al. , 2020 ) . Variational bound holds when the weighting function is the likelihood weighting ( g ) ( Song et al. , 2021 ) , where G is a scalar-valued g function . 3 MOTIVATION OF NONLINEAR DIFFUSING MECHANISM . Though it has long been theoretically and empirically grounded to train the encoder part in VAE , such solid ground is not accomplished in diffusion models . This section analyzes structural similarities between a VAE model and a diffusion model , which brings the foundation of a data-adaptive nonlinear diffusing mechanism . 3.1 VARIATIONAL GAP OF VAE . Given Negative ELBO ( NELBO ) of Negative Log-Likelihood ( NLL ) in VAE as − log pθ ( x ) ≤Eqφ ( z|x ) [ − log pθ ( x|z ) ] +DKL ( qφ ( z|x ) ‖p ( z ) ) ( 4 ) =− log pθ ( x ) +DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) , ( 5 ) we have a pair of interpretations on this NELBO . First , when we focus on Eq . 4 , NELBO 1 ) aids data reconstruction by optimizing Eqφ ( z|x ) [ − log pθ ( x|z ) ] ; and NELBO 2 ) regularizes the inference distribution of the encoder to a prior distribution by DKL ( qφ ( z|x ) ‖p ( z ) ) . On the other hand , if we concentrate on Eq . 5 , NELBO bounds NLL by approximating an intractable decoder posterior of pθ ( z|x ) with a tractable encoder posterior of qφ ( z|x ) . A vanilla VAE ( Kingma and Welling , 2013 ) assumes this approximate posterior to be a Gaussian distribution with mean and diagonal covariance estimated by amortized inference : qφ ( z|x ) = N ( z ; µφ ( x ) , σ 2 φ ( x ) I ) . By expanding the flexibility of this approximate posterior into a variational family of general distributions , for instance , Rezende and Mohamed ( 2015 ) resulted in tighter NELBO , which leads the optimization of VAE closer to MLE , and their choice of a generalizable model was normalizing flow . To connect this NELBO to a diffusion loss , we restate NELBO in the language of a stochastic process . Having that VAE attains a stochastic process of bivariate random variables , { x , z } , NELBO is reformulated to a KL divergence between two joint distributions modeled in bidirectional ways : DKL ( pr‖pθ ) ≤DKL ( pr‖pθ ) + Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] =Epr ( x ) [ log pr ( x ) pθ ( x ) + Eqφ ( z|x ) [ log qφ ( z|x ) pθ ( z|x ) ] ] =Epr ( x ) qφ ( z|x ) [ log pr ( x ) qφ ( z|x ) pθ ( x ) pθ ( z|x ) ] =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , ( 6 ) The inequality 6 , i.e. , DKL ( pr‖pθ ) ≤ DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , is well-known by itself in the field of information theory ( Duchi , 2016 ) by the name of data processing inequality . This restated bound interprets that VAE is essentially a bimodeling approach of a joint distribution on the bivariate stochastic process , { x , z } . On the forward direction ( x → z ) , a latent variable is conditioned on a data variable , and the joint distribution is modeled by qφ ( x , z ) = pr ( x ) qφ ( z|x ) . On the reverse direction ( z → x ) , a generative data variable is conditioned on the latent variable , and the joint distribution is modeled by pθ ( x , z ) = p ( z ) pθ ( x|z ) . Under this equivalent framework , we present an analytic tool to measure the closeness of NELBO and NLL ( see Table 5 ) by Gap ( qφ , pθ ) =NELBO− NLL =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) −DKL ( pr‖pθ ) =Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] , and we denote this quantity as variational gap ( Cremer et al. , 2018 ) . Though it is one of central tasks in VAE to minimize this variational gap ( Kingma et al. , 2016 ) , only limited works ( Burda et al. , 2015 ; Neal , 2001 ) have estimated variational gap due to its computational burden . We introduce the tractable computation of variational gap in the next section on diffusion models . | The author proposed a framework that combines normalizing flow with diffusion models, allowing non-linear diffusions to be used for inference and generation. Specifically, the author first discussed the similarity between VAE and diffusion models to motivate the importance of using non-linear diffusion and the reducing variational gap. Then, the author proposed to decouple the non-linear diffusion into an invertible transformation with the normalizing flow and typical linear diffusions on the transformed variables. A training objective based on variational lower bound was also proposed. Further, the author also showed that the variational gap between the lower bound and log-likelihood can be reduced with the proposed non-linear diffusions. | SP:ef70704f28e42bedf5e39f44aadcbf8b5ba8e432 |
Maximum Likelihood Training of Parametrized Diffusion Model | 1 INTRODUCTION . Diffusion models have recently achieved successes on a task of sample generations , and some researches claim the state-of-the-art performance over Generative Adversarial Networks ( GAN ) ( Karras et al. , 2019 ) . This success is highlighted particularly in the community of likelihood-based models , including normalizing flows ( Grcić et al. , 2021 ) , autoregressive models ( Parmar et al. , 2018 ) , and variational autoencoders ( VAE ) ( Vahdat and Kautz , 2020 ) . Moreover , this success is noteworthy because it is achieved merely using linear diffusing mechanisms , such as VESDEs ( Song and Ermon , 2020 ) and VPSDEs ( Ho et al. , 2020 ) . This paper expands these linear diffusing mechanisms of VE/VPSDE to a data-adaptive trainable nonlinear diffusion . To motivate the expansion , though there are structural similarities between diffusion models and VAEs , the forward diffusion in a diffusion model has not been trained in existing literature while its counterpart , which is the encoder of VAE , is trainable . Rather , the current diffusion models assume the linear diffusing mechanism to be fixed throughout training procedure . Because of this static nature of the diffusing mechanism , variational gap ( Cremer et al. , 2018 ) between the log-likelihood and the Evidence Lower BOund ( ELBO ) remains to be strictly positive unless the score perfectly estimates the data score . This variational gap prevents the score training from being Maximum Likelihood Estimation ( MLE ) . This gap is a fundamental motivation to develop a trainable encoder of the diffusion model , so that the gap can be tight . As we tighten variational gap by training a nonlinear forward diffusion , the biggest challenge comes from an intractable optimization loss . The denoising diffusion loss requires a transition probability to be closed-form in order to achieve fast optimization , but a nonlinear diffusing mechanism , in general , has no closed-form perturbation probability . Hence , our innovation becomes designing a diffusion model with a tractable loss while the diffusion is learnable and flexible , which we achieve by merging previous diffusion models and the tractable variable transformation . Our innovation concentrates on the theoretic and the practical aspects of a new diffusion , which is tractable , learnable , and flexible . Theoretically , we observe that a nonlinear diffusing mechanism can be transformed to a linear diffusion under an invertible transformation , and vice versa . In practice , we implement PDM by merging a normalizing flow model and a diffusion model , which constructs a tractable , learnable , and flexible nonlinear diffusing mechanism . From this construction , we prove that variational gap can be further tightened by training the forward diffusion , nonlinearly . Also , we demonstrate the state-of-the-art performance in CelebA on Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) . We summarize our key contributions , as below . • PDM expands the scope of a forward diffusion process from linear and fixed dynamics to nonlinear and trainable dynamics . • PDM minimizes variational gap between the log-likelihood and ELBO , lower than the gap of linear diffusion models because PDM learns a data-adaptive nonlinear diffusion . • PDM explicitly proves in Theorem 2 that the optimal generative distribution equals to the real distribution , which was not the case for a linear diffusion model . 2 PRELIMINARY . A diffusion model is constructed with bidirectional stochastic processes . The forward direction diffuses an input variable to a noise variable , and the reverse direction denoises the random noise to construct a realistic input data instance . The diffusion model learns this reverse direction ( generative process ) by estimating data score . We provide a brief summary of diffusion models , as below . Forward Diffusion At the beginning of model build-up , a diffusion process requires a diffusing mechanism on an input variable . This paper assumes that the diffusion process is governed by a SDE of dxt = f ( xt , t ) dt + G ( xt , t ) dωt with x0 ∼ pr , where pr is the distribution from a real-world dataset ; and xt is the solution of the SDE . Reverse Diffusion The theory of stochastic calculus guarantees that we could create an identical diffusion process , { xt } Tt=0 , by solving an associated reverse SDE backwards in time ( Anderson , 1982 ) . The associated reverse SDE is dxt = [ f ( xt , t ) −G ( xt , t ) GT ( xt , t ) ∇xt log pt ( xt ) ] dt+ G ( xt , t ) dω̄t , xT ∼ pT , ( 1 ) where ωt and ω̄t are standard Wiener processes with time flows forward and backward , respectively ; and pt is a probability law of xt . Generative Diffusion A diffusion model approximates the above SDE 1 to eventually yield an estimation on the data distribution of pr . In SDE 1 , previous literature setup that drift and diffusion terms , f and G , are determined a-priori in the forward diffusion . However , data score , ∇xt log pt ( xt ) , is intractable to compute , so we estimate this data score with a score network of sθ ( xt , t ) in order to mimic the reverse diffusion with our generative process . This score network approximates the reverse diffusion by plugging the estimated score in place of data score with the below generative process : dxθt = [ f ( xθt , t ) −G ( xθt , t ) GT ( xθt , t ) sθ ( xθt , t ) ] dt+ G ( xθt , t ) dω̄t , x θ T ∼ π . ( 2 ) The generative process starts from a prior distribution ( π ) , and it constructs time-continuous random variables xθt by solving a SDE 2 backwards in time . The generated stochastic process is denoted by { xθt } Tt=0 , and we omit θ in the superscript if no confusion arises . With this generative process , we define a generative distribution , xθ0 ∼ pθ , as the probability density of the generated random variable at time t = 0 . Score Estimation We train the score network by a variational bound of the log-likelihood , given by Ex0 [ − log pθ ( x0 ) ] ≤L ( { xt } Tt=0 , λ = g2 ; θ ) − ExT [ log π ( xT ) ] = ∫ T 0 g2 ( t ) Lt ( { xt } Tt=0 ; θ ) dt− ExT [ log π ( xT ) ] , ( 3 ) where Lt ( { xt } Tt=0 ; θ ) = Ex0 , xt [ ‖sθ ( xt , t ) − ∇xt log p0t ( xt|x0 ) ‖22 ] up to a constant , where p0t ( xt|x0 ) is a transition probability from x0 to xt . Here , λ is a weighting function that determines the level of contribution for each diffusion time on the overall diffusion loss , L ( { xt } Tt=0 , λ ; θ ) ( Song et al. , 2020 ) . Variational bound holds when the weighting function is the likelihood weighting ( g ) ( Song et al. , 2021 ) , where G is a scalar-valued g function . 3 MOTIVATION OF NONLINEAR DIFFUSING MECHANISM . Though it has long been theoretically and empirically grounded to train the encoder part in VAE , such solid ground is not accomplished in diffusion models . This section analyzes structural similarities between a VAE model and a diffusion model , which brings the foundation of a data-adaptive nonlinear diffusing mechanism . 3.1 VARIATIONAL GAP OF VAE . Given Negative ELBO ( NELBO ) of Negative Log-Likelihood ( NLL ) in VAE as − log pθ ( x ) ≤Eqφ ( z|x ) [ − log pθ ( x|z ) ] +DKL ( qφ ( z|x ) ‖p ( z ) ) ( 4 ) =− log pθ ( x ) +DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) , ( 5 ) we have a pair of interpretations on this NELBO . First , when we focus on Eq . 4 , NELBO 1 ) aids data reconstruction by optimizing Eqφ ( z|x ) [ − log pθ ( x|z ) ] ; and NELBO 2 ) regularizes the inference distribution of the encoder to a prior distribution by DKL ( qφ ( z|x ) ‖p ( z ) ) . On the other hand , if we concentrate on Eq . 5 , NELBO bounds NLL by approximating an intractable decoder posterior of pθ ( z|x ) with a tractable encoder posterior of qφ ( z|x ) . A vanilla VAE ( Kingma and Welling , 2013 ) assumes this approximate posterior to be a Gaussian distribution with mean and diagonal covariance estimated by amortized inference : qφ ( z|x ) = N ( z ; µφ ( x ) , σ 2 φ ( x ) I ) . By expanding the flexibility of this approximate posterior into a variational family of general distributions , for instance , Rezende and Mohamed ( 2015 ) resulted in tighter NELBO , which leads the optimization of VAE closer to MLE , and their choice of a generalizable model was normalizing flow . To connect this NELBO to a diffusion loss , we restate NELBO in the language of a stochastic process . Having that VAE attains a stochastic process of bivariate random variables , { x , z } , NELBO is reformulated to a KL divergence between two joint distributions modeled in bidirectional ways : DKL ( pr‖pθ ) ≤DKL ( pr‖pθ ) + Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] =Epr ( x ) [ log pr ( x ) pθ ( x ) + Eqφ ( z|x ) [ log qφ ( z|x ) pθ ( z|x ) ] ] =Epr ( x ) qφ ( z|x ) [ log pr ( x ) qφ ( z|x ) pθ ( x ) pθ ( z|x ) ] =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , ( 6 ) The inequality 6 , i.e. , DKL ( pr‖pθ ) ≤ DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , is well-known by itself in the field of information theory ( Duchi , 2016 ) by the name of data processing inequality . This restated bound interprets that VAE is essentially a bimodeling approach of a joint distribution on the bivariate stochastic process , { x , z } . On the forward direction ( x → z ) , a latent variable is conditioned on a data variable , and the joint distribution is modeled by qφ ( x , z ) = pr ( x ) qφ ( z|x ) . On the reverse direction ( z → x ) , a generative data variable is conditioned on the latent variable , and the joint distribution is modeled by pθ ( x , z ) = p ( z ) pθ ( x|z ) . Under this equivalent framework , we present an analytic tool to measure the closeness of NELBO and NLL ( see Table 5 ) by Gap ( qφ , pθ ) =NELBO− NLL =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) −DKL ( pr‖pθ ) =Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] , and we denote this quantity as variational gap ( Cremer et al. , 2018 ) . Though it is one of central tasks in VAE to minimize this variational gap ( Kingma et al. , 2016 ) , only limited works ( Burda et al. , 2015 ; Neal , 2001 ) have estimated variational gap due to its computational burden . We introduce the tractable computation of variational gap in the next section on diffusion models . | The paper proposes to combine Normalizing Flows with generative Diffusion Models in such a way that the target data is first non-linearly transformed via the flow and then the distribution over latent embeddings is modeled with the diffusion model. The authors call their model *Parametrized Diffusion Model (PDM)*. Since the flow is invertible and defined by a deterministic function, it is possible to formally relate the combined flow and diffusion process to a non-linear diffusion directly in data space, leveraging Ito's Lemma. The paper validates the PDM on image modeling benchmarks (CIFAR-10 and CelebA 64x64). The experiments show that the method leads to reduced variational gaps between the data likelihood and the evidence lower bound that is used for training the model, compared to several baselines. | SP:ef70704f28e42bedf5e39f44aadcbf8b5ba8e432 |
Maximum Likelihood Training of Parametrized Diffusion Model | 1 INTRODUCTION . Diffusion models have recently achieved successes on a task of sample generations , and some researches claim the state-of-the-art performance over Generative Adversarial Networks ( GAN ) ( Karras et al. , 2019 ) . This success is highlighted particularly in the community of likelihood-based models , including normalizing flows ( Grcić et al. , 2021 ) , autoregressive models ( Parmar et al. , 2018 ) , and variational autoencoders ( VAE ) ( Vahdat and Kautz , 2020 ) . Moreover , this success is noteworthy because it is achieved merely using linear diffusing mechanisms , such as VESDEs ( Song and Ermon , 2020 ) and VPSDEs ( Ho et al. , 2020 ) . This paper expands these linear diffusing mechanisms of VE/VPSDE to a data-adaptive trainable nonlinear diffusion . To motivate the expansion , though there are structural similarities between diffusion models and VAEs , the forward diffusion in a diffusion model has not been trained in existing literature while its counterpart , which is the encoder of VAE , is trainable . Rather , the current diffusion models assume the linear diffusing mechanism to be fixed throughout training procedure . Because of this static nature of the diffusing mechanism , variational gap ( Cremer et al. , 2018 ) between the log-likelihood and the Evidence Lower BOund ( ELBO ) remains to be strictly positive unless the score perfectly estimates the data score . This variational gap prevents the score training from being Maximum Likelihood Estimation ( MLE ) . This gap is a fundamental motivation to develop a trainable encoder of the diffusion model , so that the gap can be tight . As we tighten variational gap by training a nonlinear forward diffusion , the biggest challenge comes from an intractable optimization loss . The denoising diffusion loss requires a transition probability to be closed-form in order to achieve fast optimization , but a nonlinear diffusing mechanism , in general , has no closed-form perturbation probability . Hence , our innovation becomes designing a diffusion model with a tractable loss while the diffusion is learnable and flexible , which we achieve by merging previous diffusion models and the tractable variable transformation . Our innovation concentrates on the theoretic and the practical aspects of a new diffusion , which is tractable , learnable , and flexible . Theoretically , we observe that a nonlinear diffusing mechanism can be transformed to a linear diffusion under an invertible transformation , and vice versa . In practice , we implement PDM by merging a normalizing flow model and a diffusion model , which constructs a tractable , learnable , and flexible nonlinear diffusing mechanism . From this construction , we prove that variational gap can be further tightened by training the forward diffusion , nonlinearly . Also , we demonstrate the state-of-the-art performance in CelebA on Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) . We summarize our key contributions , as below . • PDM expands the scope of a forward diffusion process from linear and fixed dynamics to nonlinear and trainable dynamics . • PDM minimizes variational gap between the log-likelihood and ELBO , lower than the gap of linear diffusion models because PDM learns a data-adaptive nonlinear diffusion . • PDM explicitly proves in Theorem 2 that the optimal generative distribution equals to the real distribution , which was not the case for a linear diffusion model . 2 PRELIMINARY . A diffusion model is constructed with bidirectional stochastic processes . The forward direction diffuses an input variable to a noise variable , and the reverse direction denoises the random noise to construct a realistic input data instance . The diffusion model learns this reverse direction ( generative process ) by estimating data score . We provide a brief summary of diffusion models , as below . Forward Diffusion At the beginning of model build-up , a diffusion process requires a diffusing mechanism on an input variable . This paper assumes that the diffusion process is governed by a SDE of dxt = f ( xt , t ) dt + G ( xt , t ) dωt with x0 ∼ pr , where pr is the distribution from a real-world dataset ; and xt is the solution of the SDE . Reverse Diffusion The theory of stochastic calculus guarantees that we could create an identical diffusion process , { xt } Tt=0 , by solving an associated reverse SDE backwards in time ( Anderson , 1982 ) . The associated reverse SDE is dxt = [ f ( xt , t ) −G ( xt , t ) GT ( xt , t ) ∇xt log pt ( xt ) ] dt+ G ( xt , t ) dω̄t , xT ∼ pT , ( 1 ) where ωt and ω̄t are standard Wiener processes with time flows forward and backward , respectively ; and pt is a probability law of xt . Generative Diffusion A diffusion model approximates the above SDE 1 to eventually yield an estimation on the data distribution of pr . In SDE 1 , previous literature setup that drift and diffusion terms , f and G , are determined a-priori in the forward diffusion . However , data score , ∇xt log pt ( xt ) , is intractable to compute , so we estimate this data score with a score network of sθ ( xt , t ) in order to mimic the reverse diffusion with our generative process . This score network approximates the reverse diffusion by plugging the estimated score in place of data score with the below generative process : dxθt = [ f ( xθt , t ) −G ( xθt , t ) GT ( xθt , t ) sθ ( xθt , t ) ] dt+ G ( xθt , t ) dω̄t , x θ T ∼ π . ( 2 ) The generative process starts from a prior distribution ( π ) , and it constructs time-continuous random variables xθt by solving a SDE 2 backwards in time . The generated stochastic process is denoted by { xθt } Tt=0 , and we omit θ in the superscript if no confusion arises . With this generative process , we define a generative distribution , xθ0 ∼ pθ , as the probability density of the generated random variable at time t = 0 . Score Estimation We train the score network by a variational bound of the log-likelihood , given by Ex0 [ − log pθ ( x0 ) ] ≤L ( { xt } Tt=0 , λ = g2 ; θ ) − ExT [ log π ( xT ) ] = ∫ T 0 g2 ( t ) Lt ( { xt } Tt=0 ; θ ) dt− ExT [ log π ( xT ) ] , ( 3 ) where Lt ( { xt } Tt=0 ; θ ) = Ex0 , xt [ ‖sθ ( xt , t ) − ∇xt log p0t ( xt|x0 ) ‖22 ] up to a constant , where p0t ( xt|x0 ) is a transition probability from x0 to xt . Here , λ is a weighting function that determines the level of contribution for each diffusion time on the overall diffusion loss , L ( { xt } Tt=0 , λ ; θ ) ( Song et al. , 2020 ) . Variational bound holds when the weighting function is the likelihood weighting ( g ) ( Song et al. , 2021 ) , where G is a scalar-valued g function . 3 MOTIVATION OF NONLINEAR DIFFUSING MECHANISM . Though it has long been theoretically and empirically grounded to train the encoder part in VAE , such solid ground is not accomplished in diffusion models . This section analyzes structural similarities between a VAE model and a diffusion model , which brings the foundation of a data-adaptive nonlinear diffusing mechanism . 3.1 VARIATIONAL GAP OF VAE . Given Negative ELBO ( NELBO ) of Negative Log-Likelihood ( NLL ) in VAE as − log pθ ( x ) ≤Eqφ ( z|x ) [ − log pθ ( x|z ) ] +DKL ( qφ ( z|x ) ‖p ( z ) ) ( 4 ) =− log pθ ( x ) +DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) , ( 5 ) we have a pair of interpretations on this NELBO . First , when we focus on Eq . 4 , NELBO 1 ) aids data reconstruction by optimizing Eqφ ( z|x ) [ − log pθ ( x|z ) ] ; and NELBO 2 ) regularizes the inference distribution of the encoder to a prior distribution by DKL ( qφ ( z|x ) ‖p ( z ) ) . On the other hand , if we concentrate on Eq . 5 , NELBO bounds NLL by approximating an intractable decoder posterior of pθ ( z|x ) with a tractable encoder posterior of qφ ( z|x ) . A vanilla VAE ( Kingma and Welling , 2013 ) assumes this approximate posterior to be a Gaussian distribution with mean and diagonal covariance estimated by amortized inference : qφ ( z|x ) = N ( z ; µφ ( x ) , σ 2 φ ( x ) I ) . By expanding the flexibility of this approximate posterior into a variational family of general distributions , for instance , Rezende and Mohamed ( 2015 ) resulted in tighter NELBO , which leads the optimization of VAE closer to MLE , and their choice of a generalizable model was normalizing flow . To connect this NELBO to a diffusion loss , we restate NELBO in the language of a stochastic process . Having that VAE attains a stochastic process of bivariate random variables , { x , z } , NELBO is reformulated to a KL divergence between two joint distributions modeled in bidirectional ways : DKL ( pr‖pθ ) ≤DKL ( pr‖pθ ) + Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] =Epr ( x ) [ log pr ( x ) pθ ( x ) + Eqφ ( z|x ) [ log qφ ( z|x ) pθ ( z|x ) ] ] =Epr ( x ) qφ ( z|x ) [ log pr ( x ) qφ ( z|x ) pθ ( x ) pθ ( z|x ) ] =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , ( 6 ) The inequality 6 , i.e. , DKL ( pr‖pθ ) ≤ DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) , is well-known by itself in the field of information theory ( Duchi , 2016 ) by the name of data processing inequality . This restated bound interprets that VAE is essentially a bimodeling approach of a joint distribution on the bivariate stochastic process , { x , z } . On the forward direction ( x → z ) , a latent variable is conditioned on a data variable , and the joint distribution is modeled by qφ ( x , z ) = pr ( x ) qφ ( z|x ) . On the reverse direction ( z → x ) , a generative data variable is conditioned on the latent variable , and the joint distribution is modeled by pθ ( x , z ) = p ( z ) pθ ( x|z ) . Under this equivalent framework , we present an analytic tool to measure the closeness of NELBO and NLL ( see Table 5 ) by Gap ( qφ , pθ ) =NELBO− NLL =DKL ( qφ ( x , z ) ‖pθ ( x , z ) ) −DKL ( pr‖pθ ) =Epr ( x ) [ DKL ( qφ ( z|x ) ‖pθ ( z|x ) ) ] , and we denote this quantity as variational gap ( Cremer et al. , 2018 ) . Though it is one of central tasks in VAE to minimize this variational gap ( Kingma et al. , 2016 ) , only limited works ( Burda et al. , 2015 ; Neal , 2001 ) have estimated variational gap due to its computational burden . We introduce the tractable computation of variational gap in the next section on diffusion models . | The core contribution of the paper is to show how a nonlinear diffusion model may be constructed by cascading a normalizing flow with a linear diffusion in the resulting latent domain. The paper comes with a strong theoretical flavour and the proposed approach is well grounded. Applications in classic image generation tasks are provided. | SP:ef70704f28e42bedf5e39f44aadcbf8b5ba8e432 |
Understanding the Generalization Gap in Visual Reinforcement Learning | 1 INTRODUCTION . Deep Reinforcement Learning ( RL ) has achieved tremendous success on several video game suites ( Mnih et al. , 2013 ; Vinyals et al. , 2019 ; Berner et al. , 2019 ) . However , state-of-the-art ( SOTA ) RL agents are usually trained and tested on the same game . It turns out that the learned policy fails to transfer to different games or even unseen levels of the same game ( Cobbe et al. , 2018 ; 2019 ) . In contrast , humans are remarkable at transferring to new tasks and environments . Behavior studies ( Dubey et al. , 2018 ) show that humans make extensive use of visual priors such as object permanence , sub-goals , and intuitive physics when learning new games . Without these priors , data efficiency of humans drops an order of magnitude ( Dubey et al. , 2018 ) . ( Sax et al. , 2018 ) learns visual priors with supervised learning on datasets with manual annotations of several semantically meaningful features . In practice however , acquiring such datasets is challenging . In the absence of labelled datasets and human supervision , past works have explored three main ways to incorporate visual priors to improve generalization . The first paradigm is data augmentation ( Michael et al. , 2020 ; Kostrikov et al. , 2020 ) where invariance in the learned representations is induced by training the agent on a large set of task-irrelevant variations of the observed data . Since the distinction between what is relevant vs irrelevant is task-dependent , the optimal choice of data augmentation is also task dependent . To avoid manual selection of data augmentations , UCB-DrAC ( Raileanu et al. , 2020 ) used upper confidence bound ( UCB ) algorithm ( Auer , 2002 ) for choosing optimal augmentations . However , it remains unclear whether choosing one out of many task-agnostic data augmentations , such as cropping , helps in closing the generalization gap . In this paper , we show that set of transformations used in state-of-the-art methods are insufficient at closing the generalization gap . On the other hand , we also show that task-informed data augmentations close the generalization gap , but require task variation information during training . How to construct task sensitive data augmentations remains an open question and an avenue of future research . We discuss this finding in Section 4 . The second paradigm for transfer learning is to leverage domain confusion ( Tzeng et al. , 2014 ; 2015 ; Hoffman et al. , 2013 ) , technique commonly used in computer vision to make the source data distribution indistinguishable from the target distribution . The main idea is to discourage learning of spurious domain/level-specific features by enforcing the constraint that it should not be possible to predict the identity of the domain/level from the policy features . iDAAC ( Raileanu & Fergus , 2021 ) used this technique to improve policy generalization . However , our investigation reveals that even policies that generalize well contain domain/level specific information . In hindsight , this is not surprising . On image classification tasks , the identity of the object doesnot change based on factors such as background clutter , size , etc . However , small changes in the size of obstacles or platforms can drastically change the optimal policy . Therefore , the policy must encode information about level-specific game layout , making application of domain invariance to policy learning challenging . Details of this investigation are provided in Section 5 . The third paradigm of improving generalization involves using auxiliary prediction tasks ( such as depth prediction , image reconstruction , contrastive learning ) to regularize the policy features to prevent learning spurious features ( Jaderberg et al. , 2016 ; Srinivas et al. , 2020 ) . In this work , we choose the auxiliary task of inverse model prediction ( Agrawal et al. , 2016 ) due to its simplicity . This improves policy generalization . We detail this finding in Section 6 . It is well-known that choice of hyper parameters has a substantial impact on the performance of RL agents . When it comes to policy generalization , discussions around hyperparameter selection have been limited . We show that state-of-the-art ( SOTA ) methods that improve policy generalization require careful hyperparameter selection for each task . When these methods are constrained to choose one set of hyperparameters across tasks , they donot outperform the base PPO algorithm . We detail this finding in Section 7 . Finally , we probe if deep RL algorithms learn spurious features that deters performance of the same task in new environments . Our experiments reveal that visual features learned by training on a limited set of levels of one game donot require adaption to achieve good performance on new levels . Infact , only the layers of the policy network that convert visual features into actions require finetuning . Details of this investigation are provided in Section 8 . In summary , our experiments on Procgen ( Cobbe et al. , 2019 ) , a suite of procedurally generated games reveal that ( i ) task-informed data augmentation closes the generalization gap ; ( ii ) learning levelinvariant ( or domain-invariant ) features is not necessary for good generalization ; ( iii ) regularizing the policy features using simple auxiliary tasks can improve generalization ; ( iv ) SOTA methods that improve policy generalization rely on careful hyperparameter selection ; ( v ) training on a limited number of levels of the same game doesnot result in learning of level-specific spurious features . When operating on new levels , good performance can be achieved by only fine-tuning two layers that transform these features into actions . 2 RELATED WORK . Prior works ( Cobbe et al. , 2018 ; 2019 ; Justesen et al. , 2018 ; Zhang et al. , 2018a ; b ; Juliani et al. , 2019 ; Rajeswaran et al. , 2017 ; Raileanu & Rocktäschel , 2020 ; Grigsby & Qi , 2020 ; Kuttler et al. , 2020 ; Farebrother et al. , 2018 ) have established the problem of overfitting in reinforcement learning . In response , multiple methods have been proposed to mitigate overfitting . ( Cobbe et al. , 2018 ; 2019 ) showed that classical techniques such as dropout ( Srivastava et al. , 2014 ) , L2 regularization , and batch normalization ( Ioffe & Szegedy , 2015 ) – originally developed for supervised learning – reduce the generalization gap in RL . Other works ( Michael et al. , 2020 ; Cobbe et al. , 2018 ; Ye et al. , 2019 ; Raileanu et al. , 2020 ; Wang et al. , 2020 ) have made use of data augmentation to learn policies that generalize well . Another popular approach is to use representation learning techniques such as variational information bottleneck ( Igl et al. , 2019 ) and bisimulation metrics ( Agarwal et al. , 2021 ; Zhang et al. , 2020 ) to help with the problem of overfitting in RL . ( Cobbe et al. , 2020 ; Raileanu & Fergus , 2021 ) learned a separate network for policy and value function and showed that it helps reduce the generalization gap in RL . ( Sax et al. , 2018 ) showed that using mid-level visual features optimized for segmentation , depth , keypoints , surface normal prediction and others improve transfer . In our work , rather than proposing a novel approach to solve overfitting , we analyze the limitations of the current techniques and propose avanues for improvements . 3 PRELIMINARIES . We consider a distribution of Partially Observable Markov Decision Process ( POMDPs ) p ( M ) such thatMi = ( Si , Oi , Ai , Ti , Ωi , Ri , γ ) ∼ p ( M ) . We can think of differentMi as instances of same task in different environments . Si is the state space , Oi is the observation space , Ai is the action space , Ti ( s ′|s , a ) is the transition function , Ωi ( o′|s , a ) is the observation function , Ri ( s , a ) is the reward function and γ is the discount factor . The goal is to find a policy πθ that maximizes the expected sum of discounted rewards over the distribution of POMDPs , J ( πθ ) = Eπ , p ( M ) [ ∑T−1 t=0 γ tRi ( st , at ) ] . During training , we only have access to a limited number of POMDPs M̂ = { Mi } Ni=1 . Our goal is to find a policy πθ that generalizes to new POMDPs sampled from p ( M ) . 3.1 ENVIRONMENT SETUP . We conduct experiments using the ProcGen suite ( Cobbe et al. , 2019 ) , a collection of 16 procedurally generated video games . Each game contains multiple levels wherein the agent needs to perform the same task , but the environment varies due to changes in position of objects , their textures and the background texture . We refer to variation in levels resulting solely from changes in texture of object , agent and the background as theme variation . We collectively refer to variation in levels resulting from changes in positions of the objects as layout variation . Figure 1 illustrates theme and layout variation for two games , Jumper and Climber . For each game , the first and the second level differ in theme whereas the first and the third level differ in both the theme and the layout . 3.2 METHODS . We use standard neural network architecture to represent the policy , a ∼ πθ ( a|s ) , consisting of : a visual encoder z = πencθ1 ( s ) and a policy head a ∼ π h θ2 ( a|z ) with parameters θ1 , θ2 respectively . Collectively , they are referred as θ = [ θ1 , θ2 ] . The architecture of the visual encoder is borrowed from IMPALA ( Espeholt et al. , 2018 ) and is a ResNet with 15 convolutional layers . It outputs a flattened feature map ( z ) that we refer to as the visual feature . These features are passed into a two 2-layer fully-connected neural networks with 256 hidden units for predicting the actions ( i.e. , the policy head ) and the value function ( i.e. , the value head , V hψ ( z ) ) . We analyze the generalization performance of PPO ( Schulman et al. , 2017 ) and three state-of-the-art ( SOTA ) methods : • UCB-DrAC ( Raileanu et al. , 2020 ) uses Upper Confidence Bound ( UCB ) to automatically select game specific data augmentations out of eight possible ones : crop , grayscale , cutout , cutout-color , flip , rotate , random convolution and color jitter . For brevity , we sometimes refer to UCB-DrAC as simply DrAC . • DAAC ( Raileanu & Fergus , 2021 ) trains two separate networks for representing the policy and the value function . The intuition is that in POMDPs , the value network will overfit , but the policy can still generalize . The seperation of networks prevents interference in visual features learned for representing the value function and the policy . PPG ( Cobbe et al. , 2020 ) also trains separate networks for actor and critic but mainly focuses on improved training of policies and not their generalization performance . • iDAAC ( Raileanu & Fergus , 2021 ) adds an auxiliary loss to the training objective of DAAC to encourage domain invariance . We use PPO ’ s pytorch implementation ( Kostrikov , 2018 ) , the official implementation for UCBDrAC ( Raileanu et al. , 2020 ) , and the official implementation for DAAC/iDAAC ( Raileanu & Fergus , 2021 ) . See Appendix B for the hyperparameters used . | This paper looks into why some of the recent methods for improving generalization in deep RL still do not perfectly generalize to new levels of a game. For data augmentation methods, they show that better augmentations which make use of the underlying process that generates the data / ground truth task variation. For approaches that learn domain invariant features, the authors claim that you actually need domain-dependent features to generalize well and that these methods may work well for different reasons (i.e. the additional signal and regularization from the auxiliary losses). They investigate approaches that use data augmentation and domain invariant features and provide some new insights. The authors also show that simple auxiliary tasks can improve generalization policies and that other approaches. | SP:4b226829ac26fd231a344aeeb395a12ff69a994c |
Understanding the Generalization Gap in Visual Reinforcement Learning | 1 INTRODUCTION . Deep Reinforcement Learning ( RL ) has achieved tremendous success on several video game suites ( Mnih et al. , 2013 ; Vinyals et al. , 2019 ; Berner et al. , 2019 ) . However , state-of-the-art ( SOTA ) RL agents are usually trained and tested on the same game . It turns out that the learned policy fails to transfer to different games or even unseen levels of the same game ( Cobbe et al. , 2018 ; 2019 ) . In contrast , humans are remarkable at transferring to new tasks and environments . Behavior studies ( Dubey et al. , 2018 ) show that humans make extensive use of visual priors such as object permanence , sub-goals , and intuitive physics when learning new games . Without these priors , data efficiency of humans drops an order of magnitude ( Dubey et al. , 2018 ) . ( Sax et al. , 2018 ) learns visual priors with supervised learning on datasets with manual annotations of several semantically meaningful features . In practice however , acquiring such datasets is challenging . In the absence of labelled datasets and human supervision , past works have explored three main ways to incorporate visual priors to improve generalization . The first paradigm is data augmentation ( Michael et al. , 2020 ; Kostrikov et al. , 2020 ) where invariance in the learned representations is induced by training the agent on a large set of task-irrelevant variations of the observed data . Since the distinction between what is relevant vs irrelevant is task-dependent , the optimal choice of data augmentation is also task dependent . To avoid manual selection of data augmentations , UCB-DrAC ( Raileanu et al. , 2020 ) used upper confidence bound ( UCB ) algorithm ( Auer , 2002 ) for choosing optimal augmentations . However , it remains unclear whether choosing one out of many task-agnostic data augmentations , such as cropping , helps in closing the generalization gap . In this paper , we show that set of transformations used in state-of-the-art methods are insufficient at closing the generalization gap . On the other hand , we also show that task-informed data augmentations close the generalization gap , but require task variation information during training . How to construct task sensitive data augmentations remains an open question and an avenue of future research . We discuss this finding in Section 4 . The second paradigm for transfer learning is to leverage domain confusion ( Tzeng et al. , 2014 ; 2015 ; Hoffman et al. , 2013 ) , technique commonly used in computer vision to make the source data distribution indistinguishable from the target distribution . The main idea is to discourage learning of spurious domain/level-specific features by enforcing the constraint that it should not be possible to predict the identity of the domain/level from the policy features . iDAAC ( Raileanu & Fergus , 2021 ) used this technique to improve policy generalization . However , our investigation reveals that even policies that generalize well contain domain/level specific information . In hindsight , this is not surprising . On image classification tasks , the identity of the object doesnot change based on factors such as background clutter , size , etc . However , small changes in the size of obstacles or platforms can drastically change the optimal policy . Therefore , the policy must encode information about level-specific game layout , making application of domain invariance to policy learning challenging . Details of this investigation are provided in Section 5 . The third paradigm of improving generalization involves using auxiliary prediction tasks ( such as depth prediction , image reconstruction , contrastive learning ) to regularize the policy features to prevent learning spurious features ( Jaderberg et al. , 2016 ; Srinivas et al. , 2020 ) . In this work , we choose the auxiliary task of inverse model prediction ( Agrawal et al. , 2016 ) due to its simplicity . This improves policy generalization . We detail this finding in Section 6 . It is well-known that choice of hyper parameters has a substantial impact on the performance of RL agents . When it comes to policy generalization , discussions around hyperparameter selection have been limited . We show that state-of-the-art ( SOTA ) methods that improve policy generalization require careful hyperparameter selection for each task . When these methods are constrained to choose one set of hyperparameters across tasks , they donot outperform the base PPO algorithm . We detail this finding in Section 7 . Finally , we probe if deep RL algorithms learn spurious features that deters performance of the same task in new environments . Our experiments reveal that visual features learned by training on a limited set of levels of one game donot require adaption to achieve good performance on new levels . Infact , only the layers of the policy network that convert visual features into actions require finetuning . Details of this investigation are provided in Section 8 . In summary , our experiments on Procgen ( Cobbe et al. , 2019 ) , a suite of procedurally generated games reveal that ( i ) task-informed data augmentation closes the generalization gap ; ( ii ) learning levelinvariant ( or domain-invariant ) features is not necessary for good generalization ; ( iii ) regularizing the policy features using simple auxiliary tasks can improve generalization ; ( iv ) SOTA methods that improve policy generalization rely on careful hyperparameter selection ; ( v ) training on a limited number of levels of the same game doesnot result in learning of level-specific spurious features . When operating on new levels , good performance can be achieved by only fine-tuning two layers that transform these features into actions . 2 RELATED WORK . Prior works ( Cobbe et al. , 2018 ; 2019 ; Justesen et al. , 2018 ; Zhang et al. , 2018a ; b ; Juliani et al. , 2019 ; Rajeswaran et al. , 2017 ; Raileanu & Rocktäschel , 2020 ; Grigsby & Qi , 2020 ; Kuttler et al. , 2020 ; Farebrother et al. , 2018 ) have established the problem of overfitting in reinforcement learning . In response , multiple methods have been proposed to mitigate overfitting . ( Cobbe et al. , 2018 ; 2019 ) showed that classical techniques such as dropout ( Srivastava et al. , 2014 ) , L2 regularization , and batch normalization ( Ioffe & Szegedy , 2015 ) – originally developed for supervised learning – reduce the generalization gap in RL . Other works ( Michael et al. , 2020 ; Cobbe et al. , 2018 ; Ye et al. , 2019 ; Raileanu et al. , 2020 ; Wang et al. , 2020 ) have made use of data augmentation to learn policies that generalize well . Another popular approach is to use representation learning techniques such as variational information bottleneck ( Igl et al. , 2019 ) and bisimulation metrics ( Agarwal et al. , 2021 ; Zhang et al. , 2020 ) to help with the problem of overfitting in RL . ( Cobbe et al. , 2020 ; Raileanu & Fergus , 2021 ) learned a separate network for policy and value function and showed that it helps reduce the generalization gap in RL . ( Sax et al. , 2018 ) showed that using mid-level visual features optimized for segmentation , depth , keypoints , surface normal prediction and others improve transfer . In our work , rather than proposing a novel approach to solve overfitting , we analyze the limitations of the current techniques and propose avanues for improvements . 3 PRELIMINARIES . We consider a distribution of Partially Observable Markov Decision Process ( POMDPs ) p ( M ) such thatMi = ( Si , Oi , Ai , Ti , Ωi , Ri , γ ) ∼ p ( M ) . We can think of differentMi as instances of same task in different environments . Si is the state space , Oi is the observation space , Ai is the action space , Ti ( s ′|s , a ) is the transition function , Ωi ( o′|s , a ) is the observation function , Ri ( s , a ) is the reward function and γ is the discount factor . The goal is to find a policy πθ that maximizes the expected sum of discounted rewards over the distribution of POMDPs , J ( πθ ) = Eπ , p ( M ) [ ∑T−1 t=0 γ tRi ( st , at ) ] . During training , we only have access to a limited number of POMDPs M̂ = { Mi } Ni=1 . Our goal is to find a policy πθ that generalizes to new POMDPs sampled from p ( M ) . 3.1 ENVIRONMENT SETUP . We conduct experiments using the ProcGen suite ( Cobbe et al. , 2019 ) , a collection of 16 procedurally generated video games . Each game contains multiple levels wherein the agent needs to perform the same task , but the environment varies due to changes in position of objects , their textures and the background texture . We refer to variation in levels resulting solely from changes in texture of object , agent and the background as theme variation . We collectively refer to variation in levels resulting from changes in positions of the objects as layout variation . Figure 1 illustrates theme and layout variation for two games , Jumper and Climber . For each game , the first and the second level differ in theme whereas the first and the third level differ in both the theme and the layout . 3.2 METHODS . We use standard neural network architecture to represent the policy , a ∼ πθ ( a|s ) , consisting of : a visual encoder z = πencθ1 ( s ) and a policy head a ∼ π h θ2 ( a|z ) with parameters θ1 , θ2 respectively . Collectively , they are referred as θ = [ θ1 , θ2 ] . The architecture of the visual encoder is borrowed from IMPALA ( Espeholt et al. , 2018 ) and is a ResNet with 15 convolutional layers . It outputs a flattened feature map ( z ) that we refer to as the visual feature . These features are passed into a two 2-layer fully-connected neural networks with 256 hidden units for predicting the actions ( i.e. , the policy head ) and the value function ( i.e. , the value head , V hψ ( z ) ) . We analyze the generalization performance of PPO ( Schulman et al. , 2017 ) and three state-of-the-art ( SOTA ) methods : • UCB-DrAC ( Raileanu et al. , 2020 ) uses Upper Confidence Bound ( UCB ) to automatically select game specific data augmentations out of eight possible ones : crop , grayscale , cutout , cutout-color , flip , rotate , random convolution and color jitter . For brevity , we sometimes refer to UCB-DrAC as simply DrAC . • DAAC ( Raileanu & Fergus , 2021 ) trains two separate networks for representing the policy and the value function . The intuition is that in POMDPs , the value network will overfit , but the policy can still generalize . The seperation of networks prevents interference in visual features learned for representing the value function and the policy . PPG ( Cobbe et al. , 2020 ) also trains separate networks for actor and critic but mainly focuses on improved training of policies and not their generalization performance . • iDAAC ( Raileanu & Fergus , 2021 ) adds an auxiliary loss to the training objective of DAAC to encourage domain invariance . We use PPO ’ s pytorch implementation ( Kostrikov , 2018 ) , the official implementation for UCBDrAC ( Raileanu et al. , 2020 ) , and the official implementation for DAAC/iDAAC ( Raileanu & Fergus , 2021 ) . See Appendix B for the hyperparameters used . | The paper studies generalization of several previously published visual RL SOTA algorithms with PPO as a baseline in ProcGen environment (2d platformed style, procedurally generated maps). Generalization is studied in terms of theme (colors and styles of objects and background) and tasks (levels with different layouts and specifics things to do). DrAC is shown to not be theme-invariant by comparing result from vanilla version, a version where themes are fixed and version with randomized themes (vanilla version performs worse). For PPO, DAAC and iDAAC, linear classifiers on top of visual feature extractor layers (pretrained on the rl task) are trained to classify states (images from level) based on the level they belong to. Authors claim that accuracy around 90% hints that tested policies contain level specific information regardless of any generalization capabilities. Moreover authors propose a simple auxiliary task "inverse model" for ppo and show that it's comparable with UCB-DRAC. Finally it is mentioned that all methods need careful on per-game basis hyperparameter tuning which requires further research | SP:4b226829ac26fd231a344aeeb395a12ff69a994c |
Understanding the Generalization Gap in Visual Reinforcement Learning | 1 INTRODUCTION . Deep Reinforcement Learning ( RL ) has achieved tremendous success on several video game suites ( Mnih et al. , 2013 ; Vinyals et al. , 2019 ; Berner et al. , 2019 ) . However , state-of-the-art ( SOTA ) RL agents are usually trained and tested on the same game . It turns out that the learned policy fails to transfer to different games or even unseen levels of the same game ( Cobbe et al. , 2018 ; 2019 ) . In contrast , humans are remarkable at transferring to new tasks and environments . Behavior studies ( Dubey et al. , 2018 ) show that humans make extensive use of visual priors such as object permanence , sub-goals , and intuitive physics when learning new games . Without these priors , data efficiency of humans drops an order of magnitude ( Dubey et al. , 2018 ) . ( Sax et al. , 2018 ) learns visual priors with supervised learning on datasets with manual annotations of several semantically meaningful features . In practice however , acquiring such datasets is challenging . In the absence of labelled datasets and human supervision , past works have explored three main ways to incorporate visual priors to improve generalization . The first paradigm is data augmentation ( Michael et al. , 2020 ; Kostrikov et al. , 2020 ) where invariance in the learned representations is induced by training the agent on a large set of task-irrelevant variations of the observed data . Since the distinction between what is relevant vs irrelevant is task-dependent , the optimal choice of data augmentation is also task dependent . To avoid manual selection of data augmentations , UCB-DrAC ( Raileanu et al. , 2020 ) used upper confidence bound ( UCB ) algorithm ( Auer , 2002 ) for choosing optimal augmentations . However , it remains unclear whether choosing one out of many task-agnostic data augmentations , such as cropping , helps in closing the generalization gap . In this paper , we show that set of transformations used in state-of-the-art methods are insufficient at closing the generalization gap . On the other hand , we also show that task-informed data augmentations close the generalization gap , but require task variation information during training . How to construct task sensitive data augmentations remains an open question and an avenue of future research . We discuss this finding in Section 4 . The second paradigm for transfer learning is to leverage domain confusion ( Tzeng et al. , 2014 ; 2015 ; Hoffman et al. , 2013 ) , technique commonly used in computer vision to make the source data distribution indistinguishable from the target distribution . The main idea is to discourage learning of spurious domain/level-specific features by enforcing the constraint that it should not be possible to predict the identity of the domain/level from the policy features . iDAAC ( Raileanu & Fergus , 2021 ) used this technique to improve policy generalization . However , our investigation reveals that even policies that generalize well contain domain/level specific information . In hindsight , this is not surprising . On image classification tasks , the identity of the object doesnot change based on factors such as background clutter , size , etc . However , small changes in the size of obstacles or platforms can drastically change the optimal policy . Therefore , the policy must encode information about level-specific game layout , making application of domain invariance to policy learning challenging . Details of this investigation are provided in Section 5 . The third paradigm of improving generalization involves using auxiliary prediction tasks ( such as depth prediction , image reconstruction , contrastive learning ) to regularize the policy features to prevent learning spurious features ( Jaderberg et al. , 2016 ; Srinivas et al. , 2020 ) . In this work , we choose the auxiliary task of inverse model prediction ( Agrawal et al. , 2016 ) due to its simplicity . This improves policy generalization . We detail this finding in Section 6 . It is well-known that choice of hyper parameters has a substantial impact on the performance of RL agents . When it comes to policy generalization , discussions around hyperparameter selection have been limited . We show that state-of-the-art ( SOTA ) methods that improve policy generalization require careful hyperparameter selection for each task . When these methods are constrained to choose one set of hyperparameters across tasks , they donot outperform the base PPO algorithm . We detail this finding in Section 7 . Finally , we probe if deep RL algorithms learn spurious features that deters performance of the same task in new environments . Our experiments reveal that visual features learned by training on a limited set of levels of one game donot require adaption to achieve good performance on new levels . Infact , only the layers of the policy network that convert visual features into actions require finetuning . Details of this investigation are provided in Section 8 . In summary , our experiments on Procgen ( Cobbe et al. , 2019 ) , a suite of procedurally generated games reveal that ( i ) task-informed data augmentation closes the generalization gap ; ( ii ) learning levelinvariant ( or domain-invariant ) features is not necessary for good generalization ; ( iii ) regularizing the policy features using simple auxiliary tasks can improve generalization ; ( iv ) SOTA methods that improve policy generalization rely on careful hyperparameter selection ; ( v ) training on a limited number of levels of the same game doesnot result in learning of level-specific spurious features . When operating on new levels , good performance can be achieved by only fine-tuning two layers that transform these features into actions . 2 RELATED WORK . Prior works ( Cobbe et al. , 2018 ; 2019 ; Justesen et al. , 2018 ; Zhang et al. , 2018a ; b ; Juliani et al. , 2019 ; Rajeswaran et al. , 2017 ; Raileanu & Rocktäschel , 2020 ; Grigsby & Qi , 2020 ; Kuttler et al. , 2020 ; Farebrother et al. , 2018 ) have established the problem of overfitting in reinforcement learning . In response , multiple methods have been proposed to mitigate overfitting . ( Cobbe et al. , 2018 ; 2019 ) showed that classical techniques such as dropout ( Srivastava et al. , 2014 ) , L2 regularization , and batch normalization ( Ioffe & Szegedy , 2015 ) – originally developed for supervised learning – reduce the generalization gap in RL . Other works ( Michael et al. , 2020 ; Cobbe et al. , 2018 ; Ye et al. , 2019 ; Raileanu et al. , 2020 ; Wang et al. , 2020 ) have made use of data augmentation to learn policies that generalize well . Another popular approach is to use representation learning techniques such as variational information bottleneck ( Igl et al. , 2019 ) and bisimulation metrics ( Agarwal et al. , 2021 ; Zhang et al. , 2020 ) to help with the problem of overfitting in RL . ( Cobbe et al. , 2020 ; Raileanu & Fergus , 2021 ) learned a separate network for policy and value function and showed that it helps reduce the generalization gap in RL . ( Sax et al. , 2018 ) showed that using mid-level visual features optimized for segmentation , depth , keypoints , surface normal prediction and others improve transfer . In our work , rather than proposing a novel approach to solve overfitting , we analyze the limitations of the current techniques and propose avanues for improvements . 3 PRELIMINARIES . We consider a distribution of Partially Observable Markov Decision Process ( POMDPs ) p ( M ) such thatMi = ( Si , Oi , Ai , Ti , Ωi , Ri , γ ) ∼ p ( M ) . We can think of differentMi as instances of same task in different environments . Si is the state space , Oi is the observation space , Ai is the action space , Ti ( s ′|s , a ) is the transition function , Ωi ( o′|s , a ) is the observation function , Ri ( s , a ) is the reward function and γ is the discount factor . The goal is to find a policy πθ that maximizes the expected sum of discounted rewards over the distribution of POMDPs , J ( πθ ) = Eπ , p ( M ) [ ∑T−1 t=0 γ tRi ( st , at ) ] . During training , we only have access to a limited number of POMDPs M̂ = { Mi } Ni=1 . Our goal is to find a policy πθ that generalizes to new POMDPs sampled from p ( M ) . 3.1 ENVIRONMENT SETUP . We conduct experiments using the ProcGen suite ( Cobbe et al. , 2019 ) , a collection of 16 procedurally generated video games . Each game contains multiple levels wherein the agent needs to perform the same task , but the environment varies due to changes in position of objects , their textures and the background texture . We refer to variation in levels resulting solely from changes in texture of object , agent and the background as theme variation . We collectively refer to variation in levels resulting from changes in positions of the objects as layout variation . Figure 1 illustrates theme and layout variation for two games , Jumper and Climber . For each game , the first and the second level differ in theme whereas the first and the third level differ in both the theme and the layout . 3.2 METHODS . We use standard neural network architecture to represent the policy , a ∼ πθ ( a|s ) , consisting of : a visual encoder z = πencθ1 ( s ) and a policy head a ∼ π h θ2 ( a|z ) with parameters θ1 , θ2 respectively . Collectively , they are referred as θ = [ θ1 , θ2 ] . The architecture of the visual encoder is borrowed from IMPALA ( Espeholt et al. , 2018 ) and is a ResNet with 15 convolutional layers . It outputs a flattened feature map ( z ) that we refer to as the visual feature . These features are passed into a two 2-layer fully-connected neural networks with 256 hidden units for predicting the actions ( i.e. , the policy head ) and the value function ( i.e. , the value head , V hψ ( z ) ) . We analyze the generalization performance of PPO ( Schulman et al. , 2017 ) and three state-of-the-art ( SOTA ) methods : • UCB-DrAC ( Raileanu et al. , 2020 ) uses Upper Confidence Bound ( UCB ) to automatically select game specific data augmentations out of eight possible ones : crop , grayscale , cutout , cutout-color , flip , rotate , random convolution and color jitter . For brevity , we sometimes refer to UCB-DrAC as simply DrAC . • DAAC ( Raileanu & Fergus , 2021 ) trains two separate networks for representing the policy and the value function . The intuition is that in POMDPs , the value network will overfit , but the policy can still generalize . The seperation of networks prevents interference in visual features learned for representing the value function and the policy . PPG ( Cobbe et al. , 2020 ) also trains separate networks for actor and critic but mainly focuses on improved training of policies and not their generalization performance . • iDAAC ( Raileanu & Fergus , 2021 ) adds an auxiliary loss to the training objective of DAAC to encourage domain invariance . We use PPO ’ s pytorch implementation ( Kostrikov , 2018 ) , the official implementation for UCBDrAC ( Raileanu et al. , 2020 ) , and the official implementation for DAAC/iDAAC ( Raileanu & Fergus , 2021 ) . See Appendix B for the hyperparameters used . | The paper studies generalization of policies trained for video games. More specifically, it analyzes transfer to new game situations via changing the theme (appearance) or the level (layout) of the game. The Procgen framework is used to procedurally generate new levels or themes to evaluate a set of hypotheses. The paper investigates (1) data augmentation, (2) policy generalization via domain confusion (3) generalization via auxiliary tasks (4) effects of hyperparameter selection and (5) adaptation to new levels. | SP:4b226829ac26fd231a344aeeb395a12ff69a994c |
Role Diversity Matters: A Study of Cooperative Training Strategies for Multi-Agent RL | 1 INTRODUCTION . Recently , multi-agent reinforcement learning ( MARL ) has captured people ’ s attention due to its impressive achievements in the field of super human-level intelligence in video games [ 3 , 6 , 52 , 57 ] , card games [ 7 , 25 , 44 , 59 ] , and real-world applications [ 62–64 ] . These achievements have benefited substantially from the success of single-agent reinforcement learning ( RL ) [ 14 , 15 , 30 , 42 , 43 ] and rapid progress of MARL from both the competitive and the cooperative side . On the competitive side , existing works focus on game theory among adversary agents with guaranteed policy convergence via theoretical analysis [ 5 , 17 , 27 , 29 , 56 ] . Whereas the achievements on the cooperative MARL are more based on empirical results in cooperative multi-agent system ( MAS ) [ 4 , 21 , 28 , 39 , 46 , 51 , 61 ] . One key problem of cooperative MARL is that whether one algorithm is better than another depends on the MARL tasks as showed in Fig . 1a . Current researches focus on developing algorithms on the tasks they are good at but lack the study of why the performance declines on other tasks [ 16 , 35 , 55 , 55 , 58 ] . Even adopting the state-of-the-art algorithms does not guarantee a strong performance [ 13 , 35 , 48 , 55 , 58 ] . This may due to the varying characteristic ( e.g agent ’ s attributes and goals ) of MARL tasks and scenarios , one single algorithm is not able to cover them all , which means we have to change the training strategy according to the current scenario . From this perspective , we need to find a metric to describe different MARL tasks and use this description to help determine the best strategy combination as showed in Fig . 1b . Considering that Under review as a conference paper at ICLR 2022 Role Diversity Communication Sharing Credit Assignment Task 2 Task n … Role Diversity Algorithm for Task 2 Algorithm for Task n … Parameter Sharing Task 2 Task 1 MARL Algorithm 1 Performance the main component of MAS is the agents , we propose a new definition Role in MAS to quantify the agents ’ difference and use Role Diversity to describe MAS . We then analyze how the role diversity impacts the MARL both theoretical and experimental . For theoretical analysis , we use the decomposed estimation error of the joint action-value function Qtot in MARL to discuss how role diversity impacts the policy optimization process . The experiment further verifies the theoretical analysis that the role diversity is strongly related to the model performance and can serve as a good description of a MAS . As shown in Fig . 1 , with the role diversity description of each task , we can now avoid possible bottleneck of a MARL algorithm with the combination of different parameter sharing , communication , and credit assignment strategies . With the definition of role diversity and the analysis of its impact on MARL , we can also explain the question of why the model performance varies across different tasks . Role diversity are defined from three aspects : policy-based , trajectory-based , and contribution-based in Sec . 3 which are measured by action distribution , observation overlap , and Q/state value diversity . Through theoretical analysis , we find each type of role diversity has different impact to different terms of decomposed estimation error : algorithmic error , approximation error , and statistical error ( Sec . 4 ) . We conduct comprehensive experiments covering three main topics in MARL : parameter sharing , communication , and credit assignment in Sec . 5 and provide a set of guideline on choosing MARL training strategy in Sec . 6 . The main experiments are conducted on MPE [ 28 ] and SMAC [ 39 ] benchmarks , covering a variety of scenarios with different role diversity . The impact of role diversity is evaluated on representative MARL algorithms including IQL [ 49 ] , IA2C [ 31 ] , VDN [ 48 ] , QMIX [ 35 ] , MADDPG [ 28 ] , and MAPPO [ 58 ] , covering independent learning methods , centralised policy gradient methods , and value decomposition methods . The experiment results prove that the model performance of different algorithms and training strategies is largely dependent on the role diversity . Scenarios with large policy-based role diversity prefer no parameter sharing strategy . Communication is not needed in scenarios with large trajectory-based role diversity . Learnable credit assignment modules should be avoided when training on scenarios with large contributionbased role diversity . The key contributions of this study are as follows : First , the concepts of the role and role diversity are defined to describe MARL tasks . Second , a theoretical analysis of how role diversity impacts MARL policy optimization with estimation error decomposition is built . Third , role diversity is proven to be strongly related to performance variance when choosing different training strategies , including parameter sharing , communication , and credit assignment on the MARL benchmarks . Finally , a set of guidelines for selecting a training strategy based on role diversity is provided . 2 RELATED WORK . Researches on the development of cooperative MARL algorithms are mainly in three aspects : parameter sharing , communication and credit assignment . For parameter sharing , the common approach in cooperative MARL is to fully share the model parameters among the agents [ 16 , 35 , 48 , 55 ] . In this way , the policy optimization can benefit from the shared experience buffer with samples from all different agents , providing a higher data efficiency . However , it has also been noted in recent works that parameter sharing is not always a good choice [ 8 , 34 , 50 ] . In some scenarios , a selective parameter sharing strategy , or even no parameter sharing , can significantly benefit agent performance and surpass the full parameter sharing . However , the question of why different parameter sharing strategies have different impacts on different scenarios remains open . In this study , we find that the role diversity can serve as a strong signal for selecting the parameter sharing strategy . The communication mechanism is an intrinsic part of the multi-agent system ( MAS ) framework [ 18 , 19 , 23 , 28 , 47 ] . It provides the current agent with essential information of other agents to form a better joint policy , which substantially impacts the final performance . In some cases , communication restrictions exist , which hinder us from freely choosing communication methods [ 28 , 39 ] ; in most cases , however , the communication is available and it is optional on when to communicate and how to ingest the shared information [ 19 , 45 ] . We present a comprehensive study on the relationship between role diversity and information sharing via communication mechanisms and demonstrate that role diversity determines the necessity of communication . For the credit assignment , most cooperative MARL algorithms adopt Q-learning or policy gradient as the basic policy optimization method , which is combined with an extra value decomposition module [ 16 , 35 , 48 , 55 ] or shared critic function [ 13 , 28 , 58 ] to optimize the individual policy . Some other works find that leveraging the reward signal is unnecessary ; however , optimizing the individual policy independently ( independent learning , IL ) can still get a strong joint policy [ 34 , 49 ] . It then becomes slightly difficult to decide which credit assignment method ( including IL ) is better as there is no single method in cooperative MARL that is robust and always outperforms others ( compared to PPO [ 43 ] or SAC [ 14 ] in single-agent RL ) on different tasks . In this study , we contend that role diversity is the key factor that impacts the performance of different credit assignment strategies . In the next section , we present the role definition from three aspects including policy-based , trajectory-based , and contribution-based , and propose the measurement of different role diversity types to describe a MARL task . 3 ROLE DIVERSITY . Using role to describe the characteristic of the agents in the MARL context has been proven to be effective in many recent works [ 8 , 24 , 54 , 55 ] . However , the definition of the role concept remains largely unclear . In work [ 55 ] , the role is defined as the higher-level option in the hierarchical RL framework [ 20 ] . In work [ 8 ] , the role is defined as the environmental impact similarity of a random policy . These definitions are intuitive and can not accurately describe the role difference . In this study , we attempt to define the role in a more comprehensively way from three different aspects : policy-based , trajectory-based , and contribution-based . More specific scenario-based illustration can be found in Fig . 7 and Fig . 8 . With our refined role , a strong relationship between role diversity and the MARL optimization process can be built and the performance variance can be further explained . 3.1 POLICY-BASED ROLE . In MARL , different agents output different actions based on its current status . As common sense would indicate , actions taken at the same timestep can indicate different roles [ 55 ] . However , there are many exceptions . For instance , if we have two soccer players passing a ball to each other repeatedly [ 21 ] , although the action is different at each time step , the roles of these two soccer players can be very similar from the perspective of the whole soccer game . Therefore , it is not sufficient to distinguish the role difference based on a single timestep . Instead , we contend that this difference should be defined based on a period . As this role is purely based on policy distribution π , we refer to it as a policy-based role . Specifically , we define the policy-based role as the statistics of the actions ’ frequency over a period , which is n steps backward and forward from the current timestep . Here , n is the time interval that is half the length of the total time . More details can be found in Fig . 8a , where we provide a real scenario from SMAC . Policy-based role difference can be represented as follows : raT = 1 2n+ 1 T+n∑ t=T−n πat ( 1 ) where T represents the current timestep , n is the time interval , a is the agent index , π is the policy distribution . We adopt symmetrical KL divergence to measure the distance of different policy-based 1s1m1h1M_vs_5z4m_vs_3z roles . The total role distance of A agents can be computed as follows : dpT = 1∑A−1 0 A∑ a0=0 A∑ a1=a0 ( KL ( ra0T |r a1 T ) +KL ( r a1 T |r a0 T ) ) ( 2 ) where dpT represents the policy-based role distance at timestep T , A represents the total agent number , and KL represents Kullback–Leibler divergence . We also provide a case study of how policy-based role diversity varies in Fig . 2a . From a real battle scenario ( 4m vs 3z ) taken from SMAC , we find three stages including Find a good position , Focus on enemy and Find each one ’ s best strategy . In stage 1 , agents try to find their own best location ; the role diversity is large . In stage 2 , agents focus on the same enemy target ; the policies become similar and the role diversity is decreased . In stage 3 , the formation of the agents is broken up by the enemies . Policy-based role diversity again increases as each agent is required to find its own best strategy to deal with its current situation . | This work looks at defining role diversity as a means for analyzing multi agent dynamics. It proposes three different perspectives on analyzing roles in multiagent systems. One is from a policy perspective (based on KL divergences), an trajectory perspective (how much do the agents overlap in what they observe), and a team-contribution perspective (weighing the effects of the agent to the team reward). | SP:71d7789fea9e23a47eeb6adacc3504e2dc8950e8 |
Role Diversity Matters: A Study of Cooperative Training Strategies for Multi-Agent RL | 1 INTRODUCTION . Recently , multi-agent reinforcement learning ( MARL ) has captured people ’ s attention due to its impressive achievements in the field of super human-level intelligence in video games [ 3 , 6 , 52 , 57 ] , card games [ 7 , 25 , 44 , 59 ] , and real-world applications [ 62–64 ] . These achievements have benefited substantially from the success of single-agent reinforcement learning ( RL ) [ 14 , 15 , 30 , 42 , 43 ] and rapid progress of MARL from both the competitive and the cooperative side . On the competitive side , existing works focus on game theory among adversary agents with guaranteed policy convergence via theoretical analysis [ 5 , 17 , 27 , 29 , 56 ] . Whereas the achievements on the cooperative MARL are more based on empirical results in cooperative multi-agent system ( MAS ) [ 4 , 21 , 28 , 39 , 46 , 51 , 61 ] . One key problem of cooperative MARL is that whether one algorithm is better than another depends on the MARL tasks as showed in Fig . 1a . Current researches focus on developing algorithms on the tasks they are good at but lack the study of why the performance declines on other tasks [ 16 , 35 , 55 , 55 , 58 ] . Even adopting the state-of-the-art algorithms does not guarantee a strong performance [ 13 , 35 , 48 , 55 , 58 ] . This may due to the varying characteristic ( e.g agent ’ s attributes and goals ) of MARL tasks and scenarios , one single algorithm is not able to cover them all , which means we have to change the training strategy according to the current scenario . From this perspective , we need to find a metric to describe different MARL tasks and use this description to help determine the best strategy combination as showed in Fig . 1b . Considering that Under review as a conference paper at ICLR 2022 Role Diversity Communication Sharing Credit Assignment Task 2 Task n … Role Diversity Algorithm for Task 2 Algorithm for Task n … Parameter Sharing Task 2 Task 1 MARL Algorithm 1 Performance the main component of MAS is the agents , we propose a new definition Role in MAS to quantify the agents ’ difference and use Role Diversity to describe MAS . We then analyze how the role diversity impacts the MARL both theoretical and experimental . For theoretical analysis , we use the decomposed estimation error of the joint action-value function Qtot in MARL to discuss how role diversity impacts the policy optimization process . The experiment further verifies the theoretical analysis that the role diversity is strongly related to the model performance and can serve as a good description of a MAS . As shown in Fig . 1 , with the role diversity description of each task , we can now avoid possible bottleneck of a MARL algorithm with the combination of different parameter sharing , communication , and credit assignment strategies . With the definition of role diversity and the analysis of its impact on MARL , we can also explain the question of why the model performance varies across different tasks . Role diversity are defined from three aspects : policy-based , trajectory-based , and contribution-based in Sec . 3 which are measured by action distribution , observation overlap , and Q/state value diversity . Through theoretical analysis , we find each type of role diversity has different impact to different terms of decomposed estimation error : algorithmic error , approximation error , and statistical error ( Sec . 4 ) . We conduct comprehensive experiments covering three main topics in MARL : parameter sharing , communication , and credit assignment in Sec . 5 and provide a set of guideline on choosing MARL training strategy in Sec . 6 . The main experiments are conducted on MPE [ 28 ] and SMAC [ 39 ] benchmarks , covering a variety of scenarios with different role diversity . The impact of role diversity is evaluated on representative MARL algorithms including IQL [ 49 ] , IA2C [ 31 ] , VDN [ 48 ] , QMIX [ 35 ] , MADDPG [ 28 ] , and MAPPO [ 58 ] , covering independent learning methods , centralised policy gradient methods , and value decomposition methods . The experiment results prove that the model performance of different algorithms and training strategies is largely dependent on the role diversity . Scenarios with large policy-based role diversity prefer no parameter sharing strategy . Communication is not needed in scenarios with large trajectory-based role diversity . Learnable credit assignment modules should be avoided when training on scenarios with large contributionbased role diversity . The key contributions of this study are as follows : First , the concepts of the role and role diversity are defined to describe MARL tasks . Second , a theoretical analysis of how role diversity impacts MARL policy optimization with estimation error decomposition is built . Third , role diversity is proven to be strongly related to performance variance when choosing different training strategies , including parameter sharing , communication , and credit assignment on the MARL benchmarks . Finally , a set of guidelines for selecting a training strategy based on role diversity is provided . 2 RELATED WORK . Researches on the development of cooperative MARL algorithms are mainly in three aspects : parameter sharing , communication and credit assignment . For parameter sharing , the common approach in cooperative MARL is to fully share the model parameters among the agents [ 16 , 35 , 48 , 55 ] . In this way , the policy optimization can benefit from the shared experience buffer with samples from all different agents , providing a higher data efficiency . However , it has also been noted in recent works that parameter sharing is not always a good choice [ 8 , 34 , 50 ] . In some scenarios , a selective parameter sharing strategy , or even no parameter sharing , can significantly benefit agent performance and surpass the full parameter sharing . However , the question of why different parameter sharing strategies have different impacts on different scenarios remains open . In this study , we find that the role diversity can serve as a strong signal for selecting the parameter sharing strategy . The communication mechanism is an intrinsic part of the multi-agent system ( MAS ) framework [ 18 , 19 , 23 , 28 , 47 ] . It provides the current agent with essential information of other agents to form a better joint policy , which substantially impacts the final performance . In some cases , communication restrictions exist , which hinder us from freely choosing communication methods [ 28 , 39 ] ; in most cases , however , the communication is available and it is optional on when to communicate and how to ingest the shared information [ 19 , 45 ] . We present a comprehensive study on the relationship between role diversity and information sharing via communication mechanisms and demonstrate that role diversity determines the necessity of communication . For the credit assignment , most cooperative MARL algorithms adopt Q-learning or policy gradient as the basic policy optimization method , which is combined with an extra value decomposition module [ 16 , 35 , 48 , 55 ] or shared critic function [ 13 , 28 , 58 ] to optimize the individual policy . Some other works find that leveraging the reward signal is unnecessary ; however , optimizing the individual policy independently ( independent learning , IL ) can still get a strong joint policy [ 34 , 49 ] . It then becomes slightly difficult to decide which credit assignment method ( including IL ) is better as there is no single method in cooperative MARL that is robust and always outperforms others ( compared to PPO [ 43 ] or SAC [ 14 ] in single-agent RL ) on different tasks . In this study , we contend that role diversity is the key factor that impacts the performance of different credit assignment strategies . In the next section , we present the role definition from three aspects including policy-based , trajectory-based , and contribution-based , and propose the measurement of different role diversity types to describe a MARL task . 3 ROLE DIVERSITY . Using role to describe the characteristic of the agents in the MARL context has been proven to be effective in many recent works [ 8 , 24 , 54 , 55 ] . However , the definition of the role concept remains largely unclear . In work [ 55 ] , the role is defined as the higher-level option in the hierarchical RL framework [ 20 ] . In work [ 8 ] , the role is defined as the environmental impact similarity of a random policy . These definitions are intuitive and can not accurately describe the role difference . In this study , we attempt to define the role in a more comprehensively way from three different aspects : policy-based , trajectory-based , and contribution-based . More specific scenario-based illustration can be found in Fig . 7 and Fig . 8 . With our refined role , a strong relationship between role diversity and the MARL optimization process can be built and the performance variance can be further explained . 3.1 POLICY-BASED ROLE . In MARL , different agents output different actions based on its current status . As common sense would indicate , actions taken at the same timestep can indicate different roles [ 55 ] . However , there are many exceptions . For instance , if we have two soccer players passing a ball to each other repeatedly [ 21 ] , although the action is different at each time step , the roles of these two soccer players can be very similar from the perspective of the whole soccer game . Therefore , it is not sufficient to distinguish the role difference based on a single timestep . Instead , we contend that this difference should be defined based on a period . As this role is purely based on policy distribution π , we refer to it as a policy-based role . Specifically , we define the policy-based role as the statistics of the actions ’ frequency over a period , which is n steps backward and forward from the current timestep . Here , n is the time interval that is half the length of the total time . More details can be found in Fig . 8a , where we provide a real scenario from SMAC . Policy-based role difference can be represented as follows : raT = 1 2n+ 1 T+n∑ t=T−n πat ( 1 ) where T represents the current timestep , n is the time interval , a is the agent index , π is the policy distribution . We adopt symmetrical KL divergence to measure the distance of different policy-based 1s1m1h1M_vs_5z4m_vs_3z roles . The total role distance of A agents can be computed as follows : dpT = 1∑A−1 0 A∑ a0=0 A∑ a1=a0 ( KL ( ra0T |r a1 T ) +KL ( r a1 T |r a0 T ) ) ( 2 ) where dpT represents the policy-based role distance at timestep T , A represents the total agent number , and KL represents Kullback–Leibler divergence . We also provide a case study of how policy-based role diversity varies in Fig . 2a . From a real battle scenario ( 4m vs 3z ) taken from SMAC , we find three stages including Find a good position , Focus on enemy and Find each one ’ s best strategy . In stage 1 , agents try to find their own best location ; the role diversity is large . In stage 2 , agents focus on the same enemy target ; the policies become similar and the role diversity is decreased . In stage 3 , the formation of the agents is broken up by the enemies . Policy-based role diversity again increases as each agent is required to find its own best strategy to deal with its current situation . | This paper study the relation between role diversity of tasks and the MARL model performance. The role diversity (difference among agents) is described from three perspectives: policy-based, trajectory-based, and contribution-based. The authors analyze how the role diversity impacts the MARL performance in theory and experiments. The empirical results show a strong relation among the three metrics and the three main topics in MARL (parameter sharing, communication, and credit assignment). | SP:71d7789fea9e23a47eeb6adacc3504e2dc8950e8 |
Role Diversity Matters: A Study of Cooperative Training Strategies for Multi-Agent RL | 1 INTRODUCTION . Recently , multi-agent reinforcement learning ( MARL ) has captured people ’ s attention due to its impressive achievements in the field of super human-level intelligence in video games [ 3 , 6 , 52 , 57 ] , card games [ 7 , 25 , 44 , 59 ] , and real-world applications [ 62–64 ] . These achievements have benefited substantially from the success of single-agent reinforcement learning ( RL ) [ 14 , 15 , 30 , 42 , 43 ] and rapid progress of MARL from both the competitive and the cooperative side . On the competitive side , existing works focus on game theory among adversary agents with guaranteed policy convergence via theoretical analysis [ 5 , 17 , 27 , 29 , 56 ] . Whereas the achievements on the cooperative MARL are more based on empirical results in cooperative multi-agent system ( MAS ) [ 4 , 21 , 28 , 39 , 46 , 51 , 61 ] . One key problem of cooperative MARL is that whether one algorithm is better than another depends on the MARL tasks as showed in Fig . 1a . Current researches focus on developing algorithms on the tasks they are good at but lack the study of why the performance declines on other tasks [ 16 , 35 , 55 , 55 , 58 ] . Even adopting the state-of-the-art algorithms does not guarantee a strong performance [ 13 , 35 , 48 , 55 , 58 ] . This may due to the varying characteristic ( e.g agent ’ s attributes and goals ) of MARL tasks and scenarios , one single algorithm is not able to cover them all , which means we have to change the training strategy according to the current scenario . From this perspective , we need to find a metric to describe different MARL tasks and use this description to help determine the best strategy combination as showed in Fig . 1b . Considering that Under review as a conference paper at ICLR 2022 Role Diversity Communication Sharing Credit Assignment Task 2 Task n … Role Diversity Algorithm for Task 2 Algorithm for Task n … Parameter Sharing Task 2 Task 1 MARL Algorithm 1 Performance the main component of MAS is the agents , we propose a new definition Role in MAS to quantify the agents ’ difference and use Role Diversity to describe MAS . We then analyze how the role diversity impacts the MARL both theoretical and experimental . For theoretical analysis , we use the decomposed estimation error of the joint action-value function Qtot in MARL to discuss how role diversity impacts the policy optimization process . The experiment further verifies the theoretical analysis that the role diversity is strongly related to the model performance and can serve as a good description of a MAS . As shown in Fig . 1 , with the role diversity description of each task , we can now avoid possible bottleneck of a MARL algorithm with the combination of different parameter sharing , communication , and credit assignment strategies . With the definition of role diversity and the analysis of its impact on MARL , we can also explain the question of why the model performance varies across different tasks . Role diversity are defined from three aspects : policy-based , trajectory-based , and contribution-based in Sec . 3 which are measured by action distribution , observation overlap , and Q/state value diversity . Through theoretical analysis , we find each type of role diversity has different impact to different terms of decomposed estimation error : algorithmic error , approximation error , and statistical error ( Sec . 4 ) . We conduct comprehensive experiments covering three main topics in MARL : parameter sharing , communication , and credit assignment in Sec . 5 and provide a set of guideline on choosing MARL training strategy in Sec . 6 . The main experiments are conducted on MPE [ 28 ] and SMAC [ 39 ] benchmarks , covering a variety of scenarios with different role diversity . The impact of role diversity is evaluated on representative MARL algorithms including IQL [ 49 ] , IA2C [ 31 ] , VDN [ 48 ] , QMIX [ 35 ] , MADDPG [ 28 ] , and MAPPO [ 58 ] , covering independent learning methods , centralised policy gradient methods , and value decomposition methods . The experiment results prove that the model performance of different algorithms and training strategies is largely dependent on the role diversity . Scenarios with large policy-based role diversity prefer no parameter sharing strategy . Communication is not needed in scenarios with large trajectory-based role diversity . Learnable credit assignment modules should be avoided when training on scenarios with large contributionbased role diversity . The key contributions of this study are as follows : First , the concepts of the role and role diversity are defined to describe MARL tasks . Second , a theoretical analysis of how role diversity impacts MARL policy optimization with estimation error decomposition is built . Third , role diversity is proven to be strongly related to performance variance when choosing different training strategies , including parameter sharing , communication , and credit assignment on the MARL benchmarks . Finally , a set of guidelines for selecting a training strategy based on role diversity is provided . 2 RELATED WORK . Researches on the development of cooperative MARL algorithms are mainly in three aspects : parameter sharing , communication and credit assignment . For parameter sharing , the common approach in cooperative MARL is to fully share the model parameters among the agents [ 16 , 35 , 48 , 55 ] . In this way , the policy optimization can benefit from the shared experience buffer with samples from all different agents , providing a higher data efficiency . However , it has also been noted in recent works that parameter sharing is not always a good choice [ 8 , 34 , 50 ] . In some scenarios , a selective parameter sharing strategy , or even no parameter sharing , can significantly benefit agent performance and surpass the full parameter sharing . However , the question of why different parameter sharing strategies have different impacts on different scenarios remains open . In this study , we find that the role diversity can serve as a strong signal for selecting the parameter sharing strategy . The communication mechanism is an intrinsic part of the multi-agent system ( MAS ) framework [ 18 , 19 , 23 , 28 , 47 ] . It provides the current agent with essential information of other agents to form a better joint policy , which substantially impacts the final performance . In some cases , communication restrictions exist , which hinder us from freely choosing communication methods [ 28 , 39 ] ; in most cases , however , the communication is available and it is optional on when to communicate and how to ingest the shared information [ 19 , 45 ] . We present a comprehensive study on the relationship between role diversity and information sharing via communication mechanisms and demonstrate that role diversity determines the necessity of communication . For the credit assignment , most cooperative MARL algorithms adopt Q-learning or policy gradient as the basic policy optimization method , which is combined with an extra value decomposition module [ 16 , 35 , 48 , 55 ] or shared critic function [ 13 , 28 , 58 ] to optimize the individual policy . Some other works find that leveraging the reward signal is unnecessary ; however , optimizing the individual policy independently ( independent learning , IL ) can still get a strong joint policy [ 34 , 49 ] . It then becomes slightly difficult to decide which credit assignment method ( including IL ) is better as there is no single method in cooperative MARL that is robust and always outperforms others ( compared to PPO [ 43 ] or SAC [ 14 ] in single-agent RL ) on different tasks . In this study , we contend that role diversity is the key factor that impacts the performance of different credit assignment strategies . In the next section , we present the role definition from three aspects including policy-based , trajectory-based , and contribution-based , and propose the measurement of different role diversity types to describe a MARL task . 3 ROLE DIVERSITY . Using role to describe the characteristic of the agents in the MARL context has been proven to be effective in many recent works [ 8 , 24 , 54 , 55 ] . However , the definition of the role concept remains largely unclear . In work [ 55 ] , the role is defined as the higher-level option in the hierarchical RL framework [ 20 ] . In work [ 8 ] , the role is defined as the environmental impact similarity of a random policy . These definitions are intuitive and can not accurately describe the role difference . In this study , we attempt to define the role in a more comprehensively way from three different aspects : policy-based , trajectory-based , and contribution-based . More specific scenario-based illustration can be found in Fig . 7 and Fig . 8 . With our refined role , a strong relationship between role diversity and the MARL optimization process can be built and the performance variance can be further explained . 3.1 POLICY-BASED ROLE . In MARL , different agents output different actions based on its current status . As common sense would indicate , actions taken at the same timestep can indicate different roles [ 55 ] . However , there are many exceptions . For instance , if we have two soccer players passing a ball to each other repeatedly [ 21 ] , although the action is different at each time step , the roles of these two soccer players can be very similar from the perspective of the whole soccer game . Therefore , it is not sufficient to distinguish the role difference based on a single timestep . Instead , we contend that this difference should be defined based on a period . As this role is purely based on policy distribution π , we refer to it as a policy-based role . Specifically , we define the policy-based role as the statistics of the actions ’ frequency over a period , which is n steps backward and forward from the current timestep . Here , n is the time interval that is half the length of the total time . More details can be found in Fig . 8a , where we provide a real scenario from SMAC . Policy-based role difference can be represented as follows : raT = 1 2n+ 1 T+n∑ t=T−n πat ( 1 ) where T represents the current timestep , n is the time interval , a is the agent index , π is the policy distribution . We adopt symmetrical KL divergence to measure the distance of different policy-based 1s1m1h1M_vs_5z4m_vs_3z roles . The total role distance of A agents can be computed as follows : dpT = 1∑A−1 0 A∑ a0=0 A∑ a1=a0 ( KL ( ra0T |r a1 T ) +KL ( r a1 T |r a0 T ) ) ( 2 ) where dpT represents the policy-based role distance at timestep T , A represents the total agent number , and KL represents Kullback–Leibler divergence . We also provide a case study of how policy-based role diversity varies in Fig . 2a . From a real battle scenario ( 4m vs 3z ) taken from SMAC , we find three stages including Find a good position , Focus on enemy and Find each one ’ s best strategy . In stage 1 , agents try to find their own best location ; the role diversity is large . In stage 2 , agents focus on the same enemy target ; the policies become similar and the role diversity is decreased . In stage 3 , the formation of the agents is broken up by the enemies . Policy-based role diversity again increases as each agent is required to find its own best strategy to deal with its current situation . | To address the problem of algorithm choosing in different MARL tasks, this paper proposes to use role diversity as a metric to describe MARL tasks. For choosing parameter sharing, communication mechanism, and credit assignment strategy, this paper defines three role diversity metrics, i.e. policy-based, trajectory-based, and contribution-based, respectively. They also find that the error bound in MARL can be decomposed into three parts that have a strong relation to the role diversity. To evaluate the proposed method, they further conduct some experiments on MPE and SMAC environments. | SP:71d7789fea9e23a47eeb6adacc3504e2dc8950e8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.