paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
Diverse Client Selection for Federated Learning via Submodular Maximization | 1 INTRODUCTION . Federated learning ( FL ) involves collaboratively training of machine learning model across a large number of clients while keeping client data local . Recent approaches to this problem repeatedly alternate between device-local ( stochastic ) gradient descent steps and server-aggregation of the clients ’ model updates ( McMahan et al. , 2017 ) . In cross-device settings , a server and its model usually serves several thousands of devices . Therefore , the communication between clients and the server can be costly and slow , forming a huge impediment to FL ’ s viability . One property of the collection of clients that can mitigate these problems , however , is often not exploited , and that is redundancy . Specifically , many clients might provide similar , and thus redundant , gradient information for updating the server model . Therefore , transmitting all such updates to the server is a waste of communication and computational resources . How best to select a representative and more informative client set while adhering to practical constraints in federated learning is still an open challenge . Although several selection criterion have been investigated in recent literature , e.g. , sampling clients with probabilities proportional to their local dataset size ( McMahan et al. , 2017 ) , sampling clients of larger update norm with higher probability ( Chen et al. , 2020 ) , and selecting clients with higher losses ( Balakrishnan et al. , 2020 ; Cho et al. , 2020 ) , the redundancy and similarity of the clients ’ updates sent to the server is not represented and exploited in these approaches . In particular , communicating multiple clients ’ updates to the server may cause statistical and system inefficiency if too many of them are too similar to each other . The commonly studied modular score/probability for each individual client is incapable of capturing information as a property over a group of clients . Ideally , a diverse set of clients would be selected , thereby increasing the impact of under-represented clients that contribute different information , and thereby improving fairness . This , in fact , is a topic of increasing interest ( Mohri et al. , 2019 ; Cho et al. , 2020 ; Dennis et al. , 2021 ) . In this paper , we introduce diversity to client selection in FL , namely a strategy to measure how a selected subset of clients can represent the whole when being aggregated on the server . Specifically , in each communication round , we aim to find a subset whose aggregated model update approximates the aggregate update over all clients . By doing this , we aim to limit the impact of subset selection which introduces variance in the model updates across round , that could otherwise slow the learning process . Inspired by the CRAIG method of coreset selection for efficient machine learning training ( Mirzasoleiman et al. , 2020 ) , we derive an upper bound of the approximation error as a supermodular set function ( in particular , the min-form of the facility location function ( Cornuéjols et al. , 1977 ) ) evaluated on the selected subset . We can then apply submodular maximization ( Fujishige , 2005 ; Iyer et al. , 2013 ; Wei et al. , 2014 ) on a complement submodular function to ( approximately ) minimize the error upper bound . We employ the greedy selection ( Nemhauser et al. , 1978 ) of a subset of clients according to the marginal gain of the submodular function to achieve a solution with provable approximation guarantee ( Conforti & Cornuejols , 1984 ) . By integrating the diverse client selection into the most commonly studied FL scheme , i.e. , Federated Averaging ( FedAvg ) ( McMahan et al. , 2017 ) , we propose DivFL that applies global model aggregation over a selected subset of clients after multiple local steps on every client . We present theoretical convergence analysis of DivFL and show its tolerance to the heterogeneity of data distributions across clients and large number of local steps . However , our method differs from the CRAIG method where selection is performed based on model updates ( involving multiple epochs at the clients ) . In addition , our approach allows for partial device participation where the server does not have access to all data at any communication round , as is standard in FL ( McMahan et al. , 2017 ) . In experiments , we compare DivFL with other client selection approaches on both synthetic dataset and FEMNIST , wherein our method excels on convergence , fairness and learning efficiency . 2 BACKGROUND AND RELATED WORK . We consider a typical federated learning objective : min w f ( w ) = N∑ k=1 pkFk ( w ) , where for each client k ∈ [ N ] , pk is a pre-defined weight ( such that ∑N k=1 pk = 1 ) that can be set to 1 N or the fraction of training samples , and Fk is the client-specific empirical loss . While there are various possible modeling approaches , we consider this canonical objective of fitting a single global model to the non-identically distributed data across all clients ( McMahan et al. , 2017 ) . Client Selection in Federated Learning . Client1 sampling is a critical problem particularly for cross-device settings where it is prohibitive to communicate with all devices . Two common ( or default ) strategies are ( a ) sampling the clients based on the number of local data points and uniformly averaging the model updates , and ( b ) sampling the clients uniformly at random and aggregating the model updates with weights proportional to the local samples ( Li et al. , 2020 ) . There is also recent work proposing advanced sampling techniques to incorporate dynamic systems constraints , accelerate the convergence of federated optimization , or to obtain a better model with higher accuracy ( Nishio & Yonetani , 2019 ; Ribero & Vikalo , 2020 ; Cho et al. , 2020 ; Lai et al. , 2020 ) . We investigate client selection through the lens of encouraging client diversity at each communication round which largely remains unexplored in previous work . The closest client selection method to ours is based on clustering ( e.g. , selecting representative clients from separate clusters ( Dennis et al. , 2021 ) ) . We note that performing ( private ) clustering in federated settings is still an open problem , and our method can be viewed as a soft version of dynamic clustering at each round ( discussed in the next paragraph ) . The benefits of gradient ( or model ) diversity has been demonstrated in other related contexts , such as scaling up mini-batch stochastic gradient descent ( SGD ) ( Yin et al. , 2018 ) . Enforcing sample or gradient diversity during optimization also implicitly places more emphasis on the underrepresented sub-population of clients , and can promote fairness defined as representative disparity ( Hashimoto et al. , 2018 ) . Similar to previous work ( e.g. , Cho et al. , 2020 ; Balakrishnan et al. , 2020 ) , we observe our approach yields more fair solutions across the network in Section 5 . Diverse Subset Selection via Submodularity . Modular scores have been widely studied for subset selection in machine learning and federated learning , e.g. , a utility score for each sample or client often measured by the loss . However , the diversity of a subset can not be fully captured by such 1Following conventions , we use the term ‘ client ’ for the problem of client selection . Throughout the paper , we use ‘ devices ’ and ‘ clients ’ interchangeably . modular scores since there is no score interaction . Diversity is often well modeled by a diminishing return property , i.e. , the ( marginal ) gain an element brings to a subset diminishes as more elements added to the subset . There exists a rich and expressive family of functions , all of which are natural for measuring diversity , and all having the diminishing returns property : given a finite ground set V of size n , and any subset A ⊆ B ⊆ V and a v /∈ B , a set function F : 2V → R is submodular if F ( v ∪A ) − F ( A ) ≥ F ( v ∪B ) − F ( B ) . ( 1 ) This implies v is no less valuable to the smaller set A than to the larger set B . The marginal gain of v conditioned on A is denoted f ( v|A ) , f ( v ∪A ) − f ( A ) and reflects the importance of v to A. Submodular functions ( Fujishige , 2005 ) have been widely used for diversity models ( Lin & Bilmes , 2011 ; Batra et al. , 2012 ; Prasad et al. , 2014 ; Gillenwater et al. , 2012 ; Bilmes & Bai , 2017 ) . Maximizing a submodular function usually encourages the diversity and reduces the redundancy of a subset . This property has been utilized for data selection in active learning ( Guillory & Bilmes , 2011 ) , curriculum learning ( Zhou & Bilmes , 2018 ) , mini-batch partitioning ( Wang et al. , 2019 ) , gradient approximation ( Mirzasoleiman et al. , 2020 ) , etc . Although the number of possible subsets A is ( n k ) , enumerating them all to find the maximum is intractable . Thanks to submodularity , fast approximate algorithms ( Nemhauser et al. , 1978 ; Minoux , 1978 ; Mirzasoleiman et al. , 2015 ) exist to find an approximately optimal A with provable bounds ( Nemhauser et al. , 1978 ; Conforti & Cornuejols , 1984 ) . Despite its success in data selection , submodularity has not been explored for client selection in federated learning . Encouraging diversity amongst local gradients ( or model updates ) of selected clients can effectively reduce redundant communication and promote fairness . Moreover , it raises several new challenges in the FL setting , e.g. , ( 1 ) it is unclear which submodular function to optimize and in which space to measure the similarity/diversity between clients ; ( 2 ) What convergence guarantee can be obtained under practical assumptions such as heterogeneity among clients , and ( 3 ) What are the effects of outdated client selection due to communication constraints ? 3 DIVERSE CLIENT SELECTION . In this section , we introduce “ federated averaging with diverse client selection ” ( or DivFL ) , a method that incorporates diverse client selection into the most widely studied FL scheme , federated averaging ( FedAvg ) . We will first derive a combinatorial objective for client selection via an approximation of the full communication from all clients , which naturally morphs into a facility location function in the gradient space that can be optimized by submodular maximization . We then present the standard greedy algorithm that optimizes the objective by selecting a diverse subset of clients at every communication round . 3.1 APPROXIMATION OF FULL COMMUNICATION . We aim to find a subset S of clients whose aggregated gradient can approximate the full aggregation over all the N clients V = [ N ] . To formulate this problem , we start by following the logic in Mirzasoleiman et al . ( 2020 ) . Given a subset S , we define a mapping σ : V → S such that the gradient information ∇Fk ( vk ) from client k is approximated by the gradient information from a selected client σ ( k ) ∈ S. For i ∈ S , let Ci , { k ∈ V |σ ( k ) = i } be the set of clients approximated by client-i and γi , |Ci| . The full aggregated gradient can be written as∑ k∈ [ N ] ∇Fk ( vk ) = ∑ k∈ [ N ] [ ∇Fk ( vk ) −∇Fσ ( k ) ( vσ ( k ) ) ] + ∑ k∈S γk∇Fk ( vk ) . ( 2 ) Subtracting the second term from both sides , taking the norms , and applying triangular inequality , we can obtain an upper bound for the approximation to the aggregated gradient by S , i.e. , ∥∥∥∥∥∥ ∑ k∈ [ N ] ∇Fk ( vk ) − ∑ k∈S γk∇Fk ( vk ) ∥∥∥∥∥∥ ≤ ∑ k∈ [ N ] ∥∥∥∇Fk ( vk ) −∇Fσ ( k ) ( vσ ( k ) ) ∥∥∥ . ( 3 ) The above inequality holds for any feasible mapping σ since the left hand side does not depend on σ . So we can take the minimum of the right hand side w.r.t . σ ( k ) , ∀k ∈ [ N ] , i.e. , ∥∥∥∥∥∥ ∑ k∈ [ N ] ∇Fk ( vk ) − ∑ k∈S γk∇Fk ( vk ) ∥∥∥∥∥∥ ≤ ∑ k∈ [ N ] min i∈S ∥∥∇Fk ( vk ) −∇Fi ( vi ) ∥∥ , G ( S ) . ( 4 ) The right hand side provides a relaxed objective G ( S ) for minimizing the approximation error on the left hand . Minimizing G ( S ) ( or maximizing Ḡ , a constant minus its negation ) equals maximizing a well-known submodular function , i.e. , the facility location function ( Cornuéjols et al. , 1977 ) . To restrict the communication cost , we usually limit the number of selected clients to be no greater than K , i.e. , |S| ≤ K. This resorts to a submodular maximization problem under cardinality constraint , which is NP-hard but an approximation solution with 1− e−1 bound can be achieved via the greedy algorithm ( Nemhauser et al. , 1978 ) . | This paper presents a new client selection strategy for federated learning. The key idea is to view the client selection problem as a facility location problem, where the objective is to approximate the aggregation of gradients of all the clients with that of a subset of selected clients. A greedy solution to the problem is derived, and the theoretical convergence analysis is also provided. Although the proposed algorithm ideally requires the gradients of all clients, the paper also introduces its practical extension that instead leverages gradients collected in previous rounds. Experimental results on synthesized and real datasets show the effectiveness of the proposed approach. | SP:16dd5b0ec5e070f0875e405655998c20c5d6429c |
Multi-Agent MDP Homomorphic Networks | 1 INTRODUCTION Equivariant and geometric deep learning have gained traction in recent years , showing promising results in supervised learning ( Cohen & Welling , 2016 ; Winkels & Cohen , 2018 ; Weiler et al. , 2018 ; Weiler & Cesa , 2019 ; Worrall et al. , 2017 ; Fuchs et al. , 2020 ; Thomas et al. , 2018 ) , unsupervised learning ( Dey et al. , 2021 ) and reinforcement learning ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) . In single agent reinforcement learning , enforcing equivariance to group symmetries has been shown to improve data efficiency , for example with MDP homomorphic networks ( van der Pol et al. , 2020 ) , trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ) , or symmetric locomotion policies ( Abdolhosseini et al. , 2019 ) . Equivariant approaches enable a single agent to learn policies more efficiently within its environment by sharing weights between state-action pairs that are equivalent under a transformation . As a result of this weight sharing , the agent implicitly learns a policy in a reduced version of the MDP . We are interested in cooperative multi-agent reinforcement learning , where symmetries exist not only in the global environment , but also between individual agents in the larger multi-agent system . Existing work on symmetries in single agent reinforcement learning can only be generalized to the fully centralized multi-agent setting , because such approaches rely on the global symmetry in the full state-action spaces and these can result in correspondences across agents , as shown in Figure 1 . This means such approaches can not be used in distributed multi-agent systems with communication constraints . Here , we seek to be equivariant to global symmetries of cooperative multi-agent systems while still being able to execute policies in a distributed manner . Within deep multi-agent reinforcement learning , existing work has shown the potential of using permutation symmetries and invariance between agents ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sunehag et al. , 2017 ; Robbel et al. , 2016 ; Böhmer et al. , 2020 ; Sukhbaatar et al. , 2016 ; van der Pol & Oliehoek , 2016 ) . Such work takes an anonymity view of homogeneous agents , where only the agent ’ s observations , and not its identity , matter for the policy . Using permutation symmetries ensures extensive weight sharing between agents , resulting in improved data efficiency . In this work , we go beyond such permutation symmetries , and consider more general symmetries of global multi-agent systems , such as rotational symmetries . In this paper , we propose Multi-Agent MDP Homomorphic Networks , a class of distributed policy networks which are equivariant to global symmetries of the multi-agent system , as well as to standard permutation symmetries . Our contributions are as follows . ( i ) We propose a factorization of global symmetries in the joint state-action space of cooperative multi-agent systems . ( ii ) We introduce a multi-agent equivariant policy network based on this factorization . ( iii ) Our main contribution is an approach to cooperative multi-agent reinforcement learning that is globally equivariant while requiring only local agent computation and local communication between agents at execution time . We evaluate Multi-Agent MDP Homomorphic Networks on symmetric multi-agent problems and show improved data efficiency compared to non-equivariant baselines . 2 RELATED WORK . Symmetries in single agent reinforcement learning Symmetries in Markov Decision Processes have been formalized by Zinkevich & Balch ( 2001 ) ; Ravindran & Barto ( 2001 ) . Recent work on symmetries in single agent deep reinforcement learning has shown improvements in terms of data effiency . Such work revolves around symmetries in policy networks ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) , symmetric filters ( Clark & Storkey , 2014 ) , invariant data augmentation ( Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) or equivariant trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ; Mishra et al. , 2019 ) These approaches are only suitable for single agent problems or centralized multi-agent controllers . Here , we solve the problem of enforcing global equivariance while still allowing distributed execution . Graphs and permutation symmetries in multi agent reinforcement learning Graph-based methods in cooperative multiagent reinforcement learning are well-explored . Much work is based around coordination graphs ( Guestrin et al. , 2002b ; a ; Kok & Vlassis , 2006 ) , including approaches that approximate local Q-functions with neural networks and use max-plus to find a joint policy ( van der Pol & Oliehoek , 2016 ; Böhmer et al. , 2020 ) , and approaches that use graph-structured networks to find joint policies or value functions ( Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . In deep learning for multi-agent systems , the use of permutation symmetries is common , either through explicit formulations ( Sunehag et al. , 2017 ; Böhmer et al. , 2020 ) or through the use of graph or message passing networks ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . Policies in multi-agent systems with permutation symmetries between agents are also known as functionally homogeneous policies ( Zinkevich & Balch , 2001 ) or policies with agent anonymity ( Robbel et al. , 2016 ; Varakantham et al. , 2014 ) . Here , we move beyond permutation symmetries to a broader group of symmetries in multiagent reinforcement learning . Symmetries in multi agent reinforcement learning Recently , Hu et al . ( 2020 ) used knowledge of symmetries to improve zero-shot coordination in games which require symmetry-breaking . Here , we instead use symmetries in cooperative multi-agent systems to improve data efficiency by parameter sharing between different transformations of the global system . 3 BACKGROUND . In this section we introduce the necessary definitions and notation used in the rest of the paper . 3.1 MULTI-AGENT MDPS . We will start from the definition of Multi-Agent MDPs , a class of fully observable cooperative multi-agent systems . Full observability implies that each agent can execute the same centralized policy . Later on we will define a distributed variant of this type of decision making problem . Definition 1 A Multi-Agent Markov Decision Process ( MMDP ) ( Boutilier , 1996 ) is a tuple ( N , S , A , T , R ) where N is a set of m agents , S is the state space , A = A1 × · · · × Am is the joint action space of the MMDP , T : S ×A1 × · · · ×Am × S → [ 0 , 1 ] is the transition function , and R : S ×A1 × · · · ×Am → R is the immediate reward function . The goal of an MMDP , as in the single agent case , is to find a joint policy that maps states to probability distributions over joint actions , π : S → ∆ ( A ) , ( with ∆ ( A ) the space of such distributions ) to maximize the expected discounted return of the system , Rt = E [ ∑T k=0 γ krt+k+1 ] with γ ∈ [ 0 , 1 ] a discount factor . An MMDP can be viewed as a single-agent MDP where the agent takes joint actions . 3.2 GROUPS AND TRANSFORMATIONS . In this paper we will refer extensively to group symmetries . Here , we will briefly introduce these concepts and explain their significance to discussing equivalences of decision making problems . A group G is a set with a binary operator · that obeys the group axioms : identity , inverse , closure , and associativity . Consider as a running example the set of 90 degree rotations { 0◦ , 90◦ , 180◦ , 270◦ } , which we can write as rotation matrices : R ( θ ) = [ cos θ − sin θ sin θ cos θ ] ( 1 ) with θ ∈ { 0 , π2 , π , 3π 2 } . Composing any two matrices in this set results in another matrix in the set , meaning the set is closed under composition . For example , composing R ( π2 ) and R ( π ) results in another member of the set , in this case R ( 3π2 ) . Similarly , each member of the set has an inverse that is also in the set , and R ( 0 ) is an identity element . Since matrix multiplication is associative , the group axioms are satisfied and the set is a group under composition . A group action is a function G×X → X that satisfies ex = x ( where e is the identity element ) and ( g · h ) x = g · ( hx ) . For example , the group of 90 degree rotation matrices acts on vectors to rotate them . Similar to the action of this group on vectors , we can define an action of the same group on image space : e.g. , the NumPy ( Harris et al. , 2020 ) function np.rot90 acts on the set of images . We will consider group actions on the set of states represented as image observations . We match these with group actions on policies . Since we consider discrete action spaces , a group element g acting on a policy π will be represented as a matrix multiplication of the policy with a permutation matrix . When discussing symmetries in decision making problems , we identify sets of state-action pairs that are equivalent : if the state is transformed , the policy should be transformed as well , but potentially with a different representation of the transformation . See Figure 1 . We are interested in the case where the reward and transition functions are invariant in the orbit of state-action pairs under a symmetry group . The orbit of a point v ∈ V , with V a vector space , is the set of all its transformations ( e.g . all rotations of the point ) , defined as O ( v ) = { gv|∀g ∈ G } . The orbit of a point under a group forms an equivalence class . See Figure 2 for an example of an orbit of a traffic light state . 4 DISTRIBUTING SYMMETRIES OVER MULTIPLE AGENTS . Consider the cooperative traffic light control system in Figure 1 that contains transformationequivalent global state-action pairs . We first formalize global symmetries of the system similarly to symmetries in a single agent MDP . Then , we will discuss how we can formulate distributed symmetries in a distributed MMDP . Finally , we introduce Multi-Agent MDP Homomorphic Networks . 4.1 SYMMETRIES IN MMDPS . As a starting point , we define the notion of symmetries in an MMDP , similar to an MDP with symmetries ( van der Pol et al. , 2020 ) . Definition 2 An MMDP is an MMDP with symmetries if reward and transition functions are invariant under a transformation groupG . That is , the MMDP has symmetries if there is at least one non-trivial group G of transformations Lg : S → S and for every s , Ksg : A→ A such that R ( s , a ) = R ( Lg [ s ] , K s g [ a ] ) ∀g ∈ G , s ∈ S , a ∈ A , ( 2 ) T ( s , a , s′ ) = T ( Lg [ s ] , K s g [ a ] , Lg [ s ′ ] ) ∀g ∈ G , s , s′ ∈ S , a ∈ A . ( 3 ) If two state-action pairs s , a and Lg [ s ] , Ksg [ a ] obey Eq . 2 and 3 , then they are equivalent ( van der Pol et al. , 2020 ) . Consider as an example the symmetries in Figure 1 . These symmetries can result in correspondences across agents , for example when the observation of agent i is mapped by the symmetry to another agent j that is arbitrarily far away and with which there is no communication channel . In the next section , we will resolve this problem by defining distributed symmetries in terms of local observations and the communication graph defined by the state . If we have an MMDP with symmetries , that means that there are symmetric optimal policies , i.e . if the state of the MMDP transforms , the policy transforms accordingly . The above definition of an MMDP with symmetries is only applicable to the centralized setting . If we want to be able to execute policies in a distributed manner , we will need to enforce equivariance in a distributed manner . | This paper tries to exploit the global symmetries in the joint state-action space of cooperative multi-agent systems. To allow distributed execution using only local information, this paper introduces Multi-Agent MDP Homomorphic Networks that use a factorization of global symmetries into symmetries on local observations and local interactions. They further compare the proposed networks with non-equivariant distributed networks, and show that global equivariance improves data efficiency on two games. | SP:3c43729e80fb899feffa61b193cf0950ea2214f8 |
Multi-Agent MDP Homomorphic Networks | 1 INTRODUCTION Equivariant and geometric deep learning have gained traction in recent years , showing promising results in supervised learning ( Cohen & Welling , 2016 ; Winkels & Cohen , 2018 ; Weiler et al. , 2018 ; Weiler & Cesa , 2019 ; Worrall et al. , 2017 ; Fuchs et al. , 2020 ; Thomas et al. , 2018 ) , unsupervised learning ( Dey et al. , 2021 ) and reinforcement learning ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) . In single agent reinforcement learning , enforcing equivariance to group symmetries has been shown to improve data efficiency , for example with MDP homomorphic networks ( van der Pol et al. , 2020 ) , trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ) , or symmetric locomotion policies ( Abdolhosseini et al. , 2019 ) . Equivariant approaches enable a single agent to learn policies more efficiently within its environment by sharing weights between state-action pairs that are equivalent under a transformation . As a result of this weight sharing , the agent implicitly learns a policy in a reduced version of the MDP . We are interested in cooperative multi-agent reinforcement learning , where symmetries exist not only in the global environment , but also between individual agents in the larger multi-agent system . Existing work on symmetries in single agent reinforcement learning can only be generalized to the fully centralized multi-agent setting , because such approaches rely on the global symmetry in the full state-action spaces and these can result in correspondences across agents , as shown in Figure 1 . This means such approaches can not be used in distributed multi-agent systems with communication constraints . Here , we seek to be equivariant to global symmetries of cooperative multi-agent systems while still being able to execute policies in a distributed manner . Within deep multi-agent reinforcement learning , existing work has shown the potential of using permutation symmetries and invariance between agents ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sunehag et al. , 2017 ; Robbel et al. , 2016 ; Böhmer et al. , 2020 ; Sukhbaatar et al. , 2016 ; van der Pol & Oliehoek , 2016 ) . Such work takes an anonymity view of homogeneous agents , where only the agent ’ s observations , and not its identity , matter for the policy . Using permutation symmetries ensures extensive weight sharing between agents , resulting in improved data efficiency . In this work , we go beyond such permutation symmetries , and consider more general symmetries of global multi-agent systems , such as rotational symmetries . In this paper , we propose Multi-Agent MDP Homomorphic Networks , a class of distributed policy networks which are equivariant to global symmetries of the multi-agent system , as well as to standard permutation symmetries . Our contributions are as follows . ( i ) We propose a factorization of global symmetries in the joint state-action space of cooperative multi-agent systems . ( ii ) We introduce a multi-agent equivariant policy network based on this factorization . ( iii ) Our main contribution is an approach to cooperative multi-agent reinforcement learning that is globally equivariant while requiring only local agent computation and local communication between agents at execution time . We evaluate Multi-Agent MDP Homomorphic Networks on symmetric multi-agent problems and show improved data efficiency compared to non-equivariant baselines . 2 RELATED WORK . Symmetries in single agent reinforcement learning Symmetries in Markov Decision Processes have been formalized by Zinkevich & Balch ( 2001 ) ; Ravindran & Barto ( 2001 ) . Recent work on symmetries in single agent deep reinforcement learning has shown improvements in terms of data effiency . Such work revolves around symmetries in policy networks ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) , symmetric filters ( Clark & Storkey , 2014 ) , invariant data augmentation ( Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) or equivariant trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ; Mishra et al. , 2019 ) These approaches are only suitable for single agent problems or centralized multi-agent controllers . Here , we solve the problem of enforcing global equivariance while still allowing distributed execution . Graphs and permutation symmetries in multi agent reinforcement learning Graph-based methods in cooperative multiagent reinforcement learning are well-explored . Much work is based around coordination graphs ( Guestrin et al. , 2002b ; a ; Kok & Vlassis , 2006 ) , including approaches that approximate local Q-functions with neural networks and use max-plus to find a joint policy ( van der Pol & Oliehoek , 2016 ; Böhmer et al. , 2020 ) , and approaches that use graph-structured networks to find joint policies or value functions ( Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . In deep learning for multi-agent systems , the use of permutation symmetries is common , either through explicit formulations ( Sunehag et al. , 2017 ; Böhmer et al. , 2020 ) or through the use of graph or message passing networks ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . Policies in multi-agent systems with permutation symmetries between agents are also known as functionally homogeneous policies ( Zinkevich & Balch , 2001 ) or policies with agent anonymity ( Robbel et al. , 2016 ; Varakantham et al. , 2014 ) . Here , we move beyond permutation symmetries to a broader group of symmetries in multiagent reinforcement learning . Symmetries in multi agent reinforcement learning Recently , Hu et al . ( 2020 ) used knowledge of symmetries to improve zero-shot coordination in games which require symmetry-breaking . Here , we instead use symmetries in cooperative multi-agent systems to improve data efficiency by parameter sharing between different transformations of the global system . 3 BACKGROUND . In this section we introduce the necessary definitions and notation used in the rest of the paper . 3.1 MULTI-AGENT MDPS . We will start from the definition of Multi-Agent MDPs , a class of fully observable cooperative multi-agent systems . Full observability implies that each agent can execute the same centralized policy . Later on we will define a distributed variant of this type of decision making problem . Definition 1 A Multi-Agent Markov Decision Process ( MMDP ) ( Boutilier , 1996 ) is a tuple ( N , S , A , T , R ) where N is a set of m agents , S is the state space , A = A1 × · · · × Am is the joint action space of the MMDP , T : S ×A1 × · · · ×Am × S → [ 0 , 1 ] is the transition function , and R : S ×A1 × · · · ×Am → R is the immediate reward function . The goal of an MMDP , as in the single agent case , is to find a joint policy that maps states to probability distributions over joint actions , π : S → ∆ ( A ) , ( with ∆ ( A ) the space of such distributions ) to maximize the expected discounted return of the system , Rt = E [ ∑T k=0 γ krt+k+1 ] with γ ∈ [ 0 , 1 ] a discount factor . An MMDP can be viewed as a single-agent MDP where the agent takes joint actions . 3.2 GROUPS AND TRANSFORMATIONS . In this paper we will refer extensively to group symmetries . Here , we will briefly introduce these concepts and explain their significance to discussing equivalences of decision making problems . A group G is a set with a binary operator · that obeys the group axioms : identity , inverse , closure , and associativity . Consider as a running example the set of 90 degree rotations { 0◦ , 90◦ , 180◦ , 270◦ } , which we can write as rotation matrices : R ( θ ) = [ cos θ − sin θ sin θ cos θ ] ( 1 ) with θ ∈ { 0 , π2 , π , 3π 2 } . Composing any two matrices in this set results in another matrix in the set , meaning the set is closed under composition . For example , composing R ( π2 ) and R ( π ) results in another member of the set , in this case R ( 3π2 ) . Similarly , each member of the set has an inverse that is also in the set , and R ( 0 ) is an identity element . Since matrix multiplication is associative , the group axioms are satisfied and the set is a group under composition . A group action is a function G×X → X that satisfies ex = x ( where e is the identity element ) and ( g · h ) x = g · ( hx ) . For example , the group of 90 degree rotation matrices acts on vectors to rotate them . Similar to the action of this group on vectors , we can define an action of the same group on image space : e.g. , the NumPy ( Harris et al. , 2020 ) function np.rot90 acts on the set of images . We will consider group actions on the set of states represented as image observations . We match these with group actions on policies . Since we consider discrete action spaces , a group element g acting on a policy π will be represented as a matrix multiplication of the policy with a permutation matrix . When discussing symmetries in decision making problems , we identify sets of state-action pairs that are equivalent : if the state is transformed , the policy should be transformed as well , but potentially with a different representation of the transformation . See Figure 1 . We are interested in the case where the reward and transition functions are invariant in the orbit of state-action pairs under a symmetry group . The orbit of a point v ∈ V , with V a vector space , is the set of all its transformations ( e.g . all rotations of the point ) , defined as O ( v ) = { gv|∀g ∈ G } . The orbit of a point under a group forms an equivalence class . See Figure 2 for an example of an orbit of a traffic light state . 4 DISTRIBUTING SYMMETRIES OVER MULTIPLE AGENTS . Consider the cooperative traffic light control system in Figure 1 that contains transformationequivalent global state-action pairs . We first formalize global symmetries of the system similarly to symmetries in a single agent MDP . Then , we will discuss how we can formulate distributed symmetries in a distributed MMDP . Finally , we introduce Multi-Agent MDP Homomorphic Networks . 4.1 SYMMETRIES IN MMDPS . As a starting point , we define the notion of symmetries in an MMDP , similar to an MDP with symmetries ( van der Pol et al. , 2020 ) . Definition 2 An MMDP is an MMDP with symmetries if reward and transition functions are invariant under a transformation groupG . That is , the MMDP has symmetries if there is at least one non-trivial group G of transformations Lg : S → S and for every s , Ksg : A→ A such that R ( s , a ) = R ( Lg [ s ] , K s g [ a ] ) ∀g ∈ G , s ∈ S , a ∈ A , ( 2 ) T ( s , a , s′ ) = T ( Lg [ s ] , K s g [ a ] , Lg [ s ′ ] ) ∀g ∈ G , s , s′ ∈ S , a ∈ A . ( 3 ) If two state-action pairs s , a and Lg [ s ] , Ksg [ a ] obey Eq . 2 and 3 , then they are equivalent ( van der Pol et al. , 2020 ) . Consider as an example the symmetries in Figure 1 . These symmetries can result in correspondences across agents , for example when the observation of agent i is mapped by the symmetry to another agent j that is arbitrarily far away and with which there is no communication channel . In the next section , we will resolve this problem by defining distributed symmetries in terms of local observations and the communication graph defined by the state . If we have an MMDP with symmetries , that means that there are symmetric optimal policies , i.e . if the state of the MMDP transforms , the policy transforms accordingly . The above definition of an MMDP with symmetries is only applicable to the centralized setting . If we want to be able to execute policies in a distributed manner , we will need to enforce equivariance in a distributed manner . | The authors give a generalization of MDP Homomorphic Networks (van der Pol, 2020) to multi-agent distributed settings. This is not a special case of previous work as the agents are not assumed to be able to communicate freely. The symmetry constraints of the single-agent case generalize to the multi-agent case with the twist that the group action also induces a permutation of the agents. To create a neural network which matches this symmetry, the authors use a message-passing NN with equivariance constraints. The method shows improved sample efficiency relative to networks which are only permutation equivariant trained with and without augmentation. Only the discrete 90-degree rotation group is considered. | SP:3c43729e80fb899feffa61b193cf0950ea2214f8 |
Multi-Agent MDP Homomorphic Networks | 1 INTRODUCTION Equivariant and geometric deep learning have gained traction in recent years , showing promising results in supervised learning ( Cohen & Welling , 2016 ; Winkels & Cohen , 2018 ; Weiler et al. , 2018 ; Weiler & Cesa , 2019 ; Worrall et al. , 2017 ; Fuchs et al. , 2020 ; Thomas et al. , 2018 ) , unsupervised learning ( Dey et al. , 2021 ) and reinforcement learning ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) . In single agent reinforcement learning , enforcing equivariance to group symmetries has been shown to improve data efficiency , for example with MDP homomorphic networks ( van der Pol et al. , 2020 ) , trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ) , or symmetric locomotion policies ( Abdolhosseini et al. , 2019 ) . Equivariant approaches enable a single agent to learn policies more efficiently within its environment by sharing weights between state-action pairs that are equivalent under a transformation . As a result of this weight sharing , the agent implicitly learns a policy in a reduced version of the MDP . We are interested in cooperative multi-agent reinforcement learning , where symmetries exist not only in the global environment , but also between individual agents in the larger multi-agent system . Existing work on symmetries in single agent reinforcement learning can only be generalized to the fully centralized multi-agent setting , because such approaches rely on the global symmetry in the full state-action spaces and these can result in correspondences across agents , as shown in Figure 1 . This means such approaches can not be used in distributed multi-agent systems with communication constraints . Here , we seek to be equivariant to global symmetries of cooperative multi-agent systems while still being able to execute policies in a distributed manner . Within deep multi-agent reinforcement learning , existing work has shown the potential of using permutation symmetries and invariance between agents ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sunehag et al. , 2017 ; Robbel et al. , 2016 ; Böhmer et al. , 2020 ; Sukhbaatar et al. , 2016 ; van der Pol & Oliehoek , 2016 ) . Such work takes an anonymity view of homogeneous agents , where only the agent ’ s observations , and not its identity , matter for the policy . Using permutation symmetries ensures extensive weight sharing between agents , resulting in improved data efficiency . In this work , we go beyond such permutation symmetries , and consider more general symmetries of global multi-agent systems , such as rotational symmetries . In this paper , we propose Multi-Agent MDP Homomorphic Networks , a class of distributed policy networks which are equivariant to global symmetries of the multi-agent system , as well as to standard permutation symmetries . Our contributions are as follows . ( i ) We propose a factorization of global symmetries in the joint state-action space of cooperative multi-agent systems . ( ii ) We introduce a multi-agent equivariant policy network based on this factorization . ( iii ) Our main contribution is an approach to cooperative multi-agent reinforcement learning that is globally equivariant while requiring only local agent computation and local communication between agents at execution time . We evaluate Multi-Agent MDP Homomorphic Networks on symmetric multi-agent problems and show improved data efficiency compared to non-equivariant baselines . 2 RELATED WORK . Symmetries in single agent reinforcement learning Symmetries in Markov Decision Processes have been formalized by Zinkevich & Balch ( 2001 ) ; Ravindran & Barto ( 2001 ) . Recent work on symmetries in single agent deep reinforcement learning has shown improvements in terms of data effiency . Such work revolves around symmetries in policy networks ( van der Pol et al. , 2020 ; Simm et al. , 2020 ) , symmetric filters ( Clark & Storkey , 2014 ) , invariant data augmentation ( Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) or equivariant trajectory augmentation ( Lin et al. , 2020 ; Mavalankar , 2020 ; Mishra et al. , 2019 ) These approaches are only suitable for single agent problems or centralized multi-agent controllers . Here , we solve the problem of enforcing global equivariance while still allowing distributed execution . Graphs and permutation symmetries in multi agent reinforcement learning Graph-based methods in cooperative multiagent reinforcement learning are well-explored . Much work is based around coordination graphs ( Guestrin et al. , 2002b ; a ; Kok & Vlassis , 2006 ) , including approaches that approximate local Q-functions with neural networks and use max-plus to find a joint policy ( van der Pol & Oliehoek , 2016 ; Böhmer et al. , 2020 ) , and approaches that use graph-structured networks to find joint policies or value functions ( Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . In deep learning for multi-agent systems , the use of permutation symmetries is common , either through explicit formulations ( Sunehag et al. , 2017 ; Böhmer et al. , 2020 ) or through the use of graph or message passing networks ( Liu et al. , 2019 ; Jiang et al. , 2020 ; Sukhbaatar et al. , 2016 ) . Policies in multi-agent systems with permutation symmetries between agents are also known as functionally homogeneous policies ( Zinkevich & Balch , 2001 ) or policies with agent anonymity ( Robbel et al. , 2016 ; Varakantham et al. , 2014 ) . Here , we move beyond permutation symmetries to a broader group of symmetries in multiagent reinforcement learning . Symmetries in multi agent reinforcement learning Recently , Hu et al . ( 2020 ) used knowledge of symmetries to improve zero-shot coordination in games which require symmetry-breaking . Here , we instead use symmetries in cooperative multi-agent systems to improve data efficiency by parameter sharing between different transformations of the global system . 3 BACKGROUND . In this section we introduce the necessary definitions and notation used in the rest of the paper . 3.1 MULTI-AGENT MDPS . We will start from the definition of Multi-Agent MDPs , a class of fully observable cooperative multi-agent systems . Full observability implies that each agent can execute the same centralized policy . Later on we will define a distributed variant of this type of decision making problem . Definition 1 A Multi-Agent Markov Decision Process ( MMDP ) ( Boutilier , 1996 ) is a tuple ( N , S , A , T , R ) where N is a set of m agents , S is the state space , A = A1 × · · · × Am is the joint action space of the MMDP , T : S ×A1 × · · · ×Am × S → [ 0 , 1 ] is the transition function , and R : S ×A1 × · · · ×Am → R is the immediate reward function . The goal of an MMDP , as in the single agent case , is to find a joint policy that maps states to probability distributions over joint actions , π : S → ∆ ( A ) , ( with ∆ ( A ) the space of such distributions ) to maximize the expected discounted return of the system , Rt = E [ ∑T k=0 γ krt+k+1 ] with γ ∈ [ 0 , 1 ] a discount factor . An MMDP can be viewed as a single-agent MDP where the agent takes joint actions . 3.2 GROUPS AND TRANSFORMATIONS . In this paper we will refer extensively to group symmetries . Here , we will briefly introduce these concepts and explain their significance to discussing equivalences of decision making problems . A group G is a set with a binary operator · that obeys the group axioms : identity , inverse , closure , and associativity . Consider as a running example the set of 90 degree rotations { 0◦ , 90◦ , 180◦ , 270◦ } , which we can write as rotation matrices : R ( θ ) = [ cos θ − sin θ sin θ cos θ ] ( 1 ) with θ ∈ { 0 , π2 , π , 3π 2 } . Composing any two matrices in this set results in another matrix in the set , meaning the set is closed under composition . For example , composing R ( π2 ) and R ( π ) results in another member of the set , in this case R ( 3π2 ) . Similarly , each member of the set has an inverse that is also in the set , and R ( 0 ) is an identity element . Since matrix multiplication is associative , the group axioms are satisfied and the set is a group under composition . A group action is a function G×X → X that satisfies ex = x ( where e is the identity element ) and ( g · h ) x = g · ( hx ) . For example , the group of 90 degree rotation matrices acts on vectors to rotate them . Similar to the action of this group on vectors , we can define an action of the same group on image space : e.g. , the NumPy ( Harris et al. , 2020 ) function np.rot90 acts on the set of images . We will consider group actions on the set of states represented as image observations . We match these with group actions on policies . Since we consider discrete action spaces , a group element g acting on a policy π will be represented as a matrix multiplication of the policy with a permutation matrix . When discussing symmetries in decision making problems , we identify sets of state-action pairs that are equivalent : if the state is transformed , the policy should be transformed as well , but potentially with a different representation of the transformation . See Figure 1 . We are interested in the case where the reward and transition functions are invariant in the orbit of state-action pairs under a symmetry group . The orbit of a point v ∈ V , with V a vector space , is the set of all its transformations ( e.g . all rotations of the point ) , defined as O ( v ) = { gv|∀g ∈ G } . The orbit of a point under a group forms an equivalence class . See Figure 2 for an example of an orbit of a traffic light state . 4 DISTRIBUTING SYMMETRIES OVER MULTIPLE AGENTS . Consider the cooperative traffic light control system in Figure 1 that contains transformationequivalent global state-action pairs . We first formalize global symmetries of the system similarly to symmetries in a single agent MDP . Then , we will discuss how we can formulate distributed symmetries in a distributed MMDP . Finally , we introduce Multi-Agent MDP Homomorphic Networks . 4.1 SYMMETRIES IN MMDPS . As a starting point , we define the notion of symmetries in an MMDP , similar to an MDP with symmetries ( van der Pol et al. , 2020 ) . Definition 2 An MMDP is an MMDP with symmetries if reward and transition functions are invariant under a transformation groupG . That is , the MMDP has symmetries if there is at least one non-trivial group G of transformations Lg : S → S and for every s , Ksg : A→ A such that R ( s , a ) = R ( Lg [ s ] , K s g [ a ] ) ∀g ∈ G , s ∈ S , a ∈ A , ( 2 ) T ( s , a , s′ ) = T ( Lg [ s ] , K s g [ a ] , Lg [ s ′ ] ) ∀g ∈ G , s , s′ ∈ S , a ∈ A . ( 3 ) If two state-action pairs s , a and Lg [ s ] , Ksg [ a ] obey Eq . 2 and 3 , then they are equivalent ( van der Pol et al. , 2020 ) . Consider as an example the symmetries in Figure 1 . These symmetries can result in correspondences across agents , for example when the observation of agent i is mapped by the symmetry to another agent j that is arbitrarily far away and with which there is no communication channel . In the next section , we will resolve this problem by defining distributed symmetries in terms of local observations and the communication graph defined by the state . If we have an MMDP with symmetries , that means that there are symmetric optimal policies , i.e . if the state of the MMDP transforms , the policy transforms accordingly . The above definition of an MMDP with symmetries is only applicable to the centralized setting . If we want to be able to execute policies in a distributed manner , we will need to enforce equivariance in a distributed manner . | This work considers the symmetries properties in cooperative multi-agent systems. By decomposing global symmetries into local transformations, this work introduces a multi-agent equivariant policy network based on this factorization. Empirical results show that on symmetric multi-agent problems, distributed execution of globally symmetric policies improves data efficiency compared to non-equivariant baselines. | SP:3c43729e80fb899feffa61b193cf0950ea2214f8 |
Can standard training with clean images outperform adversarial one in robust accuracy? | 1 INTRODUCTION . The seminal work of ( Goodfellow et al. , 2015 ) pointed out a surprising weakness of modern deep neural networks : although they can perform on par with human beings , their reliability is far from satisfaction . Almost imperceptibly added perturbations will be enough to mislead the network to output a wrong class label with high confidence . It will dramatically undermine the deployment of networks in some safety-critical applications : autonomous driving , image-based ID verification , and medical image analysis . Since then , researchers have heavily investigated this risk exposure and proposed different defense strategies . One direction is some prepossessing techniques such as bit-depth reduction ( Xu et al. , 2018 ) , JPEG compression , total variance minimization , image quilting ( Guo et al. , 2018 ) , and Defense-GAN ( Samangouei et al. , 2018 ) . The idea is to mitigate the effect of added noise and save the network to some extent . Unfortunately , ( Athalye et al. , 2018 ) showed that most of these approaches are based on obfuscated gradients and can be defeated . The other line of research adopts various adversarial training techniques where malicious examples are generated and fed to the network . A simple rationale behind this is if the network has this knowledge , it will become wise in test time . While there are different mechanisms such as Mixup inference ( Pang et al. , 2020 ) , feature scattering ( Zhang & Wang , 2019 ) , feature denoising ( Xie et al. , 2019 ) , geometry-aware instance reweighting ( Zhang et al. , 2021 ) , and channel-wise activation suppressing ( Bai et al. , 2021 ) , they all share the same philosophy . While people are astonished by the fact that imperceptibly added perturbations can fool the network , some theoretical works such as ( Tsipras et al. , 2019 ; Schmidt et al. , 2018 ) showed that it is not entirely unexpected . Unfortunately , there are no solutions without the awareness of attack models . Ideally , all defenses should be ignorant of this . However , this knowledge is essential to the adversarial training method that remains most effective , although at the cost of a large computation load . Now the big question arises : “ Can standard training with clean images outperform adversarial one in robust accuracy ? ” Here “ clean images ” means there is no manipulation of inputs even by adding some random noise such as ( Jin & Rinard , 2020 ) , although it is for manifold regularization rather than adversarial training . At first glance , it seems hopeless , as a widely accepted principle in the adversarial learning community is that a network can be clever only if it has been exposed to deceptions before . However , on the other hand , the networks are supposed to generalize well after standard training . How can it perform so badly for adversarial attacks ? As a possible answer to this , ( Ilyas et al. , 2019 ) investigated the cause of adversarial examples and concluded that neural networks tend to exploit predictive yet brittle features to make classifications . These features are incomprehensible to humans and thus can be modified by adversarial attackers to mislead the networks , but ( Ilyas et al. , 2019 ) did not show how to teach the network to disregard these non-robust features and discover the robust ones to make final decisions . From this perspective , as it is difficult to tell the network to learn robust features , what if we add some hints in the loss function and let the network become robust in an implicit way ? More specifically , in addition to the classical cross-entropy loss , we use a feature smoothing term that encourages the features in an intermediate layer to be uniform , as shown in the left of Figure 1 . It sounds counterintuitive as this term will constrain the space of features that may lead to a wrong classification . However , due to the high capacity of networks , a very high standard accuracy can still be achieved with this additional term . When training completes , given an input , whether clean or crafted , extra perturbations can always be created by some added random noise followed by the promotion of feature smoothing at the cost of reduced accuracy . So long as these intentional perturbations overweight the adversary ’ s and the reduction in accuracy is affordable , the model will become robust . We call this procedure Active Defense , as shown in the right of Figure 1 . We find experimentally , a clean example from CIFAR10/CIFAR-100 can be perturbed with l∞ = 25/255 ∼ 32/255 , three to four times of l∞ = 8/255 usually adopted by an adversary , yet be classified with a high success rate . This fact sets up the adequate space for Active Defense for eliminating the effects of attacks . Our approach is independent of any attack models compared with other state-of-the-art methods , and its performance is much more stable under attacks with different budgets . The contributions of this work are summarized as follows : • We propose a novel training scheme with an extra feature smoothing loss term that only takes clean images as inputs , fundamentally different from all existing adversarial training methods that need supplementary crafted data . •We present Active Defense that adds the second round of perturbations through random noise and feature smoothing . It modifies the malicious examples in a way that is friendly to the network . This deviates from conventional passive ones that keep the input intact . 2 RELATED WORKS . Due to adversarial threats to deep learning applications , there are many works to improve the robustness . Most of them adopt adversarial training . Among them , only a few take care of the features in intermediate layers as listed in the following . Feature denoising in ( Xie et al. , 2019 ) found that small perturbations in pixel space can lead to very substantial noise in the feature maps of the network and proposed various filters to denoise . ( Zhang & Wang , 2019 ) proposed to generate adversarial images for training through feature scattering in the latent space . In essence , perturbed images are produced collaboratively via optimal transport distance minimization . ( Zhang & Wang , 2019 ) used the feature maps as a guide to making new examples . Compared with these two , we are trying to force the intermediate feature map to be uniform through an additional loss term within the standard training framework without any modification of the network as in ( Xie et al. , 2019 ) or any other manipulations of features as in ( Zhang & Wang , 2019 ) . Regarding Active Defense , we have not seen any similar work . Perhaps the most related one is ( Yang et al. , 2019 ) , which used sophisticated matrix completion techniques to reconstruct the random masked images . Our motivation is very different , as we try to exploit the deep network itself to enhance robustness without borrowing any third-party algorithms . 3 BACKGROUND . In the classification problem , given the training data set of image-label pairs D = { ( xi , yi ) } ni=1 where yi ∈ { 1 , 2 , ... , M } , the goal is to find an output probability vector F ( x ) of length M indexed by j , ideally such that y = argmaxjFj ( x ) . Of course , there is always a mismatch between these two terms . The key thing here is to find a suitable loss function such that the empirical risk minimization ( ERM ) of 1n n∑ i=1 L ( F ( xi ) , yi ) can be implemented with loss function L. Note that F ( xi ) is a vector , while yi is a scalar of the label , the very first thing is to transform yi into a vector through a vector function G ( yi ) . People usually adopt the one-hot coding H ( yi ) of length M with all elements being 0 except Hyi ( yi ) = 1 . The two probability distribution vectors F ( xi ) and H ( yi ) can be compared with cross-entropy . An adversary crafts an adversarial example xadv which is closest to x with ‖xadv − x‖p ≤ ε but misclassified as some other class . In this paper , we only consider attacks with p = ∞ . The most commonly used strategy is the iterative projected gradient descent method ( PGD ) xt+1adv = P ( x t adv + β × sign ( ∇xL ( xtadv , G ( y ) ) ) ) , ( 1 ) where β is the step size and P projects the generated example to the feasible region . Please note that L in adversarial attack may be different from L in training . People may choose traditional crossentropy loss with one-hot coding or CW loss ( Carlini & Wagner , 2017 ) to implement Equation 1 . Currently , a budget-aware step size-free variant of PGD has been proposed by ( Croce & Hein , 2020 ) , and since that , an ensemble of diverse parameter-free attacks called AutoAttack has become the de facto routine for robust accuracy evaluation . 4 METHOD . In general , our method is very simple . In training , for feature map F l of a particular layer l with W ×H × C , we use the loss L = Lce +max ( LF l , δ ) ( 2 ) LF l = 1 W ×H × C W∑ i=1 H∑ j=1 C∑ k=1 ∣∣F li , j , k −mean ( F l ) ∣∣ . ( 3 ) Here L has two terms . Lce is for cross-entropy loss , and LF l is our novel feature smoothing loss function . It is quite similar to the L1 norm of the particular feature cube and encourages the cube to be uniform . In order to avoid overfitting to the feature smoothing loss , we use max ( LF l , δ ) which disables the derivative of LF l when it drops below δ . In summary , we have two parameters , the feature layer l and the smoothing upper bound δ . Although this loss function sounds straightforward for our purpose to make the intermediate feature map smooth , there is a novel insight from the perspective of the trade-off between these two terms . In order to get low LF l , Lce will increase . In other words , after training , the network somehow understands that feature smoothing is not very annoying , and it only causes accuracy to drop to some extent . There is a huge implication in terms of robust accuracy . If we only use Lce , the network has no idea to deal with the crafted example except to be fooled . However , in our case , LF l gives us a dissipation channel of malicious perturbations that we can take via feature smoothing . Hopefully , this will remove most of the perturbations generated by an adversary , which we will elaborate on in our Active Defense design . The other concern may relate to the feature space constraints . Actually , due to the high capacity of networks , there is almost no difference in standard training accuracy between ours and cross-entropy loss . From the discussion above , our Active Defense is very intuitive . It consists of four steps depicted in the right of Figure 1 . In Step 1 , we add some random noise to an input which can somehow reduce the effect of adversarial disruptions ; more importantly , this will ensure sufficient iterations of feature smoothing . Otherwise , the attacker can bypass this and our Active Defense will fail . Steps 2 and 3 are just forward/backward passes related to LF l . In Step 4 , the noisy image get smoothed via gradient descent for LF l , and feeds into the network for another round of feature smoothing . The overall procedure of the proposed approach is in Algorithm 1 . There are only three parameters , i.e. , σ for uniform noise , β for the updating step size , and δ̃ for the upper bound of feature loss in test that is usually lower than δ for training in Equation 2 , as we pursue extra feature smoothing to deal with adversarial attacks . The updated example through Active Defense will feed into the network for final class decision . This algorithm can run a few times which we denoted as outerloop in the following sections . Algorithm 1 Active Defense Algorithm 1 : procedure ACTIVE DEFENSE ( t , LF l ) . t is a test example . 2 : t = t+ uniform ( −σ , σ ) . Step 1 , σ is the parameter of the uniform distribution . 3 : l = LF l ( t ) . Step 2 4 : while l > δ̃ do . δ̃ is the upper bound of feature loss in test . 5 : d = ∂l∂t . Step 3 6 : t = t− β × d . Step 4 , β is the step size . 7 : l = LF l ( t ) . Step 2 8 : end while 9 : return t 10 : end procedure | The paper introduces a new empirical defense against adversarial examples. The new defense is competitive to SOTA adversarial training based defenses, but does not use adversarial training. Specifically, the paper proposes adding an additional loss to the standard classification loss which “smoothens” the feature maps of a specific layer in the model. At test time, random noise is added to each input, then the input is smoothened out (in an attempt to remove the adversary), by minimizing the Smoothening loss introduced earlier with respect to the input. The introduced defense is rigorously evaluated using SOTA attacks and shows competitive robust accuracies to adversarially-trained models on CIFAR-10 and CIFAR-100. | SP:99bacc9ab953052f1f7c5a0e6a8c5e5d8b94d2bb |
Can standard training with clean images outperform adversarial one in robust accuracy? | 1 INTRODUCTION . The seminal work of ( Goodfellow et al. , 2015 ) pointed out a surprising weakness of modern deep neural networks : although they can perform on par with human beings , their reliability is far from satisfaction . Almost imperceptibly added perturbations will be enough to mislead the network to output a wrong class label with high confidence . It will dramatically undermine the deployment of networks in some safety-critical applications : autonomous driving , image-based ID verification , and medical image analysis . Since then , researchers have heavily investigated this risk exposure and proposed different defense strategies . One direction is some prepossessing techniques such as bit-depth reduction ( Xu et al. , 2018 ) , JPEG compression , total variance minimization , image quilting ( Guo et al. , 2018 ) , and Defense-GAN ( Samangouei et al. , 2018 ) . The idea is to mitigate the effect of added noise and save the network to some extent . Unfortunately , ( Athalye et al. , 2018 ) showed that most of these approaches are based on obfuscated gradients and can be defeated . The other line of research adopts various adversarial training techniques where malicious examples are generated and fed to the network . A simple rationale behind this is if the network has this knowledge , it will become wise in test time . While there are different mechanisms such as Mixup inference ( Pang et al. , 2020 ) , feature scattering ( Zhang & Wang , 2019 ) , feature denoising ( Xie et al. , 2019 ) , geometry-aware instance reweighting ( Zhang et al. , 2021 ) , and channel-wise activation suppressing ( Bai et al. , 2021 ) , they all share the same philosophy . While people are astonished by the fact that imperceptibly added perturbations can fool the network , some theoretical works such as ( Tsipras et al. , 2019 ; Schmidt et al. , 2018 ) showed that it is not entirely unexpected . Unfortunately , there are no solutions without the awareness of attack models . Ideally , all defenses should be ignorant of this . However , this knowledge is essential to the adversarial training method that remains most effective , although at the cost of a large computation load . Now the big question arises : “ Can standard training with clean images outperform adversarial one in robust accuracy ? ” Here “ clean images ” means there is no manipulation of inputs even by adding some random noise such as ( Jin & Rinard , 2020 ) , although it is for manifold regularization rather than adversarial training . At first glance , it seems hopeless , as a widely accepted principle in the adversarial learning community is that a network can be clever only if it has been exposed to deceptions before . However , on the other hand , the networks are supposed to generalize well after standard training . How can it perform so badly for adversarial attacks ? As a possible answer to this , ( Ilyas et al. , 2019 ) investigated the cause of adversarial examples and concluded that neural networks tend to exploit predictive yet brittle features to make classifications . These features are incomprehensible to humans and thus can be modified by adversarial attackers to mislead the networks , but ( Ilyas et al. , 2019 ) did not show how to teach the network to disregard these non-robust features and discover the robust ones to make final decisions . From this perspective , as it is difficult to tell the network to learn robust features , what if we add some hints in the loss function and let the network become robust in an implicit way ? More specifically , in addition to the classical cross-entropy loss , we use a feature smoothing term that encourages the features in an intermediate layer to be uniform , as shown in the left of Figure 1 . It sounds counterintuitive as this term will constrain the space of features that may lead to a wrong classification . However , due to the high capacity of networks , a very high standard accuracy can still be achieved with this additional term . When training completes , given an input , whether clean or crafted , extra perturbations can always be created by some added random noise followed by the promotion of feature smoothing at the cost of reduced accuracy . So long as these intentional perturbations overweight the adversary ’ s and the reduction in accuracy is affordable , the model will become robust . We call this procedure Active Defense , as shown in the right of Figure 1 . We find experimentally , a clean example from CIFAR10/CIFAR-100 can be perturbed with l∞ = 25/255 ∼ 32/255 , three to four times of l∞ = 8/255 usually adopted by an adversary , yet be classified with a high success rate . This fact sets up the adequate space for Active Defense for eliminating the effects of attacks . Our approach is independent of any attack models compared with other state-of-the-art methods , and its performance is much more stable under attacks with different budgets . The contributions of this work are summarized as follows : • We propose a novel training scheme with an extra feature smoothing loss term that only takes clean images as inputs , fundamentally different from all existing adversarial training methods that need supplementary crafted data . •We present Active Defense that adds the second round of perturbations through random noise and feature smoothing . It modifies the malicious examples in a way that is friendly to the network . This deviates from conventional passive ones that keep the input intact . 2 RELATED WORKS . Due to adversarial threats to deep learning applications , there are many works to improve the robustness . Most of them adopt adversarial training . Among them , only a few take care of the features in intermediate layers as listed in the following . Feature denoising in ( Xie et al. , 2019 ) found that small perturbations in pixel space can lead to very substantial noise in the feature maps of the network and proposed various filters to denoise . ( Zhang & Wang , 2019 ) proposed to generate adversarial images for training through feature scattering in the latent space . In essence , perturbed images are produced collaboratively via optimal transport distance minimization . ( Zhang & Wang , 2019 ) used the feature maps as a guide to making new examples . Compared with these two , we are trying to force the intermediate feature map to be uniform through an additional loss term within the standard training framework without any modification of the network as in ( Xie et al. , 2019 ) or any other manipulations of features as in ( Zhang & Wang , 2019 ) . Regarding Active Defense , we have not seen any similar work . Perhaps the most related one is ( Yang et al. , 2019 ) , which used sophisticated matrix completion techniques to reconstruct the random masked images . Our motivation is very different , as we try to exploit the deep network itself to enhance robustness without borrowing any third-party algorithms . 3 BACKGROUND . In the classification problem , given the training data set of image-label pairs D = { ( xi , yi ) } ni=1 where yi ∈ { 1 , 2 , ... , M } , the goal is to find an output probability vector F ( x ) of length M indexed by j , ideally such that y = argmaxjFj ( x ) . Of course , there is always a mismatch between these two terms . The key thing here is to find a suitable loss function such that the empirical risk minimization ( ERM ) of 1n n∑ i=1 L ( F ( xi ) , yi ) can be implemented with loss function L. Note that F ( xi ) is a vector , while yi is a scalar of the label , the very first thing is to transform yi into a vector through a vector function G ( yi ) . People usually adopt the one-hot coding H ( yi ) of length M with all elements being 0 except Hyi ( yi ) = 1 . The two probability distribution vectors F ( xi ) and H ( yi ) can be compared with cross-entropy . An adversary crafts an adversarial example xadv which is closest to x with ‖xadv − x‖p ≤ ε but misclassified as some other class . In this paper , we only consider attacks with p = ∞ . The most commonly used strategy is the iterative projected gradient descent method ( PGD ) xt+1adv = P ( x t adv + β × sign ( ∇xL ( xtadv , G ( y ) ) ) ) , ( 1 ) where β is the step size and P projects the generated example to the feasible region . Please note that L in adversarial attack may be different from L in training . People may choose traditional crossentropy loss with one-hot coding or CW loss ( Carlini & Wagner , 2017 ) to implement Equation 1 . Currently , a budget-aware step size-free variant of PGD has been proposed by ( Croce & Hein , 2020 ) , and since that , an ensemble of diverse parameter-free attacks called AutoAttack has become the de facto routine for robust accuracy evaluation . 4 METHOD . In general , our method is very simple . In training , for feature map F l of a particular layer l with W ×H × C , we use the loss L = Lce +max ( LF l , δ ) ( 2 ) LF l = 1 W ×H × C W∑ i=1 H∑ j=1 C∑ k=1 ∣∣F li , j , k −mean ( F l ) ∣∣ . ( 3 ) Here L has two terms . Lce is for cross-entropy loss , and LF l is our novel feature smoothing loss function . It is quite similar to the L1 norm of the particular feature cube and encourages the cube to be uniform . In order to avoid overfitting to the feature smoothing loss , we use max ( LF l , δ ) which disables the derivative of LF l when it drops below δ . In summary , we have two parameters , the feature layer l and the smoothing upper bound δ . Although this loss function sounds straightforward for our purpose to make the intermediate feature map smooth , there is a novel insight from the perspective of the trade-off between these two terms . In order to get low LF l , Lce will increase . In other words , after training , the network somehow understands that feature smoothing is not very annoying , and it only causes accuracy to drop to some extent . There is a huge implication in terms of robust accuracy . If we only use Lce , the network has no idea to deal with the crafted example except to be fooled . However , in our case , LF l gives us a dissipation channel of malicious perturbations that we can take via feature smoothing . Hopefully , this will remove most of the perturbations generated by an adversary , which we will elaborate on in our Active Defense design . The other concern may relate to the feature space constraints . Actually , due to the high capacity of networks , there is almost no difference in standard training accuracy between ours and cross-entropy loss . From the discussion above , our Active Defense is very intuitive . It consists of four steps depicted in the right of Figure 1 . In Step 1 , we add some random noise to an input which can somehow reduce the effect of adversarial disruptions ; more importantly , this will ensure sufficient iterations of feature smoothing . Otherwise , the attacker can bypass this and our Active Defense will fail . Steps 2 and 3 are just forward/backward passes related to LF l . In Step 4 , the noisy image get smoothed via gradient descent for LF l , and feeds into the network for another round of feature smoothing . The overall procedure of the proposed approach is in Algorithm 1 . There are only three parameters , i.e. , σ for uniform noise , β for the updating step size , and δ̃ for the upper bound of feature loss in test that is usually lower than δ for training in Equation 2 , as we pursue extra feature smoothing to deal with adversarial attacks . The updated example through Active Defense will feed into the network for final class decision . This algorithm can run a few times which we denoted as outerloop in the following sections . Algorithm 1 Active Defense Algorithm 1 : procedure ACTIVE DEFENSE ( t , LF l ) . t is a test example . 2 : t = t+ uniform ( −σ , σ ) . Step 1 , σ is the parameter of the uniform distribution . 3 : l = LF l ( t ) . Step 2 4 : while l > δ̃ do . δ̃ is the upper bound of feature loss in test . 5 : d = ∂l∂t . Step 3 6 : t = t− β × d . Step 4 , β is the step size . 7 : l = LF l ( t ) . Step 2 8 : end while 9 : return t 10 : end procedure | This paper proposes a defense against adversarial attacks that does not involve using attacks in the defense process. The defense consists of two parts: first, a feature smoothing loss is added to the main objective function during training. Then, when defending against attacks, noise is added to the input followed by additional perturbations to the input designed to decrease the feature smoothing loss. The proposed method achieves favorable accuracies relative to baseline defenses. | SP:99bacc9ab953052f1f7c5a0e6a8c5e5d8b94d2bb |
Can standard training with clean images outperform adversarial one in robust accuracy? | 1 INTRODUCTION . The seminal work of ( Goodfellow et al. , 2015 ) pointed out a surprising weakness of modern deep neural networks : although they can perform on par with human beings , their reliability is far from satisfaction . Almost imperceptibly added perturbations will be enough to mislead the network to output a wrong class label with high confidence . It will dramatically undermine the deployment of networks in some safety-critical applications : autonomous driving , image-based ID verification , and medical image analysis . Since then , researchers have heavily investigated this risk exposure and proposed different defense strategies . One direction is some prepossessing techniques such as bit-depth reduction ( Xu et al. , 2018 ) , JPEG compression , total variance minimization , image quilting ( Guo et al. , 2018 ) , and Defense-GAN ( Samangouei et al. , 2018 ) . The idea is to mitigate the effect of added noise and save the network to some extent . Unfortunately , ( Athalye et al. , 2018 ) showed that most of these approaches are based on obfuscated gradients and can be defeated . The other line of research adopts various adversarial training techniques where malicious examples are generated and fed to the network . A simple rationale behind this is if the network has this knowledge , it will become wise in test time . While there are different mechanisms such as Mixup inference ( Pang et al. , 2020 ) , feature scattering ( Zhang & Wang , 2019 ) , feature denoising ( Xie et al. , 2019 ) , geometry-aware instance reweighting ( Zhang et al. , 2021 ) , and channel-wise activation suppressing ( Bai et al. , 2021 ) , they all share the same philosophy . While people are astonished by the fact that imperceptibly added perturbations can fool the network , some theoretical works such as ( Tsipras et al. , 2019 ; Schmidt et al. , 2018 ) showed that it is not entirely unexpected . Unfortunately , there are no solutions without the awareness of attack models . Ideally , all defenses should be ignorant of this . However , this knowledge is essential to the adversarial training method that remains most effective , although at the cost of a large computation load . Now the big question arises : “ Can standard training with clean images outperform adversarial one in robust accuracy ? ” Here “ clean images ” means there is no manipulation of inputs even by adding some random noise such as ( Jin & Rinard , 2020 ) , although it is for manifold regularization rather than adversarial training . At first glance , it seems hopeless , as a widely accepted principle in the adversarial learning community is that a network can be clever only if it has been exposed to deceptions before . However , on the other hand , the networks are supposed to generalize well after standard training . How can it perform so badly for adversarial attacks ? As a possible answer to this , ( Ilyas et al. , 2019 ) investigated the cause of adversarial examples and concluded that neural networks tend to exploit predictive yet brittle features to make classifications . These features are incomprehensible to humans and thus can be modified by adversarial attackers to mislead the networks , but ( Ilyas et al. , 2019 ) did not show how to teach the network to disregard these non-robust features and discover the robust ones to make final decisions . From this perspective , as it is difficult to tell the network to learn robust features , what if we add some hints in the loss function and let the network become robust in an implicit way ? More specifically , in addition to the classical cross-entropy loss , we use a feature smoothing term that encourages the features in an intermediate layer to be uniform , as shown in the left of Figure 1 . It sounds counterintuitive as this term will constrain the space of features that may lead to a wrong classification . However , due to the high capacity of networks , a very high standard accuracy can still be achieved with this additional term . When training completes , given an input , whether clean or crafted , extra perturbations can always be created by some added random noise followed by the promotion of feature smoothing at the cost of reduced accuracy . So long as these intentional perturbations overweight the adversary ’ s and the reduction in accuracy is affordable , the model will become robust . We call this procedure Active Defense , as shown in the right of Figure 1 . We find experimentally , a clean example from CIFAR10/CIFAR-100 can be perturbed with l∞ = 25/255 ∼ 32/255 , three to four times of l∞ = 8/255 usually adopted by an adversary , yet be classified with a high success rate . This fact sets up the adequate space for Active Defense for eliminating the effects of attacks . Our approach is independent of any attack models compared with other state-of-the-art methods , and its performance is much more stable under attacks with different budgets . The contributions of this work are summarized as follows : • We propose a novel training scheme with an extra feature smoothing loss term that only takes clean images as inputs , fundamentally different from all existing adversarial training methods that need supplementary crafted data . •We present Active Defense that adds the second round of perturbations through random noise and feature smoothing . It modifies the malicious examples in a way that is friendly to the network . This deviates from conventional passive ones that keep the input intact . 2 RELATED WORKS . Due to adversarial threats to deep learning applications , there are many works to improve the robustness . Most of them adopt adversarial training . Among them , only a few take care of the features in intermediate layers as listed in the following . Feature denoising in ( Xie et al. , 2019 ) found that small perturbations in pixel space can lead to very substantial noise in the feature maps of the network and proposed various filters to denoise . ( Zhang & Wang , 2019 ) proposed to generate adversarial images for training through feature scattering in the latent space . In essence , perturbed images are produced collaboratively via optimal transport distance minimization . ( Zhang & Wang , 2019 ) used the feature maps as a guide to making new examples . Compared with these two , we are trying to force the intermediate feature map to be uniform through an additional loss term within the standard training framework without any modification of the network as in ( Xie et al. , 2019 ) or any other manipulations of features as in ( Zhang & Wang , 2019 ) . Regarding Active Defense , we have not seen any similar work . Perhaps the most related one is ( Yang et al. , 2019 ) , which used sophisticated matrix completion techniques to reconstruct the random masked images . Our motivation is very different , as we try to exploit the deep network itself to enhance robustness without borrowing any third-party algorithms . 3 BACKGROUND . In the classification problem , given the training data set of image-label pairs D = { ( xi , yi ) } ni=1 where yi ∈ { 1 , 2 , ... , M } , the goal is to find an output probability vector F ( x ) of length M indexed by j , ideally such that y = argmaxjFj ( x ) . Of course , there is always a mismatch between these two terms . The key thing here is to find a suitable loss function such that the empirical risk minimization ( ERM ) of 1n n∑ i=1 L ( F ( xi ) , yi ) can be implemented with loss function L. Note that F ( xi ) is a vector , while yi is a scalar of the label , the very first thing is to transform yi into a vector through a vector function G ( yi ) . People usually adopt the one-hot coding H ( yi ) of length M with all elements being 0 except Hyi ( yi ) = 1 . The two probability distribution vectors F ( xi ) and H ( yi ) can be compared with cross-entropy . An adversary crafts an adversarial example xadv which is closest to x with ‖xadv − x‖p ≤ ε but misclassified as some other class . In this paper , we only consider attacks with p = ∞ . The most commonly used strategy is the iterative projected gradient descent method ( PGD ) xt+1adv = P ( x t adv + β × sign ( ∇xL ( xtadv , G ( y ) ) ) ) , ( 1 ) where β is the step size and P projects the generated example to the feasible region . Please note that L in adversarial attack may be different from L in training . People may choose traditional crossentropy loss with one-hot coding or CW loss ( Carlini & Wagner , 2017 ) to implement Equation 1 . Currently , a budget-aware step size-free variant of PGD has been proposed by ( Croce & Hein , 2020 ) , and since that , an ensemble of diverse parameter-free attacks called AutoAttack has become the de facto routine for robust accuracy evaluation . 4 METHOD . In general , our method is very simple . In training , for feature map F l of a particular layer l with W ×H × C , we use the loss L = Lce +max ( LF l , δ ) ( 2 ) LF l = 1 W ×H × C W∑ i=1 H∑ j=1 C∑ k=1 ∣∣F li , j , k −mean ( F l ) ∣∣ . ( 3 ) Here L has two terms . Lce is for cross-entropy loss , and LF l is our novel feature smoothing loss function . It is quite similar to the L1 norm of the particular feature cube and encourages the cube to be uniform . In order to avoid overfitting to the feature smoothing loss , we use max ( LF l , δ ) which disables the derivative of LF l when it drops below δ . In summary , we have two parameters , the feature layer l and the smoothing upper bound δ . Although this loss function sounds straightforward for our purpose to make the intermediate feature map smooth , there is a novel insight from the perspective of the trade-off between these two terms . In order to get low LF l , Lce will increase . In other words , after training , the network somehow understands that feature smoothing is not very annoying , and it only causes accuracy to drop to some extent . There is a huge implication in terms of robust accuracy . If we only use Lce , the network has no idea to deal with the crafted example except to be fooled . However , in our case , LF l gives us a dissipation channel of malicious perturbations that we can take via feature smoothing . Hopefully , this will remove most of the perturbations generated by an adversary , which we will elaborate on in our Active Defense design . The other concern may relate to the feature space constraints . Actually , due to the high capacity of networks , there is almost no difference in standard training accuracy between ours and cross-entropy loss . From the discussion above , our Active Defense is very intuitive . It consists of four steps depicted in the right of Figure 1 . In Step 1 , we add some random noise to an input which can somehow reduce the effect of adversarial disruptions ; more importantly , this will ensure sufficient iterations of feature smoothing . Otherwise , the attacker can bypass this and our Active Defense will fail . Steps 2 and 3 are just forward/backward passes related to LF l . In Step 4 , the noisy image get smoothed via gradient descent for LF l , and feeds into the network for another round of feature smoothing . The overall procedure of the proposed approach is in Algorithm 1 . There are only three parameters , i.e. , σ for uniform noise , β for the updating step size , and δ̃ for the upper bound of feature loss in test that is usually lower than δ for training in Equation 2 , as we pursue extra feature smoothing to deal with adversarial attacks . The updated example through Active Defense will feed into the network for final class decision . This algorithm can run a few times which we denoted as outerloop in the following sections . Algorithm 1 Active Defense Algorithm 1 : procedure ACTIVE DEFENSE ( t , LF l ) . t is a test example . 2 : t = t+ uniform ( −σ , σ ) . Step 1 , σ is the parameter of the uniform distribution . 3 : l = LF l ( t ) . Step 2 4 : while l > δ̃ do . δ̃ is the upper bound of feature loss in test . 5 : d = ∂l∂t . Step 3 6 : t = t− β × d . Step 4 , β is the step size . 7 : l = LF l ( t ) . Step 2 8 : end while 9 : return t 10 : end procedure | This paper aims to provide an approach to train a robust model, where the model is trained without adversarial examples. To this end, the authors introduce an inference-time defense strategy. However, this idea is not novel. Moreover, the inference-time defense strategy may give false robustness. | SP:99bacc9ab953052f1f7c5a0e6a8c5e5d8b94d2bb |
Curriculum Learning: A Regularization Method for Efficient and Stable Billion-Scale GPT Model Pre-Training | Recent works have demonstrated great success in training high-capacity autoregressive language models ( GPT , GPT-2 , GPT-3 ) on a huge amount of unlabeled text corpus for text generation . Despite showing great results , autoregressive models are facing a growing training instability issue . Our study on GPT-2 models ( 117M and 1.5B parameters ) show that larger model sizes , sequence lengths , batch sizes , and learning rates would lead to lower training stability and increasing divergence risks . To avoid divergence and achieve better generalization performance , one has to train with smaller batch sizes and learning rates , which leads to worse training efficiency and longer training time . To overcome this stability-efficiency dilemma , we present a study of a curriculum learning-based approach , which improves the pre-training convergence speed of autoregressive models . More importantly , we find that curriculum learning , as a regularization method , exerts a gradient variance reduction effect and enables to train autoregressive models with much larger batch sizes and learning rates without training instability , further improving the training speed . Our evaluations demonstrate that curriculum learning enables training GPT-2 models with 8x larger batch size and 4x larger learning rate , whereas the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . 1 INTRODUCTION . Large-scale Transformer-based language models have powered breakthroughs in many natural language processing tasks ( Vaswani et al. , 2017 ) . These models contain up to billion-scale parameters and are trained on massive open-domain web text corpus with unsupervised learning . Among them , one of the most successful cases is the GPT family : from GPT ( 110M parameters ) ( Radford et al. , 2018a ) , to GPT-2 ( 1.5B parameters ) ( Radford et al. , 2018b ) , and to GPT-3 with 175B parameters ( Brown et al. , 2020 ) that hit record high accuracy for many NLP tasks . Recent studies ( Kaplan et al. , 2020 ) show that these models continue to achieve better accuracy as their sizes increase ( together with richer training data ) , indicating the model size will continue growing in the future . Despite achieving remarkable model accuracy , training these models raise huge challenges on training efficiency and instability . On one hand , training large models require a huge amount of computation . As an example , it requires approximately 9.2 days on 512 V100 GPUs to train a 8.3B GPT-2 ( Shoeybi et al. , 2019 ) , and 14.8 days on 10000 V100 GPUs to train a 175B GPT-3 ( Patterson et al. , 2021 ) . To reduce the training wall clock time of these large models , one of the most common solutions is to employ distributed training with hundreds or even thousands of GPUs across multiple machines such that the model can process the training data with much higher throughput . Meanwhile , to avoid the huge overhead incurred by cross-GPU/node communication in distributed training , practitioners increase the batch sizes in the optimization algorithm to increase the computation-communication ratio , to improve training efficiency and reduce training wall clock time . Despite increased training throughput and efficiency , increasing the batch size is not always the panacea , as it often leads to training instability during pre-training GPT models — training would diverge or recover from divergence but overall lead to slow/worse convergence . We conduct a thorough study of the GPT-2 pre-training task ( Radford et al. , 2018b ; Shoeybi et al. , 2019 ) with different batch sizes , models sizes , sequence lengths , and learning rates . We find that larger batch sizes and longer sequence lengths reduce training stability and increase divergence risk , especially when combined with larger model sizes and learning rate . This often leads to slower and worse convergence that hurts final generalization performance . To achieve stable training and avoid suboptimal generalization performance , common practice often resorts to using smaller batch sizes and learning rates , which would adversely affect training efficiency . In this work , we explore a curriculum learning-based approach to address the above training efficiencystability dilemma . Curriculum learning ( CL ) was proposed to improve training convergence speed by presenting easier/simpler examples earlier during training and gradually increasing the sample difficulties ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . CL was explored and verified for NLP one-stage and fine-tuning tasks ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ; Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) , but its application to pre-training GPT models is not well studied . We find that curriculum learning , as expected , could improve the convergence speed under the same training hyperparameters . More importantly , we find that curriculum learning , as a regularization method , can enable stable and efficient training with much larger batch sizes and learning rates than existing baseline approaches . Our analysis shows that one reason for curriculum learning ’ s better training stability lies in its gradient variance reduction effect : Although the gradient variance is generally reduced under larger batch size , the largest variance on certain dimensions ( i.e. , the outliers ) is increased and it reaches extreme values when training divergence happens . Using Adam optimizer ’ s variance term , we observe that curriculum learning helps reduce both the norm of this variance and the maximum variance outliers . This variance reduction effect helps curriculum learning to achieve stable large-batch training without hurting the token-wise convergence speed and final generalization performance . We implement curriculum learning using sequence length as a primary difficulty metric and apply it to the GPT-2 pre-training with up to 1.5B parameters . Evaluations show that curriculum learning enables stable and efficient training with 8x larger batch size and 4x larger learning rate , where the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . We make the following contributions : i ) We conduct an extensive study of the GPT-2 pre-training task , which provides detailed insights about the training stability-efficiency dilemma that motivate our work ( Section 3 ) . ii ) We present an implementation of curriculum learning based on sequence length for GPT-2 model ( and autoregressive model in general ) , which is both efficient and easy to integrate ( Section 4 ) . iii ) We conduct large-scale experiments to demonstrate the proposed work ’ s ability to provide superior training stability and efficiency at the same time . To the best of our knowledge , we are the first work to demonstrate the benefit of curriculum learning as a regularization method that improves training stability ( Section 5 ) . iv ) The curriculum learning implementation as well as the necessary changes to the GPT-2 pre-training framework has been open sourced in a deep learning optimization library ( name hidden to maintain anonymity ) . 2 BACKGROUND AND RELATED WORK . Language model pre-training The accuracy of transformer-based language models grows substantially with its model size ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) . Today , a large language model such as GPT-3 ( Brown et al. , 2020 ) contains up to 175B parameters , and recent studies show that model accuracy can continue to improve with even larger model sizes ( Kaplan et al. , 2020 ) . However , training these large models often incurs excessively long training time and training difficulties ( Brown et al. , 2020 ) . Therefore , there are a lot of demands of performing efficient and stable training for large-scale LMs . To have the pre-training finished in a reasonable amount of time , the most common way is to leverage data parallelism to train models on multiple GPUs . However , the speedup gains often saturate beyond a few tens of GPUs , because communication becomes the major bottleneck , i.e. , the workers will spend more time communicating gradients than computing them , as the number of GPUs increases . To mitigate this bottleneck , recent works such as 1-bit Adam ( Tang et al. , 2021 ) have studied gradient compression and demonstrate their effectiveness against auto-encoding models such as BERT ( Devlin et al. , 2019 ) . An alternative approach to alleviate these overheads is to use large batch sizes . For example , LAMB ( You et al. , 2020 ) and 1-bit LAMB ( Li et al. , 2021 ) enable stable and efficient distributed BERT pre-training with batch size up to 64K/32K ( for sequence length 128/512 , i.e. , 8M/16M tokens per batch ) while maintaining the sample-wise convergence speed . For encoder-decoder models such as T5 , Raffel et al . ( 2020 ) use batch size up to 2K ( for sequence length 512 , i.e. , 1M tokens per batch ) . For autoregressive models such as the GPT family ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) , existing works use batch size up to 1.6K ( for sequence length 2K , i.e , 3.2M tokens per batch ) . Despite the benefit of reduced communication overhead , large-batch training is sensitive to hyperparameters and often leads to issues such as slow convergence , training instabilities , and model divergence ( You et al. , 2020 ; Li et al. , 2021 ) . Curriculum learning Inspired by how humans and animals are trained , curriculum learning aims to improve machine learning model training convergence speed by presenting easier ( or less complex ) examples earlier during training ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . Previous studies have demonstrated the benefit of faster convergence speed by curriculum learning in many domains such as natural language processing , computer vision , and neural evolutionary computing . In this section we will discuss recent related works in the natural language processing area . For a more complete literature review , we recommend these recent survey papers ( Wang et al. , 2020 ; Soviany et al. , 2021 ) . In the natural language processing area , most of the curriculum learning works focus on small-scale one-stage tasks and downstream fine-tuning tasks , such as neural machine translation ( NMT ) ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ) and natural language understanding ( NLU ) ( Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) . These works show that curriculum learning can improve convergence speed , reduce training time , and improve accuracy . In these works , the curriculum difficulty metrics for each training sample are usually defined as the sentence length , vocabulary frequency , the inference loss on smaller/cheaper models , or based on self-paced learning ( Kumar et al. , 2010 ) . For the pacing function ( i.e. , to decide the curriculum difficulty range when sampling next training data batch ) , these works usually use fixed predefined functions ( e.g. , gradually increase difficulty upper bound by linear , root , and exponential functions ) , bucketing heuristics ( group data with similar difficulties , and sample from a subset of buckets every time ) , or based on self-paced learning . Only a few works explore curriculum learning for language model pre-training . Press et al . ( 2020 ) apply curriculum learning to neural language modeling pre-training , specifically a transformer model with 247M parameters ( Baevski & Auli , 2018 ) . They find that by adding an additional first training stage with a shorter sequence length , it is possible to achieve the same dev . set perplexity with shorter total training time . Zhang et al . ( 2021 ) apply curriculum learning to BERT-base pre-training , a transformer model with 110M parameters . They find that by grouping sequences with similar length and with curriculum learning , it is possible to achieve similar downstream task accuracy with shorter pre-training time . Campos ( 2021 ) apply curriculum learning to ELMo pre-training , a bi-directional LSTM model with 93.6M parameters ( Peters et al. , 2018 ) . They test a variety of curricula on the WikiText-2 and WikiText-103 but do not find strong evidence that the use of curriculum learning can improve language model pre-training . | This paper focuses on the pretraining of large language models. They address the issue of instability by proposing curriculum learning. They say that curriculum learning enables training with 8x larger batch size and 4x larger learning rate. This reduces number of tokens and wall clock time by the order of magnitude of 2x. | SP:c812d0de17457207c1ec2130ef1a7cdf85d0c3e6 |
Curriculum Learning: A Regularization Method for Efficient and Stable Billion-Scale GPT Model Pre-Training | Recent works have demonstrated great success in training high-capacity autoregressive language models ( GPT , GPT-2 , GPT-3 ) on a huge amount of unlabeled text corpus for text generation . Despite showing great results , autoregressive models are facing a growing training instability issue . Our study on GPT-2 models ( 117M and 1.5B parameters ) show that larger model sizes , sequence lengths , batch sizes , and learning rates would lead to lower training stability and increasing divergence risks . To avoid divergence and achieve better generalization performance , one has to train with smaller batch sizes and learning rates , which leads to worse training efficiency and longer training time . To overcome this stability-efficiency dilemma , we present a study of a curriculum learning-based approach , which improves the pre-training convergence speed of autoregressive models . More importantly , we find that curriculum learning , as a regularization method , exerts a gradient variance reduction effect and enables to train autoregressive models with much larger batch sizes and learning rates without training instability , further improving the training speed . Our evaluations demonstrate that curriculum learning enables training GPT-2 models with 8x larger batch size and 4x larger learning rate , whereas the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . 1 INTRODUCTION . Large-scale Transformer-based language models have powered breakthroughs in many natural language processing tasks ( Vaswani et al. , 2017 ) . These models contain up to billion-scale parameters and are trained on massive open-domain web text corpus with unsupervised learning . Among them , one of the most successful cases is the GPT family : from GPT ( 110M parameters ) ( Radford et al. , 2018a ) , to GPT-2 ( 1.5B parameters ) ( Radford et al. , 2018b ) , and to GPT-3 with 175B parameters ( Brown et al. , 2020 ) that hit record high accuracy for many NLP tasks . Recent studies ( Kaplan et al. , 2020 ) show that these models continue to achieve better accuracy as their sizes increase ( together with richer training data ) , indicating the model size will continue growing in the future . Despite achieving remarkable model accuracy , training these models raise huge challenges on training efficiency and instability . On one hand , training large models require a huge amount of computation . As an example , it requires approximately 9.2 days on 512 V100 GPUs to train a 8.3B GPT-2 ( Shoeybi et al. , 2019 ) , and 14.8 days on 10000 V100 GPUs to train a 175B GPT-3 ( Patterson et al. , 2021 ) . To reduce the training wall clock time of these large models , one of the most common solutions is to employ distributed training with hundreds or even thousands of GPUs across multiple machines such that the model can process the training data with much higher throughput . Meanwhile , to avoid the huge overhead incurred by cross-GPU/node communication in distributed training , practitioners increase the batch sizes in the optimization algorithm to increase the computation-communication ratio , to improve training efficiency and reduce training wall clock time . Despite increased training throughput and efficiency , increasing the batch size is not always the panacea , as it often leads to training instability during pre-training GPT models — training would diverge or recover from divergence but overall lead to slow/worse convergence . We conduct a thorough study of the GPT-2 pre-training task ( Radford et al. , 2018b ; Shoeybi et al. , 2019 ) with different batch sizes , models sizes , sequence lengths , and learning rates . We find that larger batch sizes and longer sequence lengths reduce training stability and increase divergence risk , especially when combined with larger model sizes and learning rate . This often leads to slower and worse convergence that hurts final generalization performance . To achieve stable training and avoid suboptimal generalization performance , common practice often resorts to using smaller batch sizes and learning rates , which would adversely affect training efficiency . In this work , we explore a curriculum learning-based approach to address the above training efficiencystability dilemma . Curriculum learning ( CL ) was proposed to improve training convergence speed by presenting easier/simpler examples earlier during training and gradually increasing the sample difficulties ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . CL was explored and verified for NLP one-stage and fine-tuning tasks ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ; Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) , but its application to pre-training GPT models is not well studied . We find that curriculum learning , as expected , could improve the convergence speed under the same training hyperparameters . More importantly , we find that curriculum learning , as a regularization method , can enable stable and efficient training with much larger batch sizes and learning rates than existing baseline approaches . Our analysis shows that one reason for curriculum learning ’ s better training stability lies in its gradient variance reduction effect : Although the gradient variance is generally reduced under larger batch size , the largest variance on certain dimensions ( i.e. , the outliers ) is increased and it reaches extreme values when training divergence happens . Using Adam optimizer ’ s variance term , we observe that curriculum learning helps reduce both the norm of this variance and the maximum variance outliers . This variance reduction effect helps curriculum learning to achieve stable large-batch training without hurting the token-wise convergence speed and final generalization performance . We implement curriculum learning using sequence length as a primary difficulty metric and apply it to the GPT-2 pre-training with up to 1.5B parameters . Evaluations show that curriculum learning enables stable and efficient training with 8x larger batch size and 4x larger learning rate , where the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . We make the following contributions : i ) We conduct an extensive study of the GPT-2 pre-training task , which provides detailed insights about the training stability-efficiency dilemma that motivate our work ( Section 3 ) . ii ) We present an implementation of curriculum learning based on sequence length for GPT-2 model ( and autoregressive model in general ) , which is both efficient and easy to integrate ( Section 4 ) . iii ) We conduct large-scale experiments to demonstrate the proposed work ’ s ability to provide superior training stability and efficiency at the same time . To the best of our knowledge , we are the first work to demonstrate the benefit of curriculum learning as a regularization method that improves training stability ( Section 5 ) . iv ) The curriculum learning implementation as well as the necessary changes to the GPT-2 pre-training framework has been open sourced in a deep learning optimization library ( name hidden to maintain anonymity ) . 2 BACKGROUND AND RELATED WORK . Language model pre-training The accuracy of transformer-based language models grows substantially with its model size ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) . Today , a large language model such as GPT-3 ( Brown et al. , 2020 ) contains up to 175B parameters , and recent studies show that model accuracy can continue to improve with even larger model sizes ( Kaplan et al. , 2020 ) . However , training these large models often incurs excessively long training time and training difficulties ( Brown et al. , 2020 ) . Therefore , there are a lot of demands of performing efficient and stable training for large-scale LMs . To have the pre-training finished in a reasonable amount of time , the most common way is to leverage data parallelism to train models on multiple GPUs . However , the speedup gains often saturate beyond a few tens of GPUs , because communication becomes the major bottleneck , i.e. , the workers will spend more time communicating gradients than computing them , as the number of GPUs increases . To mitigate this bottleneck , recent works such as 1-bit Adam ( Tang et al. , 2021 ) have studied gradient compression and demonstrate their effectiveness against auto-encoding models such as BERT ( Devlin et al. , 2019 ) . An alternative approach to alleviate these overheads is to use large batch sizes . For example , LAMB ( You et al. , 2020 ) and 1-bit LAMB ( Li et al. , 2021 ) enable stable and efficient distributed BERT pre-training with batch size up to 64K/32K ( for sequence length 128/512 , i.e. , 8M/16M tokens per batch ) while maintaining the sample-wise convergence speed . For encoder-decoder models such as T5 , Raffel et al . ( 2020 ) use batch size up to 2K ( for sequence length 512 , i.e. , 1M tokens per batch ) . For autoregressive models such as the GPT family ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) , existing works use batch size up to 1.6K ( for sequence length 2K , i.e , 3.2M tokens per batch ) . Despite the benefit of reduced communication overhead , large-batch training is sensitive to hyperparameters and often leads to issues such as slow convergence , training instabilities , and model divergence ( You et al. , 2020 ; Li et al. , 2021 ) . Curriculum learning Inspired by how humans and animals are trained , curriculum learning aims to improve machine learning model training convergence speed by presenting easier ( or less complex ) examples earlier during training ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . Previous studies have demonstrated the benefit of faster convergence speed by curriculum learning in many domains such as natural language processing , computer vision , and neural evolutionary computing . In this section we will discuss recent related works in the natural language processing area . For a more complete literature review , we recommend these recent survey papers ( Wang et al. , 2020 ; Soviany et al. , 2021 ) . In the natural language processing area , most of the curriculum learning works focus on small-scale one-stage tasks and downstream fine-tuning tasks , such as neural machine translation ( NMT ) ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ) and natural language understanding ( NLU ) ( Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) . These works show that curriculum learning can improve convergence speed , reduce training time , and improve accuracy . In these works , the curriculum difficulty metrics for each training sample are usually defined as the sentence length , vocabulary frequency , the inference loss on smaller/cheaper models , or based on self-paced learning ( Kumar et al. , 2010 ) . For the pacing function ( i.e. , to decide the curriculum difficulty range when sampling next training data batch ) , these works usually use fixed predefined functions ( e.g. , gradually increase difficulty upper bound by linear , root , and exponential functions ) , bucketing heuristics ( group data with similar difficulties , and sample from a subset of buckets every time ) , or based on self-paced learning . Only a few works explore curriculum learning for language model pre-training . Press et al . ( 2020 ) apply curriculum learning to neural language modeling pre-training , specifically a transformer model with 247M parameters ( Baevski & Auli , 2018 ) . They find that by adding an additional first training stage with a shorter sequence length , it is possible to achieve the same dev . set perplexity with shorter total training time . Zhang et al . ( 2021 ) apply curriculum learning to BERT-base pre-training , a transformer model with 110M parameters . They find that by grouping sequences with similar length and with curriculum learning , it is possible to achieve similar downstream task accuracy with shorter pre-training time . Campos ( 2021 ) apply curriculum learning to ELMo pre-training , a bi-directional LSTM model with 93.6M parameters ( Peters et al. , 2018 ) . They test a variety of curricula on the WikiText-2 and WikiText-103 but do not find strong evidence that the use of curriculum learning can improve language model pre-training . | The paper proposed a length-based curriculum to pretrain GPT models, that linearly increases the input lengths until a maximum value over the first 20-100K steps. Such curriculum are often proposed and evaluated for different NLP tasks (e.g. Platanios et al for MT), however, they seem to have not been evaluated for GPT models. Despite its simplicity, the approach achieves more stable training, faster convergence to a target perplexity (⪆50% time reduction), and better generalization as measured by validation perplexity or downstream accuracy. The method has three additional hyperparams (initial/final sequence lengths and the curriculum duration in updates), which are relatively easy to set by observing initial model behaviour on the validation set. | SP:c812d0de17457207c1ec2130ef1a7cdf85d0c3e6 |
Curriculum Learning: A Regularization Method for Efficient and Stable Billion-Scale GPT Model Pre-Training | Recent works have demonstrated great success in training high-capacity autoregressive language models ( GPT , GPT-2 , GPT-3 ) on a huge amount of unlabeled text corpus for text generation . Despite showing great results , autoregressive models are facing a growing training instability issue . Our study on GPT-2 models ( 117M and 1.5B parameters ) show that larger model sizes , sequence lengths , batch sizes , and learning rates would lead to lower training stability and increasing divergence risks . To avoid divergence and achieve better generalization performance , one has to train with smaller batch sizes and learning rates , which leads to worse training efficiency and longer training time . To overcome this stability-efficiency dilemma , we present a study of a curriculum learning-based approach , which improves the pre-training convergence speed of autoregressive models . More importantly , we find that curriculum learning , as a regularization method , exerts a gradient variance reduction effect and enables to train autoregressive models with much larger batch sizes and learning rates without training instability , further improving the training speed . Our evaluations demonstrate that curriculum learning enables training GPT-2 models with 8x larger batch size and 4x larger learning rate , whereas the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . 1 INTRODUCTION . Large-scale Transformer-based language models have powered breakthroughs in many natural language processing tasks ( Vaswani et al. , 2017 ) . These models contain up to billion-scale parameters and are trained on massive open-domain web text corpus with unsupervised learning . Among them , one of the most successful cases is the GPT family : from GPT ( 110M parameters ) ( Radford et al. , 2018a ) , to GPT-2 ( 1.5B parameters ) ( Radford et al. , 2018b ) , and to GPT-3 with 175B parameters ( Brown et al. , 2020 ) that hit record high accuracy for many NLP tasks . Recent studies ( Kaplan et al. , 2020 ) show that these models continue to achieve better accuracy as their sizes increase ( together with richer training data ) , indicating the model size will continue growing in the future . Despite achieving remarkable model accuracy , training these models raise huge challenges on training efficiency and instability . On one hand , training large models require a huge amount of computation . As an example , it requires approximately 9.2 days on 512 V100 GPUs to train a 8.3B GPT-2 ( Shoeybi et al. , 2019 ) , and 14.8 days on 10000 V100 GPUs to train a 175B GPT-3 ( Patterson et al. , 2021 ) . To reduce the training wall clock time of these large models , one of the most common solutions is to employ distributed training with hundreds or even thousands of GPUs across multiple machines such that the model can process the training data with much higher throughput . Meanwhile , to avoid the huge overhead incurred by cross-GPU/node communication in distributed training , practitioners increase the batch sizes in the optimization algorithm to increase the computation-communication ratio , to improve training efficiency and reduce training wall clock time . Despite increased training throughput and efficiency , increasing the batch size is not always the panacea , as it often leads to training instability during pre-training GPT models — training would diverge or recover from divergence but overall lead to slow/worse convergence . We conduct a thorough study of the GPT-2 pre-training task ( Radford et al. , 2018b ; Shoeybi et al. , 2019 ) with different batch sizes , models sizes , sequence lengths , and learning rates . We find that larger batch sizes and longer sequence lengths reduce training stability and increase divergence risk , especially when combined with larger model sizes and learning rate . This often leads to slower and worse convergence that hurts final generalization performance . To achieve stable training and avoid suboptimal generalization performance , common practice often resorts to using smaller batch sizes and learning rates , which would adversely affect training efficiency . In this work , we explore a curriculum learning-based approach to address the above training efficiencystability dilemma . Curriculum learning ( CL ) was proposed to improve training convergence speed by presenting easier/simpler examples earlier during training and gradually increasing the sample difficulties ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . CL was explored and verified for NLP one-stage and fine-tuning tasks ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ; Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) , but its application to pre-training GPT models is not well studied . We find that curriculum learning , as expected , could improve the convergence speed under the same training hyperparameters . More importantly , we find that curriculum learning , as a regularization method , can enable stable and efficient training with much larger batch sizes and learning rates than existing baseline approaches . Our analysis shows that one reason for curriculum learning ’ s better training stability lies in its gradient variance reduction effect : Although the gradient variance is generally reduced under larger batch size , the largest variance on certain dimensions ( i.e. , the outliers ) is increased and it reaches extreme values when training divergence happens . Using Adam optimizer ’ s variance term , we observe that curriculum learning helps reduce both the norm of this variance and the maximum variance outliers . This variance reduction effect helps curriculum learning to achieve stable large-batch training without hurting the token-wise convergence speed and final generalization performance . We implement curriculum learning using sequence length as a primary difficulty metric and apply it to the GPT-2 pre-training with up to 1.5B parameters . Evaluations show that curriculum learning enables stable and efficient training with 8x larger batch size and 4x larger learning rate , where the baseline approach struggles with training divergence . To achieve the same validation perplexity targets during pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 61 % and 49 % , respectively . To achieve the same or better zero-shot WikiText-103/LAMBADA evaluation results at the end of pre-training , curriculum learning reduces the required number of tokens and wall clock time by up to 54 % and 70 % , respectively . We make the following contributions : i ) We conduct an extensive study of the GPT-2 pre-training task , which provides detailed insights about the training stability-efficiency dilemma that motivate our work ( Section 3 ) . ii ) We present an implementation of curriculum learning based on sequence length for GPT-2 model ( and autoregressive model in general ) , which is both efficient and easy to integrate ( Section 4 ) . iii ) We conduct large-scale experiments to demonstrate the proposed work ’ s ability to provide superior training stability and efficiency at the same time . To the best of our knowledge , we are the first work to demonstrate the benefit of curriculum learning as a regularization method that improves training stability ( Section 5 ) . iv ) The curriculum learning implementation as well as the necessary changes to the GPT-2 pre-training framework has been open sourced in a deep learning optimization library ( name hidden to maintain anonymity ) . 2 BACKGROUND AND RELATED WORK . Language model pre-training The accuracy of transformer-based language models grows substantially with its model size ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) . Today , a large language model such as GPT-3 ( Brown et al. , 2020 ) contains up to 175B parameters , and recent studies show that model accuracy can continue to improve with even larger model sizes ( Kaplan et al. , 2020 ) . However , training these large models often incurs excessively long training time and training difficulties ( Brown et al. , 2020 ) . Therefore , there are a lot of demands of performing efficient and stable training for large-scale LMs . To have the pre-training finished in a reasonable amount of time , the most common way is to leverage data parallelism to train models on multiple GPUs . However , the speedup gains often saturate beyond a few tens of GPUs , because communication becomes the major bottleneck , i.e. , the workers will spend more time communicating gradients than computing them , as the number of GPUs increases . To mitigate this bottleneck , recent works such as 1-bit Adam ( Tang et al. , 2021 ) have studied gradient compression and demonstrate their effectiveness against auto-encoding models such as BERT ( Devlin et al. , 2019 ) . An alternative approach to alleviate these overheads is to use large batch sizes . For example , LAMB ( You et al. , 2020 ) and 1-bit LAMB ( Li et al. , 2021 ) enable stable and efficient distributed BERT pre-training with batch size up to 64K/32K ( for sequence length 128/512 , i.e. , 8M/16M tokens per batch ) while maintaining the sample-wise convergence speed . For encoder-decoder models such as T5 , Raffel et al . ( 2020 ) use batch size up to 2K ( for sequence length 512 , i.e. , 1M tokens per batch ) . For autoregressive models such as the GPT family ( Radford et al. , 2018a ; b ; Brown et al. , 2020 ) , existing works use batch size up to 1.6K ( for sequence length 2K , i.e , 3.2M tokens per batch ) . Despite the benefit of reduced communication overhead , large-batch training is sensitive to hyperparameters and often leads to issues such as slow convergence , training instabilities , and model divergence ( You et al. , 2020 ; Li et al. , 2021 ) . Curriculum learning Inspired by how humans and animals are trained , curriculum learning aims to improve machine learning model training convergence speed by presenting easier ( or less complex ) examples earlier during training ( Elman , 1993 ; Sanger , 1994 ; Bengio et al. , 2009 ) . Previous studies have demonstrated the benefit of faster convergence speed by curriculum learning in many domains such as natural language processing , computer vision , and neural evolutionary computing . In this section we will discuss recent related works in the natural language processing area . For a more complete literature review , we recommend these recent survey papers ( Wang et al. , 2020 ; Soviany et al. , 2021 ) . In the natural language processing area , most of the curriculum learning works focus on small-scale one-stage tasks and downstream fine-tuning tasks , such as neural machine translation ( NMT ) ( Kocmi & Bojar , 2017 ; Bojar et al. , 2017 ; Zhang et al. , 2018 ; Platanios et al. , 2019 ; Zhang et al. , 2019 ) and natural language understanding ( NLU ) ( Sachan & Xing , 2016 ; 2018 ; Tay et al. , 2019 ; Xu et al. , 2020 ) . These works show that curriculum learning can improve convergence speed , reduce training time , and improve accuracy . In these works , the curriculum difficulty metrics for each training sample are usually defined as the sentence length , vocabulary frequency , the inference loss on smaller/cheaper models , or based on self-paced learning ( Kumar et al. , 2010 ) . For the pacing function ( i.e. , to decide the curriculum difficulty range when sampling next training data batch ) , these works usually use fixed predefined functions ( e.g. , gradually increase difficulty upper bound by linear , root , and exponential functions ) , bucketing heuristics ( group data with similar difficulties , and sample from a subset of buckets every time ) , or based on self-paced learning . Only a few works explore curriculum learning for language model pre-training . Press et al . ( 2020 ) apply curriculum learning to neural language modeling pre-training , specifically a transformer model with 247M parameters ( Baevski & Auli , 2018 ) . They find that by adding an additional first training stage with a shorter sequence length , it is possible to achieve the same dev . set perplexity with shorter total training time . Zhang et al . ( 2021 ) apply curriculum learning to BERT-base pre-training , a transformer model with 110M parameters . They find that by grouping sequences with similar length and with curriculum learning , it is possible to achieve similar downstream task accuracy with shorter pre-training time . Campos ( 2021 ) apply curriculum learning to ELMo pre-training , a bi-directional LSTM model with 93.6M parameters ( Peters et al. , 2018 ) . They test a variety of curricula on the WikiText-2 and WikiText-103 but do not find strong evidence that the use of curriculum learning can improve language model pre-training . | The paper examine optimization stabilities encountered during training of GPT-2 models. It demonstrates that as model size, learning rate, and batch sizes grow training dynamics of the model become unstable. To alleviate these issues, the authors propose a curriculum learning approach based on the length of the sequence. They show that this approach stabilizes the learning dynamics and drastically improves the training efficiency. | SP:c812d0de17457207c1ec2130ef1a7cdf85d0c3e6 |
What Happens after SGD Reaches Zero Loss? --A Mathematical Framework | 1 INTRODUCTION . The implicit bias underlies the generalization ability of machine learning models trained by stochastic gradient descent ( SGD ) . But it still remains a mystery to mathematically characterize such bias . We study SGD in the following formulation xη ( k + 1 ) = xη ( k ) − η ( ∇L ( xη ( k ) ) + σξk ( xη ( k ) ) ) ( 1 ) where η is the learning rate ( LR ) , L : RD → R is the training loss and σ ( x ) = [ σ1 ( x ) , σ2 ( x ) , . . . , σΞ ( x ) ] ∈ RD×Ξ is a deterministic noise function . Here ξk is sampled uniformly from { 1 , 2 , . . . , Ξ } and it satisfies Eξk [ σξk ( x ) ] = 0 , ∀x ∈ Rd and k. It is widely believed that large LR ( or equivalently , small batch size ) helps SGD find better minima . For instance , some previous works argued that large noise enables SGD to select a flatter attraction basin of the loss landscape which potentiallyx benefits generalization ( Li et al. , 2019c ; Jastrzebski et al. , 2017 ) . However , there is also experimental evidence ( Li et al. , 2020b ) that small LR also has equally good implicit bias ( albeit with higher training time ) , and that is the case studied here . Presumably low LR precludes SGD jumping between different basins since under general conditions this should require Ω ( exp ( 1/η ) ) steps ( Shi et al. , 2020 ) . In other words , there should be a mechanism to reach better generalization while staying within a single basin . For deterministic GD similar mechanisms have been demonstrated in simple cases ( Soudry et al. , 2018 ; Lyu & Li , 2019 ) for GD and referred to as implicit bias of gradient descent . The current paper can be seen as study of implicit bias of Stochastic GD , which turns out to be quite different , mathematically . Recent work ( Blanc et al. , 2020 ) shed light on this direction by analyzing effects of stochasticity in the gradient . For sufficiently small LR , SGD will reach and be trapped around some manifold of local minimizers , denoted by Γ ( see Figure 2 ) . The effect is shown to be an implicit deterministic drift in a direction corresponding to lowering a regularizer-like term along the manifold . They showed SGD with label noise locally decreases the sharpness of loss , tr [ ∇2L ] , by Θ ( η0.4 ) in η−1.6 steps . However , such an analysis is actually local , since the natural time scale of analysis should be η−2 , not η−1.6 . The contribution of the current paper is a more general and global analysis of this type . We introduce a more powerful framework inspired by the classic paper Katzenberger ( 1991 ) . 1.1 INTUITIVE EXPLANATION OF REGULARIZATION EFFECT DUE TO SGD . We start with an intuitive description of the implicit regularization effect described in Blanc et al . ( 2020 ) . For simplification , we show it for the following canonical SDE approximation ( See Section B.1 for more details ) of SGD ( 1 ) ( Li et al. , 2017 ; Cheng et al. , 2020 ) . Here W ( t ) is the standard Ξ-dimensional Brownian motion . The only property about label noise SGD we will use is that the noise covariance σσ > ( x ) = ∇2L ( x ) for every x in the manifold Γ . ( See derivation in Section 5 ) dX̃η ( t ) = −η∇L ( X̃η ( t ) ) dt+ η · σ ( X̃η ( t ) ) dW ( t ) . ( 2 ) Suppose X̃η ( 0 ) is already close to some local minimizer point X∗ ∈ Γ . The goal is to show X̃η ( t ) will move in the tangent space and steadily decrease tr [ ∇2L ] . At first glance , this seems impossible as the gradient∇L vanishes around Γ , and the noise has zero mean , implying SGD should be like random walk instead of a deterministic drift . The key observation of Blanc et al . ( 2020 ) is that the local dynamics of X̃η ( t ) is completely different in tangent space and normal space — the fast random walk in normal space causes X̃η ( t ) to move slowly ( with velocity Θ ( η2 ) ) but deterministically in certain direction . To explain this , letting ∆ ( t ) = X̃η ( t ) − X∗ , Taylor expansion of ( 2 ) gives d∆ ( t ) ≈ −η∇2L ( X∗ ) ∆dt+ ησ ( X∗ ) dW ( t ) , meaning ∆ is behaving like an Ornstein-Uhlenbeck ( OU ) process locally in the normal space . Its mixing time is Θ ( η−1 ) and the stationary distribution is the standard multivariate gaussian in the normal space scaled by √ η ( see Figure 1b ) , because noise covariance σσ > = ∇2L . Though this OU process itself doesn ’ t form any regularization , it activates the second order Taylor expansion of ∇L ( X∗ + ∆ ( t ) ) , i.e. , − 12∂ 2 ( ∇L ) ( X∗ ) [ ∆ ( t ) , ∆ ( t ) ] , creating a Θ ( η2 ) velocity in the tangent space . Since there is no push back force in the tangent space , the small velocity accumulates over time , and in a longer time scale of Ω ( η−1 ) , the time average of the stochastic velocity is roughly the same as the expected velocity when ∆ is sampled from its stationary distribution . This simplifies the expression of the velocity in tangent space to η 2 2 ∇T tr [ ∇ 2L ] ( see Figure 1c ) , where ∇T means the gradient is only taken in the tangent space . However , the above approach only gives a local analysis forO ( η−1.6 ) time , where the total movement due to implicit regularization is O ( η2−1.6 ) = O ( η0.4 ) and thus is negligible when η → 0 . In order to get a non-trivial limiting dynamics when η → 0 , a global analysis for Ω ( η−2 ) steps is necessary and it can not be done by Taylor expansion with a single reference point . Recent work by Damian et al . ( 2021 ) glues analyzes of multiple local phases into a global guarantee that SGD finds a ( , γ ) stationary point for the regularized loss . This technique works for constant size LR , but this still doesn ’ t show convergence for trajectory when η → 0 . The main technical difficulty here is that it ’ s not clear how to separate the slow and fast dynamics in different spaces and how to only take limit for the slow dynamics , especially when shifting to a new reference point in the Taylor series calculation . 1.2 OUR APPROACH : SEPARATING THE SLOW FROM THE FAST . In this work , we tackle this problem via a different angle . First , since the anticipated limiting dynamics is of speed Θ ( η2 ) , we change the time scaling to accelerate ( 2 ) by η−2 times , which yields dXη ( t ) = −η−1∇L ( Xη ( t ) ) dt+ σ ( Xη ( t ) ) dW ( t ) . ( 3 ) The key idea here is that we only need to track the slow dynamic , or equivalently , some projection of X onto the manifold Γ , Φ ( X ) . Here Φ : RD → Γ is some function to be specified and hopefully we can simplify the dynamics Equation ( 3 ) via choosing suitable Φ . To track the dynamics of Φ ( Xη ) , we apply Ito ’ s lemma ( a.k.a . stochastic chain rule , see Lemma A.8 ) to Equation ( 3 ) , which yields dΦ ( Xη ( t ) ) = −η−1∂Φ ( Xη ( t ) ) ∇L ( Xη ( t ) ) dt+ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt . Note the first term −η−1∂Φ ( Xη ) ∇L ( Xη ) is going to diverge to∞ when η → 0 , so a natural choice for Φ is to kill the first term . Further note −∂Φ ( X ) ∇L ( X ) is indeed the directional derivative of Φ at X towards −∇L , killing the first term becomes equivalent to making Φ invariant under Gradient Flow of −∇L ( X ) ! Thus it suffices to take Φ ( X ) to be the limit of gradient flow starting at X . ( Formally defined in Section 3 ; see Lemma C.2 for a proof of ∂Φ ( X ) ∇L ( X ) ≡ 0 . ) Also intuitively Xη will be infinitely close to Γ , i.e. , d ( Xη ( t ) , Γ ) → 0 for any t > 0 as η → 0 , so we have Φ ( Xη ) ≈ Xη . Thus we can rewrite the above equation as dXη ( t ) ≈ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt , ( 4 ) and the solution of ( 4 ) shall converge to that of the following ( in an intuitive sense ) : dX ( t ) = ∂Φ ( X ( t ) ) σ ( X ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( X ( t ) ) ( σ ( X ( t ) ) σ ( X ( t ) ) > ) ijdt , ( 5 ) The above argument for SDE was first formalized and rigorously proved by Katzenberger ( 1991 ) . It included an extension of the analysis to the case of asymptotic continuous dynamics ( Theorem 4.1 ) including SGD with infinitesimal LR , but the result is weaker in this case and no convergence is shown . Another obstacle for applying this analysis is that 2nd order partial derivatives of Φ are unknown . We solve these issues in Section 4 and our main result Theorem 4.6 gives a clean and complete characterization for the implicit bias of SGD with infinitesimal LR in Θ ( η−2 ) steps . Finally , our Corollary 5.2 shows ( 5 ) gives exactly the same regularization as tr [ ∇2L ] for label noise SGD . The main contributions of this paper are summarized as follows . 1 . In Section 4 , we propose a mathematical framework to study the implicit bias of SGD with infinitesimal LR . Our main theorem ( Theorem 4.6 ) gives the limiting diffusion of SGD with LR η for Θ ( η−2 ) steps as η → 0 and allows any covariance structure . 2 . In Section 5 , we give limiting dynamics of SGD with isotropic noise and label noise . 3 . In Section 6 , we show for any initialization , SGD with label noise achieves O ( κ ln d ) sample complexity for learning a κ-sparse overparametrized linear model ( Woodworth et al. , 2020 ) . In this case , the implicit regularizer is a data-dependent weighted ` 1 regularizer , meaning noise can help reduce the norm and even escape the kernel regime . The O ( κ ln d ) rate is minimax optimal ( Raskutti et al. , 2012 ) and improves over Õ ( κ2 ) upper bound by HaoChen et al . ( 2020 ) . In contrast , vanilla GD requires Ω ( d ) samples to generalize in the kernel regime . For technical contributions , we rigorously prove the convergence of GF for OLM ( Lemma 6.3 ) , unlike many existing implicit bias analyses which have to assume the convergence . We also prove the convergence of limiting flow to the global minimizer of the regularizer ( Lemma 6.5 ) by a trajectory analysis via our framework . It can not be proved by previous results ( Blanc et al. , 2020 ; Damian et al. , 2021 ) , as they only assert convergence to stationary point in the best case . | The authors propose an SDE approximation to study the implicit bias of SGD with infinitesimal learning rate. They show that given any noise covariance structure, after $\eta^{-2}$ steps, the SGD converges to an SGD on a certain manifold of local minimizer as the learning rate $\eta\rightarrow 0$. This recovers and strengthens some existing results in the literature. In particular, they show a sample complexity gap between label noise SGD and GD in the kernel regime for an overparametrized linear model, justifying the generalization benefit of SGD. | SP:8945c0c13f23fc161239d8d6ca6dd6c2b8956aab |
What Happens after SGD Reaches Zero Loss? --A Mathematical Framework | 1 INTRODUCTION . The implicit bias underlies the generalization ability of machine learning models trained by stochastic gradient descent ( SGD ) . But it still remains a mystery to mathematically characterize such bias . We study SGD in the following formulation xη ( k + 1 ) = xη ( k ) − η ( ∇L ( xη ( k ) ) + σξk ( xη ( k ) ) ) ( 1 ) where η is the learning rate ( LR ) , L : RD → R is the training loss and σ ( x ) = [ σ1 ( x ) , σ2 ( x ) , . . . , σΞ ( x ) ] ∈ RD×Ξ is a deterministic noise function . Here ξk is sampled uniformly from { 1 , 2 , . . . , Ξ } and it satisfies Eξk [ σξk ( x ) ] = 0 , ∀x ∈ Rd and k. It is widely believed that large LR ( or equivalently , small batch size ) helps SGD find better minima . For instance , some previous works argued that large noise enables SGD to select a flatter attraction basin of the loss landscape which potentiallyx benefits generalization ( Li et al. , 2019c ; Jastrzebski et al. , 2017 ) . However , there is also experimental evidence ( Li et al. , 2020b ) that small LR also has equally good implicit bias ( albeit with higher training time ) , and that is the case studied here . Presumably low LR precludes SGD jumping between different basins since under general conditions this should require Ω ( exp ( 1/η ) ) steps ( Shi et al. , 2020 ) . In other words , there should be a mechanism to reach better generalization while staying within a single basin . For deterministic GD similar mechanisms have been demonstrated in simple cases ( Soudry et al. , 2018 ; Lyu & Li , 2019 ) for GD and referred to as implicit bias of gradient descent . The current paper can be seen as study of implicit bias of Stochastic GD , which turns out to be quite different , mathematically . Recent work ( Blanc et al. , 2020 ) shed light on this direction by analyzing effects of stochasticity in the gradient . For sufficiently small LR , SGD will reach and be trapped around some manifold of local minimizers , denoted by Γ ( see Figure 2 ) . The effect is shown to be an implicit deterministic drift in a direction corresponding to lowering a regularizer-like term along the manifold . They showed SGD with label noise locally decreases the sharpness of loss , tr [ ∇2L ] , by Θ ( η0.4 ) in η−1.6 steps . However , such an analysis is actually local , since the natural time scale of analysis should be η−2 , not η−1.6 . The contribution of the current paper is a more general and global analysis of this type . We introduce a more powerful framework inspired by the classic paper Katzenberger ( 1991 ) . 1.1 INTUITIVE EXPLANATION OF REGULARIZATION EFFECT DUE TO SGD . We start with an intuitive description of the implicit regularization effect described in Blanc et al . ( 2020 ) . For simplification , we show it for the following canonical SDE approximation ( See Section B.1 for more details ) of SGD ( 1 ) ( Li et al. , 2017 ; Cheng et al. , 2020 ) . Here W ( t ) is the standard Ξ-dimensional Brownian motion . The only property about label noise SGD we will use is that the noise covariance σσ > ( x ) = ∇2L ( x ) for every x in the manifold Γ . ( See derivation in Section 5 ) dX̃η ( t ) = −η∇L ( X̃η ( t ) ) dt+ η · σ ( X̃η ( t ) ) dW ( t ) . ( 2 ) Suppose X̃η ( 0 ) is already close to some local minimizer point X∗ ∈ Γ . The goal is to show X̃η ( t ) will move in the tangent space and steadily decrease tr [ ∇2L ] . At first glance , this seems impossible as the gradient∇L vanishes around Γ , and the noise has zero mean , implying SGD should be like random walk instead of a deterministic drift . The key observation of Blanc et al . ( 2020 ) is that the local dynamics of X̃η ( t ) is completely different in tangent space and normal space — the fast random walk in normal space causes X̃η ( t ) to move slowly ( with velocity Θ ( η2 ) ) but deterministically in certain direction . To explain this , letting ∆ ( t ) = X̃η ( t ) − X∗ , Taylor expansion of ( 2 ) gives d∆ ( t ) ≈ −η∇2L ( X∗ ) ∆dt+ ησ ( X∗ ) dW ( t ) , meaning ∆ is behaving like an Ornstein-Uhlenbeck ( OU ) process locally in the normal space . Its mixing time is Θ ( η−1 ) and the stationary distribution is the standard multivariate gaussian in the normal space scaled by √ η ( see Figure 1b ) , because noise covariance σσ > = ∇2L . Though this OU process itself doesn ’ t form any regularization , it activates the second order Taylor expansion of ∇L ( X∗ + ∆ ( t ) ) , i.e. , − 12∂ 2 ( ∇L ) ( X∗ ) [ ∆ ( t ) , ∆ ( t ) ] , creating a Θ ( η2 ) velocity in the tangent space . Since there is no push back force in the tangent space , the small velocity accumulates over time , and in a longer time scale of Ω ( η−1 ) , the time average of the stochastic velocity is roughly the same as the expected velocity when ∆ is sampled from its stationary distribution . This simplifies the expression of the velocity in tangent space to η 2 2 ∇T tr [ ∇ 2L ] ( see Figure 1c ) , where ∇T means the gradient is only taken in the tangent space . However , the above approach only gives a local analysis forO ( η−1.6 ) time , where the total movement due to implicit regularization is O ( η2−1.6 ) = O ( η0.4 ) and thus is negligible when η → 0 . In order to get a non-trivial limiting dynamics when η → 0 , a global analysis for Ω ( η−2 ) steps is necessary and it can not be done by Taylor expansion with a single reference point . Recent work by Damian et al . ( 2021 ) glues analyzes of multiple local phases into a global guarantee that SGD finds a ( , γ ) stationary point for the regularized loss . This technique works for constant size LR , but this still doesn ’ t show convergence for trajectory when η → 0 . The main technical difficulty here is that it ’ s not clear how to separate the slow and fast dynamics in different spaces and how to only take limit for the slow dynamics , especially when shifting to a new reference point in the Taylor series calculation . 1.2 OUR APPROACH : SEPARATING THE SLOW FROM THE FAST . In this work , we tackle this problem via a different angle . First , since the anticipated limiting dynamics is of speed Θ ( η2 ) , we change the time scaling to accelerate ( 2 ) by η−2 times , which yields dXη ( t ) = −η−1∇L ( Xη ( t ) ) dt+ σ ( Xη ( t ) ) dW ( t ) . ( 3 ) The key idea here is that we only need to track the slow dynamic , or equivalently , some projection of X onto the manifold Γ , Φ ( X ) . Here Φ : RD → Γ is some function to be specified and hopefully we can simplify the dynamics Equation ( 3 ) via choosing suitable Φ . To track the dynamics of Φ ( Xη ) , we apply Ito ’ s lemma ( a.k.a . stochastic chain rule , see Lemma A.8 ) to Equation ( 3 ) , which yields dΦ ( Xη ( t ) ) = −η−1∂Φ ( Xη ( t ) ) ∇L ( Xη ( t ) ) dt+ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt . Note the first term −η−1∂Φ ( Xη ) ∇L ( Xη ) is going to diverge to∞ when η → 0 , so a natural choice for Φ is to kill the first term . Further note −∂Φ ( X ) ∇L ( X ) is indeed the directional derivative of Φ at X towards −∇L , killing the first term becomes equivalent to making Φ invariant under Gradient Flow of −∇L ( X ) ! Thus it suffices to take Φ ( X ) to be the limit of gradient flow starting at X . ( Formally defined in Section 3 ; see Lemma C.2 for a proof of ∂Φ ( X ) ∇L ( X ) ≡ 0 . ) Also intuitively Xη will be infinitely close to Γ , i.e. , d ( Xη ( t ) , Γ ) → 0 for any t > 0 as η → 0 , so we have Φ ( Xη ) ≈ Xη . Thus we can rewrite the above equation as dXη ( t ) ≈ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt , ( 4 ) and the solution of ( 4 ) shall converge to that of the following ( in an intuitive sense ) : dX ( t ) = ∂Φ ( X ( t ) ) σ ( X ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( X ( t ) ) ( σ ( X ( t ) ) σ ( X ( t ) ) > ) ijdt , ( 5 ) The above argument for SDE was first formalized and rigorously proved by Katzenberger ( 1991 ) . It included an extension of the analysis to the case of asymptotic continuous dynamics ( Theorem 4.1 ) including SGD with infinitesimal LR , but the result is weaker in this case and no convergence is shown . Another obstacle for applying this analysis is that 2nd order partial derivatives of Φ are unknown . We solve these issues in Section 4 and our main result Theorem 4.6 gives a clean and complete characterization for the implicit bias of SGD with infinitesimal LR in Θ ( η−2 ) steps . Finally , our Corollary 5.2 shows ( 5 ) gives exactly the same regularization as tr [ ∇2L ] for label noise SGD . The main contributions of this paper are summarized as follows . 1 . In Section 4 , we propose a mathematical framework to study the implicit bias of SGD with infinitesimal LR . Our main theorem ( Theorem 4.6 ) gives the limiting diffusion of SGD with LR η for Θ ( η−2 ) steps as η → 0 and allows any covariance structure . 2 . In Section 5 , we give limiting dynamics of SGD with isotropic noise and label noise . 3 . In Section 6 , we show for any initialization , SGD with label noise achieves O ( κ ln d ) sample complexity for learning a κ-sparse overparametrized linear model ( Woodworth et al. , 2020 ) . In this case , the implicit regularizer is a data-dependent weighted ` 1 regularizer , meaning noise can help reduce the norm and even escape the kernel regime . The O ( κ ln d ) rate is minimax optimal ( Raskutti et al. , 2012 ) and improves over Õ ( κ2 ) upper bound by HaoChen et al . ( 2020 ) . In contrast , vanilla GD requires Ω ( d ) samples to generalize in the kernel regime . For technical contributions , we rigorously prove the convergence of GF for OLM ( Lemma 6.3 ) , unlike many existing implicit bias analyses which have to assume the convergence . We also prove the convergence of limiting flow to the global minimizer of the regularizer ( Lemma 6.5 ) by a trajectory analysis via our framework . It can not be proved by previous results ( Blanc et al. , 2020 ; Damian et al. , 2021 ) , as they only assert convergence to stationary point in the best case . | This paper proposes a new mathematical framework for explaining implicit regularization of SGD after attaining zero training loss. Technical novelty includes a different time scaling of the SGD that leads to the Katzenberger process, and then applying weak convergence of the Katzenberger process to obtain an elegant characterization of the SGD dynamics on zero loss manifold. This new technical device leads to a new proof of the sample complexity bound on the overparametrized linear model with label noise regularization. | SP:8945c0c13f23fc161239d8d6ca6dd6c2b8956aab |
What Happens after SGD Reaches Zero Loss? --A Mathematical Framework | 1 INTRODUCTION . The implicit bias underlies the generalization ability of machine learning models trained by stochastic gradient descent ( SGD ) . But it still remains a mystery to mathematically characterize such bias . We study SGD in the following formulation xη ( k + 1 ) = xη ( k ) − η ( ∇L ( xη ( k ) ) + σξk ( xη ( k ) ) ) ( 1 ) where η is the learning rate ( LR ) , L : RD → R is the training loss and σ ( x ) = [ σ1 ( x ) , σ2 ( x ) , . . . , σΞ ( x ) ] ∈ RD×Ξ is a deterministic noise function . Here ξk is sampled uniformly from { 1 , 2 , . . . , Ξ } and it satisfies Eξk [ σξk ( x ) ] = 0 , ∀x ∈ Rd and k. It is widely believed that large LR ( or equivalently , small batch size ) helps SGD find better minima . For instance , some previous works argued that large noise enables SGD to select a flatter attraction basin of the loss landscape which potentiallyx benefits generalization ( Li et al. , 2019c ; Jastrzebski et al. , 2017 ) . However , there is also experimental evidence ( Li et al. , 2020b ) that small LR also has equally good implicit bias ( albeit with higher training time ) , and that is the case studied here . Presumably low LR precludes SGD jumping between different basins since under general conditions this should require Ω ( exp ( 1/η ) ) steps ( Shi et al. , 2020 ) . In other words , there should be a mechanism to reach better generalization while staying within a single basin . For deterministic GD similar mechanisms have been demonstrated in simple cases ( Soudry et al. , 2018 ; Lyu & Li , 2019 ) for GD and referred to as implicit bias of gradient descent . The current paper can be seen as study of implicit bias of Stochastic GD , which turns out to be quite different , mathematically . Recent work ( Blanc et al. , 2020 ) shed light on this direction by analyzing effects of stochasticity in the gradient . For sufficiently small LR , SGD will reach and be trapped around some manifold of local minimizers , denoted by Γ ( see Figure 2 ) . The effect is shown to be an implicit deterministic drift in a direction corresponding to lowering a regularizer-like term along the manifold . They showed SGD with label noise locally decreases the sharpness of loss , tr [ ∇2L ] , by Θ ( η0.4 ) in η−1.6 steps . However , such an analysis is actually local , since the natural time scale of analysis should be η−2 , not η−1.6 . The contribution of the current paper is a more general and global analysis of this type . We introduce a more powerful framework inspired by the classic paper Katzenberger ( 1991 ) . 1.1 INTUITIVE EXPLANATION OF REGULARIZATION EFFECT DUE TO SGD . We start with an intuitive description of the implicit regularization effect described in Blanc et al . ( 2020 ) . For simplification , we show it for the following canonical SDE approximation ( See Section B.1 for more details ) of SGD ( 1 ) ( Li et al. , 2017 ; Cheng et al. , 2020 ) . Here W ( t ) is the standard Ξ-dimensional Brownian motion . The only property about label noise SGD we will use is that the noise covariance σσ > ( x ) = ∇2L ( x ) for every x in the manifold Γ . ( See derivation in Section 5 ) dX̃η ( t ) = −η∇L ( X̃η ( t ) ) dt+ η · σ ( X̃η ( t ) ) dW ( t ) . ( 2 ) Suppose X̃η ( 0 ) is already close to some local minimizer point X∗ ∈ Γ . The goal is to show X̃η ( t ) will move in the tangent space and steadily decrease tr [ ∇2L ] . At first glance , this seems impossible as the gradient∇L vanishes around Γ , and the noise has zero mean , implying SGD should be like random walk instead of a deterministic drift . The key observation of Blanc et al . ( 2020 ) is that the local dynamics of X̃η ( t ) is completely different in tangent space and normal space — the fast random walk in normal space causes X̃η ( t ) to move slowly ( with velocity Θ ( η2 ) ) but deterministically in certain direction . To explain this , letting ∆ ( t ) = X̃η ( t ) − X∗ , Taylor expansion of ( 2 ) gives d∆ ( t ) ≈ −η∇2L ( X∗ ) ∆dt+ ησ ( X∗ ) dW ( t ) , meaning ∆ is behaving like an Ornstein-Uhlenbeck ( OU ) process locally in the normal space . Its mixing time is Θ ( η−1 ) and the stationary distribution is the standard multivariate gaussian in the normal space scaled by √ η ( see Figure 1b ) , because noise covariance σσ > = ∇2L . Though this OU process itself doesn ’ t form any regularization , it activates the second order Taylor expansion of ∇L ( X∗ + ∆ ( t ) ) , i.e. , − 12∂ 2 ( ∇L ) ( X∗ ) [ ∆ ( t ) , ∆ ( t ) ] , creating a Θ ( η2 ) velocity in the tangent space . Since there is no push back force in the tangent space , the small velocity accumulates over time , and in a longer time scale of Ω ( η−1 ) , the time average of the stochastic velocity is roughly the same as the expected velocity when ∆ is sampled from its stationary distribution . This simplifies the expression of the velocity in tangent space to η 2 2 ∇T tr [ ∇ 2L ] ( see Figure 1c ) , where ∇T means the gradient is only taken in the tangent space . However , the above approach only gives a local analysis forO ( η−1.6 ) time , where the total movement due to implicit regularization is O ( η2−1.6 ) = O ( η0.4 ) and thus is negligible when η → 0 . In order to get a non-trivial limiting dynamics when η → 0 , a global analysis for Ω ( η−2 ) steps is necessary and it can not be done by Taylor expansion with a single reference point . Recent work by Damian et al . ( 2021 ) glues analyzes of multiple local phases into a global guarantee that SGD finds a ( , γ ) stationary point for the regularized loss . This technique works for constant size LR , but this still doesn ’ t show convergence for trajectory when η → 0 . The main technical difficulty here is that it ’ s not clear how to separate the slow and fast dynamics in different spaces and how to only take limit for the slow dynamics , especially when shifting to a new reference point in the Taylor series calculation . 1.2 OUR APPROACH : SEPARATING THE SLOW FROM THE FAST . In this work , we tackle this problem via a different angle . First , since the anticipated limiting dynamics is of speed Θ ( η2 ) , we change the time scaling to accelerate ( 2 ) by η−2 times , which yields dXη ( t ) = −η−1∇L ( Xη ( t ) ) dt+ σ ( Xη ( t ) ) dW ( t ) . ( 3 ) The key idea here is that we only need to track the slow dynamic , or equivalently , some projection of X onto the manifold Γ , Φ ( X ) . Here Φ : RD → Γ is some function to be specified and hopefully we can simplify the dynamics Equation ( 3 ) via choosing suitable Φ . To track the dynamics of Φ ( Xη ) , we apply Ito ’ s lemma ( a.k.a . stochastic chain rule , see Lemma A.8 ) to Equation ( 3 ) , which yields dΦ ( Xη ( t ) ) = −η−1∂Φ ( Xη ( t ) ) ∇L ( Xη ( t ) ) dt+ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt . Note the first term −η−1∂Φ ( Xη ) ∇L ( Xη ) is going to diverge to∞ when η → 0 , so a natural choice for Φ is to kill the first term . Further note −∂Φ ( X ) ∇L ( X ) is indeed the directional derivative of Φ at X towards −∇L , killing the first term becomes equivalent to making Φ invariant under Gradient Flow of −∇L ( X ) ! Thus it suffices to take Φ ( X ) to be the limit of gradient flow starting at X . ( Formally defined in Section 3 ; see Lemma C.2 for a proof of ∂Φ ( X ) ∇L ( X ) ≡ 0 . ) Also intuitively Xη will be infinitely close to Γ , i.e. , d ( Xη ( t ) , Γ ) → 0 for any t > 0 as η → 0 , so we have Φ ( Xη ) ≈ Xη . Thus we can rewrite the above equation as dXη ( t ) ≈ ∂Φ ( Xη ( t ) ) σ ( Xη ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( Xη ( t ) ) ( σ ( Xη ( t ) ) σ ( Xη ( t ) ) > ) ijdt , ( 4 ) and the solution of ( 4 ) shall converge to that of the following ( in an intuitive sense ) : dX ( t ) = ∂Φ ( X ( t ) ) σ ( X ( t ) ) dW ( t ) + 1 2 ∑D i , j=1 ∂ijΦ ( X ( t ) ) ( σ ( X ( t ) ) σ ( X ( t ) ) > ) ijdt , ( 5 ) The above argument for SDE was first formalized and rigorously proved by Katzenberger ( 1991 ) . It included an extension of the analysis to the case of asymptotic continuous dynamics ( Theorem 4.1 ) including SGD with infinitesimal LR , but the result is weaker in this case and no convergence is shown . Another obstacle for applying this analysis is that 2nd order partial derivatives of Φ are unknown . We solve these issues in Section 4 and our main result Theorem 4.6 gives a clean and complete characterization for the implicit bias of SGD with infinitesimal LR in Θ ( η−2 ) steps . Finally , our Corollary 5.2 shows ( 5 ) gives exactly the same regularization as tr [ ∇2L ] for label noise SGD . The main contributions of this paper are summarized as follows . 1 . In Section 4 , we propose a mathematical framework to study the implicit bias of SGD with infinitesimal LR . Our main theorem ( Theorem 4.6 ) gives the limiting diffusion of SGD with LR η for Θ ( η−2 ) steps as η → 0 and allows any covariance structure . 2 . In Section 5 , we give limiting dynamics of SGD with isotropic noise and label noise . 3 . In Section 6 , we show for any initialization , SGD with label noise achieves O ( κ ln d ) sample complexity for learning a κ-sparse overparametrized linear model ( Woodworth et al. , 2020 ) . In this case , the implicit regularizer is a data-dependent weighted ` 1 regularizer , meaning noise can help reduce the norm and even escape the kernel regime . The O ( κ ln d ) rate is minimax optimal ( Raskutti et al. , 2012 ) and improves over Õ ( κ2 ) upper bound by HaoChen et al . ( 2020 ) . In contrast , vanilla GD requires Ω ( d ) samples to generalize in the kernel regime . For technical contributions , we rigorously prove the convergence of GF for OLM ( Lemma 6.3 ) , unlike many existing implicit bias analyses which have to assume the convergence . We also prove the convergence of limiting flow to the global minimizer of the regularizer ( Lemma 6.5 ) by a trajectory analysis via our framework . It can not be proved by previous results ( Blanc et al. , 2020 ; Damian et al. , 2021 ) , as they only assert convergence to stationary point in the best case . | The authors of the paper under review carry a general analysis of the effect of the noise near the manifold of global minimum $\Gamma = [x, L(x) = 0]$. More precisely they show that in the limit of infinitesimal step-sizes, a time rescaled effective dynamics follows a diffusion in the manifold $\Gamma$ that mixes effects of the noise and the gradient flow. Leveraging this, they characterise explicitly the limiting point recovered by SGD on a sparse problem trained with label noise on a overparametrised linear network of depth 2. | SP:8945c0c13f23fc161239d8d6ca6dd6c2b8956aab |
Message Function Search for Hyper-relational Knowledge Graph | 1 INTRODUCTION . Knowledge base ( KB ) ( Auer et al. , 2007 ) is an important tool to organize and explore human knowledge , thereby promoting a series of applications , e.g. , question answering ( Lukovnikov et al. , 2017 ) and recommendation system ( Cao et al. , 2019 ) . Generally , the KB stores the n-ary fact r ( e1 , · · · , en ) ( n is arity ) that represents the relation r ∈ R between real-world entities ei ∈ E. To manipulate large scale KBs , KB embedding ( Nickel et al. , 2015 ; Wang et al. , 2017 ) proposes to encode the set of relations R and entities E into a d-dimensional vector space R ∈ R|R|×d , E ∈ R|E|×d . In last decades , the research community mainly focuses on embedding knowledge graphs ( KGs ) that only contain binary facts { r ( e1 , e2 ) } , e.g. , isCaptialOf ( Beijing , China ) . Among kinds of KG embedding models ( Rossi et al. , 2021 ) , tensor models ( Lacroix et al. , 2018 ; Balazevic et al. , 2019 ) propose to represent a KG into a 3-order tensor and decompose tensors into R and E , which achieve outstanding empirical performance and theoretical guarantees . Recent studies start to learn embeddings from n-ary facts ( n ≥ 2 ) because n-ary facts are widespread in KBs , e.g. , playCharacterIn ( LeonardNimoy , Spock , StarTrek1 ) . For example , more than 30 % of entities in Freebase ( Bollacker et al. , 2008 ) involve facts with higher arity ( Wen et al. , 2016 ) . Therefore , it is necessary to investigate the more general case of KGs , facts with mixed arities S = { r ( e1 , . . . , en ) : n ∈ { 2 , . . . , N } } named as hyper-relational KGs ( HKGs ) . Unfortunately , it is hard to extend powerful tensor models from the case of fixed arity ( e.g. , KG ) to the case of mixed arities ( i.e. , HKG ) . That is because a tensor can only model a set of facts under the same arity . Instead , some pioneer works ( Yadati , 2020 ; Galkin et al. , 2020 ) demonstrate that the multi-relational hypergraph ( MRHG ) could be a more natural way to model HKGs ( see Appx . A for more details ) . Let entities E and relations R be nodes and edge types in the MRHG G ( E , R , S ) , respectively . The length of MRHG ’ s edge ( e1 , . . . , en ) ( hyperedge ) could be variant , which can represent facts with various arities n. And hyperedges can be labeled by multiple edge types r ∈ R like r ( e1 , . . . , en ) ∈ S. Under the MRHG modeling , these works adapt powerful graph neural networks ( GNNs ) ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ) to embed HKGs ( Yadati , 2020 ; Galkin et al. , 2020 ) . Generally , GNNs learn node embeddings by passing messages ( e.g. , the node features ) from adjacent nodes to the center node . But in scenarios of HKGs , it is important to know the type of edge ( relation ) that connects several entities . Therefore , existing GNNs for HKG embedding design several domain-specific message functions to learn relational representationsR by capturing the interaction between entities E and relations R. Existing works manually design and fix the structures and operators of message functions . However , such rigid message function designs are not conducive to pursuing high empirical performance , as relations usually have distinct patterns in various KGs/HKGs . For example , the message function of G-MPNN ( Yadati , 2020 ) adopts the inner product way like DistMult ( Yang et al. , 2015 ) to compute the correlation between entities and relations , which has been proven to only cover symmetric relations ( Kazemi & Poole , 2018 ) . Its performance may not be good if there are many non-symmetric relations existed ( see Appx . B.1 ) . It may be a potential solution to design a universal message function to cover as many relational patterns as possible . But covering a certain pattern does not mean that the model can reach good performance on it ( Meilicke et al. , 2018 ; Rossi et al. , 2021 ) . Moreover , a pioneer work AutoSF ( Zhang et al. , 2020 ) shows that designing data-aware models can consistently achieve high performance on any given KGs . Thus , dynamically searching message functions could be an effective way to capture the data patterns of the given HKG and pursue high performance . Unfortunately , the searching method AutoSF is strictly restricted to bilinear KG models ( Yang et al. , 2015 ; Kazemi & Poole , 2018 ) , which is not applicable to message function design and the HKG scenario . Besides , although neural architecture search ( NAS ) ( Elsken et al. , 2019 ) has been introduced to search GNN architectures , current GNN search spaces ( Zhang et al. , 2021 ) are not well regularized to tasks on HKGs . Specifically , the existing search spaces of message function follow the classic way to simply aggregate node neighbors to learn node embeddings , while ignoring edge embeddings to represent relations . Thus , they can not capture the correlation between entities and relations of HKGs . In summary , rigid message function designs for HKGs are not conducive to consistently pursuing high performance on different data sets , while existing searching methods are not applicable for HKGs . To bridge this research gap , we propose the Message function SEArch for any given HKGs , named as MSeaHKG . However , it is non-trivial to design an expressive search space to enable the powerful message functions being searched , especially the space can not be too large for the sake of search efficiency . Thus , we identify the necessary computation operators that are domian-specific designs for HKGs and propose to search the interaction between these operators for capturing the relational patterns . Moreover , except for the message function search , we also incorporate other GNN components ( e.g. , aggregation function ) in the MSeaHKG search space for more performance improvements . Then , we formulate the discrete HKG models with probabilistic modelings to enable an efficient NAS algorithm working on our scenario . The main contributions are listed as : • Previous GNN searching methods generally ignore the edge representations , which fails to handle semantic meaningful relations on HKGs . Besides , their message functions can not capture complex interactions between entities with relations . In this paper , we propose a searching method to dynamically design a suitable GNN that can achieve high performance on the given HKG . • Inspired by rigid message function designs , we define a novel search space of message functions for HKGs , which enables the message function to be flexibly searched on the given HKG . Especially , the message function designs of existing GNNs for HKGs and some classic KG/HKG models can be instantiated as special cases of the proposed space . • We conduct experiments on benchmark HKGs for the link prediction and relation prediction tasks . Experimental results demonstrate that MSeaHKG can consistently achieve state-of-the-art performance by designing data-aware message functions . Besides , we also transfer MSeaHKG to other graph-based tasks and further investigate its capability . 2 RELATED WORK . 2.1 ONE-SHOT NEURAL ARCHITECTURE SEARCH IN GRAPH NEURAL NETWORK . To avoid manual efforts on neural architecture designs , NAS ( Hutter et al. , 2018 ; Yao & Wang , 2018 ) aims to automatically search suitable neural architectures for the given data and task . Generally , search Type Model Scenarios Message Function . space , search algorithm , and evaluation measurement are three important components in NAS ( Elsken et al. , 2019 ) . Search space defines what network architectures in principle should be searched . The search algorithm performs an efficient search over the search space and finds architectures that achieve good performance . Evaluation measurement decides how to evaluate the searched architectures during the search . Classical NAS methods are computationally consuming because candidate architectures are evaluated by the stand-alone way , i.e. , evaluating the performance of architecture after training it to convergence . More recently , one-shot NAS ( Pham et al. , 2018 ) proposes the weight sharing mechanism to share network weights across different candidate architectures and evaluate them on the shared weights , which can extremely reduce the search cost . Some pioneer works have explored NAS for GNNs , such as You et al . ( 2020 ) , GraphNAS ( Gao et al. , 2020 ) , AGNN ( Zhou et al. , 2019 ) , NAS-GCN ( Jiang & Balaprakash , 2020 ) . And the one-shot NAS also has been introduced to search GNN architectures recently , e.g. , SANE ( Zhao et al. , 2021 ) . As shown in the left part of Fig . 1 , most GNN searching methods follow the message passing neural networks ( MPNNs ) ( Gilmer et al. , 2017 ) to unify two steps of the GNN framework in one layer : step1 : mi ← agg ( { mgc ( ei , ej ) } ej∈N ( ei ) ) , step2 : ei ← act ( comb ( ei , mi ) ) , ( 1 ) where ei ∈ Rd represents the embedding of node ei , mi is the intermediate embeddings of ei gathered from its neighborhood N ( ei ) . The search space of operators in Eq . 1 are summarized into : • Message Function mgc ( · ) : The message function decides the way to gather information from a neighborhood ej of the center node ei . Zhang et al . ( 2021 ) summarizes the typical message in existing GNN searching methods as mgc ( ei , ej ) = aijWej , where aij denotes the attention scores between nodes ei with ej . Besides , we present more message function designs in Tab . 1 . • Aggregation Function agg ( · ) : It controls the way to aggregate message from nodes ’ neighborhood . Usually agg ∈ { sum , mean , max } , where sum ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) , mean ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) /|N ( v ) | , and max ( · ) denotes channel-wise maximum . • Combination Function comb ( · ) : It determines the way to merge messages between neighborhood and node itself . In literature , comb is selected from { concat , add , mlp } , where concat ( · ) = [ ei , mi ] , add ( · ) = ei + mi , and mlp ( · ) = MLP ( ei +mi ) ( MLP is Multi-layer Perceptron ) . • Activation Function act ( · ) : [ identity , sigmoid , tanh , relu , elu ] are some of the most commonly used activation functions ( Gao et al. , 2020 ) . Overall , mgc ( · ) in Eq . 1 only learns node embeddings , which can not encode the semantic meaningful edge types ( i.e. , relations in HKGs ) . Note that NAS-GCN ( Jiang & Balaprakash , 2020 ) takes the edge feature hij between ei and ej as input without learning edge embeddings , and recent AutoGEL ( Zhili et al. , 2021 ) simply extends the message function mgc ( · ) to learn edge embeddings without studying the interactions between entities and relations , thereby failing to handle the LP/RP tasks on HKGs . Entity Embed Relation Embed Computing Operator Role/Position Embed Positional matrix Transform matrix ... ... Cat & MLP Message Function Space | In this paper, the authors propose to conduct neural architecture search (NAS) for hyper-relational knowledge graphs (HKGs). Compared with normal graphs, HKGs can better model the complex relationships between different entities. Specifically, a novel search space is proposed inspired by recent message-passing GNNs on HKGs such as G-MPNN, CompGCN, StarE, etc., and a differentiable search algorithm is utilized. Experiments demonstrate the effectiveness of the proposed method. | SP:1893217add677f4477e46cc375a05a9cfb0767e8 |
Message Function Search for Hyper-relational Knowledge Graph | 1 INTRODUCTION . Knowledge base ( KB ) ( Auer et al. , 2007 ) is an important tool to organize and explore human knowledge , thereby promoting a series of applications , e.g. , question answering ( Lukovnikov et al. , 2017 ) and recommendation system ( Cao et al. , 2019 ) . Generally , the KB stores the n-ary fact r ( e1 , · · · , en ) ( n is arity ) that represents the relation r ∈ R between real-world entities ei ∈ E. To manipulate large scale KBs , KB embedding ( Nickel et al. , 2015 ; Wang et al. , 2017 ) proposes to encode the set of relations R and entities E into a d-dimensional vector space R ∈ R|R|×d , E ∈ R|E|×d . In last decades , the research community mainly focuses on embedding knowledge graphs ( KGs ) that only contain binary facts { r ( e1 , e2 ) } , e.g. , isCaptialOf ( Beijing , China ) . Among kinds of KG embedding models ( Rossi et al. , 2021 ) , tensor models ( Lacroix et al. , 2018 ; Balazevic et al. , 2019 ) propose to represent a KG into a 3-order tensor and decompose tensors into R and E , which achieve outstanding empirical performance and theoretical guarantees . Recent studies start to learn embeddings from n-ary facts ( n ≥ 2 ) because n-ary facts are widespread in KBs , e.g. , playCharacterIn ( LeonardNimoy , Spock , StarTrek1 ) . For example , more than 30 % of entities in Freebase ( Bollacker et al. , 2008 ) involve facts with higher arity ( Wen et al. , 2016 ) . Therefore , it is necessary to investigate the more general case of KGs , facts with mixed arities S = { r ( e1 , . . . , en ) : n ∈ { 2 , . . . , N } } named as hyper-relational KGs ( HKGs ) . Unfortunately , it is hard to extend powerful tensor models from the case of fixed arity ( e.g. , KG ) to the case of mixed arities ( i.e. , HKG ) . That is because a tensor can only model a set of facts under the same arity . Instead , some pioneer works ( Yadati , 2020 ; Galkin et al. , 2020 ) demonstrate that the multi-relational hypergraph ( MRHG ) could be a more natural way to model HKGs ( see Appx . A for more details ) . Let entities E and relations R be nodes and edge types in the MRHG G ( E , R , S ) , respectively . The length of MRHG ’ s edge ( e1 , . . . , en ) ( hyperedge ) could be variant , which can represent facts with various arities n. And hyperedges can be labeled by multiple edge types r ∈ R like r ( e1 , . . . , en ) ∈ S. Under the MRHG modeling , these works adapt powerful graph neural networks ( GNNs ) ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ) to embed HKGs ( Yadati , 2020 ; Galkin et al. , 2020 ) . Generally , GNNs learn node embeddings by passing messages ( e.g. , the node features ) from adjacent nodes to the center node . But in scenarios of HKGs , it is important to know the type of edge ( relation ) that connects several entities . Therefore , existing GNNs for HKG embedding design several domain-specific message functions to learn relational representationsR by capturing the interaction between entities E and relations R. Existing works manually design and fix the structures and operators of message functions . However , such rigid message function designs are not conducive to pursuing high empirical performance , as relations usually have distinct patterns in various KGs/HKGs . For example , the message function of G-MPNN ( Yadati , 2020 ) adopts the inner product way like DistMult ( Yang et al. , 2015 ) to compute the correlation between entities and relations , which has been proven to only cover symmetric relations ( Kazemi & Poole , 2018 ) . Its performance may not be good if there are many non-symmetric relations existed ( see Appx . B.1 ) . It may be a potential solution to design a universal message function to cover as many relational patterns as possible . But covering a certain pattern does not mean that the model can reach good performance on it ( Meilicke et al. , 2018 ; Rossi et al. , 2021 ) . Moreover , a pioneer work AutoSF ( Zhang et al. , 2020 ) shows that designing data-aware models can consistently achieve high performance on any given KGs . Thus , dynamically searching message functions could be an effective way to capture the data patterns of the given HKG and pursue high performance . Unfortunately , the searching method AutoSF is strictly restricted to bilinear KG models ( Yang et al. , 2015 ; Kazemi & Poole , 2018 ) , which is not applicable to message function design and the HKG scenario . Besides , although neural architecture search ( NAS ) ( Elsken et al. , 2019 ) has been introduced to search GNN architectures , current GNN search spaces ( Zhang et al. , 2021 ) are not well regularized to tasks on HKGs . Specifically , the existing search spaces of message function follow the classic way to simply aggregate node neighbors to learn node embeddings , while ignoring edge embeddings to represent relations . Thus , they can not capture the correlation between entities and relations of HKGs . In summary , rigid message function designs for HKGs are not conducive to consistently pursuing high performance on different data sets , while existing searching methods are not applicable for HKGs . To bridge this research gap , we propose the Message function SEArch for any given HKGs , named as MSeaHKG . However , it is non-trivial to design an expressive search space to enable the powerful message functions being searched , especially the space can not be too large for the sake of search efficiency . Thus , we identify the necessary computation operators that are domian-specific designs for HKGs and propose to search the interaction between these operators for capturing the relational patterns . Moreover , except for the message function search , we also incorporate other GNN components ( e.g. , aggregation function ) in the MSeaHKG search space for more performance improvements . Then , we formulate the discrete HKG models with probabilistic modelings to enable an efficient NAS algorithm working on our scenario . The main contributions are listed as : • Previous GNN searching methods generally ignore the edge representations , which fails to handle semantic meaningful relations on HKGs . Besides , their message functions can not capture complex interactions between entities with relations . In this paper , we propose a searching method to dynamically design a suitable GNN that can achieve high performance on the given HKG . • Inspired by rigid message function designs , we define a novel search space of message functions for HKGs , which enables the message function to be flexibly searched on the given HKG . Especially , the message function designs of existing GNNs for HKGs and some classic KG/HKG models can be instantiated as special cases of the proposed space . • We conduct experiments on benchmark HKGs for the link prediction and relation prediction tasks . Experimental results demonstrate that MSeaHKG can consistently achieve state-of-the-art performance by designing data-aware message functions . Besides , we also transfer MSeaHKG to other graph-based tasks and further investigate its capability . 2 RELATED WORK . 2.1 ONE-SHOT NEURAL ARCHITECTURE SEARCH IN GRAPH NEURAL NETWORK . To avoid manual efforts on neural architecture designs , NAS ( Hutter et al. , 2018 ; Yao & Wang , 2018 ) aims to automatically search suitable neural architectures for the given data and task . Generally , search Type Model Scenarios Message Function . space , search algorithm , and evaluation measurement are three important components in NAS ( Elsken et al. , 2019 ) . Search space defines what network architectures in principle should be searched . The search algorithm performs an efficient search over the search space and finds architectures that achieve good performance . Evaluation measurement decides how to evaluate the searched architectures during the search . Classical NAS methods are computationally consuming because candidate architectures are evaluated by the stand-alone way , i.e. , evaluating the performance of architecture after training it to convergence . More recently , one-shot NAS ( Pham et al. , 2018 ) proposes the weight sharing mechanism to share network weights across different candidate architectures and evaluate them on the shared weights , which can extremely reduce the search cost . Some pioneer works have explored NAS for GNNs , such as You et al . ( 2020 ) , GraphNAS ( Gao et al. , 2020 ) , AGNN ( Zhou et al. , 2019 ) , NAS-GCN ( Jiang & Balaprakash , 2020 ) . And the one-shot NAS also has been introduced to search GNN architectures recently , e.g. , SANE ( Zhao et al. , 2021 ) . As shown in the left part of Fig . 1 , most GNN searching methods follow the message passing neural networks ( MPNNs ) ( Gilmer et al. , 2017 ) to unify two steps of the GNN framework in one layer : step1 : mi ← agg ( { mgc ( ei , ej ) } ej∈N ( ei ) ) , step2 : ei ← act ( comb ( ei , mi ) ) , ( 1 ) where ei ∈ Rd represents the embedding of node ei , mi is the intermediate embeddings of ei gathered from its neighborhood N ( ei ) . The search space of operators in Eq . 1 are summarized into : • Message Function mgc ( · ) : The message function decides the way to gather information from a neighborhood ej of the center node ei . Zhang et al . ( 2021 ) summarizes the typical message in existing GNN searching methods as mgc ( ei , ej ) = aijWej , where aij denotes the attention scores between nodes ei with ej . Besides , we present more message function designs in Tab . 1 . • Aggregation Function agg ( · ) : It controls the way to aggregate message from nodes ’ neighborhood . Usually agg ∈ { sum , mean , max } , where sum ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) , mean ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) /|N ( v ) | , and max ( · ) denotes channel-wise maximum . • Combination Function comb ( · ) : It determines the way to merge messages between neighborhood and node itself . In literature , comb is selected from { concat , add , mlp } , where concat ( · ) = [ ei , mi ] , add ( · ) = ei + mi , and mlp ( · ) = MLP ( ei +mi ) ( MLP is Multi-layer Perceptron ) . • Activation Function act ( · ) : [ identity , sigmoid , tanh , relu , elu ] are some of the most commonly used activation functions ( Gao et al. , 2020 ) . Overall , mgc ( · ) in Eq . 1 only learns node embeddings , which can not encode the semantic meaningful edge types ( i.e. , relations in HKGs ) . Note that NAS-GCN ( Jiang & Balaprakash , 2020 ) takes the edge feature hij between ei and ej as input without learning edge embeddings , and recent AutoGEL ( Zhili et al. , 2021 ) simply extends the message function mgc ( · ) to learn edge embeddings without studying the interactions between entities and relations , thereby failing to handle the LP/RP tasks on HKGs . Entity Embed Relation Embed Computing Operator Role/Position Embed Positional matrix Transform matrix ... ... Cat & MLP Message Function Space | In this paper, authors propose a new message function searching method for Hyper Relational Knowledge Graphs. They also proposed a search space of message functions. Finally the authors proposed a one shot NAS algorithm for searching in the message function space and also over other GNN components for a given Hyper Relational Knowledge Graph. | SP:1893217add677f4477e46cc375a05a9cfb0767e8 |
Message Function Search for Hyper-relational Knowledge Graph | 1 INTRODUCTION . Knowledge base ( KB ) ( Auer et al. , 2007 ) is an important tool to organize and explore human knowledge , thereby promoting a series of applications , e.g. , question answering ( Lukovnikov et al. , 2017 ) and recommendation system ( Cao et al. , 2019 ) . Generally , the KB stores the n-ary fact r ( e1 , · · · , en ) ( n is arity ) that represents the relation r ∈ R between real-world entities ei ∈ E. To manipulate large scale KBs , KB embedding ( Nickel et al. , 2015 ; Wang et al. , 2017 ) proposes to encode the set of relations R and entities E into a d-dimensional vector space R ∈ R|R|×d , E ∈ R|E|×d . In last decades , the research community mainly focuses on embedding knowledge graphs ( KGs ) that only contain binary facts { r ( e1 , e2 ) } , e.g. , isCaptialOf ( Beijing , China ) . Among kinds of KG embedding models ( Rossi et al. , 2021 ) , tensor models ( Lacroix et al. , 2018 ; Balazevic et al. , 2019 ) propose to represent a KG into a 3-order tensor and decompose tensors into R and E , which achieve outstanding empirical performance and theoretical guarantees . Recent studies start to learn embeddings from n-ary facts ( n ≥ 2 ) because n-ary facts are widespread in KBs , e.g. , playCharacterIn ( LeonardNimoy , Spock , StarTrek1 ) . For example , more than 30 % of entities in Freebase ( Bollacker et al. , 2008 ) involve facts with higher arity ( Wen et al. , 2016 ) . Therefore , it is necessary to investigate the more general case of KGs , facts with mixed arities S = { r ( e1 , . . . , en ) : n ∈ { 2 , . . . , N } } named as hyper-relational KGs ( HKGs ) . Unfortunately , it is hard to extend powerful tensor models from the case of fixed arity ( e.g. , KG ) to the case of mixed arities ( i.e. , HKG ) . That is because a tensor can only model a set of facts under the same arity . Instead , some pioneer works ( Yadati , 2020 ; Galkin et al. , 2020 ) demonstrate that the multi-relational hypergraph ( MRHG ) could be a more natural way to model HKGs ( see Appx . A for more details ) . Let entities E and relations R be nodes and edge types in the MRHG G ( E , R , S ) , respectively . The length of MRHG ’ s edge ( e1 , . . . , en ) ( hyperedge ) could be variant , which can represent facts with various arities n. And hyperedges can be labeled by multiple edge types r ∈ R like r ( e1 , . . . , en ) ∈ S. Under the MRHG modeling , these works adapt powerful graph neural networks ( GNNs ) ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ) to embed HKGs ( Yadati , 2020 ; Galkin et al. , 2020 ) . Generally , GNNs learn node embeddings by passing messages ( e.g. , the node features ) from adjacent nodes to the center node . But in scenarios of HKGs , it is important to know the type of edge ( relation ) that connects several entities . Therefore , existing GNNs for HKG embedding design several domain-specific message functions to learn relational representationsR by capturing the interaction between entities E and relations R. Existing works manually design and fix the structures and operators of message functions . However , such rigid message function designs are not conducive to pursuing high empirical performance , as relations usually have distinct patterns in various KGs/HKGs . For example , the message function of G-MPNN ( Yadati , 2020 ) adopts the inner product way like DistMult ( Yang et al. , 2015 ) to compute the correlation between entities and relations , which has been proven to only cover symmetric relations ( Kazemi & Poole , 2018 ) . Its performance may not be good if there are many non-symmetric relations existed ( see Appx . B.1 ) . It may be a potential solution to design a universal message function to cover as many relational patterns as possible . But covering a certain pattern does not mean that the model can reach good performance on it ( Meilicke et al. , 2018 ; Rossi et al. , 2021 ) . Moreover , a pioneer work AutoSF ( Zhang et al. , 2020 ) shows that designing data-aware models can consistently achieve high performance on any given KGs . Thus , dynamically searching message functions could be an effective way to capture the data patterns of the given HKG and pursue high performance . Unfortunately , the searching method AutoSF is strictly restricted to bilinear KG models ( Yang et al. , 2015 ; Kazemi & Poole , 2018 ) , which is not applicable to message function design and the HKG scenario . Besides , although neural architecture search ( NAS ) ( Elsken et al. , 2019 ) has been introduced to search GNN architectures , current GNN search spaces ( Zhang et al. , 2021 ) are not well regularized to tasks on HKGs . Specifically , the existing search spaces of message function follow the classic way to simply aggregate node neighbors to learn node embeddings , while ignoring edge embeddings to represent relations . Thus , they can not capture the correlation between entities and relations of HKGs . In summary , rigid message function designs for HKGs are not conducive to consistently pursuing high performance on different data sets , while existing searching methods are not applicable for HKGs . To bridge this research gap , we propose the Message function SEArch for any given HKGs , named as MSeaHKG . However , it is non-trivial to design an expressive search space to enable the powerful message functions being searched , especially the space can not be too large for the sake of search efficiency . Thus , we identify the necessary computation operators that are domian-specific designs for HKGs and propose to search the interaction between these operators for capturing the relational patterns . Moreover , except for the message function search , we also incorporate other GNN components ( e.g. , aggregation function ) in the MSeaHKG search space for more performance improvements . Then , we formulate the discrete HKG models with probabilistic modelings to enable an efficient NAS algorithm working on our scenario . The main contributions are listed as : • Previous GNN searching methods generally ignore the edge representations , which fails to handle semantic meaningful relations on HKGs . Besides , their message functions can not capture complex interactions between entities with relations . In this paper , we propose a searching method to dynamically design a suitable GNN that can achieve high performance on the given HKG . • Inspired by rigid message function designs , we define a novel search space of message functions for HKGs , which enables the message function to be flexibly searched on the given HKG . Especially , the message function designs of existing GNNs for HKGs and some classic KG/HKG models can be instantiated as special cases of the proposed space . • We conduct experiments on benchmark HKGs for the link prediction and relation prediction tasks . Experimental results demonstrate that MSeaHKG can consistently achieve state-of-the-art performance by designing data-aware message functions . Besides , we also transfer MSeaHKG to other graph-based tasks and further investigate its capability . 2 RELATED WORK . 2.1 ONE-SHOT NEURAL ARCHITECTURE SEARCH IN GRAPH NEURAL NETWORK . To avoid manual efforts on neural architecture designs , NAS ( Hutter et al. , 2018 ; Yao & Wang , 2018 ) aims to automatically search suitable neural architectures for the given data and task . Generally , search Type Model Scenarios Message Function . space , search algorithm , and evaluation measurement are three important components in NAS ( Elsken et al. , 2019 ) . Search space defines what network architectures in principle should be searched . The search algorithm performs an efficient search over the search space and finds architectures that achieve good performance . Evaluation measurement decides how to evaluate the searched architectures during the search . Classical NAS methods are computationally consuming because candidate architectures are evaluated by the stand-alone way , i.e. , evaluating the performance of architecture after training it to convergence . More recently , one-shot NAS ( Pham et al. , 2018 ) proposes the weight sharing mechanism to share network weights across different candidate architectures and evaluate them on the shared weights , which can extremely reduce the search cost . Some pioneer works have explored NAS for GNNs , such as You et al . ( 2020 ) , GraphNAS ( Gao et al. , 2020 ) , AGNN ( Zhou et al. , 2019 ) , NAS-GCN ( Jiang & Balaprakash , 2020 ) . And the one-shot NAS also has been introduced to search GNN architectures recently , e.g. , SANE ( Zhao et al. , 2021 ) . As shown in the left part of Fig . 1 , most GNN searching methods follow the message passing neural networks ( MPNNs ) ( Gilmer et al. , 2017 ) to unify two steps of the GNN framework in one layer : step1 : mi ← agg ( { mgc ( ei , ej ) } ej∈N ( ei ) ) , step2 : ei ← act ( comb ( ei , mi ) ) , ( 1 ) where ei ∈ Rd represents the embedding of node ei , mi is the intermediate embeddings of ei gathered from its neighborhood N ( ei ) . The search space of operators in Eq . 1 are summarized into : • Message Function mgc ( · ) : The message function decides the way to gather information from a neighborhood ej of the center node ei . Zhang et al . ( 2021 ) summarizes the typical message in existing GNN searching methods as mgc ( ei , ej ) = aijWej , where aij denotes the attention scores between nodes ei with ej . Besides , we present more message function designs in Tab . 1 . • Aggregation Function agg ( · ) : It controls the way to aggregate message from nodes ’ neighborhood . Usually agg ∈ { sum , mean , max } , where sum ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) , mean ( · ) = ∑ ej∈N ( ei ) mgc ( ei , ej ) /|N ( v ) | , and max ( · ) denotes channel-wise maximum . • Combination Function comb ( · ) : It determines the way to merge messages between neighborhood and node itself . In literature , comb is selected from { concat , add , mlp } , where concat ( · ) = [ ei , mi ] , add ( · ) = ei + mi , and mlp ( · ) = MLP ( ei +mi ) ( MLP is Multi-layer Perceptron ) . • Activation Function act ( · ) : [ identity , sigmoid , tanh , relu , elu ] are some of the most commonly used activation functions ( Gao et al. , 2020 ) . Overall , mgc ( · ) in Eq . 1 only learns node embeddings , which can not encode the semantic meaningful edge types ( i.e. , relations in HKGs ) . Note that NAS-GCN ( Jiang & Balaprakash , 2020 ) takes the edge feature hij between ei and ej as input without learning edge embeddings , and recent AutoGEL ( Zhili et al. , 2021 ) simply extends the message function mgc ( · ) to learn edge embeddings without studying the interactions between entities and relations , thereby failing to handle the LP/RP tasks on HKGs . Entity Embed Relation Embed Computing Operator Role/Position Embed Positional matrix Transform matrix ... ... Cat & MLP Message Function Space | The paper proposes a new neural architecture search framework over graph neural networks in hyper relational knowledge graphs (HKG). The main motivation is that the current GraphNAS system does not have an emphasis on edge representations and how message passing functions handle position-sensitive information on HKG. The paper proposes a new search space of these configurations and proposes a new HKG method that achieves state-of-the-art on several benchmarks. | SP:1893217add677f4477e46cc375a05a9cfb0767e8 |
Defending Backdoor Data Poisoning Attacks by Using Noisy Label Defense Algorithm | 1 INTRODUCTION . Deep neural networks ( DNN ) have achieved significant success in a variety of applications such as image classification ( Krizhevsky et al. , 2012 ) , autonomous driving ( Major et al. , 2019 ) , and natural language processing ( Devlin et al. , 2018 ) , due to its powerful generalization ability . In the meantime , DNN can be highly susceptible to even small perturbations of training data , which has raised considerable concerns about its trustworthiness ( Liu et al. , 2020 ) . One representative perturbation approach is backdoor attack , which undermines the DNN performance by modifying a small fraction of the training samples with specific triggers injected into their input features , whose ground-truth labels are altered accordingly to be the attacker-specified ones . It is unlikely to detect backdoor attacks by monitoring the model training performance , since the trained model can still perform well on the benign validation samples . Consequently , during testing phase , if the data is augmented with the trigger , it would be classified as the attacker-specified label . Subtle yet effective , backdoor attacks can pose serious threats to the practical application of DNNs . Another typical type of data poisoning attack is noisy label attacks ( Han et al. , 2018 ; Patrini et al. , 2017 ; Yi & Wu , 2019 ; Jiang et al. , 2017 ) , in which the labels of a small fraction of data are altered deliberately to compromise the model learning , while the input features of the training data remain untouched . Backdoor attacks share a close connection to noisy label attacks , in that during a backdoor attack , the feature can only be altered insignificantly to put the trigger in disguise , which makes the corrupted feature ( e.g . images with the trigger ) highly similar to the uncorrupted ones . Prior efforts have been made to effectively address noisy label attacks . For instance , there are algorithms that can tolerate a large fraction of label corruption , with up to 45 % noisy labels ( Han et al. , 2018 ; Jiang et al. , 2018 ) . However , to the best of our knowledge , most algorithms defending against backdoor attacks can not deal with a high corruption ratio even if the features of corrupted data are only slightly perturbed . Observing the limitation of prior arts , we aim to answer one key question : Can one train a deep neural network that is robust against a large number of backdoor attacks ? Moreover , given the resemblance between noisy label attacks and backdoor attacks , we also investigate another intriguing question : Can one leverage algorithms initially designed for handling noisy label attacks to defend against backdoor attacks more effectively ? The contributions of this paper are multi-fold . First , we provide a novel and principled perspective to decouple the challenges of defending backdoor attacks into two components : one induced by the corrupted input features , and the other induced by the corrupted labels , based on which we can draw a theoretical connection between the noisy-label attacks and backdoor data attacks . Second , we propose a meta-algorithm which addresses both challenges by a novel minimax optimization . Specifically , the proposed approach takes any noisy-label defense algorithm as the input and outputs a reinforced version of the algorithm that is robust against backdoor poisoning attacks , while the initial form of the algorithm fails to provide such defense . Extensive experiments show that the proposed meta-algorithm improves the robustness of DNN models against various backdoor attacks on a variety of benchmark datasets with up to 45 % corruption ratio . Furthermore , we propose a systematic , meta-framework to solve backdoor attacks , which can effectively join existing force in noisy label attack defenses and provides more insights to future development of defense algorithms . 2 RELATED WORK . 2.1 ROBUST DEEP LEARNING AGAINST ADVERSARIAL ATTACK . Although DNNs have shown high generalization performance on various tasks , it has been observed that a trained DNN model would yield different results even by perturbing the image in an invisible manner ( Goodfellow et al. , 2014 ; Yuan et al. , 2019 ) . Prior efforts have been made to tackle this issue , among which one natural defense strategy is to change the empirical loss minimization into a minimax objective . By solving the minimax problem , the model is guaranteed a better worst-case generalization performance ( Duchi & Namkoong , 2021 ) . Since exactly solving the inner maximization problem can be computationally prohibitive , different strategies have been proposed to approximate the inner maximization optimization , including heuristic alternative optimization , linear programming Wong & Kolter ( 2018 ) , semi-definite programming Raghunathan et al . ( 2018 ) , etc . Besides minimax optimization , another approach to improve model robustness is imposing a Lipschitz constraint on the network . Work along this line includes randomized smoothing Cohen et al . ( 2019 ) ; Salman et al . ( 2019 ) , spectral normalization Miyato et al . ( 2018a ) , and adversarial Lipschitz regularization Terjék ( 2019 ) . Although there are algorithms that are robust against adversarial samples , they are not designed to confront backdoor attacks , in which clean training data is usually inaccessible . There are also studies that investigated the connection between adversarial robustness and robustness against backdoor attack ( Weber et al. , 2020 ) . However , to our best knowledge , there is no literature studying the relationship between label flipping attack and backdoor attack . 2.2 ROBUST DEEP LEARNING AGAINST LABEL NOISE . Many recent studies have investigated the robustness of classification tasks with noisy labels . For example , Kumar et al . ( 2010 ) proposed the Self-Paced Learning ( SPL ) approach , which assigns higher weights to examples with a smaller loss . A similar idea was used in Curriculum Learning ( Bengio et al. , 2009 ) , in which a model learns on easier examples before moving to the harder ones . Other methods inspired by SPL include learning the data weights ( Jiang et al. , 2018 ) and collaborative learning ( Han et al. , 2018 ; Yu et al. , 2019 ) . An alternative approach to defending noisy label attacks is label correction ( Patrini et al. , 2017 ; Li et al. , 2017 ; Yi & Wu , 2019 ) , which attempts to revise the original labels of the data to recover clean labels from corrupted ones . However , since we do not have the knowledge of which data points have been corrupted , it is nontrivial to obtain provable guarantees for label corrections , unless strong assumptions have been made on the corruption type . 2.3 DATA POISONING BACKDOOR ATTACK AND ITS DEFENSE . Robust learning against backdoor attacks has been widely studied recently . Gu et al . ( 2017 ) showed that even a small patch of perturbation can compromise the generalization performance when data is augmented with a backdoor trigger . Other types of attacks include the blend attacks ( Chen et al. , 2017 ) , clean label attacks ( Turner et al. , 2018 ; Shafahi et al. , 2018 ) , latent backdoor attacks ( Yao et al. , 2019 ) , etc . While there are various types of backdoor attacks , some attack requires that the adversary not only has access to the data but also can has limited control on the training and inference process . Those attacks include Trojan attacks and blind backdoor attacks ( Pang et al. , 2020 ) . We refer readers to Pang et al . ( 2020 ) for a comprehensive survey on different types of backdoor attacks . Various defense methods have been proposed to defend against backdoor attacks . One defense category is to remove the corrupted data by using anomaly detection ( Tran et al. , 2018 ; Chen et al. , 2018 ) . Another category of work is the model inspection ( Wang et al. , 2019 ) , which aims to inspect and modify the backdoored model to make it robust against the trigger . There are also other methods of tackling the backdoor attacks , such as randomized smoothing ( Cohen et al. , 2019 ; Weber et al. , 2020 ) , and the median of means ( Levine & Feizi , 2020 ) . However , they are either inefficient or can not defend against backdoor attacks with a large ratio of corrupted data . Some of the above methods also hinge on a clean set of validation data , while in practice , it is unlikely to guarantee the existence of clean validation data , since validation data is usually a subset of training data . To the best of our knowledge , there is no existing backdoor defense algorithm that is motivated from the label corruption perspective . 3 PRELIMINARIES . 3.1 LEARNING WITH NOISY LABELS . In this section , we review some representative approaches for defending noisy-labels . Although the initial forms of these approaches can be vulnerable to backdoor attacks , we show later in the next section that our proposed meta-algorithm can empower them to effectively confront backdoor attacks . Specifically , we look into two types of nosiy-label defending approaches : filtering-based approaches and consistency-based approaches . The filtering-based approach is one of the most effective strategies for defending noisy labels , which works by selecting or weighting the training samples based on indicators such as sample losses ( Jiang et al. , 2017 ; Han et al. , 2018 ; Jiang et al. , 2020 ) or gradient norms of the loss-layer ( Liu et al. , 2021 ) . For instance , Jiang et al . ( 2017 ) proposed to assign higher probabilities to samples with lower losses to be selected for model training . Consistency-based approach modifies data labels during model training . Specifically , the Bootstrap approach ( Reed et al. , 2014 ) encourages model predictions to be consistent between iterations , by modifying the labels as a linear combination of the observed labels and previous predictions . In this paper , we leverage two filtering-based noisy label algorithms , i.e . the Self-Paced Learning ( SPL ) ( Jiang et al. , 2017 ; Kumar et al. , 2010 ) and Provable Robust Learning ( PRL ) ( Liu et al. , 2021 ) , and one consistency-based algorithm , i.e . the Bootstrap ( Reed et al. , 2014 ) , to investigate the efficacy of the proposed meta algorithm . Strong empirical results in Section 5 on those input algorithms suggest that our meta framework is readily to benefit other robust noisy-label algorithms . We briefly summarize the main idea of the above algorithms in table 1 . 3.2 PROBLEM SETTING OF BACKDOOR ATTACKS . In this paper , we follow a standard setting for backdoor attacks and assume that there is an adversary that tries to perform the backdoor attack . Firstly , the adversary can choose up to fraction of clean labels Y ∈ Rn×q and modify them to arbitrary valid numbers to form the corrupted labels Yb ∈ Rbn c×q . Let Yr represent the remaining untouched labels , then the final training labels can be denoted as Y = [ Yb , Yr ] . Accordingly , the corresponding original feature are denoted as X = [ Xo ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . The adversary can design a trigger t ∈ Rd to form the corrupted feature set Xb ∈ Rbn c×d such that for any bi in Xb , oi in Xo , it satisfies bi = oi + t. Finally , the training feature will be X = [ Xb ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . Without ambiguity,1 we also denote T = [ t , t , ... , t ] ∈ Rbn c×d , so that Xo +T = Xb . Before analyzing the algorithm , we make following assumptions about the adversary attack : Assumption 1 ( Bounded Corruption Ratio ) . The overall corruption ratio and the corruption ratio in each class is bounded . Specifically , E ( x , y , yb ) ∈ ( X , Y , Yb ) [ I ( yb = c|y 6= c ) I ( y = c ) ] ≤ = 0.5 ∀c ∈ 4Y . Assumption 2 ( Small Trigger ) . Any backdoor trigger satisfies ‖t‖p ≤ τ , which subtly alters the data within a small radius-τ ball without changing its ground-truth label . We also assume that there exists at least one black-box robust algorithm A which can defend any noisy label attacks so long as the noisy-label ratio is bounded by . Note that the above assumption is mild , since a variety of existing algorithm can handle noisy labels attacks with a large corruption rate ( e.g . 45 % ) ( Jiang et al. , 2017 ; Han et al. , 2018 ; Reed et al. , 2014 ; Liu et al. , 2021 ) . | The paper introduces an algorithm to defend against backdoor data poisoning attacks by leveraging noisy-label defense algorithms. Per se, noisy-label algorithms are not capable of defending against backdoors. However, the authors propose to use these techniques in combination with their proposed algorithm for adversarial training to reduce the effectiveness of backdoor data poisoning attacks. | SP:01d00582d40474de9db387743171338e67f6760f |
Defending Backdoor Data Poisoning Attacks by Using Noisy Label Defense Algorithm | 1 INTRODUCTION . Deep neural networks ( DNN ) have achieved significant success in a variety of applications such as image classification ( Krizhevsky et al. , 2012 ) , autonomous driving ( Major et al. , 2019 ) , and natural language processing ( Devlin et al. , 2018 ) , due to its powerful generalization ability . In the meantime , DNN can be highly susceptible to even small perturbations of training data , which has raised considerable concerns about its trustworthiness ( Liu et al. , 2020 ) . One representative perturbation approach is backdoor attack , which undermines the DNN performance by modifying a small fraction of the training samples with specific triggers injected into their input features , whose ground-truth labels are altered accordingly to be the attacker-specified ones . It is unlikely to detect backdoor attacks by monitoring the model training performance , since the trained model can still perform well on the benign validation samples . Consequently , during testing phase , if the data is augmented with the trigger , it would be classified as the attacker-specified label . Subtle yet effective , backdoor attacks can pose serious threats to the practical application of DNNs . Another typical type of data poisoning attack is noisy label attacks ( Han et al. , 2018 ; Patrini et al. , 2017 ; Yi & Wu , 2019 ; Jiang et al. , 2017 ) , in which the labels of a small fraction of data are altered deliberately to compromise the model learning , while the input features of the training data remain untouched . Backdoor attacks share a close connection to noisy label attacks , in that during a backdoor attack , the feature can only be altered insignificantly to put the trigger in disguise , which makes the corrupted feature ( e.g . images with the trigger ) highly similar to the uncorrupted ones . Prior efforts have been made to effectively address noisy label attacks . For instance , there are algorithms that can tolerate a large fraction of label corruption , with up to 45 % noisy labels ( Han et al. , 2018 ; Jiang et al. , 2018 ) . However , to the best of our knowledge , most algorithms defending against backdoor attacks can not deal with a high corruption ratio even if the features of corrupted data are only slightly perturbed . Observing the limitation of prior arts , we aim to answer one key question : Can one train a deep neural network that is robust against a large number of backdoor attacks ? Moreover , given the resemblance between noisy label attacks and backdoor attacks , we also investigate another intriguing question : Can one leverage algorithms initially designed for handling noisy label attacks to defend against backdoor attacks more effectively ? The contributions of this paper are multi-fold . First , we provide a novel and principled perspective to decouple the challenges of defending backdoor attacks into two components : one induced by the corrupted input features , and the other induced by the corrupted labels , based on which we can draw a theoretical connection between the noisy-label attacks and backdoor data attacks . Second , we propose a meta-algorithm which addresses both challenges by a novel minimax optimization . Specifically , the proposed approach takes any noisy-label defense algorithm as the input and outputs a reinforced version of the algorithm that is robust against backdoor poisoning attacks , while the initial form of the algorithm fails to provide such defense . Extensive experiments show that the proposed meta-algorithm improves the robustness of DNN models against various backdoor attacks on a variety of benchmark datasets with up to 45 % corruption ratio . Furthermore , we propose a systematic , meta-framework to solve backdoor attacks , which can effectively join existing force in noisy label attack defenses and provides more insights to future development of defense algorithms . 2 RELATED WORK . 2.1 ROBUST DEEP LEARNING AGAINST ADVERSARIAL ATTACK . Although DNNs have shown high generalization performance on various tasks , it has been observed that a trained DNN model would yield different results even by perturbing the image in an invisible manner ( Goodfellow et al. , 2014 ; Yuan et al. , 2019 ) . Prior efforts have been made to tackle this issue , among which one natural defense strategy is to change the empirical loss minimization into a minimax objective . By solving the minimax problem , the model is guaranteed a better worst-case generalization performance ( Duchi & Namkoong , 2021 ) . Since exactly solving the inner maximization problem can be computationally prohibitive , different strategies have been proposed to approximate the inner maximization optimization , including heuristic alternative optimization , linear programming Wong & Kolter ( 2018 ) , semi-definite programming Raghunathan et al . ( 2018 ) , etc . Besides minimax optimization , another approach to improve model robustness is imposing a Lipschitz constraint on the network . Work along this line includes randomized smoothing Cohen et al . ( 2019 ) ; Salman et al . ( 2019 ) , spectral normalization Miyato et al . ( 2018a ) , and adversarial Lipschitz regularization Terjék ( 2019 ) . Although there are algorithms that are robust against adversarial samples , they are not designed to confront backdoor attacks , in which clean training data is usually inaccessible . There are also studies that investigated the connection between adversarial robustness and robustness against backdoor attack ( Weber et al. , 2020 ) . However , to our best knowledge , there is no literature studying the relationship between label flipping attack and backdoor attack . 2.2 ROBUST DEEP LEARNING AGAINST LABEL NOISE . Many recent studies have investigated the robustness of classification tasks with noisy labels . For example , Kumar et al . ( 2010 ) proposed the Self-Paced Learning ( SPL ) approach , which assigns higher weights to examples with a smaller loss . A similar idea was used in Curriculum Learning ( Bengio et al. , 2009 ) , in which a model learns on easier examples before moving to the harder ones . Other methods inspired by SPL include learning the data weights ( Jiang et al. , 2018 ) and collaborative learning ( Han et al. , 2018 ; Yu et al. , 2019 ) . An alternative approach to defending noisy label attacks is label correction ( Patrini et al. , 2017 ; Li et al. , 2017 ; Yi & Wu , 2019 ) , which attempts to revise the original labels of the data to recover clean labels from corrupted ones . However , since we do not have the knowledge of which data points have been corrupted , it is nontrivial to obtain provable guarantees for label corrections , unless strong assumptions have been made on the corruption type . 2.3 DATA POISONING BACKDOOR ATTACK AND ITS DEFENSE . Robust learning against backdoor attacks has been widely studied recently . Gu et al . ( 2017 ) showed that even a small patch of perturbation can compromise the generalization performance when data is augmented with a backdoor trigger . Other types of attacks include the blend attacks ( Chen et al. , 2017 ) , clean label attacks ( Turner et al. , 2018 ; Shafahi et al. , 2018 ) , latent backdoor attacks ( Yao et al. , 2019 ) , etc . While there are various types of backdoor attacks , some attack requires that the adversary not only has access to the data but also can has limited control on the training and inference process . Those attacks include Trojan attacks and blind backdoor attacks ( Pang et al. , 2020 ) . We refer readers to Pang et al . ( 2020 ) for a comprehensive survey on different types of backdoor attacks . Various defense methods have been proposed to defend against backdoor attacks . One defense category is to remove the corrupted data by using anomaly detection ( Tran et al. , 2018 ; Chen et al. , 2018 ) . Another category of work is the model inspection ( Wang et al. , 2019 ) , which aims to inspect and modify the backdoored model to make it robust against the trigger . There are also other methods of tackling the backdoor attacks , such as randomized smoothing ( Cohen et al. , 2019 ; Weber et al. , 2020 ) , and the median of means ( Levine & Feizi , 2020 ) . However , they are either inefficient or can not defend against backdoor attacks with a large ratio of corrupted data . Some of the above methods also hinge on a clean set of validation data , while in practice , it is unlikely to guarantee the existence of clean validation data , since validation data is usually a subset of training data . To the best of our knowledge , there is no existing backdoor defense algorithm that is motivated from the label corruption perspective . 3 PRELIMINARIES . 3.1 LEARNING WITH NOISY LABELS . In this section , we review some representative approaches for defending noisy-labels . Although the initial forms of these approaches can be vulnerable to backdoor attacks , we show later in the next section that our proposed meta-algorithm can empower them to effectively confront backdoor attacks . Specifically , we look into two types of nosiy-label defending approaches : filtering-based approaches and consistency-based approaches . The filtering-based approach is one of the most effective strategies for defending noisy labels , which works by selecting or weighting the training samples based on indicators such as sample losses ( Jiang et al. , 2017 ; Han et al. , 2018 ; Jiang et al. , 2020 ) or gradient norms of the loss-layer ( Liu et al. , 2021 ) . For instance , Jiang et al . ( 2017 ) proposed to assign higher probabilities to samples with lower losses to be selected for model training . Consistency-based approach modifies data labels during model training . Specifically , the Bootstrap approach ( Reed et al. , 2014 ) encourages model predictions to be consistent between iterations , by modifying the labels as a linear combination of the observed labels and previous predictions . In this paper , we leverage two filtering-based noisy label algorithms , i.e . the Self-Paced Learning ( SPL ) ( Jiang et al. , 2017 ; Kumar et al. , 2010 ) and Provable Robust Learning ( PRL ) ( Liu et al. , 2021 ) , and one consistency-based algorithm , i.e . the Bootstrap ( Reed et al. , 2014 ) , to investigate the efficacy of the proposed meta algorithm . Strong empirical results in Section 5 on those input algorithms suggest that our meta framework is readily to benefit other robust noisy-label algorithms . We briefly summarize the main idea of the above algorithms in table 1 . 3.2 PROBLEM SETTING OF BACKDOOR ATTACKS . In this paper , we follow a standard setting for backdoor attacks and assume that there is an adversary that tries to perform the backdoor attack . Firstly , the adversary can choose up to fraction of clean labels Y ∈ Rn×q and modify them to arbitrary valid numbers to form the corrupted labels Yb ∈ Rbn c×q . Let Yr represent the remaining untouched labels , then the final training labels can be denoted as Y = [ Yb , Yr ] . Accordingly , the corresponding original feature are denoted as X = [ Xo ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . The adversary can design a trigger t ∈ Rd to form the corrupted feature set Xb ∈ Rbn c×d such that for any bi in Xb , oi in Xo , it satisfies bi = oi + t. Finally , the training feature will be X = [ Xb ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . Without ambiguity,1 we also denote T = [ t , t , ... , t ] ∈ Rbn c×d , so that Xo +T = Xb . Before analyzing the algorithm , we make following assumptions about the adversary attack : Assumption 1 ( Bounded Corruption Ratio ) . The overall corruption ratio and the corruption ratio in each class is bounded . Specifically , E ( x , y , yb ) ∈ ( X , Y , Yb ) [ I ( yb = c|y 6= c ) I ( y = c ) ] ≤ = 0.5 ∀c ∈ 4Y . Assumption 2 ( Small Trigger ) . Any backdoor trigger satisfies ‖t‖p ≤ τ , which subtly alters the data within a small radius-τ ball without changing its ground-truth label . We also assume that there exists at least one black-box robust algorithm A which can defend any noisy label attacks so long as the noisy-label ratio is bounded by . Note that the above assumption is mild , since a variety of existing algorithm can handle noisy labels attacks with a large corruption rate ( e.g . 45 % ) ( Jiang et al. , 2017 ; Han et al. , 2018 ; Reed et al. , 2014 ; Liu et al. , 2021 ) . | The proposed work presents a defense algorithm for backdoor poisoning attacks. The authors consider a noisy label setting where the attacker adds a trigger to certain samples of training data and changes their label. This mainly consists of two attacks, BadNets and Blending attack. The authors then come up with an objective to train the network in a noisy label setting such that networks become robust to the poisoning attacks. | SP:01d00582d40474de9db387743171338e67f6760f |
Defending Backdoor Data Poisoning Attacks by Using Noisy Label Defense Algorithm | 1 INTRODUCTION . Deep neural networks ( DNN ) have achieved significant success in a variety of applications such as image classification ( Krizhevsky et al. , 2012 ) , autonomous driving ( Major et al. , 2019 ) , and natural language processing ( Devlin et al. , 2018 ) , due to its powerful generalization ability . In the meantime , DNN can be highly susceptible to even small perturbations of training data , which has raised considerable concerns about its trustworthiness ( Liu et al. , 2020 ) . One representative perturbation approach is backdoor attack , which undermines the DNN performance by modifying a small fraction of the training samples with specific triggers injected into their input features , whose ground-truth labels are altered accordingly to be the attacker-specified ones . It is unlikely to detect backdoor attacks by monitoring the model training performance , since the trained model can still perform well on the benign validation samples . Consequently , during testing phase , if the data is augmented with the trigger , it would be classified as the attacker-specified label . Subtle yet effective , backdoor attacks can pose serious threats to the practical application of DNNs . Another typical type of data poisoning attack is noisy label attacks ( Han et al. , 2018 ; Patrini et al. , 2017 ; Yi & Wu , 2019 ; Jiang et al. , 2017 ) , in which the labels of a small fraction of data are altered deliberately to compromise the model learning , while the input features of the training data remain untouched . Backdoor attacks share a close connection to noisy label attacks , in that during a backdoor attack , the feature can only be altered insignificantly to put the trigger in disguise , which makes the corrupted feature ( e.g . images with the trigger ) highly similar to the uncorrupted ones . Prior efforts have been made to effectively address noisy label attacks . For instance , there are algorithms that can tolerate a large fraction of label corruption , with up to 45 % noisy labels ( Han et al. , 2018 ; Jiang et al. , 2018 ) . However , to the best of our knowledge , most algorithms defending against backdoor attacks can not deal with a high corruption ratio even if the features of corrupted data are only slightly perturbed . Observing the limitation of prior arts , we aim to answer one key question : Can one train a deep neural network that is robust against a large number of backdoor attacks ? Moreover , given the resemblance between noisy label attacks and backdoor attacks , we also investigate another intriguing question : Can one leverage algorithms initially designed for handling noisy label attacks to defend against backdoor attacks more effectively ? The contributions of this paper are multi-fold . First , we provide a novel and principled perspective to decouple the challenges of defending backdoor attacks into two components : one induced by the corrupted input features , and the other induced by the corrupted labels , based on which we can draw a theoretical connection between the noisy-label attacks and backdoor data attacks . Second , we propose a meta-algorithm which addresses both challenges by a novel minimax optimization . Specifically , the proposed approach takes any noisy-label defense algorithm as the input and outputs a reinforced version of the algorithm that is robust against backdoor poisoning attacks , while the initial form of the algorithm fails to provide such defense . Extensive experiments show that the proposed meta-algorithm improves the robustness of DNN models against various backdoor attacks on a variety of benchmark datasets with up to 45 % corruption ratio . Furthermore , we propose a systematic , meta-framework to solve backdoor attacks , which can effectively join existing force in noisy label attack defenses and provides more insights to future development of defense algorithms . 2 RELATED WORK . 2.1 ROBUST DEEP LEARNING AGAINST ADVERSARIAL ATTACK . Although DNNs have shown high generalization performance on various tasks , it has been observed that a trained DNN model would yield different results even by perturbing the image in an invisible manner ( Goodfellow et al. , 2014 ; Yuan et al. , 2019 ) . Prior efforts have been made to tackle this issue , among which one natural defense strategy is to change the empirical loss minimization into a minimax objective . By solving the minimax problem , the model is guaranteed a better worst-case generalization performance ( Duchi & Namkoong , 2021 ) . Since exactly solving the inner maximization problem can be computationally prohibitive , different strategies have been proposed to approximate the inner maximization optimization , including heuristic alternative optimization , linear programming Wong & Kolter ( 2018 ) , semi-definite programming Raghunathan et al . ( 2018 ) , etc . Besides minimax optimization , another approach to improve model robustness is imposing a Lipschitz constraint on the network . Work along this line includes randomized smoothing Cohen et al . ( 2019 ) ; Salman et al . ( 2019 ) , spectral normalization Miyato et al . ( 2018a ) , and adversarial Lipschitz regularization Terjék ( 2019 ) . Although there are algorithms that are robust against adversarial samples , they are not designed to confront backdoor attacks , in which clean training data is usually inaccessible . There are also studies that investigated the connection between adversarial robustness and robustness against backdoor attack ( Weber et al. , 2020 ) . However , to our best knowledge , there is no literature studying the relationship between label flipping attack and backdoor attack . 2.2 ROBUST DEEP LEARNING AGAINST LABEL NOISE . Many recent studies have investigated the robustness of classification tasks with noisy labels . For example , Kumar et al . ( 2010 ) proposed the Self-Paced Learning ( SPL ) approach , which assigns higher weights to examples with a smaller loss . A similar idea was used in Curriculum Learning ( Bengio et al. , 2009 ) , in which a model learns on easier examples before moving to the harder ones . Other methods inspired by SPL include learning the data weights ( Jiang et al. , 2018 ) and collaborative learning ( Han et al. , 2018 ; Yu et al. , 2019 ) . An alternative approach to defending noisy label attacks is label correction ( Patrini et al. , 2017 ; Li et al. , 2017 ; Yi & Wu , 2019 ) , which attempts to revise the original labels of the data to recover clean labels from corrupted ones . However , since we do not have the knowledge of which data points have been corrupted , it is nontrivial to obtain provable guarantees for label corrections , unless strong assumptions have been made on the corruption type . 2.3 DATA POISONING BACKDOOR ATTACK AND ITS DEFENSE . Robust learning against backdoor attacks has been widely studied recently . Gu et al . ( 2017 ) showed that even a small patch of perturbation can compromise the generalization performance when data is augmented with a backdoor trigger . Other types of attacks include the blend attacks ( Chen et al. , 2017 ) , clean label attacks ( Turner et al. , 2018 ; Shafahi et al. , 2018 ) , latent backdoor attacks ( Yao et al. , 2019 ) , etc . While there are various types of backdoor attacks , some attack requires that the adversary not only has access to the data but also can has limited control on the training and inference process . Those attacks include Trojan attacks and blind backdoor attacks ( Pang et al. , 2020 ) . We refer readers to Pang et al . ( 2020 ) for a comprehensive survey on different types of backdoor attacks . Various defense methods have been proposed to defend against backdoor attacks . One defense category is to remove the corrupted data by using anomaly detection ( Tran et al. , 2018 ; Chen et al. , 2018 ) . Another category of work is the model inspection ( Wang et al. , 2019 ) , which aims to inspect and modify the backdoored model to make it robust against the trigger . There are also other methods of tackling the backdoor attacks , such as randomized smoothing ( Cohen et al. , 2019 ; Weber et al. , 2020 ) , and the median of means ( Levine & Feizi , 2020 ) . However , they are either inefficient or can not defend against backdoor attacks with a large ratio of corrupted data . Some of the above methods also hinge on a clean set of validation data , while in practice , it is unlikely to guarantee the existence of clean validation data , since validation data is usually a subset of training data . To the best of our knowledge , there is no existing backdoor defense algorithm that is motivated from the label corruption perspective . 3 PRELIMINARIES . 3.1 LEARNING WITH NOISY LABELS . In this section , we review some representative approaches for defending noisy-labels . Although the initial forms of these approaches can be vulnerable to backdoor attacks , we show later in the next section that our proposed meta-algorithm can empower them to effectively confront backdoor attacks . Specifically , we look into two types of nosiy-label defending approaches : filtering-based approaches and consistency-based approaches . The filtering-based approach is one of the most effective strategies for defending noisy labels , which works by selecting or weighting the training samples based on indicators such as sample losses ( Jiang et al. , 2017 ; Han et al. , 2018 ; Jiang et al. , 2020 ) or gradient norms of the loss-layer ( Liu et al. , 2021 ) . For instance , Jiang et al . ( 2017 ) proposed to assign higher probabilities to samples with lower losses to be selected for model training . Consistency-based approach modifies data labels during model training . Specifically , the Bootstrap approach ( Reed et al. , 2014 ) encourages model predictions to be consistent between iterations , by modifying the labels as a linear combination of the observed labels and previous predictions . In this paper , we leverage two filtering-based noisy label algorithms , i.e . the Self-Paced Learning ( SPL ) ( Jiang et al. , 2017 ; Kumar et al. , 2010 ) and Provable Robust Learning ( PRL ) ( Liu et al. , 2021 ) , and one consistency-based algorithm , i.e . the Bootstrap ( Reed et al. , 2014 ) , to investigate the efficacy of the proposed meta algorithm . Strong empirical results in Section 5 on those input algorithms suggest that our meta framework is readily to benefit other robust noisy-label algorithms . We briefly summarize the main idea of the above algorithms in table 1 . 3.2 PROBLEM SETTING OF BACKDOOR ATTACKS . In this paper , we follow a standard setting for backdoor attacks and assume that there is an adversary that tries to perform the backdoor attack . Firstly , the adversary can choose up to fraction of clean labels Y ∈ Rn×q and modify them to arbitrary valid numbers to form the corrupted labels Yb ∈ Rbn c×q . Let Yr represent the remaining untouched labels , then the final training labels can be denoted as Y = [ Yb , Yr ] . Accordingly , the corresponding original feature are denoted as X = [ Xo ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . The adversary can design a trigger t ∈ Rd to form the corrupted feature set Xb ∈ Rbn c×d such that for any bi in Xb , oi in Xo , it satisfies bi = oi + t. Finally , the training feature will be X = [ Xb ∈ Rbn c×d , Xr ∈ R ( n−bn c ) ×d ] . Without ambiguity,1 we also denote T = [ t , t , ... , t ] ∈ Rbn c×d , so that Xo +T = Xb . Before analyzing the algorithm , we make following assumptions about the adversary attack : Assumption 1 ( Bounded Corruption Ratio ) . The overall corruption ratio and the corruption ratio in each class is bounded . Specifically , E ( x , y , yb ) ∈ ( X , Y , Yb ) [ I ( yb = c|y 6= c ) I ( y = c ) ] ≤ = 0.5 ∀c ∈ 4Y . Assumption 2 ( Small Trigger ) . Any backdoor trigger satisfies ‖t‖p ≤ τ , which subtly alters the data within a small radius-τ ball without changing its ground-truth label . We also assume that there exists at least one black-box robust algorithm A which can defend any noisy label attacks so long as the noisy-label ratio is bounded by . Note that the above assumption is mild , since a variety of existing algorithm can handle noisy labels attacks with a large corruption rate ( e.g . 45 % ) ( Jiang et al. , 2017 ; Han et al. , 2018 ; Reed et al. , 2014 ; Liu et al. , 2021 ) . | This paper aims to apply noisy-label defense algorithms to defend general backdoor attacks. The authors propose a meta-algorithm by adding noisy labels to the training set and optimizing outer minimization and inner maximization of the model by the noisy-label algorithm. Combined with adversarial training, the authors show their method could improve the robustness of models against backdoor attack. | SP:01d00582d40474de9db387743171338e67f6760f |
Directional Bias Helps Stochastic Gradient Descent to Generalize in Nonparametric Model | 1 INTRODUCTION . In this paper , we study the Stochastic Gradient Descent ( SGD ) algorithm in a nonparametric regression model . Among nonparametric models , one popular choice in both statistics and machine learning communities is the kernel model that is generated by a Reproducing Kernel Hilbert Space ( RKHS ) . When fitting kernel models to the data , SGD is computationally efficient as compared to Gradient Descent ( GD ) ( Ma et al. , 2018 ) . This motivates us to analyze the properties of SGD in the kernel model , especially for SGD with a nontrivial step size for a practical reason . In particular , we aim to provide a fundamental explanation of why SGD estimators generalize well . Our work is inspired by Wu et al . ( 2021 ) , which shows that directional bias has a significant impact on the generalization property in the linear regression model . We adopt a similar concept of the directional bias , but generalize them to the nonparametric model . Our result is a non-trivial extension of their approach , due to the difference in our problem setting and our SGD algorithm design . To the best of our knowledge , we are the first to show the directional bias phenomenon of SGD and analyze how it helps generalization in nonparametric regression . Our contributions are two folded . First , we study the directional bias of ( S ) GD in a nonparametric regression model . On the one hand , nonparametric regression is well studied in both statistics and machine learning . On the other hand , the directional bias is a relatively new concept ( Wu et al. , 2021 ) of an algorithm that affects the statistics properties , and there is no thorough understanding of the directional bias of ( S ) GD algorithms for the nonparametric regression model . Note that our result is closely related to those in Belkin et al . ( 2018 ) ; Liang & Rakhlin ( 2020 ) : they prove that SGD and GD algorithms both converge to the minimum norm interpolate , where the same properties are discovered for SGD and GD ; whereas we investigate the solution paths before their convergence , and show that SGD and GD have different solution paths that lead to different properties . Our result helps to explain why the SGD generalizes better than GD . Our second contribution is to unify the conditions to show the directional bias of ( S ) GD sequences in nonparametric models . The main condition is the diagonal dominant gram matrix , which covers a large class of kernel functions and allows us to study their properties . Moreover , our SGD is different from those in Wu et al . ( 2021 ) : they define SGD in epochs while we define SGD in steps . The fundamental difference in the SGD algorithm requires us to develop different techniques for analyzing the SGD sequence and showing its directional bias , which has not yet been covered in the current literature . Main Theorems of this paper can be divided into two parts , briefly summarized as follows : First is the directional bias of SGD . Theorem 5 shows that for a two-stage SGD with a moderate step size in the first stage and a small step size in the second stage , an early-stopped estimator has a directional bias towards the eigenvector that corresponds to the largest eigenvalue of the gram matrix . Later we refer to this direction as the direction towards the largest eigenvector to simplify the statement . As a comparison , Theorem 7 shows that GD with both moderate and small step sizes has a directional bias towards the eigenvector that corresponds to the smallest eigenvalue of the gram matrix ( denote it as the direction towards the smallest eigenvector ) . From which , we conclude that SGD and GD have different direction biases in kernel regression . Second is the implication of directional bias . The implication is very useful since it quantifies the effect of the directional bias on the generalization error . Theorem 9 considers a general problem of quadratic loss . It shows that the estimator biased towards the largest eigenvector of the Hessian ( which is the gram matrix in our nonparametric regression ) can have the smallest parameter estimation error , when compared with other estimators of the same loss . With this high-level idea of directional bias helps generalization , Theorem 11 compares the generalization error of SGD and GD in our problem setting . In particular , it upper bounds the generalization error of SGD and lower bounds the generalization error of GD . By directly comparing the error bounds , we guarantee that the generalization error of the SGD estimator is smaller than that of the GD estimator with high probability . We also point out that our result might shed new light on deep learning ( Belkin et al. , 2018 ) . By the state-of-the-art mathematical theory of Neural Networks ( NN ) , kernel and/or nonparametric methods can approximate the functional space of neural networks , see for example the NTK theory ( Jacot et al. , 2018 ) , and the Radon bounded variance space description for ReLU NN ( Parhi & Nowak , 2021 ) . Our technique might allow one to characterize the SGD solution path and show the generalization property in those problem settings . Paper organization . The rest of the paper is as follows : In Section 2 , we review some relevant literature ; In Section 3 , we give the formulation of the nonparametric regression and define the optimization problem . We also formalize the algorithm that is considered in this work and make assumptions to analyze the algorithms ; In Section 4 , we state our main theory on the directional bias of SGD/GD in nonparametric regression , where we include both the directional bias result and the implication of the directional bias for generalization . Experiments are conducted to support our theory ; In Section 5 , we discuss the finding in this paper , and propose some future research topic . All the proof , experiment details , and more experiments are deferred to the appendix due to page limits . 2 LITERATURE REVIEW . In this section , we review some relevant works . For better understanding , we split into two subsections : Subsection 2.1 reviews the background of RKHS ; Subsection 2.2 presents the state-of-the-art technique for analyzing the directional bias of the ( S ) GD algorithm . 2.1 RKHS . Kernel methods are among the core algorithms in machine learning and statistics ( Bartlett et al. , 2021 ) . As proposed by Wahba ( 1990 ) , the kernel method and RKHS serve as a unified framework of a group of nonparametric models , which extends the spline method . Later , kernel models become an important component in nonparametric models . In machine learning , the kernel-based method is always referred to as the “ kernel trick ” . By lifting the x variable to a high dimensional space via the kernel method , we can explore possibly nonlinear relationships between variables . Moreover , to play the kernel trick , one can directly calculate the kernel function using original features . This is computationally efficient since we avoid calculating high dimension or infinite dimension features . For applications of kernel method in machine learning , one can see kernel regression for image processing ( Takeda et al. , 2007 ) , for text mining ( Greene & Cunningham , 2006 ) , and for tasks in bioinformatics ( Saigo et al. , 2004 ) . Regarding deep learning , the kernel method is also important because it has implications for deep learning models . On the one hand , the kernel methods have similar benign overfitting behavior to neural network due to the implicit regularization and/or implicit bias phenomenon that we will review in the next subsection ( Belkin et al. , 2018 ) . On the other hand , the RKHS itself is closely related to Neural Networks via the Neural Tangent Kernel theory ( Jacot et al. , 2018 ) . This all indicates that to understand deep learning , one should first study kernel methods . 2.2 DIRECTIONAL BIAS . This paper analyzes the directional bias of SGD for the nonparametric regression . Directional bias , also referred to as implicit bias , of an algorithm refers to that its solution path is biased towards a certain direction . It works as that the algorithm prefers some directions over the others even though they may have the same objective function value . Since the algorithm selects a direction by itself , instead of explicitly required by any constraint , people use the term “ implicit ” . It is worth noting that the implicit regularization is related to implicit bias . The implicit regularization refers to that the converged point of an algorithm is like a regularized estimator , even if the objective function is not explicitly regularized . One can also interpret implicit regularization as the “ final result ” of implicit bias . In the recent work by Derezinski et al . ( 2020 ) , implicit regularization is used to develop an exact bound for double descent in linear regression . In this way , implicit regularization/bias serves as a way to explain some deep learning phenomenons that could not be addressed by the classical empirical risk minimization ( ERM ) framework . Therefore , it is important to study directional bias . State-of-the-art study on the directional bias of first-order algorithms can be divided into two categories by the technique they use : The first category is the ( stochastic ) gradient flow method , by taking an infinitesimal step size in ( S ) GD , the parameter dynamic follows a ( stochastic ) differential equation . Studying the solution path and the stationary point of the underlying differential equation helps to reveal the property of the parameter estimation . We list some works that use the first method to show the directional bias result of the ( stochastic ) gradient descent . Liu et al . ( 2018 ) analyze the Momentum SGD ( MSGD ) with infinitesimal step size , and show that the solution path escapes from the saddle for a nonconvex objective function . It is worth noting that in their case , the associated stochastic differential equation defines a complicated stochastic process , thus they replace it with an appropriate diffusion process , and the analysis is done based on such diffusion approximation . If one analyzes a stochastic gradient flow and finds it intractable , one may consider using the technique of diffusion approximation . Ali et al . ( 2020 ) shows the stochastic gradient flow for the linear regression problem minw ‖Xw−y‖22 has a solution path close to the solution path of Ridge regression ; Blanc et al . ( 2020 ) shows the stochastic gradient flow for a general loss function has a solution path close to the solution path of gradient flow on the objective function plus some extra penalty terms , and they explicitly identify the penalty terms ; Smith et al . ( 2021 ) go one more step from the infinitesimal step size to small step size , and characterize the effect of small step size as an extra penalty term in the gradient flow . Another category is analyzing the discrete ( S ) GD sequence . This technique in general just requires a moderate step size such that the algorithm converges ( or nearly converges ) , thus it is more meaningful from a practical perspective . We also find some directional bias work that is based on this technique . Vaskevicius et al . ( 2019 ) ; Zhao et al . ( 2019 ) ; Fan et al . ( 2021 ) analyze Hadamard reparameterized GD in sparse regression . They divide the true parameter into strong , weak , and 0 parts , and for each part , they carefully develop the stepwise error bound for each step of GD . They finally show that an early-stopped estimator along the solution path achieves the minimax optimal error rate for sparse regression , which indicates that the solution path is in the direction that biased towards a sparse solution . Recently , Wu et al . ( 2021 ) show that for overparameterized linear regression , SGD with moderate step size converges to the minimum norm interpolant in the direction that corresponds to the largest eigenvalue of the design matrix , while GD converges in the direction that corresponds to the smallest eigenvalue . For Neural Networks in the ‘ lazy training ’ regime , ? shows that GD also converges in the direction of the smallest eigenvalue of the Neural Tangent Kernel . Their result further reveal the mechanism of the directional bias as : GD fits the direction of a larger eigenvalue faster at the beginning of the training , left the smaller eigenvalue direction unfitted ; later the direction of smaller eigenvalue is fitted , resulting in that the estimator goes in this direction . | This paper studies the directional bias of SGD in kernel regression. In particular, this paper shows that when using moderate or small step size, GD converges along the direction corresponding to the smallest eigenvalue of the covariance matrix. In contrast, when provided with a moderate initial learning rate with annealing, SGD converges along the direction corresponding to the largest eigenvalue. Consequently, the authors show that such directional bias of SGD can result in an estimator that is closer to the ground truth, which further leads to better generalization. | SP:55961f4b6b0f58a8504258968e6574e1493d63d0 |
Directional Bias Helps Stochastic Gradient Descent to Generalize in Nonparametric Model | 1 INTRODUCTION . In this paper , we study the Stochastic Gradient Descent ( SGD ) algorithm in a nonparametric regression model . Among nonparametric models , one popular choice in both statistics and machine learning communities is the kernel model that is generated by a Reproducing Kernel Hilbert Space ( RKHS ) . When fitting kernel models to the data , SGD is computationally efficient as compared to Gradient Descent ( GD ) ( Ma et al. , 2018 ) . This motivates us to analyze the properties of SGD in the kernel model , especially for SGD with a nontrivial step size for a practical reason . In particular , we aim to provide a fundamental explanation of why SGD estimators generalize well . Our work is inspired by Wu et al . ( 2021 ) , which shows that directional bias has a significant impact on the generalization property in the linear regression model . We adopt a similar concept of the directional bias , but generalize them to the nonparametric model . Our result is a non-trivial extension of their approach , due to the difference in our problem setting and our SGD algorithm design . To the best of our knowledge , we are the first to show the directional bias phenomenon of SGD and analyze how it helps generalization in nonparametric regression . Our contributions are two folded . First , we study the directional bias of ( S ) GD in a nonparametric regression model . On the one hand , nonparametric regression is well studied in both statistics and machine learning . On the other hand , the directional bias is a relatively new concept ( Wu et al. , 2021 ) of an algorithm that affects the statistics properties , and there is no thorough understanding of the directional bias of ( S ) GD algorithms for the nonparametric regression model . Note that our result is closely related to those in Belkin et al . ( 2018 ) ; Liang & Rakhlin ( 2020 ) : they prove that SGD and GD algorithms both converge to the minimum norm interpolate , where the same properties are discovered for SGD and GD ; whereas we investigate the solution paths before their convergence , and show that SGD and GD have different solution paths that lead to different properties . Our result helps to explain why the SGD generalizes better than GD . Our second contribution is to unify the conditions to show the directional bias of ( S ) GD sequences in nonparametric models . The main condition is the diagonal dominant gram matrix , which covers a large class of kernel functions and allows us to study their properties . Moreover , our SGD is different from those in Wu et al . ( 2021 ) : they define SGD in epochs while we define SGD in steps . The fundamental difference in the SGD algorithm requires us to develop different techniques for analyzing the SGD sequence and showing its directional bias , which has not yet been covered in the current literature . Main Theorems of this paper can be divided into two parts , briefly summarized as follows : First is the directional bias of SGD . Theorem 5 shows that for a two-stage SGD with a moderate step size in the first stage and a small step size in the second stage , an early-stopped estimator has a directional bias towards the eigenvector that corresponds to the largest eigenvalue of the gram matrix . Later we refer to this direction as the direction towards the largest eigenvector to simplify the statement . As a comparison , Theorem 7 shows that GD with both moderate and small step sizes has a directional bias towards the eigenvector that corresponds to the smallest eigenvalue of the gram matrix ( denote it as the direction towards the smallest eigenvector ) . From which , we conclude that SGD and GD have different direction biases in kernel regression . Second is the implication of directional bias . The implication is very useful since it quantifies the effect of the directional bias on the generalization error . Theorem 9 considers a general problem of quadratic loss . It shows that the estimator biased towards the largest eigenvector of the Hessian ( which is the gram matrix in our nonparametric regression ) can have the smallest parameter estimation error , when compared with other estimators of the same loss . With this high-level idea of directional bias helps generalization , Theorem 11 compares the generalization error of SGD and GD in our problem setting . In particular , it upper bounds the generalization error of SGD and lower bounds the generalization error of GD . By directly comparing the error bounds , we guarantee that the generalization error of the SGD estimator is smaller than that of the GD estimator with high probability . We also point out that our result might shed new light on deep learning ( Belkin et al. , 2018 ) . By the state-of-the-art mathematical theory of Neural Networks ( NN ) , kernel and/or nonparametric methods can approximate the functional space of neural networks , see for example the NTK theory ( Jacot et al. , 2018 ) , and the Radon bounded variance space description for ReLU NN ( Parhi & Nowak , 2021 ) . Our technique might allow one to characterize the SGD solution path and show the generalization property in those problem settings . Paper organization . The rest of the paper is as follows : In Section 2 , we review some relevant literature ; In Section 3 , we give the formulation of the nonparametric regression and define the optimization problem . We also formalize the algorithm that is considered in this work and make assumptions to analyze the algorithms ; In Section 4 , we state our main theory on the directional bias of SGD/GD in nonparametric regression , where we include both the directional bias result and the implication of the directional bias for generalization . Experiments are conducted to support our theory ; In Section 5 , we discuss the finding in this paper , and propose some future research topic . All the proof , experiment details , and more experiments are deferred to the appendix due to page limits . 2 LITERATURE REVIEW . In this section , we review some relevant works . For better understanding , we split into two subsections : Subsection 2.1 reviews the background of RKHS ; Subsection 2.2 presents the state-of-the-art technique for analyzing the directional bias of the ( S ) GD algorithm . 2.1 RKHS . Kernel methods are among the core algorithms in machine learning and statistics ( Bartlett et al. , 2021 ) . As proposed by Wahba ( 1990 ) , the kernel method and RKHS serve as a unified framework of a group of nonparametric models , which extends the spline method . Later , kernel models become an important component in nonparametric models . In machine learning , the kernel-based method is always referred to as the “ kernel trick ” . By lifting the x variable to a high dimensional space via the kernel method , we can explore possibly nonlinear relationships between variables . Moreover , to play the kernel trick , one can directly calculate the kernel function using original features . This is computationally efficient since we avoid calculating high dimension or infinite dimension features . For applications of kernel method in machine learning , one can see kernel regression for image processing ( Takeda et al. , 2007 ) , for text mining ( Greene & Cunningham , 2006 ) , and for tasks in bioinformatics ( Saigo et al. , 2004 ) . Regarding deep learning , the kernel method is also important because it has implications for deep learning models . On the one hand , the kernel methods have similar benign overfitting behavior to neural network due to the implicit regularization and/or implicit bias phenomenon that we will review in the next subsection ( Belkin et al. , 2018 ) . On the other hand , the RKHS itself is closely related to Neural Networks via the Neural Tangent Kernel theory ( Jacot et al. , 2018 ) . This all indicates that to understand deep learning , one should first study kernel methods . 2.2 DIRECTIONAL BIAS . This paper analyzes the directional bias of SGD for the nonparametric regression . Directional bias , also referred to as implicit bias , of an algorithm refers to that its solution path is biased towards a certain direction . It works as that the algorithm prefers some directions over the others even though they may have the same objective function value . Since the algorithm selects a direction by itself , instead of explicitly required by any constraint , people use the term “ implicit ” . It is worth noting that the implicit regularization is related to implicit bias . The implicit regularization refers to that the converged point of an algorithm is like a regularized estimator , even if the objective function is not explicitly regularized . One can also interpret implicit regularization as the “ final result ” of implicit bias . In the recent work by Derezinski et al . ( 2020 ) , implicit regularization is used to develop an exact bound for double descent in linear regression . In this way , implicit regularization/bias serves as a way to explain some deep learning phenomenons that could not be addressed by the classical empirical risk minimization ( ERM ) framework . Therefore , it is important to study directional bias . State-of-the-art study on the directional bias of first-order algorithms can be divided into two categories by the technique they use : The first category is the ( stochastic ) gradient flow method , by taking an infinitesimal step size in ( S ) GD , the parameter dynamic follows a ( stochastic ) differential equation . Studying the solution path and the stationary point of the underlying differential equation helps to reveal the property of the parameter estimation . We list some works that use the first method to show the directional bias result of the ( stochastic ) gradient descent . Liu et al . ( 2018 ) analyze the Momentum SGD ( MSGD ) with infinitesimal step size , and show that the solution path escapes from the saddle for a nonconvex objective function . It is worth noting that in their case , the associated stochastic differential equation defines a complicated stochastic process , thus they replace it with an appropriate diffusion process , and the analysis is done based on such diffusion approximation . If one analyzes a stochastic gradient flow and finds it intractable , one may consider using the technique of diffusion approximation . Ali et al . ( 2020 ) shows the stochastic gradient flow for the linear regression problem minw ‖Xw−y‖22 has a solution path close to the solution path of Ridge regression ; Blanc et al . ( 2020 ) shows the stochastic gradient flow for a general loss function has a solution path close to the solution path of gradient flow on the objective function plus some extra penalty terms , and they explicitly identify the penalty terms ; Smith et al . ( 2021 ) go one more step from the infinitesimal step size to small step size , and characterize the effect of small step size as an extra penalty term in the gradient flow . Another category is analyzing the discrete ( S ) GD sequence . This technique in general just requires a moderate step size such that the algorithm converges ( or nearly converges ) , thus it is more meaningful from a practical perspective . We also find some directional bias work that is based on this technique . Vaskevicius et al . ( 2019 ) ; Zhao et al . ( 2019 ) ; Fan et al . ( 2021 ) analyze Hadamard reparameterized GD in sparse regression . They divide the true parameter into strong , weak , and 0 parts , and for each part , they carefully develop the stepwise error bound for each step of GD . They finally show that an early-stopped estimator along the solution path achieves the minimax optimal error rate for sparse regression , which indicates that the solution path is in the direction that biased towards a sparse solution . Recently , Wu et al . ( 2021 ) show that for overparameterized linear regression , SGD with moderate step size converges to the minimum norm interpolant in the direction that corresponds to the largest eigenvalue of the design matrix , while GD converges in the direction that corresponds to the smallest eigenvalue . For Neural Networks in the ‘ lazy training ’ regime , ? shows that GD also converges in the direction of the smallest eigenvalue of the Neural Tangent Kernel . Their result further reveal the mechanism of the directional bias as : GD fits the direction of a larger eigenvalue faster at the beginning of the training , left the smaller eigenvalue direction unfitted ; later the direction of smaller eigenvalue is fitted , resulting in that the estimator goes in this direction . | The paper studies the trajectory of GD and SGD for kernel regression, and the connection to generalization. The paper shows that, under some stepsize choices, SGD has a directional bias towards sharp eigendirections of the kernel matrix. The authors link this feature to generalization using the properties of quadratics. | SP:55961f4b6b0f58a8504258968e6574e1493d63d0 |
Directional Bias Helps Stochastic Gradient Descent to Generalize in Nonparametric Model | 1 INTRODUCTION . In this paper , we study the Stochastic Gradient Descent ( SGD ) algorithm in a nonparametric regression model . Among nonparametric models , one popular choice in both statistics and machine learning communities is the kernel model that is generated by a Reproducing Kernel Hilbert Space ( RKHS ) . When fitting kernel models to the data , SGD is computationally efficient as compared to Gradient Descent ( GD ) ( Ma et al. , 2018 ) . This motivates us to analyze the properties of SGD in the kernel model , especially for SGD with a nontrivial step size for a practical reason . In particular , we aim to provide a fundamental explanation of why SGD estimators generalize well . Our work is inspired by Wu et al . ( 2021 ) , which shows that directional bias has a significant impact on the generalization property in the linear regression model . We adopt a similar concept of the directional bias , but generalize them to the nonparametric model . Our result is a non-trivial extension of their approach , due to the difference in our problem setting and our SGD algorithm design . To the best of our knowledge , we are the first to show the directional bias phenomenon of SGD and analyze how it helps generalization in nonparametric regression . Our contributions are two folded . First , we study the directional bias of ( S ) GD in a nonparametric regression model . On the one hand , nonparametric regression is well studied in both statistics and machine learning . On the other hand , the directional bias is a relatively new concept ( Wu et al. , 2021 ) of an algorithm that affects the statistics properties , and there is no thorough understanding of the directional bias of ( S ) GD algorithms for the nonparametric regression model . Note that our result is closely related to those in Belkin et al . ( 2018 ) ; Liang & Rakhlin ( 2020 ) : they prove that SGD and GD algorithms both converge to the minimum norm interpolate , where the same properties are discovered for SGD and GD ; whereas we investigate the solution paths before their convergence , and show that SGD and GD have different solution paths that lead to different properties . Our result helps to explain why the SGD generalizes better than GD . Our second contribution is to unify the conditions to show the directional bias of ( S ) GD sequences in nonparametric models . The main condition is the diagonal dominant gram matrix , which covers a large class of kernel functions and allows us to study their properties . Moreover , our SGD is different from those in Wu et al . ( 2021 ) : they define SGD in epochs while we define SGD in steps . The fundamental difference in the SGD algorithm requires us to develop different techniques for analyzing the SGD sequence and showing its directional bias , which has not yet been covered in the current literature . Main Theorems of this paper can be divided into two parts , briefly summarized as follows : First is the directional bias of SGD . Theorem 5 shows that for a two-stage SGD with a moderate step size in the first stage and a small step size in the second stage , an early-stopped estimator has a directional bias towards the eigenvector that corresponds to the largest eigenvalue of the gram matrix . Later we refer to this direction as the direction towards the largest eigenvector to simplify the statement . As a comparison , Theorem 7 shows that GD with both moderate and small step sizes has a directional bias towards the eigenvector that corresponds to the smallest eigenvalue of the gram matrix ( denote it as the direction towards the smallest eigenvector ) . From which , we conclude that SGD and GD have different direction biases in kernel regression . Second is the implication of directional bias . The implication is very useful since it quantifies the effect of the directional bias on the generalization error . Theorem 9 considers a general problem of quadratic loss . It shows that the estimator biased towards the largest eigenvector of the Hessian ( which is the gram matrix in our nonparametric regression ) can have the smallest parameter estimation error , when compared with other estimators of the same loss . With this high-level idea of directional bias helps generalization , Theorem 11 compares the generalization error of SGD and GD in our problem setting . In particular , it upper bounds the generalization error of SGD and lower bounds the generalization error of GD . By directly comparing the error bounds , we guarantee that the generalization error of the SGD estimator is smaller than that of the GD estimator with high probability . We also point out that our result might shed new light on deep learning ( Belkin et al. , 2018 ) . By the state-of-the-art mathematical theory of Neural Networks ( NN ) , kernel and/or nonparametric methods can approximate the functional space of neural networks , see for example the NTK theory ( Jacot et al. , 2018 ) , and the Radon bounded variance space description for ReLU NN ( Parhi & Nowak , 2021 ) . Our technique might allow one to characterize the SGD solution path and show the generalization property in those problem settings . Paper organization . The rest of the paper is as follows : In Section 2 , we review some relevant literature ; In Section 3 , we give the formulation of the nonparametric regression and define the optimization problem . We also formalize the algorithm that is considered in this work and make assumptions to analyze the algorithms ; In Section 4 , we state our main theory on the directional bias of SGD/GD in nonparametric regression , where we include both the directional bias result and the implication of the directional bias for generalization . Experiments are conducted to support our theory ; In Section 5 , we discuss the finding in this paper , and propose some future research topic . All the proof , experiment details , and more experiments are deferred to the appendix due to page limits . 2 LITERATURE REVIEW . In this section , we review some relevant works . For better understanding , we split into two subsections : Subsection 2.1 reviews the background of RKHS ; Subsection 2.2 presents the state-of-the-art technique for analyzing the directional bias of the ( S ) GD algorithm . 2.1 RKHS . Kernel methods are among the core algorithms in machine learning and statistics ( Bartlett et al. , 2021 ) . As proposed by Wahba ( 1990 ) , the kernel method and RKHS serve as a unified framework of a group of nonparametric models , which extends the spline method . Later , kernel models become an important component in nonparametric models . In machine learning , the kernel-based method is always referred to as the “ kernel trick ” . By lifting the x variable to a high dimensional space via the kernel method , we can explore possibly nonlinear relationships between variables . Moreover , to play the kernel trick , one can directly calculate the kernel function using original features . This is computationally efficient since we avoid calculating high dimension or infinite dimension features . For applications of kernel method in machine learning , one can see kernel regression for image processing ( Takeda et al. , 2007 ) , for text mining ( Greene & Cunningham , 2006 ) , and for tasks in bioinformatics ( Saigo et al. , 2004 ) . Regarding deep learning , the kernel method is also important because it has implications for deep learning models . On the one hand , the kernel methods have similar benign overfitting behavior to neural network due to the implicit regularization and/or implicit bias phenomenon that we will review in the next subsection ( Belkin et al. , 2018 ) . On the other hand , the RKHS itself is closely related to Neural Networks via the Neural Tangent Kernel theory ( Jacot et al. , 2018 ) . This all indicates that to understand deep learning , one should first study kernel methods . 2.2 DIRECTIONAL BIAS . This paper analyzes the directional bias of SGD for the nonparametric regression . Directional bias , also referred to as implicit bias , of an algorithm refers to that its solution path is biased towards a certain direction . It works as that the algorithm prefers some directions over the others even though they may have the same objective function value . Since the algorithm selects a direction by itself , instead of explicitly required by any constraint , people use the term “ implicit ” . It is worth noting that the implicit regularization is related to implicit bias . The implicit regularization refers to that the converged point of an algorithm is like a regularized estimator , even if the objective function is not explicitly regularized . One can also interpret implicit regularization as the “ final result ” of implicit bias . In the recent work by Derezinski et al . ( 2020 ) , implicit regularization is used to develop an exact bound for double descent in linear regression . In this way , implicit regularization/bias serves as a way to explain some deep learning phenomenons that could not be addressed by the classical empirical risk minimization ( ERM ) framework . Therefore , it is important to study directional bias . State-of-the-art study on the directional bias of first-order algorithms can be divided into two categories by the technique they use : The first category is the ( stochastic ) gradient flow method , by taking an infinitesimal step size in ( S ) GD , the parameter dynamic follows a ( stochastic ) differential equation . Studying the solution path and the stationary point of the underlying differential equation helps to reveal the property of the parameter estimation . We list some works that use the first method to show the directional bias result of the ( stochastic ) gradient descent . Liu et al . ( 2018 ) analyze the Momentum SGD ( MSGD ) with infinitesimal step size , and show that the solution path escapes from the saddle for a nonconvex objective function . It is worth noting that in their case , the associated stochastic differential equation defines a complicated stochastic process , thus they replace it with an appropriate diffusion process , and the analysis is done based on such diffusion approximation . If one analyzes a stochastic gradient flow and finds it intractable , one may consider using the technique of diffusion approximation . Ali et al . ( 2020 ) shows the stochastic gradient flow for the linear regression problem minw ‖Xw−y‖22 has a solution path close to the solution path of Ridge regression ; Blanc et al . ( 2020 ) shows the stochastic gradient flow for a general loss function has a solution path close to the solution path of gradient flow on the objective function plus some extra penalty terms , and they explicitly identify the penalty terms ; Smith et al . ( 2021 ) go one more step from the infinitesimal step size to small step size , and characterize the effect of small step size as an extra penalty term in the gradient flow . Another category is analyzing the discrete ( S ) GD sequence . This technique in general just requires a moderate step size such that the algorithm converges ( or nearly converges ) , thus it is more meaningful from a practical perspective . We also find some directional bias work that is based on this technique . Vaskevicius et al . ( 2019 ) ; Zhao et al . ( 2019 ) ; Fan et al . ( 2021 ) analyze Hadamard reparameterized GD in sparse regression . They divide the true parameter into strong , weak , and 0 parts , and for each part , they carefully develop the stepwise error bound for each step of GD . They finally show that an early-stopped estimator along the solution path achieves the minimax optimal error rate for sparse regression , which indicates that the solution path is in the direction that biased towards a sparse solution . Recently , Wu et al . ( 2021 ) show that for overparameterized linear regression , SGD with moderate step size converges to the minimum norm interpolant in the direction that corresponds to the largest eigenvalue of the design matrix , while GD converges in the direction that corresponds to the smallest eigenvalue . For Neural Networks in the ‘ lazy training ’ regime , ? shows that GD also converges in the direction of the smallest eigenvalue of the Neural Tangent Kernel . Their result further reveal the mechanism of the directional bias as : GD fits the direction of a larger eigenvalue faster at the beginning of the training , left the smaller eigenvalue direction unfitted ; later the direction of smaller eigenvalue is fitted , resulting in that the estimator goes in this direction . | This paper studies directional bias of SGD vs. GD in the setting of kernel regression. The presented results well-recover those for linear regression shown by prior work (Wu et al. 2021). Both theory and experiments are presented. | SP:55961f4b6b0f58a8504258968e6574e1493d63d0 |
Image BERT Pre-training with Online Tokenizer | 1 INTRODUCTION Masked Language Modeling ( MLM ) , which first randomly masks and then reconstructs a set of input tokens , is a popular pre-training paradigm for language models . The MLM pre-trained Transformers ( Devlin et al. , 2019 ) have demonstrated their scalability to largecapacity models and datasets , becoming a defacto standard for lingual tasks . However , its potential for Vision Transformer ( ViT ) , which recently started to revolutionize computer vision research ( Touvron et al. , 2021 ; Dosovitskiy et al. , 2021 ) , has been largely underexplored . Most popular unsupervised pretraining schemes in vision deal with the global views ( Chen et al. , 2021 ; Caron et al. , 2021 ) , neglecting images ’ internal structures , as opposed to MLM modeling local tokens . In this work , we seek to continue the success of MLM and explore Masked Image Modeling ( MIM ) for training better Vision Transform- ers such that it can serve as a standard component , as it does for NLP . One of the most crucial components in MLM is the lingual tokenizer which splits language into semantically meaningful tokens , e.g. , WordPiece ( Wu et al. , 2016 ) in BERT . Similarly , the crux of MIM lies in a proper design of visual tokenizer , which transforms the masked patches to supervisory signals for the target model , as shown in Fig . 2 . However , unlike lingual semantics arising naturally from the statistical analysis of word frequency ( Sennrich et al. , 2016 ) , visual semantics can not be ex- tracted such easily due to the continuous property of images . Empirically , visual semantics emerges progressively by bootstrapping online representation that enforces a similarity of distorted image views ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2020 ) . This property intuitively indicates a multi-stage training pipeline , where we need to first train an off-the-shelf semantic-rich tokenizer before training the target model . However , since acquiring visual semantics is a common end for both the tokenizer and target model , a single-stage training pipeline where the tokenizer and target model can be jointly optimized awaits further exploration . Previous works partially tackle the above challenges . Several works use identity mapping as the visual tokenizer , i.e. , predicting the raw pixel values ( Pathak et al. , 2016 ; Atito et al. , 2021 ) . Such paradigm struggles in semantic abstraction and wastes the capacity at modeling high-frequency details , yielding less competitive performance in semantic understanding ( Liu et al. , 2021a ) . Recently , BEiT ( Bao et al. , 2021 ) proposes to use a pre-trained discrete VAE ( Ramesh et al. , 2021 ) as the tokenizer . Though providing some level of abstraction , the discrete VAE is still found only to capture low-level semantics within local details ( as observed by Tab . 9 ) . Moreover , the tokenizer needs to be offline pre-trained with fixed model architectures and extra dataset ( Ramesh et al. , 2021 ) , which potentially limits its adapativity to perform MIM using data from different domains . To this end , we present iBOT , short for image BERT pre-training with Online Tokenizer , a new framework that performs MIM with a tokenizer handling above-mentioned challenges favorably . We motivate iBOT by formulating the MIM as knowledge distillation ( KD ) , which learns to distill knowledge from the tokenizer , and further propose to perform self-distillation for MIM with the help of twin teacher as online tokenizer . The target network is fed with a masked image while the online tokenizer with the original image . The goal is to let the target network recover each masked patch token to its corresponding tokenizer output . Our online tokenizer naturally resolves two major challenges . On the one hand , our tokenizer captures highlevel visual semantics progressively learned by enforcing the similarity of cross-view images on class tokens . On the other hand , our tokenizer needs no extra stages of training as pre-processing setup since it is jointly optimized with MIM via momentum update . The online tokenizer enables iBOT to achieve excellent performance for feature representation . Specifically , iBOT advances ImageNet-1K classification benchmark under k-NN , linear probing and fine-tuning protocols to 77.1 % , 79.5 % , 83.8 % with ViT-Base/16 respectively , which is 1.0 % , 1.3 % , 0.2 % higher than previous best results . When pre-trained with ImageNet-22K , iBOT with ViT-L/16 achieves a linear probing accuracy of 81.7 % and a fine-tuning accuracy of 86.3 % , which is 0.4 % and 0.3 % higher than previous best results . Beyond that , the advancement is also valid when transferring to other datasets or under semi-supervised and unsupervised classification settings . Of particular interest , we have identified an emerging part-level semantics that can help the model with image recognition both on global and local scales . We identify that the semantic patterns learned in patch tokens , which sufficiently lack in the off-line tokenizer as in BEiT ( Bao et al. , 2021 ) , helps the model to be advanced in linear classification and robustness against common image corruptions . When it is transferred to downstream tasks , we show that in downstream tasks related to image classification , object detection , instance segmentation , and semantic segmentation , iBOT surpasses previous methods with nontrivial margins . All of the evidence demonstrates that iBOT has largely closed the gap of masked modeling pre-training between language and vision Transformers . 2 PRELIMINARIES . 2.1 MASKED IMAGE MODELING AS KNOWLEDGE DISTILLATION . Masked image modeling ( MIM ) , which takes a similar formulation as MLM in BERT , has been proposed in several recent works ( Bao et al. , 2021 ; Tan et al. , 2021 ) . Specifically , for an image token sequence x = { xi } Ni=1 , MIM first samples a random mask m ∈ { 0 , 1 } N according to a prediction ratio r , where N is the number of tokens . The patch token xi where mi being 1 , denoted as x̃ , { xi | mi = 1 } , are then replaced with a mask token e [ MASK ] , yielding a corrupted image x̂ , { x̂i | ( 1−mi ) xi+mie [ MASK ] } Ni=1 . MIM is to recover the masked tokens x̃ from the corrupted image x̂ , i.e. , to maximize : log qθ ( x̃|x̂ ) ≈ ∑N i=1 mi · log qθ ( xi|x̂ ) , where ≈ holds with an independence assumption that each masked token can be reconstructed separately . In BEiT ( Bao et al. , 2021 ) , qθ is modelled as a categorical distribution and the task is to minimize − N∑ i=1 mi · Pφ ( xi ) T log Pθ ( x̂i ) , ( 1 ) where P ( · ) transforms the input to a probability distribution overK dimensions , andφ is parameters of a discrete VAE ( Ramesh et al. , 2021 ) that clusters image patches into K categories and assigns each patch token a one-hot encoding identifying its category . We note this loss is formulated similarly to knowledge distillation ( Hinton et al. , 2015 ) , where knowledge is distilled from a pre-fixed tokenizer parameterized by φ to current model parameterized by θ . 2.2 SELF-DISTILLATION . Self-distillation , proposed recently in DINO ( Caron et al. , 2021 ) , distills knowledge not from posterior distributions Pφ ( x ) but past iterations of model itself Pθ′ ( x ) and is cast as a discriminative self-supervised objective . Given the training set I , an image x ∼ I is sampled uniformly , over which two random augmentations are applied , yielding two distorted views u and v. The two distorted views are then put through a teacher-student framework to get the predictive categorical distributions from the [ CLS ] token : v [ CLS ] t = P [ CLS ] θ′ ( v ) and u [ CLS ] s = P [ CLS ] θ ( u ) . The knowledge is distilled from teacher to student by minimizing their cross-entropy , formulated as L [ CLS ] = −P [ CLS ] θ′ ( v ) T log P [ CLS ] θ ( u ) . ( 2 ) The teacher and the student share the same architecture consisting of a backbone f ( e.g. , ViT ) and a projection head h [ CLS ] . The parameters of the student network θ are Exponentially Moving Averaged ( EMA ) to the parameters of teacher network θ′ . The loss is symmetrized by averaging with another cross-entropy term between v [ CLS ] s and u [ CLS ] t . 3 IBOT . We motivate our method by identifying the similar formulation of Eq . ( 1 ) and Eq . ( 2 ) . A visual tokenizer parameterized by online θ′ instead of pre-fixed φ thus arises naturally . In this section , we present iBOT , casting self-distillation as a token-generation self-supervised objective and perform MIM via self-distillation.We illustrate the framework of iBOT in Fig . 3 and demonstrate the pseudocode in Appendix A . In Sec . 3.2 , we briefly introduce the architecture and pre-training setup . 3.1 FRAMEWORK . First , we perform blockwise masking ( Bao et al. , 2021 ) on the two augmented views u and v and obtain their masked views û and v̂ . Taking û as an example for simplicity , the student network outputs for the masked view û projections of its patch tokens ûpatchs = P patch θ ( û ) and the teacher network outputs for the non-masked view u projections of its patch tokens upatcht = P patch θ′ ( u ) . We here define the training objective of MIM in iBOT as LMIM = − N∑ i=1 mi · P patchθ′ ( ui ) T log P patch θ ( ûi ) . ( 3 ) We symmetrize the loss by averaging with another CE term between v̂patchs and v patch t . The backbone together with the projection head of teacher network hpatcht ◦ ft is , therefore , a visual tokenizer that generates online token distributions for each masked patch token . The tokenizer used in iBOT is jointly learnable to MIM objective without a need of being pre-trained in an extra stage , a bonus feature of which is now its domain knowledge can be distilled from the current dataset rather than fixed to the specified dataset . To ensure that the online tokenizer is semantically-meaningful , we perform self-distillation on [ CLS ] token of cross-view images such that visual semantics can be obtained via bootstrapping , as achieved by the majority of the self-supervised methods ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2021 ) . In practice , iBOT works with L [ CLS ] in Eq . ( 2 ) proposed in DINO ( Caron et al. , 2021 ) , except that now we have û [ CLS ] s instead of u [ CLS ] s as input for the student network . To further borrow the capability of semantics abstraction acquired from self-distillatin on [ CLS ] token , we share the parameters of projection heads for [ CLS ] token and patch tokens , i.e. , h [ CLS ] s = h patch s , h [ CLS ] t = h patch t . We empirically find that it produces better results than using separate heads . Unlike tokenized words whose semantics are almost certain , image patch is ambiguous in its semantic meaning . Therefore , tokenization as one-hot discretization can be sub-optimal for images . In iBOT , we use the token distribution after softmax instead of the one-hot token id as a supervisory signal , which plays an important role in iBOT pre-training as shown in Tab . 18 . | The paper proposes the iBOT method. This approach is inspired by the contrastive self-supervised learning approach like DINO and the mask modelling approach like BeiT. The idea is to use an online tokenizer instead of a pretrained tokenizer like Beit. The iBoT approach combines a loss at the patch level like Beit and a global loss at the image level like DINO. IBOT is evaluated in image classification, detection and segmentation. | SP:c1c8be0136f7d9590eee036951fe203c317ef53a |
Image BERT Pre-training with Online Tokenizer | 1 INTRODUCTION Masked Language Modeling ( MLM ) , which first randomly masks and then reconstructs a set of input tokens , is a popular pre-training paradigm for language models . The MLM pre-trained Transformers ( Devlin et al. , 2019 ) have demonstrated their scalability to largecapacity models and datasets , becoming a defacto standard for lingual tasks . However , its potential for Vision Transformer ( ViT ) , which recently started to revolutionize computer vision research ( Touvron et al. , 2021 ; Dosovitskiy et al. , 2021 ) , has been largely underexplored . Most popular unsupervised pretraining schemes in vision deal with the global views ( Chen et al. , 2021 ; Caron et al. , 2021 ) , neglecting images ’ internal structures , as opposed to MLM modeling local tokens . In this work , we seek to continue the success of MLM and explore Masked Image Modeling ( MIM ) for training better Vision Transform- ers such that it can serve as a standard component , as it does for NLP . One of the most crucial components in MLM is the lingual tokenizer which splits language into semantically meaningful tokens , e.g. , WordPiece ( Wu et al. , 2016 ) in BERT . Similarly , the crux of MIM lies in a proper design of visual tokenizer , which transforms the masked patches to supervisory signals for the target model , as shown in Fig . 2 . However , unlike lingual semantics arising naturally from the statistical analysis of word frequency ( Sennrich et al. , 2016 ) , visual semantics can not be ex- tracted such easily due to the continuous property of images . Empirically , visual semantics emerges progressively by bootstrapping online representation that enforces a similarity of distorted image views ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2020 ) . This property intuitively indicates a multi-stage training pipeline , where we need to first train an off-the-shelf semantic-rich tokenizer before training the target model . However , since acquiring visual semantics is a common end for both the tokenizer and target model , a single-stage training pipeline where the tokenizer and target model can be jointly optimized awaits further exploration . Previous works partially tackle the above challenges . Several works use identity mapping as the visual tokenizer , i.e. , predicting the raw pixel values ( Pathak et al. , 2016 ; Atito et al. , 2021 ) . Such paradigm struggles in semantic abstraction and wastes the capacity at modeling high-frequency details , yielding less competitive performance in semantic understanding ( Liu et al. , 2021a ) . Recently , BEiT ( Bao et al. , 2021 ) proposes to use a pre-trained discrete VAE ( Ramesh et al. , 2021 ) as the tokenizer . Though providing some level of abstraction , the discrete VAE is still found only to capture low-level semantics within local details ( as observed by Tab . 9 ) . Moreover , the tokenizer needs to be offline pre-trained with fixed model architectures and extra dataset ( Ramesh et al. , 2021 ) , which potentially limits its adapativity to perform MIM using data from different domains . To this end , we present iBOT , short for image BERT pre-training with Online Tokenizer , a new framework that performs MIM with a tokenizer handling above-mentioned challenges favorably . We motivate iBOT by formulating the MIM as knowledge distillation ( KD ) , which learns to distill knowledge from the tokenizer , and further propose to perform self-distillation for MIM with the help of twin teacher as online tokenizer . The target network is fed with a masked image while the online tokenizer with the original image . The goal is to let the target network recover each masked patch token to its corresponding tokenizer output . Our online tokenizer naturally resolves two major challenges . On the one hand , our tokenizer captures highlevel visual semantics progressively learned by enforcing the similarity of cross-view images on class tokens . On the other hand , our tokenizer needs no extra stages of training as pre-processing setup since it is jointly optimized with MIM via momentum update . The online tokenizer enables iBOT to achieve excellent performance for feature representation . Specifically , iBOT advances ImageNet-1K classification benchmark under k-NN , linear probing and fine-tuning protocols to 77.1 % , 79.5 % , 83.8 % with ViT-Base/16 respectively , which is 1.0 % , 1.3 % , 0.2 % higher than previous best results . When pre-trained with ImageNet-22K , iBOT with ViT-L/16 achieves a linear probing accuracy of 81.7 % and a fine-tuning accuracy of 86.3 % , which is 0.4 % and 0.3 % higher than previous best results . Beyond that , the advancement is also valid when transferring to other datasets or under semi-supervised and unsupervised classification settings . Of particular interest , we have identified an emerging part-level semantics that can help the model with image recognition both on global and local scales . We identify that the semantic patterns learned in patch tokens , which sufficiently lack in the off-line tokenizer as in BEiT ( Bao et al. , 2021 ) , helps the model to be advanced in linear classification and robustness against common image corruptions . When it is transferred to downstream tasks , we show that in downstream tasks related to image classification , object detection , instance segmentation , and semantic segmentation , iBOT surpasses previous methods with nontrivial margins . All of the evidence demonstrates that iBOT has largely closed the gap of masked modeling pre-training between language and vision Transformers . 2 PRELIMINARIES . 2.1 MASKED IMAGE MODELING AS KNOWLEDGE DISTILLATION . Masked image modeling ( MIM ) , which takes a similar formulation as MLM in BERT , has been proposed in several recent works ( Bao et al. , 2021 ; Tan et al. , 2021 ) . Specifically , for an image token sequence x = { xi } Ni=1 , MIM first samples a random mask m ∈ { 0 , 1 } N according to a prediction ratio r , where N is the number of tokens . The patch token xi where mi being 1 , denoted as x̃ , { xi | mi = 1 } , are then replaced with a mask token e [ MASK ] , yielding a corrupted image x̂ , { x̂i | ( 1−mi ) xi+mie [ MASK ] } Ni=1 . MIM is to recover the masked tokens x̃ from the corrupted image x̂ , i.e. , to maximize : log qθ ( x̃|x̂ ) ≈ ∑N i=1 mi · log qθ ( xi|x̂ ) , where ≈ holds with an independence assumption that each masked token can be reconstructed separately . In BEiT ( Bao et al. , 2021 ) , qθ is modelled as a categorical distribution and the task is to minimize − N∑ i=1 mi · Pφ ( xi ) T log Pθ ( x̂i ) , ( 1 ) where P ( · ) transforms the input to a probability distribution overK dimensions , andφ is parameters of a discrete VAE ( Ramesh et al. , 2021 ) that clusters image patches into K categories and assigns each patch token a one-hot encoding identifying its category . We note this loss is formulated similarly to knowledge distillation ( Hinton et al. , 2015 ) , where knowledge is distilled from a pre-fixed tokenizer parameterized by φ to current model parameterized by θ . 2.2 SELF-DISTILLATION . Self-distillation , proposed recently in DINO ( Caron et al. , 2021 ) , distills knowledge not from posterior distributions Pφ ( x ) but past iterations of model itself Pθ′ ( x ) and is cast as a discriminative self-supervised objective . Given the training set I , an image x ∼ I is sampled uniformly , over which two random augmentations are applied , yielding two distorted views u and v. The two distorted views are then put through a teacher-student framework to get the predictive categorical distributions from the [ CLS ] token : v [ CLS ] t = P [ CLS ] θ′ ( v ) and u [ CLS ] s = P [ CLS ] θ ( u ) . The knowledge is distilled from teacher to student by minimizing their cross-entropy , formulated as L [ CLS ] = −P [ CLS ] θ′ ( v ) T log P [ CLS ] θ ( u ) . ( 2 ) The teacher and the student share the same architecture consisting of a backbone f ( e.g. , ViT ) and a projection head h [ CLS ] . The parameters of the student network θ are Exponentially Moving Averaged ( EMA ) to the parameters of teacher network θ′ . The loss is symmetrized by averaging with another cross-entropy term between v [ CLS ] s and u [ CLS ] t . 3 IBOT . We motivate our method by identifying the similar formulation of Eq . ( 1 ) and Eq . ( 2 ) . A visual tokenizer parameterized by online θ′ instead of pre-fixed φ thus arises naturally . In this section , we present iBOT , casting self-distillation as a token-generation self-supervised objective and perform MIM via self-distillation.We illustrate the framework of iBOT in Fig . 3 and demonstrate the pseudocode in Appendix A . In Sec . 3.2 , we briefly introduce the architecture and pre-training setup . 3.1 FRAMEWORK . First , we perform blockwise masking ( Bao et al. , 2021 ) on the two augmented views u and v and obtain their masked views û and v̂ . Taking û as an example for simplicity , the student network outputs for the masked view û projections of its patch tokens ûpatchs = P patch θ ( û ) and the teacher network outputs for the non-masked view u projections of its patch tokens upatcht = P patch θ′ ( u ) . We here define the training objective of MIM in iBOT as LMIM = − N∑ i=1 mi · P patchθ′ ( ui ) T log P patch θ ( ûi ) . ( 3 ) We symmetrize the loss by averaging with another CE term between v̂patchs and v patch t . The backbone together with the projection head of teacher network hpatcht ◦ ft is , therefore , a visual tokenizer that generates online token distributions for each masked patch token . The tokenizer used in iBOT is jointly learnable to MIM objective without a need of being pre-trained in an extra stage , a bonus feature of which is now its domain knowledge can be distilled from the current dataset rather than fixed to the specified dataset . To ensure that the online tokenizer is semantically-meaningful , we perform self-distillation on [ CLS ] token of cross-view images such that visual semantics can be obtained via bootstrapping , as achieved by the majority of the self-supervised methods ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2021 ) . In practice , iBOT works with L [ CLS ] in Eq . ( 2 ) proposed in DINO ( Caron et al. , 2021 ) , except that now we have û [ CLS ] s instead of u [ CLS ] s as input for the student network . To further borrow the capability of semantics abstraction acquired from self-distillatin on [ CLS ] token , we share the parameters of projection heads for [ CLS ] token and patch tokens , i.e. , h [ CLS ] s = h patch s , h [ CLS ] t = h patch t . We empirically find that it produces better results than using separate heads . Unlike tokenized words whose semantics are almost certain , image patch is ambiguous in its semantic meaning . Therefore , tokenization as one-hot discretization can be sub-optimal for images . In iBOT , we use the token distribution after softmax instead of the one-hot token id as a supervisory signal , which plays an important role in iBOT pre-training as shown in Tab . 18 . | This paper presents a new strategy for self-supervised training of vision transformer models by combining the self-distillation-based method DINO with mask image modeling. The momentum teacher model in DINO is taken as an online tokenizer. A mask image modeling loss that computes self-distillation loss between the reconstructed tokens and the output tokens of the momentum teacher is proposed. Extensive experiments are conducted to show the effectiveness of the proposed self-supervised training framework. The result on downstream tasks including classification, object detection, and segmentation also shows the benefit of the mask image modeling loss. | SP:c1c8be0136f7d9590eee036951fe203c317ef53a |
Image BERT Pre-training with Online Tokenizer | 1 INTRODUCTION Masked Language Modeling ( MLM ) , which first randomly masks and then reconstructs a set of input tokens , is a popular pre-training paradigm for language models . The MLM pre-trained Transformers ( Devlin et al. , 2019 ) have demonstrated their scalability to largecapacity models and datasets , becoming a defacto standard for lingual tasks . However , its potential for Vision Transformer ( ViT ) , which recently started to revolutionize computer vision research ( Touvron et al. , 2021 ; Dosovitskiy et al. , 2021 ) , has been largely underexplored . Most popular unsupervised pretraining schemes in vision deal with the global views ( Chen et al. , 2021 ; Caron et al. , 2021 ) , neglecting images ’ internal structures , as opposed to MLM modeling local tokens . In this work , we seek to continue the success of MLM and explore Masked Image Modeling ( MIM ) for training better Vision Transform- ers such that it can serve as a standard component , as it does for NLP . One of the most crucial components in MLM is the lingual tokenizer which splits language into semantically meaningful tokens , e.g. , WordPiece ( Wu et al. , 2016 ) in BERT . Similarly , the crux of MIM lies in a proper design of visual tokenizer , which transforms the masked patches to supervisory signals for the target model , as shown in Fig . 2 . However , unlike lingual semantics arising naturally from the statistical analysis of word frequency ( Sennrich et al. , 2016 ) , visual semantics can not be ex- tracted such easily due to the continuous property of images . Empirically , visual semantics emerges progressively by bootstrapping online representation that enforces a similarity of distorted image views ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2020 ) . This property intuitively indicates a multi-stage training pipeline , where we need to first train an off-the-shelf semantic-rich tokenizer before training the target model . However , since acquiring visual semantics is a common end for both the tokenizer and target model , a single-stage training pipeline where the tokenizer and target model can be jointly optimized awaits further exploration . Previous works partially tackle the above challenges . Several works use identity mapping as the visual tokenizer , i.e. , predicting the raw pixel values ( Pathak et al. , 2016 ; Atito et al. , 2021 ) . Such paradigm struggles in semantic abstraction and wastes the capacity at modeling high-frequency details , yielding less competitive performance in semantic understanding ( Liu et al. , 2021a ) . Recently , BEiT ( Bao et al. , 2021 ) proposes to use a pre-trained discrete VAE ( Ramesh et al. , 2021 ) as the tokenizer . Though providing some level of abstraction , the discrete VAE is still found only to capture low-level semantics within local details ( as observed by Tab . 9 ) . Moreover , the tokenizer needs to be offline pre-trained with fixed model architectures and extra dataset ( Ramesh et al. , 2021 ) , which potentially limits its adapativity to perform MIM using data from different domains . To this end , we present iBOT , short for image BERT pre-training with Online Tokenizer , a new framework that performs MIM with a tokenizer handling above-mentioned challenges favorably . We motivate iBOT by formulating the MIM as knowledge distillation ( KD ) , which learns to distill knowledge from the tokenizer , and further propose to perform self-distillation for MIM with the help of twin teacher as online tokenizer . The target network is fed with a masked image while the online tokenizer with the original image . The goal is to let the target network recover each masked patch token to its corresponding tokenizer output . Our online tokenizer naturally resolves two major challenges . On the one hand , our tokenizer captures highlevel visual semantics progressively learned by enforcing the similarity of cross-view images on class tokens . On the other hand , our tokenizer needs no extra stages of training as pre-processing setup since it is jointly optimized with MIM via momentum update . The online tokenizer enables iBOT to achieve excellent performance for feature representation . Specifically , iBOT advances ImageNet-1K classification benchmark under k-NN , linear probing and fine-tuning protocols to 77.1 % , 79.5 % , 83.8 % with ViT-Base/16 respectively , which is 1.0 % , 1.3 % , 0.2 % higher than previous best results . When pre-trained with ImageNet-22K , iBOT with ViT-L/16 achieves a linear probing accuracy of 81.7 % and a fine-tuning accuracy of 86.3 % , which is 0.4 % and 0.3 % higher than previous best results . Beyond that , the advancement is also valid when transferring to other datasets or under semi-supervised and unsupervised classification settings . Of particular interest , we have identified an emerging part-level semantics that can help the model with image recognition both on global and local scales . We identify that the semantic patterns learned in patch tokens , which sufficiently lack in the off-line tokenizer as in BEiT ( Bao et al. , 2021 ) , helps the model to be advanced in linear classification and robustness against common image corruptions . When it is transferred to downstream tasks , we show that in downstream tasks related to image classification , object detection , instance segmentation , and semantic segmentation , iBOT surpasses previous methods with nontrivial margins . All of the evidence demonstrates that iBOT has largely closed the gap of masked modeling pre-training between language and vision Transformers . 2 PRELIMINARIES . 2.1 MASKED IMAGE MODELING AS KNOWLEDGE DISTILLATION . Masked image modeling ( MIM ) , which takes a similar formulation as MLM in BERT , has been proposed in several recent works ( Bao et al. , 2021 ; Tan et al. , 2021 ) . Specifically , for an image token sequence x = { xi } Ni=1 , MIM first samples a random mask m ∈ { 0 , 1 } N according to a prediction ratio r , where N is the number of tokens . The patch token xi where mi being 1 , denoted as x̃ , { xi | mi = 1 } , are then replaced with a mask token e [ MASK ] , yielding a corrupted image x̂ , { x̂i | ( 1−mi ) xi+mie [ MASK ] } Ni=1 . MIM is to recover the masked tokens x̃ from the corrupted image x̂ , i.e. , to maximize : log qθ ( x̃|x̂ ) ≈ ∑N i=1 mi · log qθ ( xi|x̂ ) , where ≈ holds with an independence assumption that each masked token can be reconstructed separately . In BEiT ( Bao et al. , 2021 ) , qθ is modelled as a categorical distribution and the task is to minimize − N∑ i=1 mi · Pφ ( xi ) T log Pθ ( x̂i ) , ( 1 ) where P ( · ) transforms the input to a probability distribution overK dimensions , andφ is parameters of a discrete VAE ( Ramesh et al. , 2021 ) that clusters image patches into K categories and assigns each patch token a one-hot encoding identifying its category . We note this loss is formulated similarly to knowledge distillation ( Hinton et al. , 2015 ) , where knowledge is distilled from a pre-fixed tokenizer parameterized by φ to current model parameterized by θ . 2.2 SELF-DISTILLATION . Self-distillation , proposed recently in DINO ( Caron et al. , 2021 ) , distills knowledge not from posterior distributions Pφ ( x ) but past iterations of model itself Pθ′ ( x ) and is cast as a discriminative self-supervised objective . Given the training set I , an image x ∼ I is sampled uniformly , over which two random augmentations are applied , yielding two distorted views u and v. The two distorted views are then put through a teacher-student framework to get the predictive categorical distributions from the [ CLS ] token : v [ CLS ] t = P [ CLS ] θ′ ( v ) and u [ CLS ] s = P [ CLS ] θ ( u ) . The knowledge is distilled from teacher to student by minimizing their cross-entropy , formulated as L [ CLS ] = −P [ CLS ] θ′ ( v ) T log P [ CLS ] θ ( u ) . ( 2 ) The teacher and the student share the same architecture consisting of a backbone f ( e.g. , ViT ) and a projection head h [ CLS ] . The parameters of the student network θ are Exponentially Moving Averaged ( EMA ) to the parameters of teacher network θ′ . The loss is symmetrized by averaging with another cross-entropy term between v [ CLS ] s and u [ CLS ] t . 3 IBOT . We motivate our method by identifying the similar formulation of Eq . ( 1 ) and Eq . ( 2 ) . A visual tokenizer parameterized by online θ′ instead of pre-fixed φ thus arises naturally . In this section , we present iBOT , casting self-distillation as a token-generation self-supervised objective and perform MIM via self-distillation.We illustrate the framework of iBOT in Fig . 3 and demonstrate the pseudocode in Appendix A . In Sec . 3.2 , we briefly introduce the architecture and pre-training setup . 3.1 FRAMEWORK . First , we perform blockwise masking ( Bao et al. , 2021 ) on the two augmented views u and v and obtain their masked views û and v̂ . Taking û as an example for simplicity , the student network outputs for the masked view û projections of its patch tokens ûpatchs = P patch θ ( û ) and the teacher network outputs for the non-masked view u projections of its patch tokens upatcht = P patch θ′ ( u ) . We here define the training objective of MIM in iBOT as LMIM = − N∑ i=1 mi · P patchθ′ ( ui ) T log P patch θ ( ûi ) . ( 3 ) We symmetrize the loss by averaging with another CE term between v̂patchs and v patch t . The backbone together with the projection head of teacher network hpatcht ◦ ft is , therefore , a visual tokenizer that generates online token distributions for each masked patch token . The tokenizer used in iBOT is jointly learnable to MIM objective without a need of being pre-trained in an extra stage , a bonus feature of which is now its domain knowledge can be distilled from the current dataset rather than fixed to the specified dataset . To ensure that the online tokenizer is semantically-meaningful , we perform self-distillation on [ CLS ] token of cross-view images such that visual semantics can be obtained via bootstrapping , as achieved by the majority of the self-supervised methods ( He et al. , 2020 ; Grill et al. , 2020 ; Caron et al. , 2021 ) . In practice , iBOT works with L [ CLS ] in Eq . ( 2 ) proposed in DINO ( Caron et al. , 2021 ) , except that now we have û [ CLS ] s instead of u [ CLS ] s as input for the student network . To further borrow the capability of semantics abstraction acquired from self-distillatin on [ CLS ] token , we share the parameters of projection heads for [ CLS ] token and patch tokens , i.e. , h [ CLS ] s = h patch s , h [ CLS ] t = h patch t . We empirically find that it produces better results than using separate heads . Unlike tokenized words whose semantics are almost certain , image patch is ambiguous in its semantic meaning . Therefore , tokenization as one-hot discretization can be sub-optimal for images . In iBOT , we use the token distribution after softmax instead of the one-hot token id as a supervisory signal , which plays an important role in iBOT pre-training as shown in Tab . 18 . | This is one of the first papers doing BERT-style pretraining for vision transformers, in particular the first to not use a pre-trained tokenizer (here the (part of) the network that generates the targets for the masked tokens). This has a similarity with BEiT, although BEiT uses an externally procured tokenizer (CLIP, so trained with labels). Instead, here, the idea is to use a teacher (EMA from student) to propose the targets for the masked tokens, yielding a masked image modeling task (L_MIM). The whole model and approach works with 2 augmented views of the same image (as in BYOL or DINO) and also has a self-distillation loss (L_CLS). L = L_MIM + L_CLS. The paper presents state of the art results in kNN (retrieval), image classification with linear probing and fine-tuning (ImageNet), image detection, instance segmentation (both on COCO), and semantic segmentation (ADE20K), within the classes of models that the authors studied. | SP:c1c8be0136f7d9590eee036951fe203c317ef53a |
SURF: Semi-supervised Reward Learning with Data Augmentation for Feedback-efficient Preference-based Reinforcement Learning | 1 INTRODUCTION . Reward function plays a crucial role in reinforcement learning ( RL ) to convey complex objectives to agents . For various applications , where we can design an informative reward function , RL with deep neural networks has been used to solve a variety of sequential decision-making problems , including board games ( Silver et al. , 2017 ; 2018 ) , video games ( Mnih et al. , 2015 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ) , autonomous control ( Schulman et al. , 2015 ; Bellemare et al. , 2020 ) , and robotic manipulation ( Kober & Peters , 2011 ; Kober et al. , 2013 ; Kalashnikov et al. , 2018 ; Andrychowicz et al. , 2020 ) . However , there are several issues in reward engineering . First , designing a suitable reward function requires more human effort as the tasks become more complex . For example , defining a reward function for book summarization ( Wu et al. , 2021 ) is non-trivial because it is hard to quantify the quality of summarization in a scale value . Also , it has been observed that RL agents could achieve high returns by discovering undesirable shortcuts if the hand-engineered reward function does fully specify the desired task ( Amodei et al. , 2016 ; Hadfield-Menell et al. , 2017 ; Lee et al. , 2021a ) . Furthermore , there are various domains , where a single ground-truth function does not exist , and thus personalization is required by modeling different reward functions based on the user ’ s preference . Preference-based RL ( Akrour et al. , 2011 ; Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Lee et al. , 2021a ) provides an attractive alternative to avoid reward engineering . Instead of assuming a handengineered reward function , a ( human ) teacher provides preferences between the two agent behaviors , and an agent learns how to show the desired behavior by learning a reward function , which is consistent with the teacher ’ s preferences . Recent progress of preference-based RL has shown that the teacher can guide the agent to perform novel behaviors ( Christiano et al. , 2017 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ) , and mitigate the effects of reward exploitation ( Lee et al. , 2021a ) . However , existing preference-based approaches often suffer from expensive labeling costs , and this makes it hard to apply preference-based RL to various applications . Meanwhile , recent state-of-the-art system in computer vision , the label-efficiency problem has been successfully addressed through semi-supervised learning ( SSL ) approaches ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ; Chen et al. , 2020b ) . By leveraging unlabeled dataset , SSL methods have improved the performance with low cost . Data augmentation also plays a significant role in improving the performance of supervised learning methods ( Cubuk et al. , 2018 ; 2019 ) . By using multiple augmented views of the same data as input , the performance has been improved by learning augmentation-invariant representations . Inspired by the impact of semi-supervised learning and data augmentation , we present SURF : a Semi-sUpervised Reward learning with data augmentation for Feedback-efficient preference-based RL . To be specific , SURF consists of the following key ingredients : ( a ) Pseudo-labeling ( Lee , 2013 ; Sohn et al. , 2020 ) : We leverage unlabeled data by utilizing the artificial labels generated by learned preference predictor , which makes the reward function produce a confident prediction ( see Figure 1a ) . We remark that such a SSL approach is particularly attractive in our setup as an unlimited number of unlabeled data can be obtained with no additional cost , i.e. , from past experiences stored in the buffer . ( b ) Temporal cropping augmentation : We generate slightly shifted or resized behaviors , which are expected to have the same preferences from a teacher , and utilize them for reward learning ( see Figure 1b ) . Our data augmentation technique enhances the feedback-efficiency by enforcing consistencies ( Xie et al. , 2019 ; Berthelot et al. , 2020 ; Sohn et al. , 2020 ) to the reward function . We remark that SURF is not a naïve application of these two techniques , but a novel combination of semi-supervised learning and the proposed data augmentation , which has not been considered or evaluated in the context of the preference-based RL . Our experiments demonstrate that SURF significantly improves the preference-based RL method ( Lee et al. , 2021a ) on complex locomotion and robotic manipulation tasks from DeepMind Control Suite ( Tassa et al. , 2018 ; 2020 ) and Meta-world ( Yu et al. , 2020 ) , in terms of feedbackefficiency . In particular , our framework could make RL agents achieve ∼100 % of success rate on complex robotic manipulation task using only a few hundred preference queries , while its baseline method only achieves ∼50 % of the success rate under the same condition ( see Figure 3 ) . 2 RELATED WORK . Preference-based RL . In the preference-based RL framework , a ( human ) supervisor provides preferences between the two agent behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ; Lee et al. , 2021a ; b ) . Since this approach is only feasible if the feedback is practical for a human to provide , several strategies have been studied in the literature . Ibarz et al . ( 2018 ) initialized the agent ’ s policy with imitation learning from the expert demonstrations , while Lee et al . ( 2021a ) utilized unsupervised pre-training for policy initialization . Several sampling schemes ( Sadigh et al. , 2017 ; Biyik & Sadigh , 2018 ; Biyik et al. , 2020 ) to select informative queries also have been adopted for improving the feedback-efficiency . Our approach differs in that we utilize unlabeled samples for reward learning , and also provide a novel data augmentation technique for the agent behaviors . Data augmentation for RL . In the context of RL , data augmentation has been widely investigated for improving data-efficiency ( Srinivas et al. , 2020 ; Yarats et al. , 2021 ) , or RL generalization ( Cobbe et al. , 2019 ; Lee et al. , 2019 ) . For example , RAD ( Laskin et al. , 2020 ) demonstrated that data augmentation , such as random crop , can improve both data-efficiency and generalization of RL algorithms . While these methods are known to be beneficial to learn policy in the standard RL setup , they have not been tested for learning rewards . To the best of our knowledge , we present the first data augmentation method specially designed for learning reward function . Semi-supervised learning . The goal of semi-supervised learning ( SSL ) is to leveraging unlabeled samples to improve a model ’ s performance when the amount of labeled samples are limited . In an attempt to leverage the information in the unlabeled dataset , a number of techniques have been proposed , e.g. , entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) and consistency regularization ( Sajjadi et al. , 2016 ; Miyato et al. , 2018 ; Xie et al. , 2019 ; Sohn et al. , 2020 ) . Recently , the combination of these two approaches have shown state-of-the-art performance in benchmarks , e.g. , MixMatch ( Berthelot et al. , 2019 ) , and ReMixMatch ( Berthelot et al. , 2020 ) , when used with advanced data augmentation techniques ( Zhang et al. , 2018 ; Cubuk et al. , 2019 ) . Specifically , FixMatch ( Sohn et al. , 2020 ) revisits pseudo-labeling technique and demonstrates that joint usage of pseudo-labels and consistency regularization achieves remarkable performance due to its simplicity . 3 PRELIMINARIES . Reinforcement learning ( RL ) is a framework where an agent interacts with an environment in discrete time ( Sutton & Barto , 2018 ) . At each timestep t , the agent receives a state st from the environment and chooses an action at based on its policy π ( at|st ) . In conventional RL framework , the environment gives a reward r ( st , at ) and the agent transitions to the next state st+1 . The return Rt = ∑∞ k=0 γ kr ( st+k , at+k ) is defined as discounted cumulative sum of the reward with discount factor γ ∈ [ 0 , 1 ) . The goal of the agent is to learn a policy that maximizes the expected return . Preference-based reinforcement learning . In this paper , we consider a preference-based RL framework , which does not assume the existence of hand-engineered reward . Instead , a ( human ) teacher provides preferences between the agent ’ s behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Lee et al. , 2021a ; b ; Wu et al. , 2021 ) by learning a reward function , which is consistent with the observed preferences . We formulate a reward learning problem as a supervised learning problem ( Wilson et al. , 2012 ; Christiano et al. , 2017 ) . Formally , a segment σ is a sequence of observations and actions { ( sk , ak ) , ... , ( sk+H−1 , ak+H−1 ) } . Given a pair of segments ( σ0 , σ1 ) , a teacher gives a feedback indicating which segment is preferred , i.e. , y ∈ { 0 , 1 , 0.5 } , where 1 indicates σ1 σ0 , 0 indicates σ0 σ1 , and 0.5 implies an equally preferable case . Each feedback is stored in a dataset D as a triple ( σ0 , σ1 , y ) . Then , we model a preference predictor using the reward function r̂ψ following the Bradley-Terry model ( Bradley & Terry , 1952 ) : Pψ [ σ 1 σ0 ] = exp ( ∑ t r̂ψ ( s 1 t , a 1 t ) ) ∑ i∈ { 0,1 } exp ( ∑ t r̂ψ ( s i t , a i t ) ) , ( 1 ) where σi σj denotes the event that segment i is preferable to segment j . The underlying assumption of this model is that the teacher ’ s probability of preferring a segment depends exponentially on the accumulated sum of the reward over the segment . The reward model is trained through supervised learning with teacher ’ s preferences . Specifically , given a dataset of preferences D , the reward function is updated by minimizing the binary cross-entropy loss : LCE = E ( σ0 , σ1 , y ) ∼D [ LReward ] = − E ( σ0 , σ1 , y ) ∼D [ ( 1− y ) logPψ [ σ0 σ1 ] + y logPψ [ σ1 σ0 ] ] . Algorithm 1 SURF Require : Hyperparameters : unlabeled batch ratio µ , threshold parameter τ , and loss weight λ Require : Set of collected labeled data Dl , and unlabeled data Du 1 : for each gradient step do 2 : Sample labeled batch { ( σ0l , σ1l , y ) ( i ) } Bi=1 ∼ Dl 3 : Sample unlabeled batch { ( σ0u , σ1u ) ( j ) } µBj=1 ∼ Du 4 : // DATA AUGMENTATION FOR LABELED DATA 5 : for i in 1 . . . B do 6 : ( σ̂0l , σ̂ 1 l ) ( i ) ← TDA ( ( σ0l , σ1l ) ( i ) ) in Algorithm 2 7 : end for 8 : // PSEUDO-LABELING AND DATA AUGMENTATION FOR UNLABELED DATA 9 : for j in 1 . . . µB do 10 : Predict pseudo-labels ŷ ( ( σ0u , σ1u ) ( j ) ) 11 : ( σ̂0u , σ̂1u ) ( j ) ← TDA ( ( σ0u , σ1u ) ( j ) ) in Algorithm 2 12 : end for 13 : Optimize LSSL ( 3 ) with respect to ψ 14 : end for The reward function r̂ψ is usually optimized only using labels from real human , which are expensive to obtain in practice . Instead , we propose a simple yet effective method based on semi-supervised learning and data augmentation to improve the feedback-efficiency of preference-based learning . | This work introduces a semi-supervised reward learning approach to reduce the efforts of reward engineering, which contains two key components. The first is to produce artificial labels for these unlabeled samples leveraging the pseudo-labeling and the learned reference predictor. The second component is to crop consecutive subsequences for data augmentation. The proposed approach is tested on Meta-world and DMControl suites, and the results show that it significantly improves the performances. | SP:2672395e363969d2462f66e7ad538b7ec6b22cc5 |
SURF: Semi-supervised Reward Learning with Data Augmentation for Feedback-efficient Preference-based Reinforcement Learning | 1 INTRODUCTION . Reward function plays a crucial role in reinforcement learning ( RL ) to convey complex objectives to agents . For various applications , where we can design an informative reward function , RL with deep neural networks has been used to solve a variety of sequential decision-making problems , including board games ( Silver et al. , 2017 ; 2018 ) , video games ( Mnih et al. , 2015 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ) , autonomous control ( Schulman et al. , 2015 ; Bellemare et al. , 2020 ) , and robotic manipulation ( Kober & Peters , 2011 ; Kober et al. , 2013 ; Kalashnikov et al. , 2018 ; Andrychowicz et al. , 2020 ) . However , there are several issues in reward engineering . First , designing a suitable reward function requires more human effort as the tasks become more complex . For example , defining a reward function for book summarization ( Wu et al. , 2021 ) is non-trivial because it is hard to quantify the quality of summarization in a scale value . Also , it has been observed that RL agents could achieve high returns by discovering undesirable shortcuts if the hand-engineered reward function does fully specify the desired task ( Amodei et al. , 2016 ; Hadfield-Menell et al. , 2017 ; Lee et al. , 2021a ) . Furthermore , there are various domains , where a single ground-truth function does not exist , and thus personalization is required by modeling different reward functions based on the user ’ s preference . Preference-based RL ( Akrour et al. , 2011 ; Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Lee et al. , 2021a ) provides an attractive alternative to avoid reward engineering . Instead of assuming a handengineered reward function , a ( human ) teacher provides preferences between the two agent behaviors , and an agent learns how to show the desired behavior by learning a reward function , which is consistent with the teacher ’ s preferences . Recent progress of preference-based RL has shown that the teacher can guide the agent to perform novel behaviors ( Christiano et al. , 2017 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ) , and mitigate the effects of reward exploitation ( Lee et al. , 2021a ) . However , existing preference-based approaches often suffer from expensive labeling costs , and this makes it hard to apply preference-based RL to various applications . Meanwhile , recent state-of-the-art system in computer vision , the label-efficiency problem has been successfully addressed through semi-supervised learning ( SSL ) approaches ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ; Chen et al. , 2020b ) . By leveraging unlabeled dataset , SSL methods have improved the performance with low cost . Data augmentation also plays a significant role in improving the performance of supervised learning methods ( Cubuk et al. , 2018 ; 2019 ) . By using multiple augmented views of the same data as input , the performance has been improved by learning augmentation-invariant representations . Inspired by the impact of semi-supervised learning and data augmentation , we present SURF : a Semi-sUpervised Reward learning with data augmentation for Feedback-efficient preference-based RL . To be specific , SURF consists of the following key ingredients : ( a ) Pseudo-labeling ( Lee , 2013 ; Sohn et al. , 2020 ) : We leverage unlabeled data by utilizing the artificial labels generated by learned preference predictor , which makes the reward function produce a confident prediction ( see Figure 1a ) . We remark that such a SSL approach is particularly attractive in our setup as an unlimited number of unlabeled data can be obtained with no additional cost , i.e. , from past experiences stored in the buffer . ( b ) Temporal cropping augmentation : We generate slightly shifted or resized behaviors , which are expected to have the same preferences from a teacher , and utilize them for reward learning ( see Figure 1b ) . Our data augmentation technique enhances the feedback-efficiency by enforcing consistencies ( Xie et al. , 2019 ; Berthelot et al. , 2020 ; Sohn et al. , 2020 ) to the reward function . We remark that SURF is not a naïve application of these two techniques , but a novel combination of semi-supervised learning and the proposed data augmentation , which has not been considered or evaluated in the context of the preference-based RL . Our experiments demonstrate that SURF significantly improves the preference-based RL method ( Lee et al. , 2021a ) on complex locomotion and robotic manipulation tasks from DeepMind Control Suite ( Tassa et al. , 2018 ; 2020 ) and Meta-world ( Yu et al. , 2020 ) , in terms of feedbackefficiency . In particular , our framework could make RL agents achieve ∼100 % of success rate on complex robotic manipulation task using only a few hundred preference queries , while its baseline method only achieves ∼50 % of the success rate under the same condition ( see Figure 3 ) . 2 RELATED WORK . Preference-based RL . In the preference-based RL framework , a ( human ) supervisor provides preferences between the two agent behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ; Lee et al. , 2021a ; b ) . Since this approach is only feasible if the feedback is practical for a human to provide , several strategies have been studied in the literature . Ibarz et al . ( 2018 ) initialized the agent ’ s policy with imitation learning from the expert demonstrations , while Lee et al . ( 2021a ) utilized unsupervised pre-training for policy initialization . Several sampling schemes ( Sadigh et al. , 2017 ; Biyik & Sadigh , 2018 ; Biyik et al. , 2020 ) to select informative queries also have been adopted for improving the feedback-efficiency . Our approach differs in that we utilize unlabeled samples for reward learning , and also provide a novel data augmentation technique for the agent behaviors . Data augmentation for RL . In the context of RL , data augmentation has been widely investigated for improving data-efficiency ( Srinivas et al. , 2020 ; Yarats et al. , 2021 ) , or RL generalization ( Cobbe et al. , 2019 ; Lee et al. , 2019 ) . For example , RAD ( Laskin et al. , 2020 ) demonstrated that data augmentation , such as random crop , can improve both data-efficiency and generalization of RL algorithms . While these methods are known to be beneficial to learn policy in the standard RL setup , they have not been tested for learning rewards . To the best of our knowledge , we present the first data augmentation method specially designed for learning reward function . Semi-supervised learning . The goal of semi-supervised learning ( SSL ) is to leveraging unlabeled samples to improve a model ’ s performance when the amount of labeled samples are limited . In an attempt to leverage the information in the unlabeled dataset , a number of techniques have been proposed , e.g. , entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) and consistency regularization ( Sajjadi et al. , 2016 ; Miyato et al. , 2018 ; Xie et al. , 2019 ; Sohn et al. , 2020 ) . Recently , the combination of these two approaches have shown state-of-the-art performance in benchmarks , e.g. , MixMatch ( Berthelot et al. , 2019 ) , and ReMixMatch ( Berthelot et al. , 2020 ) , when used with advanced data augmentation techniques ( Zhang et al. , 2018 ; Cubuk et al. , 2019 ) . Specifically , FixMatch ( Sohn et al. , 2020 ) revisits pseudo-labeling technique and demonstrates that joint usage of pseudo-labels and consistency regularization achieves remarkable performance due to its simplicity . 3 PRELIMINARIES . Reinforcement learning ( RL ) is a framework where an agent interacts with an environment in discrete time ( Sutton & Barto , 2018 ) . At each timestep t , the agent receives a state st from the environment and chooses an action at based on its policy π ( at|st ) . In conventional RL framework , the environment gives a reward r ( st , at ) and the agent transitions to the next state st+1 . The return Rt = ∑∞ k=0 γ kr ( st+k , at+k ) is defined as discounted cumulative sum of the reward with discount factor γ ∈ [ 0 , 1 ) . The goal of the agent is to learn a policy that maximizes the expected return . Preference-based reinforcement learning . In this paper , we consider a preference-based RL framework , which does not assume the existence of hand-engineered reward . Instead , a ( human ) teacher provides preferences between the agent ’ s behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Lee et al. , 2021a ; b ; Wu et al. , 2021 ) by learning a reward function , which is consistent with the observed preferences . We formulate a reward learning problem as a supervised learning problem ( Wilson et al. , 2012 ; Christiano et al. , 2017 ) . Formally , a segment σ is a sequence of observations and actions { ( sk , ak ) , ... , ( sk+H−1 , ak+H−1 ) } . Given a pair of segments ( σ0 , σ1 ) , a teacher gives a feedback indicating which segment is preferred , i.e. , y ∈ { 0 , 1 , 0.5 } , where 1 indicates σ1 σ0 , 0 indicates σ0 σ1 , and 0.5 implies an equally preferable case . Each feedback is stored in a dataset D as a triple ( σ0 , σ1 , y ) . Then , we model a preference predictor using the reward function r̂ψ following the Bradley-Terry model ( Bradley & Terry , 1952 ) : Pψ [ σ 1 σ0 ] = exp ( ∑ t r̂ψ ( s 1 t , a 1 t ) ) ∑ i∈ { 0,1 } exp ( ∑ t r̂ψ ( s i t , a i t ) ) , ( 1 ) where σi σj denotes the event that segment i is preferable to segment j . The underlying assumption of this model is that the teacher ’ s probability of preferring a segment depends exponentially on the accumulated sum of the reward over the segment . The reward model is trained through supervised learning with teacher ’ s preferences . Specifically , given a dataset of preferences D , the reward function is updated by minimizing the binary cross-entropy loss : LCE = E ( σ0 , σ1 , y ) ∼D [ LReward ] = − E ( σ0 , σ1 , y ) ∼D [ ( 1− y ) logPψ [ σ0 σ1 ] + y logPψ [ σ1 σ0 ] ] . Algorithm 1 SURF Require : Hyperparameters : unlabeled batch ratio µ , threshold parameter τ , and loss weight λ Require : Set of collected labeled data Dl , and unlabeled data Du 1 : for each gradient step do 2 : Sample labeled batch { ( σ0l , σ1l , y ) ( i ) } Bi=1 ∼ Dl 3 : Sample unlabeled batch { ( σ0u , σ1u ) ( j ) } µBj=1 ∼ Du 4 : // DATA AUGMENTATION FOR LABELED DATA 5 : for i in 1 . . . B do 6 : ( σ̂0l , σ̂ 1 l ) ( i ) ← TDA ( ( σ0l , σ1l ) ( i ) ) in Algorithm 2 7 : end for 8 : // PSEUDO-LABELING AND DATA AUGMENTATION FOR UNLABELED DATA 9 : for j in 1 . . . µB do 10 : Predict pseudo-labels ŷ ( ( σ0u , σ1u ) ( j ) ) 11 : ( σ̂0u , σ̂1u ) ( j ) ← TDA ( ( σ0u , σ1u ) ( j ) ) in Algorithm 2 12 : end for 13 : Optimize LSSL ( 3 ) with respect to ψ 14 : end for The reward function r̂ψ is usually optimized only using labels from real human , which are expensive to obtain in practice . Instead , we propose a simple yet effective method based on semi-supervised learning and data augmentation to improve the feedback-efficiency of preference-based learning . | The authors introduce a method for combining semi-supervised learning with preference learning for reinforcement learning. The method uses pseudo labels, derived from a surrogate preference model. Furthermore, a data augmentation scheme for this setting is introduced, which is based on cropped sequences. Evaluation is performed on a range of robotics tasks, including ablation studies for several hyperparameters and the two, distinct parts of the introduced method. | SP:2672395e363969d2462f66e7ad538b7ec6b22cc5 |
SURF: Semi-supervised Reward Learning with Data Augmentation for Feedback-efficient Preference-based Reinforcement Learning | 1 INTRODUCTION . Reward function plays a crucial role in reinforcement learning ( RL ) to convey complex objectives to agents . For various applications , where we can design an informative reward function , RL with deep neural networks has been used to solve a variety of sequential decision-making problems , including board games ( Silver et al. , 2017 ; 2018 ) , video games ( Mnih et al. , 2015 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ) , autonomous control ( Schulman et al. , 2015 ; Bellemare et al. , 2020 ) , and robotic manipulation ( Kober & Peters , 2011 ; Kober et al. , 2013 ; Kalashnikov et al. , 2018 ; Andrychowicz et al. , 2020 ) . However , there are several issues in reward engineering . First , designing a suitable reward function requires more human effort as the tasks become more complex . For example , defining a reward function for book summarization ( Wu et al. , 2021 ) is non-trivial because it is hard to quantify the quality of summarization in a scale value . Also , it has been observed that RL agents could achieve high returns by discovering undesirable shortcuts if the hand-engineered reward function does fully specify the desired task ( Amodei et al. , 2016 ; Hadfield-Menell et al. , 2017 ; Lee et al. , 2021a ) . Furthermore , there are various domains , where a single ground-truth function does not exist , and thus personalization is required by modeling different reward functions based on the user ’ s preference . Preference-based RL ( Akrour et al. , 2011 ; Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Lee et al. , 2021a ) provides an attractive alternative to avoid reward engineering . Instead of assuming a handengineered reward function , a ( human ) teacher provides preferences between the two agent behaviors , and an agent learns how to show the desired behavior by learning a reward function , which is consistent with the teacher ’ s preferences . Recent progress of preference-based RL has shown that the teacher can guide the agent to perform novel behaviors ( Christiano et al. , 2017 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ) , and mitigate the effects of reward exploitation ( Lee et al. , 2021a ) . However , existing preference-based approaches often suffer from expensive labeling costs , and this makes it hard to apply preference-based RL to various applications . Meanwhile , recent state-of-the-art system in computer vision , the label-efficiency problem has been successfully addressed through semi-supervised learning ( SSL ) approaches ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ; Chen et al. , 2020b ) . By leveraging unlabeled dataset , SSL methods have improved the performance with low cost . Data augmentation also plays a significant role in improving the performance of supervised learning methods ( Cubuk et al. , 2018 ; 2019 ) . By using multiple augmented views of the same data as input , the performance has been improved by learning augmentation-invariant representations . Inspired by the impact of semi-supervised learning and data augmentation , we present SURF : a Semi-sUpervised Reward learning with data augmentation for Feedback-efficient preference-based RL . To be specific , SURF consists of the following key ingredients : ( a ) Pseudo-labeling ( Lee , 2013 ; Sohn et al. , 2020 ) : We leverage unlabeled data by utilizing the artificial labels generated by learned preference predictor , which makes the reward function produce a confident prediction ( see Figure 1a ) . We remark that such a SSL approach is particularly attractive in our setup as an unlimited number of unlabeled data can be obtained with no additional cost , i.e. , from past experiences stored in the buffer . ( b ) Temporal cropping augmentation : We generate slightly shifted or resized behaviors , which are expected to have the same preferences from a teacher , and utilize them for reward learning ( see Figure 1b ) . Our data augmentation technique enhances the feedback-efficiency by enforcing consistencies ( Xie et al. , 2019 ; Berthelot et al. , 2020 ; Sohn et al. , 2020 ) to the reward function . We remark that SURF is not a naïve application of these two techniques , but a novel combination of semi-supervised learning and the proposed data augmentation , which has not been considered or evaluated in the context of the preference-based RL . Our experiments demonstrate that SURF significantly improves the preference-based RL method ( Lee et al. , 2021a ) on complex locomotion and robotic manipulation tasks from DeepMind Control Suite ( Tassa et al. , 2018 ; 2020 ) and Meta-world ( Yu et al. , 2020 ) , in terms of feedbackefficiency . In particular , our framework could make RL agents achieve ∼100 % of success rate on complex robotic manipulation task using only a few hundred preference queries , while its baseline method only achieves ∼50 % of the success rate under the same condition ( see Figure 3 ) . 2 RELATED WORK . Preference-based RL . In the preference-based RL framework , a ( human ) supervisor provides preferences between the two agent behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Wu et al. , 2021 ; Lee et al. , 2021a ; b ) . Since this approach is only feasible if the feedback is practical for a human to provide , several strategies have been studied in the literature . Ibarz et al . ( 2018 ) initialized the agent ’ s policy with imitation learning from the expert demonstrations , while Lee et al . ( 2021a ) utilized unsupervised pre-training for policy initialization . Several sampling schemes ( Sadigh et al. , 2017 ; Biyik & Sadigh , 2018 ; Biyik et al. , 2020 ) to select informative queries also have been adopted for improving the feedback-efficiency . Our approach differs in that we utilize unlabeled samples for reward learning , and also provide a novel data augmentation technique for the agent behaviors . Data augmentation for RL . In the context of RL , data augmentation has been widely investigated for improving data-efficiency ( Srinivas et al. , 2020 ; Yarats et al. , 2021 ) , or RL generalization ( Cobbe et al. , 2019 ; Lee et al. , 2019 ) . For example , RAD ( Laskin et al. , 2020 ) demonstrated that data augmentation , such as random crop , can improve both data-efficiency and generalization of RL algorithms . While these methods are known to be beneficial to learn policy in the standard RL setup , they have not been tested for learning rewards . To the best of our knowledge , we present the first data augmentation method specially designed for learning reward function . Semi-supervised learning . The goal of semi-supervised learning ( SSL ) is to leveraging unlabeled samples to improve a model ’ s performance when the amount of labeled samples are limited . In an attempt to leverage the information in the unlabeled dataset , a number of techniques have been proposed , e.g. , entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) and consistency regularization ( Sajjadi et al. , 2016 ; Miyato et al. , 2018 ; Xie et al. , 2019 ; Sohn et al. , 2020 ) . Recently , the combination of these two approaches have shown state-of-the-art performance in benchmarks , e.g. , MixMatch ( Berthelot et al. , 2019 ) , and ReMixMatch ( Berthelot et al. , 2020 ) , when used with advanced data augmentation techniques ( Zhang et al. , 2018 ; Cubuk et al. , 2019 ) . Specifically , FixMatch ( Sohn et al. , 2020 ) revisits pseudo-labeling technique and demonstrates that joint usage of pseudo-labels and consistency regularization achieves remarkable performance due to its simplicity . 3 PRELIMINARIES . Reinforcement learning ( RL ) is a framework where an agent interacts with an environment in discrete time ( Sutton & Barto , 2018 ) . At each timestep t , the agent receives a state st from the environment and chooses an action at based on its policy π ( at|st ) . In conventional RL framework , the environment gives a reward r ( st , at ) and the agent transitions to the next state st+1 . The return Rt = ∑∞ k=0 γ kr ( st+k , at+k ) is defined as discounted cumulative sum of the reward with discount factor γ ∈ [ 0 , 1 ) . The goal of the agent is to learn a policy that maximizes the expected return . Preference-based reinforcement learning . In this paper , we consider a preference-based RL framework , which does not assume the existence of hand-engineered reward . Instead , a ( human ) teacher provides preferences between the agent ’ s behaviors and the agent uses this feedback to perform the task ( Christiano et al. , 2017 ; Ibarz et al. , 2018 ; Leike et al. , 2018 ; Stiennon et al. , 2020 ; Lee et al. , 2021a ; b ; Wu et al. , 2021 ) by learning a reward function , which is consistent with the observed preferences . We formulate a reward learning problem as a supervised learning problem ( Wilson et al. , 2012 ; Christiano et al. , 2017 ) . Formally , a segment σ is a sequence of observations and actions { ( sk , ak ) , ... , ( sk+H−1 , ak+H−1 ) } . Given a pair of segments ( σ0 , σ1 ) , a teacher gives a feedback indicating which segment is preferred , i.e. , y ∈ { 0 , 1 , 0.5 } , where 1 indicates σ1 σ0 , 0 indicates σ0 σ1 , and 0.5 implies an equally preferable case . Each feedback is stored in a dataset D as a triple ( σ0 , σ1 , y ) . Then , we model a preference predictor using the reward function r̂ψ following the Bradley-Terry model ( Bradley & Terry , 1952 ) : Pψ [ σ 1 σ0 ] = exp ( ∑ t r̂ψ ( s 1 t , a 1 t ) ) ∑ i∈ { 0,1 } exp ( ∑ t r̂ψ ( s i t , a i t ) ) , ( 1 ) where σi σj denotes the event that segment i is preferable to segment j . The underlying assumption of this model is that the teacher ’ s probability of preferring a segment depends exponentially on the accumulated sum of the reward over the segment . The reward model is trained through supervised learning with teacher ’ s preferences . Specifically , given a dataset of preferences D , the reward function is updated by minimizing the binary cross-entropy loss : LCE = E ( σ0 , σ1 , y ) ∼D [ LReward ] = − E ( σ0 , σ1 , y ) ∼D [ ( 1− y ) logPψ [ σ0 σ1 ] + y logPψ [ σ1 σ0 ] ] . Algorithm 1 SURF Require : Hyperparameters : unlabeled batch ratio µ , threshold parameter τ , and loss weight λ Require : Set of collected labeled data Dl , and unlabeled data Du 1 : for each gradient step do 2 : Sample labeled batch { ( σ0l , σ1l , y ) ( i ) } Bi=1 ∼ Dl 3 : Sample unlabeled batch { ( σ0u , σ1u ) ( j ) } µBj=1 ∼ Du 4 : // DATA AUGMENTATION FOR LABELED DATA 5 : for i in 1 . . . B do 6 : ( σ̂0l , σ̂ 1 l ) ( i ) ← TDA ( ( σ0l , σ1l ) ( i ) ) in Algorithm 2 7 : end for 8 : // PSEUDO-LABELING AND DATA AUGMENTATION FOR UNLABELED DATA 9 : for j in 1 . . . µB do 10 : Predict pseudo-labels ŷ ( ( σ0u , σ1u ) ( j ) ) 11 : ( σ̂0u , σ̂1u ) ( j ) ← TDA ( ( σ0u , σ1u ) ( j ) ) in Algorithm 2 12 : end for 13 : Optimize LSSL ( 3 ) with respect to ψ 14 : end for The reward function r̂ψ is usually optimized only using labels from real human , which are expensive to obtain in practice . Instead , we propose a simple yet effective method based on semi-supervised learning and data augmentation to improve the feedback-efficiency of preference-based learning . | This paper proposes two data-augmentation techniques to improve the query efficiency of preference-based RL. (1) Pseudo-labeling leverages unlabeled data by using high-confidence predictions as labels. (2) Temporal cropping augmentation generates imaginary comparisons by cropping trajectories. The proposed augmentation can significantly improve the query efficiency of preference-based RL in a variety of benchmark tasks, including DMControl and Meta-World. The performance of SURF is comparable to dense-reward SAC while only accessing a few expert queries. | SP:2672395e363969d2462f66e7ad538b7ec6b22cc5 |
NAIL: A Challenging Benchmark for Na\"ive Logical Reasoning | 1 INTRODUCTION . Current deep models have achieved near human-level performance on many tasks in NLP ( Devlin et al. , 2019 ; Liu et al. , 2019 ) , and more often than not , superficial knowledge suffices to solve the problems . To move towards human intelligence , we need to equip the models with logical reasoning capabilities ( e.g. , ability to draw logical conclusions from given statements ) , which is also a long sought-after goal of AI ( Newell & Simon , 1956 ; McCarthy et al. , 1960 ) . One related task is natural language inference whose goal is to assign the logical relationships ( contradicted , neutral and entailment ) to sentence pairs . To push the development of models in logical reasoning , the researchers have focused on more challenging reading comprehension tasks , which often require more complex reasoning as well as longer input . However , most existing reading comprehension datasets are not oriented for the logical reasoning ( e.g. , SQuAD and HotpotQA ) , with the exception of LogiQA ( Liu et al. , 2020 ) , ReClor ( Yu et al. , 2020 ) and LR-LSAT ( Wang et al. , 2021 ) . Above datasets ( LogiQA , ReClor and LR-LSAT ) are limited and inadequate to train and evaluate logical reasoning capability . The reason is that all of the three datasets involve diverse types of logical reasoning , such as drawing an alternate conclusion to the argument , finding necessary/sufficient assumptions , whether statements strengthen/weaken the argument or explain/resolve the situation . Mixing multiple types of logical reasoning may pose the following challenges . a ) . From the perspective of human cognition , different types of logical reasoning correspond to different problem-solving ideas . But in practice we usually train a model on the whole dataset with the same idea , which makes it more limited for models to learn different logical reasoning capability . b ) . From the perspective of machine learning , if there are many reasoning types mixed in a dataset , then there will be less data for each reasoning type , which is inadequate to train and evaluate logical reasoning capability ( demonstrated in our experiments ) . Furthermore , when the model does not work , it is difficult to determine which reasoning type is the bottleneck ( no reasoning type annotation in the dataset ) , which may hinder the design of better models . To tackle the challenges , we focus on a more fine-grained type of logical reasoning , named naı̈ve logical reasoning ( Section 2 ) , which is to infer the logical conclusion from statements that describe triples ( subject , predicate , object ) and the relationships among them . A typical example of naı̈ve Paragraph : A,B,C,D为四位漂亮女生。她们喜欢穿漂亮衣服。某天,她们穿的衣服颜色各不相同,有黄色,绿色,蓝色 和红色四种,在问到她们各自衣服的颜色时,A说: “ B的衣服不是黄色的。 ” B说: “ C的衣服不是绿色的。 ” C说: “ D的衣服不 是蓝色的。 ” D说: “ A,B,C三人中有一个人的衣服是绿色的,而且只有这个人说的是实话。 ” ( There are four pretty girls , namely A , B , C , and D , all of whom love to dress beautifully . One day , four girls get dressed in different colors : yellow , green , blue , and red . When asked about the color , A said that B did not dress in yellow ; B said that C did not dress in green ; C said that D did not dress in blue ; D said that among A , B , and C , only one girl dressed in green and she was the only one who told the truth . ) logical reasoning is shown in Figure 1 . To answer this query , we need to iteratively derive conclusions according to the conditions , and stop the searching branch if a conflict occurs . Specifically , in the initial table , we only know that “ D is not green ” from “ D told the truth ” . Assume that “ A told the truth ” , and infer that “ A is green , C is non-green ” . Next derive “ C is green ” from “ C told the lie ” . Then C is derived as both green and non-green , thus causing a conflict . Similar processes for assuming “ B told the truth ” and “ C told the truth ” . It takes extensive training and practice for human brains to cope with such complex logical reasoning . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we build a new large-scale benchmark , NAIL , by selecting naı̈ve logical reasoning examples from standardized exams such as the National Civil Servants Examination of China and Law School Admission Test . However , such examples are limited in their number , as it takes efforts for human experts to design these questions . To collect more data , we propose to imitate examples of standardized exams rather than designing them from scratch . Unlike simple data augmentation ( e.g. , substitution , paraphrasing ) , human imitation aims at getting more diverse examples while maintaining the underlying logic ( Figure 1 ) . NAIL is available in both Chinese and English , containing a total of 10 , 296 ∗ 2 instances . Empirical results show that state-of-the-art neural models struggle on NAIL with very poor accuracy ( the best result is 30.1 % for NAIL and 36.2 % for Chinese NAIL ) , while human experts can perform 100 % accuracy . Further results indicate that human imitations can significantly help models learn naı̈ve logical ability from natural text . 2 NAÏVE LOGICAL REASONING . The naı̈ve logical reasoning is a more fine-grained type of logical reasoning . Formally , we give the definition as follows . Definition 1 . The subject is a described resource , usually an entity , such as person or location . The predicate indicates an attribute of the subject or indicates some kind of relationship between the subject and the object . When denoting an attribute , the object is the attribute value , usually a literal value , e.g. , ( Jacket , Color , Red ) , otherwise the object is an entity , e.g. , ( Beijing , Capital , China ) . Definition 2 . Assuming the set of subjects S , the set of predicates P , the set of objects O and several statements , each statement describes a triple ( subject , predicate , object ) or some logical relationship between triples . The naive logical reasoning is the process of reasoning from these statements to reach a logical conclusion . 1 In this work , we explore naı̈ve logical reasoning in the form of reading comprehension . A typical example and detailed reasoning process is shown in Figure 1 . Similar to the format of multiple-choice reading comprehension , it contains a context , a query and four options with only one correct answer . To solve the problem , the model needs to understand the logical connections between the subjects , predicates and objects , and then derive a valid option . 3 NAIL : DATA COLLECTION AND ANALYSIS . NAIL is a carefully designed benchmark for naı̈ve logical reasoning similar to the format of multiplechoice reading comprehension . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we first collect a small amount of examples from examinations , denoted as NAIL-E ( Section 3.1 ) . Then we propose to imitate examples of NAIL-E to collect more data , denoted as NAIL-I ( Section 3.2 ) . Finally we provide a detailed analysis of the proposed NAIL ( Section 3.3 ) . 3.1 COLLECTION FROM EXAMINATION . We searched for such examples widely from two different types of public examinations : Chinese National Civil Servants Examination ( CNCSE ) and Law School Admission Test ( LSAT ) . 2 CNCSE is a once-a-year competitive examination in China , and there are overall 120-140 examples per exam per year . But only 1-4 examples belong to the scope of naı̈ve logical reasoning , which is also the most difficult type of problems for candidates within the given 120 minutes . And the LSAT is a standardized test for prospective law school candidates in the United States , Canada , and a growing number of other countries . Logical Reasoning is a multiple-choice section of LSAT , containing 24-26 questions under the limitation of 35 minutes , where about 2-4 problems fall into naı̈ve logical reasoning category . We artificially selected examples that belong to the naı̈ve logical reasoning category from the above two examinations . Finally we obtained 488 examples from the last 25 years of CNCSE and LSAT in the last 30 years , denoted as NAIL-E . These two exams are from countries with different native languages . The former is expressed in Chinese , and the latter is expressed in English . And note that there are slight difference in language style between them . And for diversity and fairness , in later step we get all examples in both Chinese and English through translation . 3.2 COLLECTION FROM IMITATION . After collecting a small amount of NAIL-E , we expect to expand the number of the dataset . Designing examples from scratch requires a huge effort from human experts . One simple solution is data augmentation , which artificially scales up data by creating modified data from existing data , such as word/sentence shuffling , word replacement and syntactic variation . However , the data augmented in this way is highly correlated with the original data , and the model easily captures these semantic surface correlations , which makes it limited to train and evaluate logical reasoning capability . To alleviate this limitation , we propose to imitate examples of NAIL-E , to create more examples with a diverse semantic surface while keeping the underlying logic of the original example . Furthermore , in the process of human imitation , we design strict strategies to control the quality of imitation . Imitation Example See Figure 2 , the context of an example from NAIL-E consists of 6 sentences and a query ( split by blank lines ) , each of which can be represented as a logical template ( see “ backbone template ” ) . The example focus on the description of a scenario : picking Prince Charming ( m1 ) , which involves five entities : Li Na ( s1 ) , Wang Wei ( p1 ) , Wu Gang ( p2 ) , Li Qiang ( p3 ) , Liu Dawei ( p4 ) , and three noun/adjective properties : tall ( a1 ) , handsome ( a2 ) , a PhD ( a3 ) . An accepted imitation needs to keep original underlying logic but have semantically different groundings , i.e. , to describe a completely different scenario . Imitation 1 and 2 1The term naive refers to the fact that this logical reasoning process of human in this task is spontaneous , intuitive and unsystematic . 2https : //www.lsac.org/lsat/taking-lsat/test-format/logical-reasoning are unqualified imitations . Since Imitation 1 only conducts subject-level imitations ( S imitations ) , i.e. , only superficially substitute the five entities ( s1 : Li Na→Sun Yi , p1 : Wang Wei→Qu Heng , p2 : Wu Gang→Mei Zhen , p3 : Li Qiang→Ji Fan , p4 : Liu Dawei→Zhang Lei ) . Further , Imitation 2 conducts subject-and-object-level imitations ( SO imitations ) , i.e. , not only substituting the entities , but also altering the corresponding objects ( property values ) . ( a1 : tall→rich , a2 : handsome→having a house , a3 : a PhD→having a car ) . The difference between Imitation 2 and the original example is much greater than that between Imitation 1 and and the raw problem , however , Imitation 2 is still not an ideal imitation . Furthermore , Imitation 3 changes the scenario m1 into picking ideal gift . Imitation 3 is an expected imitative writing , which conducts subject-and-predicate-and-object-level imitations ( SPO imitations ) . Note that all of the three imitations share the same logic templates . And p2 is the answer for all of the original example and above three imitations . Imitation Process We first select a group of people from a variety of occupations : professional editors , legal practitioners , in-service civil servants and college students ( from different majors ) . Empirically , people in these occupations have strong logical and verbal skills . These people are asked to conduct SPO imitations based on original examples from NAIL-E , and reasonable imitations should meet two requirements : logic invariance and semantic diversity . We trained these candidate people how to conduct SPO imitations such as Figure 2 . We then conducted a trial phase before the official imitation phase , in which process we eliminated some people of poor quality . Finally we employed 82 qualified people3 to imitatively construct problems based on NAIL-E , and they are paid RMB¥2.8 per imitation4 . Averagely , it costs a trained person about 3-4 minutes to finish an imitation : starting from coming up a scenario , then replacing the subjects , predicates , and objects of the raw 3Consisting of 42 native Chinese speakers and 40 native English speakers . Native speakers of a language will be assigned imitation tasks expressed by that language . 4A part-time employee can produce 15-20 imitations per hour , where he/she can get RMB¥42-RMB¥56 , while the local minimum wage is RMB¥23 per hour . problem with those scenario-related while keeping invariant logic , and finally smoothing the new sentence with some transition words if necessary . For each original example in NAIL-E , we expect at least 20 imitations ( except for extremely difficult cases ) . Overall we use 813 paid work hours in total to build the NAIL-I . Imitation Quality Control We adopt following strategies to ensure the quality of imitations : 1 . As mentioned above , we conducted a trial phase before the official imitation phase . In this phase , we asked them to imitate a small number of problems . Although we do not necessarily need them to write the backbone template , we will check the logic and give feedback to help them understand the task . This process was iterated for three rounds . Only those who passed the trial phase could participate in the official imitation . 2 . During the official imitation , we set up an online chat room to communicate with employees and answer their questions timely . 3 . To embrace semantic diversity , each original example is shown to at least 5 people , that is , one can only conduct 4 imitations based on one original example . People who are assigned to the same example imitate independently without interference from each other , to ensure varied inspiration for imitation . 4 . To ensure logic invariance , we adopt a double-checking strategy : • Cross Checking : Everyday , for each employee , we sample 5 imitations from all of his/her daily imitations . And the sampled imitation is assigned to other 2 employees for cross-checking . The imitation will be qualified only if they both approved , and the criterion for approval is that the imitation share the same logics with the original example . If any one of the 5 imitations produced by one employee fail , then all imitations of that employee for that day will be returned to re-check and repair . • Post Checking : To further ensure that the underlying logic do not deviate during imitation , we introduce another team of experts to solve the imitative examples . The team consists of 20 experienced experts . 10 of them speaks Chinese as native language and have passed CNCSE , while the other 10 speaks English and have passed LSAT . 5 Each imitative example was presented to 3 experts randomly , who are allowed to select one and only choice from “ A ” , “ B ” , “ C ” , “ D ” , otherwise , “ UNABLE TO ANSWER ” if bugs exist in the example , causing no correct choice or multiple correct choices . As long as one of the 3 experts pointed out “ UNABLE TO ANSWER ” , then the imitator of this problem should recheck the logic , until each of these 3 experts could give a choice from “ A ” , “ B ” , “ C ” , “ D ” . Note that in the post checking process , we broke up the imitations together and shuffle randomly , otherwise if a person is faced with imitations from same original example , he/she is prone to give a shortcut option with speculation . Translation Quality Control After collecting high-quality mono-collections , we first adopted Google Translation to translate Chinese/English collections into another language , and then employed 10 professional bilingual experts in Chinese and English for manual correction . Bilingual experts were asked to pay attention to logic-invariance and faithfulness during translation . Next , to ensure translation quality , we also adopted the post checking strategy . That is , we asked the 20 human experts mentioned above to solve the translated examples . Each translated example was presented to 3 experts randomly . Since human experts excel in solving naı̈ve logical reasoning problems , ( i.e . achieve 100 % accuracy on mono-collections ) , if any expert made a mistake on a translated sample or pointed out “ UNABLE TO ANSWER ” , the translated instance is sent back to the bilingual experts for revision . Finally , we asked 50 native speakers to read through all paragraphs of the translation parts in NAIL and mark “ 0 ” / “ 1 ” for each , where “ 1 ” stands for a translated sample is idiomatic , and “ 0 ” otherwise . Then for all samples marked with “ 0 ” ( about 20 % ) , the bilingual experts and native speakers will work together to polish them and conform to the target language norms . Human Evaluation As mentioned above , an imitation is finally regarded as qualified only if the sampled 3 experts could all solve the example . For any original example in NAIL-E , we also ask 3 experts in the team to solve it . Since the gold answers to examples in NAIL-E are provided in public by the examination committee , and corresponding imitations in NAIL-I share the same answer with the original example . Therefore , we calculated the mean accuracy of these three submissions on the overall NAIL , denoted as the performance of human experts . To better demonstrate the 5Experts who are native English speakers will be assigned English problems and experts who are native Chinese speakers will be assigned Chinese problems . difficulty of NAIL , we also selected another team consisting of 20 first-year college students . Same as above , an example is shown to 3 students randomly and they have to give the answer independently . We calculated the overall mean accuracy as the performance of human baseline.The evaluation of human baseline is paid separately . Each person can receive RMB¥1.5 for answering each example , which generally cost the person 2-3 minutes . Since we hire part-time people to write imitatively rather than using existing crowd-sourcing platforms , we build our own website , where the quality and overall progress can be viewed at any time . | This paper proposes a new challenge for large pretrained models (which can of course extend to any other model claiming to store language knowledge): naive logical reasoning. The main contribution of the paper is the construction of a dataset in Chinese and English (termed NAIL) with items for training and evaluating such naive logical reasoning, where the task in the dataset is cast as a standard multi-choice (4-choice in this case) question, with only one correct answer. The main empirical result of the paper consists in showing that pretrained language models, even when trained on naive logical reasoning examples, lag far behind human performance. | SP:607f386583cf7c3a73fc36f68f97a3a3ca7182c1 |
NAIL: A Challenging Benchmark for Na\"ive Logical Reasoning | 1 INTRODUCTION . Current deep models have achieved near human-level performance on many tasks in NLP ( Devlin et al. , 2019 ; Liu et al. , 2019 ) , and more often than not , superficial knowledge suffices to solve the problems . To move towards human intelligence , we need to equip the models with logical reasoning capabilities ( e.g. , ability to draw logical conclusions from given statements ) , which is also a long sought-after goal of AI ( Newell & Simon , 1956 ; McCarthy et al. , 1960 ) . One related task is natural language inference whose goal is to assign the logical relationships ( contradicted , neutral and entailment ) to sentence pairs . To push the development of models in logical reasoning , the researchers have focused on more challenging reading comprehension tasks , which often require more complex reasoning as well as longer input . However , most existing reading comprehension datasets are not oriented for the logical reasoning ( e.g. , SQuAD and HotpotQA ) , with the exception of LogiQA ( Liu et al. , 2020 ) , ReClor ( Yu et al. , 2020 ) and LR-LSAT ( Wang et al. , 2021 ) . Above datasets ( LogiQA , ReClor and LR-LSAT ) are limited and inadequate to train and evaluate logical reasoning capability . The reason is that all of the three datasets involve diverse types of logical reasoning , such as drawing an alternate conclusion to the argument , finding necessary/sufficient assumptions , whether statements strengthen/weaken the argument or explain/resolve the situation . Mixing multiple types of logical reasoning may pose the following challenges . a ) . From the perspective of human cognition , different types of logical reasoning correspond to different problem-solving ideas . But in practice we usually train a model on the whole dataset with the same idea , which makes it more limited for models to learn different logical reasoning capability . b ) . From the perspective of machine learning , if there are many reasoning types mixed in a dataset , then there will be less data for each reasoning type , which is inadequate to train and evaluate logical reasoning capability ( demonstrated in our experiments ) . Furthermore , when the model does not work , it is difficult to determine which reasoning type is the bottleneck ( no reasoning type annotation in the dataset ) , which may hinder the design of better models . To tackle the challenges , we focus on a more fine-grained type of logical reasoning , named naı̈ve logical reasoning ( Section 2 ) , which is to infer the logical conclusion from statements that describe triples ( subject , predicate , object ) and the relationships among them . A typical example of naı̈ve Paragraph : A,B,C,D为四位漂亮女生。她们喜欢穿漂亮衣服。某天,她们穿的衣服颜色各不相同,有黄色,绿色,蓝色 和红色四种,在问到她们各自衣服的颜色时,A说: “ B的衣服不是黄色的。 ” B说: “ C的衣服不是绿色的。 ” C说: “ D的衣服不 是蓝色的。 ” D说: “ A,B,C三人中有一个人的衣服是绿色的,而且只有这个人说的是实话。 ” ( There are four pretty girls , namely A , B , C , and D , all of whom love to dress beautifully . One day , four girls get dressed in different colors : yellow , green , blue , and red . When asked about the color , A said that B did not dress in yellow ; B said that C did not dress in green ; C said that D did not dress in blue ; D said that among A , B , and C , only one girl dressed in green and she was the only one who told the truth . ) logical reasoning is shown in Figure 1 . To answer this query , we need to iteratively derive conclusions according to the conditions , and stop the searching branch if a conflict occurs . Specifically , in the initial table , we only know that “ D is not green ” from “ D told the truth ” . Assume that “ A told the truth ” , and infer that “ A is green , C is non-green ” . Next derive “ C is green ” from “ C told the lie ” . Then C is derived as both green and non-green , thus causing a conflict . Similar processes for assuming “ B told the truth ” and “ C told the truth ” . It takes extensive training and practice for human brains to cope with such complex logical reasoning . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we build a new large-scale benchmark , NAIL , by selecting naı̈ve logical reasoning examples from standardized exams such as the National Civil Servants Examination of China and Law School Admission Test . However , such examples are limited in their number , as it takes efforts for human experts to design these questions . To collect more data , we propose to imitate examples of standardized exams rather than designing them from scratch . Unlike simple data augmentation ( e.g. , substitution , paraphrasing ) , human imitation aims at getting more diverse examples while maintaining the underlying logic ( Figure 1 ) . NAIL is available in both Chinese and English , containing a total of 10 , 296 ∗ 2 instances . Empirical results show that state-of-the-art neural models struggle on NAIL with very poor accuracy ( the best result is 30.1 % for NAIL and 36.2 % for Chinese NAIL ) , while human experts can perform 100 % accuracy . Further results indicate that human imitations can significantly help models learn naı̈ve logical ability from natural text . 2 NAÏVE LOGICAL REASONING . The naı̈ve logical reasoning is a more fine-grained type of logical reasoning . Formally , we give the definition as follows . Definition 1 . The subject is a described resource , usually an entity , such as person or location . The predicate indicates an attribute of the subject or indicates some kind of relationship between the subject and the object . When denoting an attribute , the object is the attribute value , usually a literal value , e.g. , ( Jacket , Color , Red ) , otherwise the object is an entity , e.g. , ( Beijing , Capital , China ) . Definition 2 . Assuming the set of subjects S , the set of predicates P , the set of objects O and several statements , each statement describes a triple ( subject , predicate , object ) or some logical relationship between triples . The naive logical reasoning is the process of reasoning from these statements to reach a logical conclusion . 1 In this work , we explore naı̈ve logical reasoning in the form of reading comprehension . A typical example and detailed reasoning process is shown in Figure 1 . Similar to the format of multiple-choice reading comprehension , it contains a context , a query and four options with only one correct answer . To solve the problem , the model needs to understand the logical connections between the subjects , predicates and objects , and then derive a valid option . 3 NAIL : DATA COLLECTION AND ANALYSIS . NAIL is a carefully designed benchmark for naı̈ve logical reasoning similar to the format of multiplechoice reading comprehension . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we first collect a small amount of examples from examinations , denoted as NAIL-E ( Section 3.1 ) . Then we propose to imitate examples of NAIL-E to collect more data , denoted as NAIL-I ( Section 3.2 ) . Finally we provide a detailed analysis of the proposed NAIL ( Section 3.3 ) . 3.1 COLLECTION FROM EXAMINATION . We searched for such examples widely from two different types of public examinations : Chinese National Civil Servants Examination ( CNCSE ) and Law School Admission Test ( LSAT ) . 2 CNCSE is a once-a-year competitive examination in China , and there are overall 120-140 examples per exam per year . But only 1-4 examples belong to the scope of naı̈ve logical reasoning , which is also the most difficult type of problems for candidates within the given 120 minutes . And the LSAT is a standardized test for prospective law school candidates in the United States , Canada , and a growing number of other countries . Logical Reasoning is a multiple-choice section of LSAT , containing 24-26 questions under the limitation of 35 minutes , where about 2-4 problems fall into naı̈ve logical reasoning category . We artificially selected examples that belong to the naı̈ve logical reasoning category from the above two examinations . Finally we obtained 488 examples from the last 25 years of CNCSE and LSAT in the last 30 years , denoted as NAIL-E . These two exams are from countries with different native languages . The former is expressed in Chinese , and the latter is expressed in English . And note that there are slight difference in language style between them . And for diversity and fairness , in later step we get all examples in both Chinese and English through translation . 3.2 COLLECTION FROM IMITATION . After collecting a small amount of NAIL-E , we expect to expand the number of the dataset . Designing examples from scratch requires a huge effort from human experts . One simple solution is data augmentation , which artificially scales up data by creating modified data from existing data , such as word/sentence shuffling , word replacement and syntactic variation . However , the data augmented in this way is highly correlated with the original data , and the model easily captures these semantic surface correlations , which makes it limited to train and evaluate logical reasoning capability . To alleviate this limitation , we propose to imitate examples of NAIL-E , to create more examples with a diverse semantic surface while keeping the underlying logic of the original example . Furthermore , in the process of human imitation , we design strict strategies to control the quality of imitation . Imitation Example See Figure 2 , the context of an example from NAIL-E consists of 6 sentences and a query ( split by blank lines ) , each of which can be represented as a logical template ( see “ backbone template ” ) . The example focus on the description of a scenario : picking Prince Charming ( m1 ) , which involves five entities : Li Na ( s1 ) , Wang Wei ( p1 ) , Wu Gang ( p2 ) , Li Qiang ( p3 ) , Liu Dawei ( p4 ) , and three noun/adjective properties : tall ( a1 ) , handsome ( a2 ) , a PhD ( a3 ) . An accepted imitation needs to keep original underlying logic but have semantically different groundings , i.e. , to describe a completely different scenario . Imitation 1 and 2 1The term naive refers to the fact that this logical reasoning process of human in this task is spontaneous , intuitive and unsystematic . 2https : //www.lsac.org/lsat/taking-lsat/test-format/logical-reasoning are unqualified imitations . Since Imitation 1 only conducts subject-level imitations ( S imitations ) , i.e. , only superficially substitute the five entities ( s1 : Li Na→Sun Yi , p1 : Wang Wei→Qu Heng , p2 : Wu Gang→Mei Zhen , p3 : Li Qiang→Ji Fan , p4 : Liu Dawei→Zhang Lei ) . Further , Imitation 2 conducts subject-and-object-level imitations ( SO imitations ) , i.e. , not only substituting the entities , but also altering the corresponding objects ( property values ) . ( a1 : tall→rich , a2 : handsome→having a house , a3 : a PhD→having a car ) . The difference between Imitation 2 and the original example is much greater than that between Imitation 1 and and the raw problem , however , Imitation 2 is still not an ideal imitation . Furthermore , Imitation 3 changes the scenario m1 into picking ideal gift . Imitation 3 is an expected imitative writing , which conducts subject-and-predicate-and-object-level imitations ( SPO imitations ) . Note that all of the three imitations share the same logic templates . And p2 is the answer for all of the original example and above three imitations . Imitation Process We first select a group of people from a variety of occupations : professional editors , legal practitioners , in-service civil servants and college students ( from different majors ) . Empirically , people in these occupations have strong logical and verbal skills . These people are asked to conduct SPO imitations based on original examples from NAIL-E , and reasonable imitations should meet two requirements : logic invariance and semantic diversity . We trained these candidate people how to conduct SPO imitations such as Figure 2 . We then conducted a trial phase before the official imitation phase , in which process we eliminated some people of poor quality . Finally we employed 82 qualified people3 to imitatively construct problems based on NAIL-E , and they are paid RMB¥2.8 per imitation4 . Averagely , it costs a trained person about 3-4 minutes to finish an imitation : starting from coming up a scenario , then replacing the subjects , predicates , and objects of the raw 3Consisting of 42 native Chinese speakers and 40 native English speakers . Native speakers of a language will be assigned imitation tasks expressed by that language . 4A part-time employee can produce 15-20 imitations per hour , where he/she can get RMB¥42-RMB¥56 , while the local minimum wage is RMB¥23 per hour . problem with those scenario-related while keeping invariant logic , and finally smoothing the new sentence with some transition words if necessary . For each original example in NAIL-E , we expect at least 20 imitations ( except for extremely difficult cases ) . Overall we use 813 paid work hours in total to build the NAIL-I . Imitation Quality Control We adopt following strategies to ensure the quality of imitations : 1 . As mentioned above , we conducted a trial phase before the official imitation phase . In this phase , we asked them to imitate a small number of problems . Although we do not necessarily need them to write the backbone template , we will check the logic and give feedback to help them understand the task . This process was iterated for three rounds . Only those who passed the trial phase could participate in the official imitation . 2 . During the official imitation , we set up an online chat room to communicate with employees and answer their questions timely . 3 . To embrace semantic diversity , each original example is shown to at least 5 people , that is , one can only conduct 4 imitations based on one original example . People who are assigned to the same example imitate independently without interference from each other , to ensure varied inspiration for imitation . 4 . To ensure logic invariance , we adopt a double-checking strategy : • Cross Checking : Everyday , for each employee , we sample 5 imitations from all of his/her daily imitations . And the sampled imitation is assigned to other 2 employees for cross-checking . The imitation will be qualified only if they both approved , and the criterion for approval is that the imitation share the same logics with the original example . If any one of the 5 imitations produced by one employee fail , then all imitations of that employee for that day will be returned to re-check and repair . • Post Checking : To further ensure that the underlying logic do not deviate during imitation , we introduce another team of experts to solve the imitative examples . The team consists of 20 experienced experts . 10 of them speaks Chinese as native language and have passed CNCSE , while the other 10 speaks English and have passed LSAT . 5 Each imitative example was presented to 3 experts randomly , who are allowed to select one and only choice from “ A ” , “ B ” , “ C ” , “ D ” , otherwise , “ UNABLE TO ANSWER ” if bugs exist in the example , causing no correct choice or multiple correct choices . As long as one of the 3 experts pointed out “ UNABLE TO ANSWER ” , then the imitator of this problem should recheck the logic , until each of these 3 experts could give a choice from “ A ” , “ B ” , “ C ” , “ D ” . Note that in the post checking process , we broke up the imitations together and shuffle randomly , otherwise if a person is faced with imitations from same original example , he/she is prone to give a shortcut option with speculation . Translation Quality Control After collecting high-quality mono-collections , we first adopted Google Translation to translate Chinese/English collections into another language , and then employed 10 professional bilingual experts in Chinese and English for manual correction . Bilingual experts were asked to pay attention to logic-invariance and faithfulness during translation . Next , to ensure translation quality , we also adopted the post checking strategy . That is , we asked the 20 human experts mentioned above to solve the translated examples . Each translated example was presented to 3 experts randomly . Since human experts excel in solving naı̈ve logical reasoning problems , ( i.e . achieve 100 % accuracy on mono-collections ) , if any expert made a mistake on a translated sample or pointed out “ UNABLE TO ANSWER ” , the translated instance is sent back to the bilingual experts for revision . Finally , we asked 50 native speakers to read through all paragraphs of the translation parts in NAIL and mark “ 0 ” / “ 1 ” for each , where “ 1 ” stands for a translated sample is idiomatic , and “ 0 ” otherwise . Then for all samples marked with “ 0 ” ( about 20 % ) , the bilingual experts and native speakers will work together to polish them and conform to the target language norms . Human Evaluation As mentioned above , an imitation is finally regarded as qualified only if the sampled 3 experts could all solve the example . For any original example in NAIL-E , we also ask 3 experts in the team to solve it . Since the gold answers to examples in NAIL-E are provided in public by the examination committee , and corresponding imitations in NAIL-I share the same answer with the original example . Therefore , we calculated the mean accuracy of these three submissions on the overall NAIL , denoted as the performance of human experts . To better demonstrate the 5Experts who are native English speakers will be assigned English problems and experts who are native Chinese speakers will be assigned Chinese problems . difficulty of NAIL , we also selected another team consisting of 20 first-year college students . Same as above , an example is shown to 3 students randomly and they have to give the answer independently . We calculated the overall mean accuracy as the performance of human baseline.The evaluation of human baseline is paid separately . Each person can receive RMB¥1.5 for answering each example , which generally cost the person 2-3 minutes . Since we hire part-time people to write imitatively rather than using existing crowd-sourcing platforms , we build our own website , where the quality and overall progress can be viewed at any time . | This work introduces NAIL, a bilingual (English and Chinese) a benchmark for naive logical reasoning, inspired in the kind of questions, involving this aspect contained in standardized exams such as Chinese National Civil Servants Examination (CNCSE) and Law School Admission Test (LSAT). Two different sets are collected in this work. NAIL-E, which are actual examples from both CNCSE and LSAT, translated to English and Chinese respectively, and NAIL-I, a data augmentation approach that uses the structure from existing examples and replaces the three aspects of the problem, subject, predicated and objects in order to create new instances. An qualitative analysis is carried out to reach the conclusion that those three replacings are necessary in order to create new, and more challenging instances. The resulting datasets NAIL-E and NAIL-I are finally splitted into train, dev and test, and examined to test their quality. Random baseline, word match, sliding window, BERT and Roberta (as well as human evaluations carried out by average and expert annotators) are carried out showing the quality of the resulting datasets and the challeding there are for current NLP models. Extra experimentation is done to test their transfer learning skills among the full dataset, its split NAIL-E and NAIL-I and using LogiQA, ReClor, RACE as pretriaining steps. | SP:607f386583cf7c3a73fc36f68f97a3a3ca7182c1 |
NAIL: A Challenging Benchmark for Na\"ive Logical Reasoning | 1 INTRODUCTION . Current deep models have achieved near human-level performance on many tasks in NLP ( Devlin et al. , 2019 ; Liu et al. , 2019 ) , and more often than not , superficial knowledge suffices to solve the problems . To move towards human intelligence , we need to equip the models with logical reasoning capabilities ( e.g. , ability to draw logical conclusions from given statements ) , which is also a long sought-after goal of AI ( Newell & Simon , 1956 ; McCarthy et al. , 1960 ) . One related task is natural language inference whose goal is to assign the logical relationships ( contradicted , neutral and entailment ) to sentence pairs . To push the development of models in logical reasoning , the researchers have focused on more challenging reading comprehension tasks , which often require more complex reasoning as well as longer input . However , most existing reading comprehension datasets are not oriented for the logical reasoning ( e.g. , SQuAD and HotpotQA ) , with the exception of LogiQA ( Liu et al. , 2020 ) , ReClor ( Yu et al. , 2020 ) and LR-LSAT ( Wang et al. , 2021 ) . Above datasets ( LogiQA , ReClor and LR-LSAT ) are limited and inadequate to train and evaluate logical reasoning capability . The reason is that all of the three datasets involve diverse types of logical reasoning , such as drawing an alternate conclusion to the argument , finding necessary/sufficient assumptions , whether statements strengthen/weaken the argument or explain/resolve the situation . Mixing multiple types of logical reasoning may pose the following challenges . a ) . From the perspective of human cognition , different types of logical reasoning correspond to different problem-solving ideas . But in practice we usually train a model on the whole dataset with the same idea , which makes it more limited for models to learn different logical reasoning capability . b ) . From the perspective of machine learning , if there are many reasoning types mixed in a dataset , then there will be less data for each reasoning type , which is inadequate to train and evaluate logical reasoning capability ( demonstrated in our experiments ) . Furthermore , when the model does not work , it is difficult to determine which reasoning type is the bottleneck ( no reasoning type annotation in the dataset ) , which may hinder the design of better models . To tackle the challenges , we focus on a more fine-grained type of logical reasoning , named naı̈ve logical reasoning ( Section 2 ) , which is to infer the logical conclusion from statements that describe triples ( subject , predicate , object ) and the relationships among them . A typical example of naı̈ve Paragraph : A,B,C,D为四位漂亮女生。她们喜欢穿漂亮衣服。某天,她们穿的衣服颜色各不相同,有黄色,绿色,蓝色 和红色四种,在问到她们各自衣服的颜色时,A说: “ B的衣服不是黄色的。 ” B说: “ C的衣服不是绿色的。 ” C说: “ D的衣服不 是蓝色的。 ” D说: “ A,B,C三人中有一个人的衣服是绿色的,而且只有这个人说的是实话。 ” ( There are four pretty girls , namely A , B , C , and D , all of whom love to dress beautifully . One day , four girls get dressed in different colors : yellow , green , blue , and red . When asked about the color , A said that B did not dress in yellow ; B said that C did not dress in green ; C said that D did not dress in blue ; D said that among A , B , and C , only one girl dressed in green and she was the only one who told the truth . ) logical reasoning is shown in Figure 1 . To answer this query , we need to iteratively derive conclusions according to the conditions , and stop the searching branch if a conflict occurs . Specifically , in the initial table , we only know that “ D is not green ” from “ D told the truth ” . Assume that “ A told the truth ” , and infer that “ A is green , C is non-green ” . Next derive “ C is green ” from “ C told the lie ” . Then C is derived as both green and non-green , thus causing a conflict . Similar processes for assuming “ B told the truth ” and “ C told the truth ” . It takes extensive training and practice for human brains to cope with such complex logical reasoning . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we build a new large-scale benchmark , NAIL , by selecting naı̈ve logical reasoning examples from standardized exams such as the National Civil Servants Examination of China and Law School Admission Test . However , such examples are limited in their number , as it takes efforts for human experts to design these questions . To collect more data , we propose to imitate examples of standardized exams rather than designing them from scratch . Unlike simple data augmentation ( e.g. , substitution , paraphrasing ) , human imitation aims at getting more diverse examples while maintaining the underlying logic ( Figure 1 ) . NAIL is available in both Chinese and English , containing a total of 10 , 296 ∗ 2 instances . Empirical results show that state-of-the-art neural models struggle on NAIL with very poor accuracy ( the best result is 30.1 % for NAIL and 36.2 % for Chinese NAIL ) , while human experts can perform 100 % accuracy . Further results indicate that human imitations can significantly help models learn naı̈ve logical ability from natural text . 2 NAÏVE LOGICAL REASONING . The naı̈ve logical reasoning is a more fine-grained type of logical reasoning . Formally , we give the definition as follows . Definition 1 . The subject is a described resource , usually an entity , such as person or location . The predicate indicates an attribute of the subject or indicates some kind of relationship between the subject and the object . When denoting an attribute , the object is the attribute value , usually a literal value , e.g. , ( Jacket , Color , Red ) , otherwise the object is an entity , e.g. , ( Beijing , Capital , China ) . Definition 2 . Assuming the set of subjects S , the set of predicates P , the set of objects O and several statements , each statement describes a triple ( subject , predicate , object ) or some logical relationship between triples . The naive logical reasoning is the process of reasoning from these statements to reach a logical conclusion . 1 In this work , we explore naı̈ve logical reasoning in the form of reading comprehension . A typical example and detailed reasoning process is shown in Figure 1 . Similar to the format of multiple-choice reading comprehension , it contains a context , a query and four options with only one correct answer . To solve the problem , the model needs to understand the logical connections between the subjects , predicates and objects , and then derive a valid option . 3 NAIL : DATA COLLECTION AND ANALYSIS . NAIL is a carefully designed benchmark for naı̈ve logical reasoning similar to the format of multiplechoice reading comprehension . Inspired by the datasets extracted from standardized examinations ( Lai et al. , 2017 ; Clark et al. , 2018 ; Liu et al. , 2020 ) , we first collect a small amount of examples from examinations , denoted as NAIL-E ( Section 3.1 ) . Then we propose to imitate examples of NAIL-E to collect more data , denoted as NAIL-I ( Section 3.2 ) . Finally we provide a detailed analysis of the proposed NAIL ( Section 3.3 ) . 3.1 COLLECTION FROM EXAMINATION . We searched for such examples widely from two different types of public examinations : Chinese National Civil Servants Examination ( CNCSE ) and Law School Admission Test ( LSAT ) . 2 CNCSE is a once-a-year competitive examination in China , and there are overall 120-140 examples per exam per year . But only 1-4 examples belong to the scope of naı̈ve logical reasoning , which is also the most difficult type of problems for candidates within the given 120 minutes . And the LSAT is a standardized test for prospective law school candidates in the United States , Canada , and a growing number of other countries . Logical Reasoning is a multiple-choice section of LSAT , containing 24-26 questions under the limitation of 35 minutes , where about 2-4 problems fall into naı̈ve logical reasoning category . We artificially selected examples that belong to the naı̈ve logical reasoning category from the above two examinations . Finally we obtained 488 examples from the last 25 years of CNCSE and LSAT in the last 30 years , denoted as NAIL-E . These two exams are from countries with different native languages . The former is expressed in Chinese , and the latter is expressed in English . And note that there are slight difference in language style between them . And for diversity and fairness , in later step we get all examples in both Chinese and English through translation . 3.2 COLLECTION FROM IMITATION . After collecting a small amount of NAIL-E , we expect to expand the number of the dataset . Designing examples from scratch requires a huge effort from human experts . One simple solution is data augmentation , which artificially scales up data by creating modified data from existing data , such as word/sentence shuffling , word replacement and syntactic variation . However , the data augmented in this way is highly correlated with the original data , and the model easily captures these semantic surface correlations , which makes it limited to train and evaluate logical reasoning capability . To alleviate this limitation , we propose to imitate examples of NAIL-E , to create more examples with a diverse semantic surface while keeping the underlying logic of the original example . Furthermore , in the process of human imitation , we design strict strategies to control the quality of imitation . Imitation Example See Figure 2 , the context of an example from NAIL-E consists of 6 sentences and a query ( split by blank lines ) , each of which can be represented as a logical template ( see “ backbone template ” ) . The example focus on the description of a scenario : picking Prince Charming ( m1 ) , which involves five entities : Li Na ( s1 ) , Wang Wei ( p1 ) , Wu Gang ( p2 ) , Li Qiang ( p3 ) , Liu Dawei ( p4 ) , and three noun/adjective properties : tall ( a1 ) , handsome ( a2 ) , a PhD ( a3 ) . An accepted imitation needs to keep original underlying logic but have semantically different groundings , i.e. , to describe a completely different scenario . Imitation 1 and 2 1The term naive refers to the fact that this logical reasoning process of human in this task is spontaneous , intuitive and unsystematic . 2https : //www.lsac.org/lsat/taking-lsat/test-format/logical-reasoning are unqualified imitations . Since Imitation 1 only conducts subject-level imitations ( S imitations ) , i.e. , only superficially substitute the five entities ( s1 : Li Na→Sun Yi , p1 : Wang Wei→Qu Heng , p2 : Wu Gang→Mei Zhen , p3 : Li Qiang→Ji Fan , p4 : Liu Dawei→Zhang Lei ) . Further , Imitation 2 conducts subject-and-object-level imitations ( SO imitations ) , i.e. , not only substituting the entities , but also altering the corresponding objects ( property values ) . ( a1 : tall→rich , a2 : handsome→having a house , a3 : a PhD→having a car ) . The difference between Imitation 2 and the original example is much greater than that between Imitation 1 and and the raw problem , however , Imitation 2 is still not an ideal imitation . Furthermore , Imitation 3 changes the scenario m1 into picking ideal gift . Imitation 3 is an expected imitative writing , which conducts subject-and-predicate-and-object-level imitations ( SPO imitations ) . Note that all of the three imitations share the same logic templates . And p2 is the answer for all of the original example and above three imitations . Imitation Process We first select a group of people from a variety of occupations : professional editors , legal practitioners , in-service civil servants and college students ( from different majors ) . Empirically , people in these occupations have strong logical and verbal skills . These people are asked to conduct SPO imitations based on original examples from NAIL-E , and reasonable imitations should meet two requirements : logic invariance and semantic diversity . We trained these candidate people how to conduct SPO imitations such as Figure 2 . We then conducted a trial phase before the official imitation phase , in which process we eliminated some people of poor quality . Finally we employed 82 qualified people3 to imitatively construct problems based on NAIL-E , and they are paid RMB¥2.8 per imitation4 . Averagely , it costs a trained person about 3-4 minutes to finish an imitation : starting from coming up a scenario , then replacing the subjects , predicates , and objects of the raw 3Consisting of 42 native Chinese speakers and 40 native English speakers . Native speakers of a language will be assigned imitation tasks expressed by that language . 4A part-time employee can produce 15-20 imitations per hour , where he/she can get RMB¥42-RMB¥56 , while the local minimum wage is RMB¥23 per hour . problem with those scenario-related while keeping invariant logic , and finally smoothing the new sentence with some transition words if necessary . For each original example in NAIL-E , we expect at least 20 imitations ( except for extremely difficult cases ) . Overall we use 813 paid work hours in total to build the NAIL-I . Imitation Quality Control We adopt following strategies to ensure the quality of imitations : 1 . As mentioned above , we conducted a trial phase before the official imitation phase . In this phase , we asked them to imitate a small number of problems . Although we do not necessarily need them to write the backbone template , we will check the logic and give feedback to help them understand the task . This process was iterated for three rounds . Only those who passed the trial phase could participate in the official imitation . 2 . During the official imitation , we set up an online chat room to communicate with employees and answer their questions timely . 3 . To embrace semantic diversity , each original example is shown to at least 5 people , that is , one can only conduct 4 imitations based on one original example . People who are assigned to the same example imitate independently without interference from each other , to ensure varied inspiration for imitation . 4 . To ensure logic invariance , we adopt a double-checking strategy : • Cross Checking : Everyday , for each employee , we sample 5 imitations from all of his/her daily imitations . And the sampled imitation is assigned to other 2 employees for cross-checking . The imitation will be qualified only if they both approved , and the criterion for approval is that the imitation share the same logics with the original example . If any one of the 5 imitations produced by one employee fail , then all imitations of that employee for that day will be returned to re-check and repair . • Post Checking : To further ensure that the underlying logic do not deviate during imitation , we introduce another team of experts to solve the imitative examples . The team consists of 20 experienced experts . 10 of them speaks Chinese as native language and have passed CNCSE , while the other 10 speaks English and have passed LSAT . 5 Each imitative example was presented to 3 experts randomly , who are allowed to select one and only choice from “ A ” , “ B ” , “ C ” , “ D ” , otherwise , “ UNABLE TO ANSWER ” if bugs exist in the example , causing no correct choice or multiple correct choices . As long as one of the 3 experts pointed out “ UNABLE TO ANSWER ” , then the imitator of this problem should recheck the logic , until each of these 3 experts could give a choice from “ A ” , “ B ” , “ C ” , “ D ” . Note that in the post checking process , we broke up the imitations together and shuffle randomly , otherwise if a person is faced with imitations from same original example , he/she is prone to give a shortcut option with speculation . Translation Quality Control After collecting high-quality mono-collections , we first adopted Google Translation to translate Chinese/English collections into another language , and then employed 10 professional bilingual experts in Chinese and English for manual correction . Bilingual experts were asked to pay attention to logic-invariance and faithfulness during translation . Next , to ensure translation quality , we also adopted the post checking strategy . That is , we asked the 20 human experts mentioned above to solve the translated examples . Each translated example was presented to 3 experts randomly . Since human experts excel in solving naı̈ve logical reasoning problems , ( i.e . achieve 100 % accuracy on mono-collections ) , if any expert made a mistake on a translated sample or pointed out “ UNABLE TO ANSWER ” , the translated instance is sent back to the bilingual experts for revision . Finally , we asked 50 native speakers to read through all paragraphs of the translation parts in NAIL and mark “ 0 ” / “ 1 ” for each , where “ 1 ” stands for a translated sample is idiomatic , and “ 0 ” otherwise . Then for all samples marked with “ 0 ” ( about 20 % ) , the bilingual experts and native speakers will work together to polish them and conform to the target language norms . Human Evaluation As mentioned above , an imitation is finally regarded as qualified only if the sampled 3 experts could all solve the example . For any original example in NAIL-E , we also ask 3 experts in the team to solve it . Since the gold answers to examples in NAIL-E are provided in public by the examination committee , and corresponding imitations in NAIL-I share the same answer with the original example . Therefore , we calculated the mean accuracy of these three submissions on the overall NAIL , denoted as the performance of human experts . To better demonstrate the 5Experts who are native English speakers will be assigned English problems and experts who are native Chinese speakers will be assigned Chinese problems . difficulty of NAIL , we also selected another team consisting of 20 first-year college students . Same as above , an example is shown to 3 students randomly and they have to give the answer independently . We calculated the overall mean accuracy as the performance of human baseline.The evaluation of human baseline is paid separately . Each person can receive RMB¥1.5 for answering each example , which generally cost the person 2-3 minutes . Since we hire part-time people to write imitatively rather than using existing crowd-sourcing platforms , we build our own website , where the quality and overall progress can be viewed at any time . | This paper proposes a new dataset that tests the capability of logical reasoning through multiple-choice reading comprehension. Questions are collected from human exams (Chinese National Civil Servants Examination in Chinese and Law School Admission Test in English) and are augmented by imitating the actual exam examples. The main focus of the questions is understanding of the relationship between subject-predicate-object triples, involving four reasoning types: factuality, ordering, matching, and set operation. In the imitation process, the authors hire people from different backgrounds who are asked to write examples that are logically invariant but semantically different from a given actual example (82 people, 813 paid work hours with fair payment, and at least 20 imitations per actual example). All collected examples are manually validated by experts and answered by college students for measuring human baseline. Experiments with rule-based (word matching and sliding window) and neural network-based (BERT and RoBERTa) models show that the machine performance (30.10 and 36.15 for the English and Chinese sets respectively) is largely lower than the human baseline (71.31 and 76.38), which indicates that these systems struggle to solve the naive logical reasoning questions. | SP:607f386583cf7c3a73fc36f68f97a3a3ca7182c1 |
Test-time Batch Statistics Calibration for Covariate Shift | 1 INTRODUCTION . Deep neural networks ( DNNs ) achieve impressive success across various applications , but heavily rely on the independent and identical distribution ( i.i.d . ) assumption . However , in real-world applications , the model is prone to encounter the novel instances . For examples , an automatic pilot should have robust performance under different weather conditions . Unfortunately , when applying DNNs to novel environment , the performance has a clear degradation due to the covariate shift ( Ben-David et al. , 2010 ) , i.e. , the test data distribution differs from the training distribution . Domain adaptation ( DA ) is a promising alternative , which transfers the knowledge learned on labeled source domain to unlabeled target domain , where the data distribution is distinct ( Long et al. , 2015 ) . However , domain adaptation needs the pre-collected target data , which is not applicable . Unlike DA , Domain generalization ( DG ) aims at training a general model from multiple source domains and generalizing to the unseen target domain . DG is more challenging since the target domain is totally unseen during training . Recently , another practical scenario named test-time adaptation ( TTA ) is proposed . In TTA , the target data are not pre-collected for iterative training , but used for adapting the source-trained model during inference . We show the comparison between different settings in Table 1 . To make the comparison clear , we introduce two indicators . Iterative training means the model is trained on the unlabeled target data iteratively . Online training means the model parameters are updated during inference . Noticing that a recent DG work ( Pandey et al. , 2021 ) adapts the model during inference , while most previous DG methods did not . We call it as optimization-free TTA . In this paper , we focus on the practical scenarios : DG and TTA . One of the main approaches to adapt during inference is test-time normalization ( T-BN ) ( Nado et al. , 2020 ) . T-BN re-calculates the target batch statistics to replace the source statistics in BN layers during inference . Motivated by T-BN , Wang et al . ( 2021 ) proposed to perform test time adaptation by re-calculating the target batch statistics and updating the affine parameters in BN layers with entropy minimization . However , this paradigm has critical restrictions . For representation learning , the discriminative representations are crucial for recognition task . Substituting the source statistics with target statistics in BN layers will inevitably lead to a mismatch with the source-trained model parameters . This mismatch will probably perturb the original discriminative structures . Another limitation is the estimation error on target batch statistics . The source statistics in BN layers are updated in a moving average manner during training time , while the target statistics are calculated in each batch during test time . The statistics estimated in a batch introduces more errors in reflecting the domain characteristics . A preliminary empirical investigation of the mentioned restrictions are shown in Fig . 1 and Table 2 . Motivated by the hidden restrictions of T-BN , we propose a more general method named α-BN to calibrate the batch statistics during inference . Specifically , we mix up the source and target statistics in BN layers to both alleviate the domain shift and preserve the discriminative structures . Equipped with α-BN , common DG models can be further improved without any training . Based on α-BN , we further propose an unified test-time adaptation framework named CORE with an online optimization , which exploits the pairwise Class correlation to facilitate robust and accurate test time adaptation . To sum up , we have following contributions : 1 . We investigate two practical yet challenging transfer learning scenarios : domain generalization and test time adaptation , which release the requirement of pre-collected target domain data . 2 . Motivated by the hidden restrictions of test time normalization , we present a general formulation α-BN for both alleviating domain shifts and preserving discriminative informations . It can be seamlessly incorporated into mainstream deep neural networks to improve the generalization on unseen domains without any training . 3 . Based on α-BN , we propose a unified framework CORE for test-time adaptation . CORE optimizes the pairwise class correlation in an unsupervised online learning manner . 4 . We conduct numerous experiments on total twelve datasets from three topics : robustness to corruptions , DG on image classification and DG on semantic segmentations . The empirical results show that both α-BN and CORE achieve the state-of-the-art ( SoTA ) performance in their respective communities . The result on GTA5→ Cityscapes , for instance , is improved from 28.4 % to 43.9 % without any training , which even outperforms the SoTA source-free DA method . 2 RELATED WORKS . Domain Adaptation and Generalization Domain adaptation ( DA ) enables transferring the knowledge from source domain to target domain by jointly optimizing both labeled source data and unlabeled target data . This paradigm has gained a lot of attention in the last decade and various methods are proposed , which can be roughly divided into three categories : metric learning ( Long et al. , 2015 ; Sun & Saenko , 2016 ; Kang et al. , 2019 ; Li et al. , 2020 ) , adversarial training ( Ganin et al. , 2016 ; Long et al. , 2018 ; Tsai et al. , 2018 ) and self-training Zou et al . ( 2019 ) ; Liang et al . ( 2020 ) ; Ge et al . ( 2020 ) . However , training with the large amounts source data is inefficient and impractical in many real-world applications . To address this issue , source-free DA is proposed , which adapts to the target domain with target data and the model pre-trained on source domain . Chidlovskii et al . ( 2016 ) are the first to investigate source-free DA and proposed a denoising auto-encoder for adaptation . SHOT ( Liang et al. , 2020 ) is another representative work , which proposed information maximization loss and clustering-based pseudo-labeling . However , despite getting rid of the source domain data , source-free DA also requires the pre-collected target domain data for iterative training , limiting its application scenarios . Therefore , domain generalization ( DG ) and fully test-time adaptation ( TTA ) are proposed ( Let us elaborate TTA in the next paragraph ) . Domain generalization aims at generalizing the model trained on a ( multiple ) source domain ( s ) to the unseen target domain directly . Recently , various DG methods are proposed including domain-invariant representation learning ( Zhao et al. , 2020 ; Matsuura & Harada , 2020 ) , proxy tasks ( Carlucci et al. , 2019 ; Huang et al. , 2020 ) , augmentations ( Volpi et al. , 2018 ; Zhou et al. , 2021 ) , meta-learning ( Li et al. , 2018 ; Balaji et al. , 2018 ) and so on . However , Gulrajani & Lopez-Paz ( 2020 ) provided a DG benchmark named DomainBed for fair comparison and found a well-implemented empirical risk minimization ( ERM ) model outperforms most DG methods . Recently , Pandey et al . ( 2021 ) proposed label-preserving target projections during inference time for DG . This work differs from most previous works , which focus on learning from source domains , while it performs optimization-free TTA during inference . Our proposed α-BN also belongs to it , but the methods differ . Fully Test-time Adaptation Fully test-time adaptation is proposed by Wang et al . ( 2021 ) , which adapts the model to target domain by online training . TTA can be seen as a compromise between source-free DA and DG . Different from source-free DA , TTA does not require the pre-collected target domain data but trains on the target data in an online manner . Also , different from DG , TTA allows optimization during test , which introduces additional test time cost but usually guarantees better performance . Therefore , TTA is a really practical scenario since it gets rid of iterative training and yields better performance compared to generalizing to the new environment directly . Wang et al . ( 2021 ) proposed TENT to achieve TTA by feature modulation . Feature modulation contains two steps : test-time normalization ( we will elaborate it in the next paragraph . ) and affine parameters optimization by entropy minimization , which is a widely-used regularization term on DA and semisupervised learning ( Grandvalet et al. , 2005 ) . Another similar scenario is test-time training , which optimizes the networks before making a prediction during inference Sun et al . ( 2019 ) . Since this setting is weaker than TTA , we mainly talk about TTA in this paper . Normalization and Adaptation Batch normalization ( BN ) is widely-used in DNNs nowadays for stable training and fast converge . BN is originally proposed to alleviate the internal covariate shift during training a very deep neural networks Ioffe & Szegedy ( 2015 ) . Recently , Schneider et al . ( 2020 ) and Nado et al . ( 2020 ) discovered that updating the batch statistics during testing improves the robustness to common corruptions . In this paper , we call it as test-time normalization . Similar to their works , Wang et al . ( 2021 ) proposed feature modulation , which also updates the batch statistics rather than freezes them . The key insight for these methods is that batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) . Based on this finding , Jeon et al . ( 2021 ) and Zhou et al . ( 2021 ) proposed to synthesise the novel domain styles to facilitate generalization . Another kind of work focuses on instance normalization ( Ulyanov et al. , 2016 ) . Similarly , Huang & Belongie ( 2017 ) found the instance-wise statistics are related to instance characteristics ( i.e. , image styles ) . Motivated by this finding , Zhou et al . ( 2021 ) proposed to generate novel in- stances by mixing instance-level feature statistics to enhance out-of-distribution generalization . It is worth noticing that the aforementioned DG method can be summarized as an augmentation-based technique . Different from them , we propose a post-processing method to calibrate the batch statistics on target domain during test time . 3 UNDERSTANDING TEST-TIME NORMALIZATION . Test-time normalization ( T-BN ) re-calculates the batch statistics on target domain during inference . Since the batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) , T-BN adapts the model to target domain explicitly . However , every coin has two sides , and T-BN is not a free lunch . During training on the source domain , the model parameters are associated with the source statistics . Therefore , substituting the source statistics with the target ones inevitably results in a mismatch with the model parameters , which leads to the degradation of discrim- inative structures . In short , T-BN alleviates the negative effects caused by domain shift , but perturbs the discriminative structures . We report the averaged accuracy of “ Source ” and “ T-BN ” on three DG classification benchmarks in Table 2 . We observe that the accuracy of “ T-BN ” is consistently lower than “ Source ” , revealing that substituting the source statistics by the estimated target batch statistics directly is not effective in generalizing to the new environment . To further understand T-BN , we begin with the following two perspectives . Error of ideal target hypothesis . Based on domain adaptation theory ( Ben-David et al. , 2010 ) , the domain shift can be reflected by the error of the ideal target hypothesis based on the target representations learned by source model . “ target representation ” means the representations are obtained on the target domain data . To obtain the ideal target hypothesis , we train a new classifier over the target representations with corresponding labels . Two methods are compared : “ Source ” and “ T-BN ” . “ Source ” obtains the target representations by the source model directly , while “ T-BN ” performs test-time normalization . The error of the ideal target hypothesis is shown in Fig . 1 ( b ) . As expected , the error of the ideal target hypothesis in “ T-BN ” is lower over all tasks . It is worth noticing that the only difference between them is that T-BN normalizes the BN layer inputs by the target statistics rather than the source statistics , and others remain consistent ( e.g. , the same network architecture and the same network parameters ) . Therefore , we reasonably postulate that T-BN alleviates the domain shift , which results in the lower error of the ideal target hypothesis . Representation visualization . Discriminative representation learning is essential for recognition task . The discriminative representation satisfies two basic principles : intra-class tightness and interclass separation . To qualitatively verify that how T-BN affects the learned representations , we visualize the target representations in Fig . 1 ( c ) . The variance of each category cluster in “ T-BN ” is significantly larger compared to “ Source ” , which indicates the discriminative structures are injured due to the mismatch between target statistics and source model parameters . | This paper presents a domain adaptation algorithm for the recently introduced test-time adaptation setting by adapting batch-norm parameters. The algorithm has two key components: first, it adapts batch-norm statistics using a linear combination of source and estimated target domain statistics; second, it uses a class correlation optimzation loss to optimize batch-norm parameters on the test batches. These design choices differ from previously described methods. The resulting algorithm is evaluated on a range of datasets and tasks including common corruptions and the DomainBed benchmark for image classification, as well as a benchmark for image segmentation. | SP:3f57f4ee1ca0e7be745741a72e9910d4448a527d |
Test-time Batch Statistics Calibration for Covariate Shift | 1 INTRODUCTION . Deep neural networks ( DNNs ) achieve impressive success across various applications , but heavily rely on the independent and identical distribution ( i.i.d . ) assumption . However , in real-world applications , the model is prone to encounter the novel instances . For examples , an automatic pilot should have robust performance under different weather conditions . Unfortunately , when applying DNNs to novel environment , the performance has a clear degradation due to the covariate shift ( Ben-David et al. , 2010 ) , i.e. , the test data distribution differs from the training distribution . Domain adaptation ( DA ) is a promising alternative , which transfers the knowledge learned on labeled source domain to unlabeled target domain , where the data distribution is distinct ( Long et al. , 2015 ) . However , domain adaptation needs the pre-collected target data , which is not applicable . Unlike DA , Domain generalization ( DG ) aims at training a general model from multiple source domains and generalizing to the unseen target domain . DG is more challenging since the target domain is totally unseen during training . Recently , another practical scenario named test-time adaptation ( TTA ) is proposed . In TTA , the target data are not pre-collected for iterative training , but used for adapting the source-trained model during inference . We show the comparison between different settings in Table 1 . To make the comparison clear , we introduce two indicators . Iterative training means the model is trained on the unlabeled target data iteratively . Online training means the model parameters are updated during inference . Noticing that a recent DG work ( Pandey et al. , 2021 ) adapts the model during inference , while most previous DG methods did not . We call it as optimization-free TTA . In this paper , we focus on the practical scenarios : DG and TTA . One of the main approaches to adapt during inference is test-time normalization ( T-BN ) ( Nado et al. , 2020 ) . T-BN re-calculates the target batch statistics to replace the source statistics in BN layers during inference . Motivated by T-BN , Wang et al . ( 2021 ) proposed to perform test time adaptation by re-calculating the target batch statistics and updating the affine parameters in BN layers with entropy minimization . However , this paradigm has critical restrictions . For representation learning , the discriminative representations are crucial for recognition task . Substituting the source statistics with target statistics in BN layers will inevitably lead to a mismatch with the source-trained model parameters . This mismatch will probably perturb the original discriminative structures . Another limitation is the estimation error on target batch statistics . The source statistics in BN layers are updated in a moving average manner during training time , while the target statistics are calculated in each batch during test time . The statistics estimated in a batch introduces more errors in reflecting the domain characteristics . A preliminary empirical investigation of the mentioned restrictions are shown in Fig . 1 and Table 2 . Motivated by the hidden restrictions of T-BN , we propose a more general method named α-BN to calibrate the batch statistics during inference . Specifically , we mix up the source and target statistics in BN layers to both alleviate the domain shift and preserve the discriminative structures . Equipped with α-BN , common DG models can be further improved without any training . Based on α-BN , we further propose an unified test-time adaptation framework named CORE with an online optimization , which exploits the pairwise Class correlation to facilitate robust and accurate test time adaptation . To sum up , we have following contributions : 1 . We investigate two practical yet challenging transfer learning scenarios : domain generalization and test time adaptation , which release the requirement of pre-collected target domain data . 2 . Motivated by the hidden restrictions of test time normalization , we present a general formulation α-BN for both alleviating domain shifts and preserving discriminative informations . It can be seamlessly incorporated into mainstream deep neural networks to improve the generalization on unseen domains without any training . 3 . Based on α-BN , we propose a unified framework CORE for test-time adaptation . CORE optimizes the pairwise class correlation in an unsupervised online learning manner . 4 . We conduct numerous experiments on total twelve datasets from three topics : robustness to corruptions , DG on image classification and DG on semantic segmentations . The empirical results show that both α-BN and CORE achieve the state-of-the-art ( SoTA ) performance in their respective communities . The result on GTA5→ Cityscapes , for instance , is improved from 28.4 % to 43.9 % without any training , which even outperforms the SoTA source-free DA method . 2 RELATED WORKS . Domain Adaptation and Generalization Domain adaptation ( DA ) enables transferring the knowledge from source domain to target domain by jointly optimizing both labeled source data and unlabeled target data . This paradigm has gained a lot of attention in the last decade and various methods are proposed , which can be roughly divided into three categories : metric learning ( Long et al. , 2015 ; Sun & Saenko , 2016 ; Kang et al. , 2019 ; Li et al. , 2020 ) , adversarial training ( Ganin et al. , 2016 ; Long et al. , 2018 ; Tsai et al. , 2018 ) and self-training Zou et al . ( 2019 ) ; Liang et al . ( 2020 ) ; Ge et al . ( 2020 ) . However , training with the large amounts source data is inefficient and impractical in many real-world applications . To address this issue , source-free DA is proposed , which adapts to the target domain with target data and the model pre-trained on source domain . Chidlovskii et al . ( 2016 ) are the first to investigate source-free DA and proposed a denoising auto-encoder for adaptation . SHOT ( Liang et al. , 2020 ) is another representative work , which proposed information maximization loss and clustering-based pseudo-labeling . However , despite getting rid of the source domain data , source-free DA also requires the pre-collected target domain data for iterative training , limiting its application scenarios . Therefore , domain generalization ( DG ) and fully test-time adaptation ( TTA ) are proposed ( Let us elaborate TTA in the next paragraph ) . Domain generalization aims at generalizing the model trained on a ( multiple ) source domain ( s ) to the unseen target domain directly . Recently , various DG methods are proposed including domain-invariant representation learning ( Zhao et al. , 2020 ; Matsuura & Harada , 2020 ) , proxy tasks ( Carlucci et al. , 2019 ; Huang et al. , 2020 ) , augmentations ( Volpi et al. , 2018 ; Zhou et al. , 2021 ) , meta-learning ( Li et al. , 2018 ; Balaji et al. , 2018 ) and so on . However , Gulrajani & Lopez-Paz ( 2020 ) provided a DG benchmark named DomainBed for fair comparison and found a well-implemented empirical risk minimization ( ERM ) model outperforms most DG methods . Recently , Pandey et al . ( 2021 ) proposed label-preserving target projections during inference time for DG . This work differs from most previous works , which focus on learning from source domains , while it performs optimization-free TTA during inference . Our proposed α-BN also belongs to it , but the methods differ . Fully Test-time Adaptation Fully test-time adaptation is proposed by Wang et al . ( 2021 ) , which adapts the model to target domain by online training . TTA can be seen as a compromise between source-free DA and DG . Different from source-free DA , TTA does not require the pre-collected target domain data but trains on the target data in an online manner . Also , different from DG , TTA allows optimization during test , which introduces additional test time cost but usually guarantees better performance . Therefore , TTA is a really practical scenario since it gets rid of iterative training and yields better performance compared to generalizing to the new environment directly . Wang et al . ( 2021 ) proposed TENT to achieve TTA by feature modulation . Feature modulation contains two steps : test-time normalization ( we will elaborate it in the next paragraph . ) and affine parameters optimization by entropy minimization , which is a widely-used regularization term on DA and semisupervised learning ( Grandvalet et al. , 2005 ) . Another similar scenario is test-time training , which optimizes the networks before making a prediction during inference Sun et al . ( 2019 ) . Since this setting is weaker than TTA , we mainly talk about TTA in this paper . Normalization and Adaptation Batch normalization ( BN ) is widely-used in DNNs nowadays for stable training and fast converge . BN is originally proposed to alleviate the internal covariate shift during training a very deep neural networks Ioffe & Szegedy ( 2015 ) . Recently , Schneider et al . ( 2020 ) and Nado et al . ( 2020 ) discovered that updating the batch statistics during testing improves the robustness to common corruptions . In this paper , we call it as test-time normalization . Similar to their works , Wang et al . ( 2021 ) proposed feature modulation , which also updates the batch statistics rather than freezes them . The key insight for these methods is that batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) . Based on this finding , Jeon et al . ( 2021 ) and Zhou et al . ( 2021 ) proposed to synthesise the novel domain styles to facilitate generalization . Another kind of work focuses on instance normalization ( Ulyanov et al. , 2016 ) . Similarly , Huang & Belongie ( 2017 ) found the instance-wise statistics are related to instance characteristics ( i.e. , image styles ) . Motivated by this finding , Zhou et al . ( 2021 ) proposed to generate novel in- stances by mixing instance-level feature statistics to enhance out-of-distribution generalization . It is worth noticing that the aforementioned DG method can be summarized as an augmentation-based technique . Different from them , we propose a post-processing method to calibrate the batch statistics on target domain during test time . 3 UNDERSTANDING TEST-TIME NORMALIZATION . Test-time normalization ( T-BN ) re-calculates the batch statistics on target domain during inference . Since the batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) , T-BN adapts the model to target domain explicitly . However , every coin has two sides , and T-BN is not a free lunch . During training on the source domain , the model parameters are associated with the source statistics . Therefore , substituting the source statistics with the target ones inevitably results in a mismatch with the model parameters , which leads to the degradation of discrim- inative structures . In short , T-BN alleviates the negative effects caused by domain shift , but perturbs the discriminative structures . We report the averaged accuracy of “ Source ” and “ T-BN ” on three DG classification benchmarks in Table 2 . We observe that the accuracy of “ T-BN ” is consistently lower than “ Source ” , revealing that substituting the source statistics by the estimated target batch statistics directly is not effective in generalizing to the new environment . To further understand T-BN , we begin with the following two perspectives . Error of ideal target hypothesis . Based on domain adaptation theory ( Ben-David et al. , 2010 ) , the domain shift can be reflected by the error of the ideal target hypothesis based on the target representations learned by source model . “ target representation ” means the representations are obtained on the target domain data . To obtain the ideal target hypothesis , we train a new classifier over the target representations with corresponding labels . Two methods are compared : “ Source ” and “ T-BN ” . “ Source ” obtains the target representations by the source model directly , while “ T-BN ” performs test-time normalization . The error of the ideal target hypothesis is shown in Fig . 1 ( b ) . As expected , the error of the ideal target hypothesis in “ T-BN ” is lower over all tasks . It is worth noticing that the only difference between them is that T-BN normalizes the BN layer inputs by the target statistics rather than the source statistics , and others remain consistent ( e.g. , the same network architecture and the same network parameters ) . Therefore , we reasonably postulate that T-BN alleviates the domain shift , which results in the lower error of the ideal target hypothesis . Representation visualization . Discriminative representation learning is essential for recognition task . The discriminative representation satisfies two basic principles : intra-class tightness and interclass separation . To qualitatively verify that how T-BN affects the learned representations , we visualize the target representations in Fig . 1 ( c ) . The variance of each category cluster in “ T-BN ” is significantly larger compared to “ Source ” , which indicates the discriminative structures are injured due to the mismatch between target statistics and source model parameters . | This paper presents a method to calibrate batch normalization statistics at test time to improve a model’s cross-domain generalization ability under covariate shifts. The authors validate the effectiveness of the method on several datasets and tasks. The authors also conduct some interesting analyses to help better understand the method. | SP:3f57f4ee1ca0e7be745741a72e9910d4448a527d |
Test-time Batch Statistics Calibration for Covariate Shift | 1 INTRODUCTION . Deep neural networks ( DNNs ) achieve impressive success across various applications , but heavily rely on the independent and identical distribution ( i.i.d . ) assumption . However , in real-world applications , the model is prone to encounter the novel instances . For examples , an automatic pilot should have robust performance under different weather conditions . Unfortunately , when applying DNNs to novel environment , the performance has a clear degradation due to the covariate shift ( Ben-David et al. , 2010 ) , i.e. , the test data distribution differs from the training distribution . Domain adaptation ( DA ) is a promising alternative , which transfers the knowledge learned on labeled source domain to unlabeled target domain , where the data distribution is distinct ( Long et al. , 2015 ) . However , domain adaptation needs the pre-collected target data , which is not applicable . Unlike DA , Domain generalization ( DG ) aims at training a general model from multiple source domains and generalizing to the unseen target domain . DG is more challenging since the target domain is totally unseen during training . Recently , another practical scenario named test-time adaptation ( TTA ) is proposed . In TTA , the target data are not pre-collected for iterative training , but used for adapting the source-trained model during inference . We show the comparison between different settings in Table 1 . To make the comparison clear , we introduce two indicators . Iterative training means the model is trained on the unlabeled target data iteratively . Online training means the model parameters are updated during inference . Noticing that a recent DG work ( Pandey et al. , 2021 ) adapts the model during inference , while most previous DG methods did not . We call it as optimization-free TTA . In this paper , we focus on the practical scenarios : DG and TTA . One of the main approaches to adapt during inference is test-time normalization ( T-BN ) ( Nado et al. , 2020 ) . T-BN re-calculates the target batch statistics to replace the source statistics in BN layers during inference . Motivated by T-BN , Wang et al . ( 2021 ) proposed to perform test time adaptation by re-calculating the target batch statistics and updating the affine parameters in BN layers with entropy minimization . However , this paradigm has critical restrictions . For representation learning , the discriminative representations are crucial for recognition task . Substituting the source statistics with target statistics in BN layers will inevitably lead to a mismatch with the source-trained model parameters . This mismatch will probably perturb the original discriminative structures . Another limitation is the estimation error on target batch statistics . The source statistics in BN layers are updated in a moving average manner during training time , while the target statistics are calculated in each batch during test time . The statistics estimated in a batch introduces more errors in reflecting the domain characteristics . A preliminary empirical investigation of the mentioned restrictions are shown in Fig . 1 and Table 2 . Motivated by the hidden restrictions of T-BN , we propose a more general method named α-BN to calibrate the batch statistics during inference . Specifically , we mix up the source and target statistics in BN layers to both alleviate the domain shift and preserve the discriminative structures . Equipped with α-BN , common DG models can be further improved without any training . Based on α-BN , we further propose an unified test-time adaptation framework named CORE with an online optimization , which exploits the pairwise Class correlation to facilitate robust and accurate test time adaptation . To sum up , we have following contributions : 1 . We investigate two practical yet challenging transfer learning scenarios : domain generalization and test time adaptation , which release the requirement of pre-collected target domain data . 2 . Motivated by the hidden restrictions of test time normalization , we present a general formulation α-BN for both alleviating domain shifts and preserving discriminative informations . It can be seamlessly incorporated into mainstream deep neural networks to improve the generalization on unseen domains without any training . 3 . Based on α-BN , we propose a unified framework CORE for test-time adaptation . CORE optimizes the pairwise class correlation in an unsupervised online learning manner . 4 . We conduct numerous experiments on total twelve datasets from three topics : robustness to corruptions , DG on image classification and DG on semantic segmentations . The empirical results show that both α-BN and CORE achieve the state-of-the-art ( SoTA ) performance in their respective communities . The result on GTA5→ Cityscapes , for instance , is improved from 28.4 % to 43.9 % without any training , which even outperforms the SoTA source-free DA method . 2 RELATED WORKS . Domain Adaptation and Generalization Domain adaptation ( DA ) enables transferring the knowledge from source domain to target domain by jointly optimizing both labeled source data and unlabeled target data . This paradigm has gained a lot of attention in the last decade and various methods are proposed , which can be roughly divided into three categories : metric learning ( Long et al. , 2015 ; Sun & Saenko , 2016 ; Kang et al. , 2019 ; Li et al. , 2020 ) , adversarial training ( Ganin et al. , 2016 ; Long et al. , 2018 ; Tsai et al. , 2018 ) and self-training Zou et al . ( 2019 ) ; Liang et al . ( 2020 ) ; Ge et al . ( 2020 ) . However , training with the large amounts source data is inefficient and impractical in many real-world applications . To address this issue , source-free DA is proposed , which adapts to the target domain with target data and the model pre-trained on source domain . Chidlovskii et al . ( 2016 ) are the first to investigate source-free DA and proposed a denoising auto-encoder for adaptation . SHOT ( Liang et al. , 2020 ) is another representative work , which proposed information maximization loss and clustering-based pseudo-labeling . However , despite getting rid of the source domain data , source-free DA also requires the pre-collected target domain data for iterative training , limiting its application scenarios . Therefore , domain generalization ( DG ) and fully test-time adaptation ( TTA ) are proposed ( Let us elaborate TTA in the next paragraph ) . Domain generalization aims at generalizing the model trained on a ( multiple ) source domain ( s ) to the unseen target domain directly . Recently , various DG methods are proposed including domain-invariant representation learning ( Zhao et al. , 2020 ; Matsuura & Harada , 2020 ) , proxy tasks ( Carlucci et al. , 2019 ; Huang et al. , 2020 ) , augmentations ( Volpi et al. , 2018 ; Zhou et al. , 2021 ) , meta-learning ( Li et al. , 2018 ; Balaji et al. , 2018 ) and so on . However , Gulrajani & Lopez-Paz ( 2020 ) provided a DG benchmark named DomainBed for fair comparison and found a well-implemented empirical risk minimization ( ERM ) model outperforms most DG methods . Recently , Pandey et al . ( 2021 ) proposed label-preserving target projections during inference time for DG . This work differs from most previous works , which focus on learning from source domains , while it performs optimization-free TTA during inference . Our proposed α-BN also belongs to it , but the methods differ . Fully Test-time Adaptation Fully test-time adaptation is proposed by Wang et al . ( 2021 ) , which adapts the model to target domain by online training . TTA can be seen as a compromise between source-free DA and DG . Different from source-free DA , TTA does not require the pre-collected target domain data but trains on the target data in an online manner . Also , different from DG , TTA allows optimization during test , which introduces additional test time cost but usually guarantees better performance . Therefore , TTA is a really practical scenario since it gets rid of iterative training and yields better performance compared to generalizing to the new environment directly . Wang et al . ( 2021 ) proposed TENT to achieve TTA by feature modulation . Feature modulation contains two steps : test-time normalization ( we will elaborate it in the next paragraph . ) and affine parameters optimization by entropy minimization , which is a widely-used regularization term on DA and semisupervised learning ( Grandvalet et al. , 2005 ) . Another similar scenario is test-time training , which optimizes the networks before making a prediction during inference Sun et al . ( 2019 ) . Since this setting is weaker than TTA , we mainly talk about TTA in this paper . Normalization and Adaptation Batch normalization ( BN ) is widely-used in DNNs nowadays for stable training and fast converge . BN is originally proposed to alleviate the internal covariate shift during training a very deep neural networks Ioffe & Szegedy ( 2015 ) . Recently , Schneider et al . ( 2020 ) and Nado et al . ( 2020 ) discovered that updating the batch statistics during testing improves the robustness to common corruptions . In this paper , we call it as test-time normalization . Similar to their works , Wang et al . ( 2021 ) proposed feature modulation , which also updates the batch statistics rather than freezes them . The key insight for these methods is that batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) . Based on this finding , Jeon et al . ( 2021 ) and Zhou et al . ( 2021 ) proposed to synthesise the novel domain styles to facilitate generalization . Another kind of work focuses on instance normalization ( Ulyanov et al. , 2016 ) . Similarly , Huang & Belongie ( 2017 ) found the instance-wise statistics are related to instance characteristics ( i.e. , image styles ) . Motivated by this finding , Zhou et al . ( 2021 ) proposed to generate novel in- stances by mixing instance-level feature statistics to enhance out-of-distribution generalization . It is worth noticing that the aforementioned DG method can be summarized as an augmentation-based technique . Different from them , we propose a post-processing method to calibrate the batch statistics on target domain during test time . 3 UNDERSTANDING TEST-TIME NORMALIZATION . Test-time normalization ( T-BN ) re-calculates the batch statistics on target domain during inference . Since the batch statistics are closely related to the domain characteristics ( Li et al. , 2016 ; Pan et al. , 2018 ) , T-BN adapts the model to target domain explicitly . However , every coin has two sides , and T-BN is not a free lunch . During training on the source domain , the model parameters are associated with the source statistics . Therefore , substituting the source statistics with the target ones inevitably results in a mismatch with the model parameters , which leads to the degradation of discrim- inative structures . In short , T-BN alleviates the negative effects caused by domain shift , but perturbs the discriminative structures . We report the averaged accuracy of “ Source ” and “ T-BN ” on three DG classification benchmarks in Table 2 . We observe that the accuracy of “ T-BN ” is consistently lower than “ Source ” , revealing that substituting the source statistics by the estimated target batch statistics directly is not effective in generalizing to the new environment . To further understand T-BN , we begin with the following two perspectives . Error of ideal target hypothesis . Based on domain adaptation theory ( Ben-David et al. , 2010 ) , the domain shift can be reflected by the error of the ideal target hypothesis based on the target representations learned by source model . “ target representation ” means the representations are obtained on the target domain data . To obtain the ideal target hypothesis , we train a new classifier over the target representations with corresponding labels . Two methods are compared : “ Source ” and “ T-BN ” . “ Source ” obtains the target representations by the source model directly , while “ T-BN ” performs test-time normalization . The error of the ideal target hypothesis is shown in Fig . 1 ( b ) . As expected , the error of the ideal target hypothesis in “ T-BN ” is lower over all tasks . It is worth noticing that the only difference between them is that T-BN normalizes the BN layer inputs by the target statistics rather than the source statistics , and others remain consistent ( e.g. , the same network architecture and the same network parameters ) . Therefore , we reasonably postulate that T-BN alleviates the domain shift , which results in the lower error of the ideal target hypothesis . Representation visualization . Discriminative representation learning is essential for recognition task . The discriminative representation satisfies two basic principles : intra-class tightness and interclass separation . To qualitatively verify that how T-BN affects the learned representations , we visualize the target representations in Fig . 1 ( c ) . The variance of each category cluster in “ T-BN ” is significantly larger compared to “ Source ” , which indicates the discriminative structures are injured due to the mismatch between target statistics and source model parameters . | The paper proposes a test-time batch normalization method for domain adaptation. They present a formulation $\alpha$-BN to calibrate the batch statistics by mixing up the source and target statistics with a fixed hyper-parameter of alpha. And, they propose to use the Core loss [ Jin et al. (2020)] to optimize the affine parameters of beta and gamma in BN layers instead of the entropy minimization used in the Tent method. The paper provides comprehensive experiment results. | SP:3f57f4ee1ca0e7be745741a72e9910d4448a527d |
Ask2Mask: Guided Data Selection for Masked Speech Modeling | 1 INTRODUCTION . Self-training and self-supervised training techniques rely on huge amounts of unlabeled speech or text data for better generalization . The self-training techniques such as pseudo-labeling ( Scudder , 1965 ; Kahn et al. , 2020 ) and student-teacher training ( Park et al. , 2020 ) have shown promising improvements by incorporating the data selection process . This data selection step removes pseudolabels with less confidence as denoted by the teacher model before feeding the input to a student model . Xu et al . ( 2021 ) shows that self-training and self-supervised training are complementary to each other and also show that self-supervised models act as good initialization for self-training techniques . Self-supervised training ( Hinton & Zemel , 1994 ) is a representation learning approach which implicitly learns patterns in the data without relying on explicit labels . Masked speech modeling ( MSM ) is the recent and successful self-supervised learning technique , thanks to the advent of BERT ( Devlin et al. , 2018 ) in NLP which inspired learning speech representations from masked inputs . MSM techniques such as wav2vec2 ( Baevski et al. , 2020 ) , HuBERT ( Hsu et al. , 2021b ) and w2v-BERT ( Chung et al. , 2021 ) have shown considerable gains across various down-stream speech tasks and have become the go-to models for ASR . Unfortunately , MSM does not have a data selection scheme to discard the irrelevant input samples and instead imposes burden on the training criterion to learn the relevance of the input samples in learning meaningful representations . Hsu et al . ( 2021a ) noticed the impact of not selecting relevant data from the huge amounts of unsupervised data during pre-training by showing degradation in ASR performance when fine-tuned to a target dataset with limited data . To mitigate this constraint , Chan et al . ( 2021 ) introduced substantially more fine-tuning data related to the target dataset but did not achieve satisfactory results . Hsu et al . ( 2021a ) attempted to solve this issue by heuristically selecting the data from a closed set of unsupervised speech databases or by pooling in data relevant to target dataset along with the existing pre-training dataset . However , this data selection approach is not done within the existing pre-training dataset and it is not completely empirically motivated . In this study , in order to break the above limitation of the MSM techniques , we propose a simple strategy named ask2mask ( ATM ) to incorporate data selection within a chosen pretraining dataset . • In ATM , the masking is done over the input samples or speech frames with higher confidence as determined by the scorer . This is contrary to the random selection of frames to be masked in conventional MSM models . We hypothesize that this guided selection of frames to be masked allows the model to focus on the frames which can provide meaningful representations . The scoring model used in this work is necessarily a speech recognition model trained on small amount of data and provides frame-level confidence for each input . • The ATM technique is further extended to exploit the confidence values provided by the scorer by directly using them to re-weight the MSM loss . We denote this approach as ATM with loss scaling ( ATM+S ) . It allows the model training to focus on certain utterances by down scaling the utterances with low-confidences . Similar to our work based on masking with external guidance , there is work in NLP that also benefit by incorporating masking with knowledge . In Sun et al . ( 2019 ) , masking is done at phrase-level segments in BERT and has shown to learn semantic dependencies . In Wang et al . ( 2019 ) , phonetic knowledge is injected to mask over phonetic segments to perform spectral augmentation . Our ATM approach is primarily motivated based on the recent work by Veselý et al . ( 2017 ) on semi-supervised learning of conventional ASR systems which shows that performing data selection at frame-level or token-level on unsupervised data provides better performance . The importance of pruning out the input samples at frame-level has been studied in Ferreira et al . ( 2021 ) to improve both classification and regression tasks . Few works on unsupervised learning also highlight the importance of weighting the data based on its confidence ( Wessel et al. , 2001 ; Ren et al. , 2020 ; Coleman et al. , 2019 ) . We hypothesize that ATM can leverage the effect of data selection within a particular training corpus to further enhance the recognition performance of MSM techniques . To summarize , our contributions are listed as follows : • Novelty : To the extent of our knowledge , ATM is the first approach to incorporate a withincorpus data selection strategy in MSM . We also show that data selection can be simply performed inside MSM by guided selection of frames to be masked using a scorer model . • Technical contributions : We provide two simple strategies to incorporate data selection into MSM pretraining by applying the confidence of the scorer : 1 ) choosing the data at framelevel by applying guided masking 2 ) soft weighting the data at utterance level by scaling the MSM loss of each utterance with its corresponding confidence score . ATM is designed to be compatible to all MSM based pre-training techniques . • Empirical study : Analysis is done to find an optimal masking percentage for ATM and we highlight the effectiveness of ATM across varying masking percentages . The importance of masking frames with high confidence is substantiated by empirically comparing it with masking low confident frames and random frames respectively . Experiments are performed on AMI data which is from a distinct condition compared to Libri-light corpus used for MSM based pretraining . The results confirm the importance of ATM by improving the recognition performance on evaluation sets of AMI by a significant margin . 2 PRELIMINARIES ON MASKED SPEECH MODELING ( MSM ) . In this section , we formally define the masked speech modeling ( MSM ) technique and brief primary instantiations including wav2vec2 and w2v-BERT . The technique can be formulated by defining input speech sequence X = [ x1 , x2 , ... , xT ′ ] , where xt is the log Mel-filterbank feature vector at time t. X is sent to the feature encoder Φ to obtain the encoded representations E = Φ ( X ) . The feature encoder contains convolutional layers performing subsampling at a factor of 4 and reducing the total number of frames of an utterance from T ′ to T to get E = [ e1 , e2 , ... , eT ] . E is then sent to two parallel modules : 1 ) masking component , and 2 ) quantizer . 2.1 MASKING . The idea behind masking input samples and predicting them was initially proposed in BERT ( Devlin et al. , 2018 ) and later adopted to speech ( Baevski et al. , 2020 ) with modifications to suit the characteristics of speech input . The masking is done over sets of frames or blocks b1 , b2 , ... , bK and accommodates overlap between blocks . Here K is the number of masked blocks in a randomly masked encoded sequence Ẽ . The importance of block masking is motivated by the improvements observed in Span-BERT by Joshi et al . ( 2020 ) and ERNIE ( Sun et al. , 2019 ) . The block bk = [ ik , c ] , where ik is the starting index of the masked block and c is the corresponding right context size denoting the number of consecutive speech frames . Here ik are randomly sampled from a uniform distribution . It has been empirically observed by Baevski et al . ( 2020 ) that 49 % of the frames are masked and c = 10 is chosen as the golden ratio to attain best representation during pre-training . 2.2 QUANTIZER . Gumbel-softmax quantizer component Ψ is used to get quantized representations which act as targets for wav2vec2 and w2v-BERT models . These quantized representations align to phonetic units as described in Baevski et al . ( 2020 ) . Each quantized vector is of L dimensions which denote the number of targets or codes used in a codebook . Each incoming input E is projected to L dimensions within the quantizer before applying the Gumbel-softmax . 2.3 CONTEXT NETWORK AND MSM LOSS . Wav2vec2-conformer : In this model type , the unmasked sequence E is sent to Ψ to get Q = Ψ ( E ) , where Q = [ q1 , q2 , .. , qT ] as described in Baevski et al . ( 2020 ) . The masked sequence Ẽ is fed to the context network Ω which contains conformer blocks to learn contextual representations from the input . C = Ω ( E ) denotes the output of the context network . The contrastive loss Lctr ( cj , qj ) objective is computed between the quantized representation qj and context network output cj ∈ C for all masked time instances j ∈ J . Diversity loss Ldiv is computed as an auxiliary objective in wav2vec2 to force the model to choose diverse codes in the quantization codebook . Detailed description of Ldiv is in Baevski et al . ( 2020 ) . The final training objective is denoted as : Lwv = Lctr + 0.1 · Ldiv , ( 1 ) where Lctr = ∑J j=1 Lctr ( cj , qj ) . HuBERT-conformer : This is another variant of wav2vec2-conformer model with two major differences : 1 ) Targets are k-means cluster ids which are computed over a small portion of input 2 ) Cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction of the context network ŷj and the k-means cluster id target yj . W2V-BERT : This model marries the concept of wav2vec2 and BERT model by including an additional context network Λ containing conformer blocks in addition to Ω as in wav2vec2 . The Λ receives the output of the Ω and strives to further learn refined contextual information to get H = Λ ( C ) . The targets of w2v-BERT yj is computed by taking an argmax over the codebook dimensions L of quantized representations qj , l as : yj = arg max l qj , l , l ∈ L ( 2 ) Finally , the cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction ŷj = softmax ( hj ) and the target yj over the masked time instances J . The final training objective Lwb = Lce + Lwv is a combination of cross-entropy loss and wav2vec2 loss . A block diagrammatic overview of the above MSM architectures are available in appendix A.7 . 3 ASK2MASK ( ATM ) . The primary reason to employ pre-training models is to exploit the abundantly available unsupervised data for improving ASR under limited availability of supervised data . While the MSM models such as wav2vec2 and w2v-BERT described in Section 2 exploit the unsupervised data , they treat each data with equal weight for computing the final objective.Instead , we generate a score st for each encoded frame et . This is used to select relevant data in a fine-grained manner during masking for computing the loss objective . 3.1 METHODOLOGY . For each encoded feature frame et ∈ E , the scorer emits probabilities p ( vt = l |E ) ; l ∈ L of the frame belonging to a particular label . The scorer model is a CTC based frame-synchronous ASR model separately trained with a limited amount of data . Our initial intuition was to chose the scorer ’ s training data to match the target data condition , however our empirical analysis in ( cf . Section 5.3 ) shows that the performance is agnostic to the scorer model ’ s training data . Finally , the confidence score st of the frame is defined as the maximum probability across all labels : st = max l p ( vt = l |E ) ( 3 ) We sample K masking start indices { i1 , .. , ik } with probabilities : p ( ik = t ) = st∑ sv v/∈ { i1 , .. , ik−1 } · δt/∈ { i1. , ,ik−1 } , ( 4 ) That is , we sample beginning frames with probability proportional to the scores of each frame . The indicator function δt/∈ { i1. , ,ik−1 } ensures that we sample without replacement . This is the key difference between ATM and the random masking in prior works as described in Section 2.1 . Prior works uniformly sample the start indices of each masking block b1 : K , while the ATM uses the probability distribution induced by the scorer . K is determined by the percentage of frames to be masked . We hypothesize that frames with maximum confidence from an external scoring model will be 1 ) easiest to learn using an MSM training criteria and 2 ) most informative in for pretraining to facilitate fine-tuning . Conversely , the lowest confidence frames , those more confusable to an external scoring model , will be the least reliably learned by MSM and least informative for pretraining . The resulting frames are sent as input to the MSM architecture and the final loss objective L is determined by either of the MSM objectives Lwv or Lwb described in Sections 2.3 . This modified training objective allows the model to focus on learning from gradients calculated from the frames with high confidences . | Many self-supervised speech representation learning methods use masked prediction at their core. This paper proposes Ask2Mask (ATM) approach for informed masking during learning through a supervised teacher model that provides frame-level posteriors probabilities of linguistic output units. The frame-posterior probabilities extracted from the supervised teacher model are also used as utterance weights to favor ones with high confidence. | SP:8ce1eb305ad9b55f8e09159d9c26b51779977b6e |
Ask2Mask: Guided Data Selection for Masked Speech Modeling | 1 INTRODUCTION . Self-training and self-supervised training techniques rely on huge amounts of unlabeled speech or text data for better generalization . The self-training techniques such as pseudo-labeling ( Scudder , 1965 ; Kahn et al. , 2020 ) and student-teacher training ( Park et al. , 2020 ) have shown promising improvements by incorporating the data selection process . This data selection step removes pseudolabels with less confidence as denoted by the teacher model before feeding the input to a student model . Xu et al . ( 2021 ) shows that self-training and self-supervised training are complementary to each other and also show that self-supervised models act as good initialization for self-training techniques . Self-supervised training ( Hinton & Zemel , 1994 ) is a representation learning approach which implicitly learns patterns in the data without relying on explicit labels . Masked speech modeling ( MSM ) is the recent and successful self-supervised learning technique , thanks to the advent of BERT ( Devlin et al. , 2018 ) in NLP which inspired learning speech representations from masked inputs . MSM techniques such as wav2vec2 ( Baevski et al. , 2020 ) , HuBERT ( Hsu et al. , 2021b ) and w2v-BERT ( Chung et al. , 2021 ) have shown considerable gains across various down-stream speech tasks and have become the go-to models for ASR . Unfortunately , MSM does not have a data selection scheme to discard the irrelevant input samples and instead imposes burden on the training criterion to learn the relevance of the input samples in learning meaningful representations . Hsu et al . ( 2021a ) noticed the impact of not selecting relevant data from the huge amounts of unsupervised data during pre-training by showing degradation in ASR performance when fine-tuned to a target dataset with limited data . To mitigate this constraint , Chan et al . ( 2021 ) introduced substantially more fine-tuning data related to the target dataset but did not achieve satisfactory results . Hsu et al . ( 2021a ) attempted to solve this issue by heuristically selecting the data from a closed set of unsupervised speech databases or by pooling in data relevant to target dataset along with the existing pre-training dataset . However , this data selection approach is not done within the existing pre-training dataset and it is not completely empirically motivated . In this study , in order to break the above limitation of the MSM techniques , we propose a simple strategy named ask2mask ( ATM ) to incorporate data selection within a chosen pretraining dataset . • In ATM , the masking is done over the input samples or speech frames with higher confidence as determined by the scorer . This is contrary to the random selection of frames to be masked in conventional MSM models . We hypothesize that this guided selection of frames to be masked allows the model to focus on the frames which can provide meaningful representations . The scoring model used in this work is necessarily a speech recognition model trained on small amount of data and provides frame-level confidence for each input . • The ATM technique is further extended to exploit the confidence values provided by the scorer by directly using them to re-weight the MSM loss . We denote this approach as ATM with loss scaling ( ATM+S ) . It allows the model training to focus on certain utterances by down scaling the utterances with low-confidences . Similar to our work based on masking with external guidance , there is work in NLP that also benefit by incorporating masking with knowledge . In Sun et al . ( 2019 ) , masking is done at phrase-level segments in BERT and has shown to learn semantic dependencies . In Wang et al . ( 2019 ) , phonetic knowledge is injected to mask over phonetic segments to perform spectral augmentation . Our ATM approach is primarily motivated based on the recent work by Veselý et al . ( 2017 ) on semi-supervised learning of conventional ASR systems which shows that performing data selection at frame-level or token-level on unsupervised data provides better performance . The importance of pruning out the input samples at frame-level has been studied in Ferreira et al . ( 2021 ) to improve both classification and regression tasks . Few works on unsupervised learning also highlight the importance of weighting the data based on its confidence ( Wessel et al. , 2001 ; Ren et al. , 2020 ; Coleman et al. , 2019 ) . We hypothesize that ATM can leverage the effect of data selection within a particular training corpus to further enhance the recognition performance of MSM techniques . To summarize , our contributions are listed as follows : • Novelty : To the extent of our knowledge , ATM is the first approach to incorporate a withincorpus data selection strategy in MSM . We also show that data selection can be simply performed inside MSM by guided selection of frames to be masked using a scorer model . • Technical contributions : We provide two simple strategies to incorporate data selection into MSM pretraining by applying the confidence of the scorer : 1 ) choosing the data at framelevel by applying guided masking 2 ) soft weighting the data at utterance level by scaling the MSM loss of each utterance with its corresponding confidence score . ATM is designed to be compatible to all MSM based pre-training techniques . • Empirical study : Analysis is done to find an optimal masking percentage for ATM and we highlight the effectiveness of ATM across varying masking percentages . The importance of masking frames with high confidence is substantiated by empirically comparing it with masking low confident frames and random frames respectively . Experiments are performed on AMI data which is from a distinct condition compared to Libri-light corpus used for MSM based pretraining . The results confirm the importance of ATM by improving the recognition performance on evaluation sets of AMI by a significant margin . 2 PRELIMINARIES ON MASKED SPEECH MODELING ( MSM ) . In this section , we formally define the masked speech modeling ( MSM ) technique and brief primary instantiations including wav2vec2 and w2v-BERT . The technique can be formulated by defining input speech sequence X = [ x1 , x2 , ... , xT ′ ] , where xt is the log Mel-filterbank feature vector at time t. X is sent to the feature encoder Φ to obtain the encoded representations E = Φ ( X ) . The feature encoder contains convolutional layers performing subsampling at a factor of 4 and reducing the total number of frames of an utterance from T ′ to T to get E = [ e1 , e2 , ... , eT ] . E is then sent to two parallel modules : 1 ) masking component , and 2 ) quantizer . 2.1 MASKING . The idea behind masking input samples and predicting them was initially proposed in BERT ( Devlin et al. , 2018 ) and later adopted to speech ( Baevski et al. , 2020 ) with modifications to suit the characteristics of speech input . The masking is done over sets of frames or blocks b1 , b2 , ... , bK and accommodates overlap between blocks . Here K is the number of masked blocks in a randomly masked encoded sequence Ẽ . The importance of block masking is motivated by the improvements observed in Span-BERT by Joshi et al . ( 2020 ) and ERNIE ( Sun et al. , 2019 ) . The block bk = [ ik , c ] , where ik is the starting index of the masked block and c is the corresponding right context size denoting the number of consecutive speech frames . Here ik are randomly sampled from a uniform distribution . It has been empirically observed by Baevski et al . ( 2020 ) that 49 % of the frames are masked and c = 10 is chosen as the golden ratio to attain best representation during pre-training . 2.2 QUANTIZER . Gumbel-softmax quantizer component Ψ is used to get quantized representations which act as targets for wav2vec2 and w2v-BERT models . These quantized representations align to phonetic units as described in Baevski et al . ( 2020 ) . Each quantized vector is of L dimensions which denote the number of targets or codes used in a codebook . Each incoming input E is projected to L dimensions within the quantizer before applying the Gumbel-softmax . 2.3 CONTEXT NETWORK AND MSM LOSS . Wav2vec2-conformer : In this model type , the unmasked sequence E is sent to Ψ to get Q = Ψ ( E ) , where Q = [ q1 , q2 , .. , qT ] as described in Baevski et al . ( 2020 ) . The masked sequence Ẽ is fed to the context network Ω which contains conformer blocks to learn contextual representations from the input . C = Ω ( E ) denotes the output of the context network . The contrastive loss Lctr ( cj , qj ) objective is computed between the quantized representation qj and context network output cj ∈ C for all masked time instances j ∈ J . Diversity loss Ldiv is computed as an auxiliary objective in wav2vec2 to force the model to choose diverse codes in the quantization codebook . Detailed description of Ldiv is in Baevski et al . ( 2020 ) . The final training objective is denoted as : Lwv = Lctr + 0.1 · Ldiv , ( 1 ) where Lctr = ∑J j=1 Lctr ( cj , qj ) . HuBERT-conformer : This is another variant of wav2vec2-conformer model with two major differences : 1 ) Targets are k-means cluster ids which are computed over a small portion of input 2 ) Cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction of the context network ŷj and the k-means cluster id target yj . W2V-BERT : This model marries the concept of wav2vec2 and BERT model by including an additional context network Λ containing conformer blocks in addition to Ω as in wav2vec2 . The Λ receives the output of the Ω and strives to further learn refined contextual information to get H = Λ ( C ) . The targets of w2v-BERT yj is computed by taking an argmax over the codebook dimensions L of quantized representations qj , l as : yj = arg max l qj , l , l ∈ L ( 2 ) Finally , the cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction ŷj = softmax ( hj ) and the target yj over the masked time instances J . The final training objective Lwb = Lce + Lwv is a combination of cross-entropy loss and wav2vec2 loss . A block diagrammatic overview of the above MSM architectures are available in appendix A.7 . 3 ASK2MASK ( ATM ) . The primary reason to employ pre-training models is to exploit the abundantly available unsupervised data for improving ASR under limited availability of supervised data . While the MSM models such as wav2vec2 and w2v-BERT described in Section 2 exploit the unsupervised data , they treat each data with equal weight for computing the final objective.Instead , we generate a score st for each encoded frame et . This is used to select relevant data in a fine-grained manner during masking for computing the loss objective . 3.1 METHODOLOGY . For each encoded feature frame et ∈ E , the scorer emits probabilities p ( vt = l |E ) ; l ∈ L of the frame belonging to a particular label . The scorer model is a CTC based frame-synchronous ASR model separately trained with a limited amount of data . Our initial intuition was to chose the scorer ’ s training data to match the target data condition , however our empirical analysis in ( cf . Section 5.3 ) shows that the performance is agnostic to the scorer model ’ s training data . Finally , the confidence score st of the frame is defined as the maximum probability across all labels : st = max l p ( vt = l |E ) ( 3 ) We sample K masking start indices { i1 , .. , ik } with probabilities : p ( ik = t ) = st∑ sv v/∈ { i1 , .. , ik−1 } · δt/∈ { i1. , ,ik−1 } , ( 4 ) That is , we sample beginning frames with probability proportional to the scores of each frame . The indicator function δt/∈ { i1. , ,ik−1 } ensures that we sample without replacement . This is the key difference between ATM and the random masking in prior works as described in Section 2.1 . Prior works uniformly sample the start indices of each masking block b1 : K , while the ATM uses the probability distribution induced by the scorer . K is determined by the percentage of frames to be masked . We hypothesize that frames with maximum confidence from an external scoring model will be 1 ) easiest to learn using an MSM training criteria and 2 ) most informative in for pretraining to facilitate fine-tuning . Conversely , the lowest confidence frames , those more confusable to an external scoring model , will be the least reliably learned by MSM and least informative for pretraining . The resulting frames are sent as input to the MSM architecture and the final loss objective L is determined by either of the MSM objectives Lwv or Lwb described in Sections 2.3 . This modified training objective allows the model to focus on learning from gradients calculated from the frames with high confidences . | This study investigates the use of an external frame-synchronous CTC-based ASR system to get confidence scores for frames in masked speech modeling which is called AskToMask (ATM). These confidence scores are used in two ways: 1) as a distribution to determine the segment to mask (higher confidence means higher probability), 2) the utterance level average of the per-frame confidence scores is used as a scaling factor of the per-utterance loss. The experiments perform unsupervised pre-training using these two proposed methods and then performs supervised fine-tuning for the final ASR task. Experiments on Librispeech and AMI show that confidence score-based selection of masking improves the final WER as compared to using uniform distribution in the mask selection (the first approach versus baseline). The second approach provides marginal gains on top of the first approach. | SP:8ce1eb305ad9b55f8e09159d9c26b51779977b6e |
Ask2Mask: Guided Data Selection for Masked Speech Modeling | 1 INTRODUCTION . Self-training and self-supervised training techniques rely on huge amounts of unlabeled speech or text data for better generalization . The self-training techniques such as pseudo-labeling ( Scudder , 1965 ; Kahn et al. , 2020 ) and student-teacher training ( Park et al. , 2020 ) have shown promising improvements by incorporating the data selection process . This data selection step removes pseudolabels with less confidence as denoted by the teacher model before feeding the input to a student model . Xu et al . ( 2021 ) shows that self-training and self-supervised training are complementary to each other and also show that self-supervised models act as good initialization for self-training techniques . Self-supervised training ( Hinton & Zemel , 1994 ) is a representation learning approach which implicitly learns patterns in the data without relying on explicit labels . Masked speech modeling ( MSM ) is the recent and successful self-supervised learning technique , thanks to the advent of BERT ( Devlin et al. , 2018 ) in NLP which inspired learning speech representations from masked inputs . MSM techniques such as wav2vec2 ( Baevski et al. , 2020 ) , HuBERT ( Hsu et al. , 2021b ) and w2v-BERT ( Chung et al. , 2021 ) have shown considerable gains across various down-stream speech tasks and have become the go-to models for ASR . Unfortunately , MSM does not have a data selection scheme to discard the irrelevant input samples and instead imposes burden on the training criterion to learn the relevance of the input samples in learning meaningful representations . Hsu et al . ( 2021a ) noticed the impact of not selecting relevant data from the huge amounts of unsupervised data during pre-training by showing degradation in ASR performance when fine-tuned to a target dataset with limited data . To mitigate this constraint , Chan et al . ( 2021 ) introduced substantially more fine-tuning data related to the target dataset but did not achieve satisfactory results . Hsu et al . ( 2021a ) attempted to solve this issue by heuristically selecting the data from a closed set of unsupervised speech databases or by pooling in data relevant to target dataset along with the existing pre-training dataset . However , this data selection approach is not done within the existing pre-training dataset and it is not completely empirically motivated . In this study , in order to break the above limitation of the MSM techniques , we propose a simple strategy named ask2mask ( ATM ) to incorporate data selection within a chosen pretraining dataset . • In ATM , the masking is done over the input samples or speech frames with higher confidence as determined by the scorer . This is contrary to the random selection of frames to be masked in conventional MSM models . We hypothesize that this guided selection of frames to be masked allows the model to focus on the frames which can provide meaningful representations . The scoring model used in this work is necessarily a speech recognition model trained on small amount of data and provides frame-level confidence for each input . • The ATM technique is further extended to exploit the confidence values provided by the scorer by directly using them to re-weight the MSM loss . We denote this approach as ATM with loss scaling ( ATM+S ) . It allows the model training to focus on certain utterances by down scaling the utterances with low-confidences . Similar to our work based on masking with external guidance , there is work in NLP that also benefit by incorporating masking with knowledge . In Sun et al . ( 2019 ) , masking is done at phrase-level segments in BERT and has shown to learn semantic dependencies . In Wang et al . ( 2019 ) , phonetic knowledge is injected to mask over phonetic segments to perform spectral augmentation . Our ATM approach is primarily motivated based on the recent work by Veselý et al . ( 2017 ) on semi-supervised learning of conventional ASR systems which shows that performing data selection at frame-level or token-level on unsupervised data provides better performance . The importance of pruning out the input samples at frame-level has been studied in Ferreira et al . ( 2021 ) to improve both classification and regression tasks . Few works on unsupervised learning also highlight the importance of weighting the data based on its confidence ( Wessel et al. , 2001 ; Ren et al. , 2020 ; Coleman et al. , 2019 ) . We hypothesize that ATM can leverage the effect of data selection within a particular training corpus to further enhance the recognition performance of MSM techniques . To summarize , our contributions are listed as follows : • Novelty : To the extent of our knowledge , ATM is the first approach to incorporate a withincorpus data selection strategy in MSM . We also show that data selection can be simply performed inside MSM by guided selection of frames to be masked using a scorer model . • Technical contributions : We provide two simple strategies to incorporate data selection into MSM pretraining by applying the confidence of the scorer : 1 ) choosing the data at framelevel by applying guided masking 2 ) soft weighting the data at utterance level by scaling the MSM loss of each utterance with its corresponding confidence score . ATM is designed to be compatible to all MSM based pre-training techniques . • Empirical study : Analysis is done to find an optimal masking percentage for ATM and we highlight the effectiveness of ATM across varying masking percentages . The importance of masking frames with high confidence is substantiated by empirically comparing it with masking low confident frames and random frames respectively . Experiments are performed on AMI data which is from a distinct condition compared to Libri-light corpus used for MSM based pretraining . The results confirm the importance of ATM by improving the recognition performance on evaluation sets of AMI by a significant margin . 2 PRELIMINARIES ON MASKED SPEECH MODELING ( MSM ) . In this section , we formally define the masked speech modeling ( MSM ) technique and brief primary instantiations including wav2vec2 and w2v-BERT . The technique can be formulated by defining input speech sequence X = [ x1 , x2 , ... , xT ′ ] , where xt is the log Mel-filterbank feature vector at time t. X is sent to the feature encoder Φ to obtain the encoded representations E = Φ ( X ) . The feature encoder contains convolutional layers performing subsampling at a factor of 4 and reducing the total number of frames of an utterance from T ′ to T to get E = [ e1 , e2 , ... , eT ] . E is then sent to two parallel modules : 1 ) masking component , and 2 ) quantizer . 2.1 MASKING . The idea behind masking input samples and predicting them was initially proposed in BERT ( Devlin et al. , 2018 ) and later adopted to speech ( Baevski et al. , 2020 ) with modifications to suit the characteristics of speech input . The masking is done over sets of frames or blocks b1 , b2 , ... , bK and accommodates overlap between blocks . Here K is the number of masked blocks in a randomly masked encoded sequence Ẽ . The importance of block masking is motivated by the improvements observed in Span-BERT by Joshi et al . ( 2020 ) and ERNIE ( Sun et al. , 2019 ) . The block bk = [ ik , c ] , where ik is the starting index of the masked block and c is the corresponding right context size denoting the number of consecutive speech frames . Here ik are randomly sampled from a uniform distribution . It has been empirically observed by Baevski et al . ( 2020 ) that 49 % of the frames are masked and c = 10 is chosen as the golden ratio to attain best representation during pre-training . 2.2 QUANTIZER . Gumbel-softmax quantizer component Ψ is used to get quantized representations which act as targets for wav2vec2 and w2v-BERT models . These quantized representations align to phonetic units as described in Baevski et al . ( 2020 ) . Each quantized vector is of L dimensions which denote the number of targets or codes used in a codebook . Each incoming input E is projected to L dimensions within the quantizer before applying the Gumbel-softmax . 2.3 CONTEXT NETWORK AND MSM LOSS . Wav2vec2-conformer : In this model type , the unmasked sequence E is sent to Ψ to get Q = Ψ ( E ) , where Q = [ q1 , q2 , .. , qT ] as described in Baevski et al . ( 2020 ) . The masked sequence Ẽ is fed to the context network Ω which contains conformer blocks to learn contextual representations from the input . C = Ω ( E ) denotes the output of the context network . The contrastive loss Lctr ( cj , qj ) objective is computed between the quantized representation qj and context network output cj ∈ C for all masked time instances j ∈ J . Diversity loss Ldiv is computed as an auxiliary objective in wav2vec2 to force the model to choose diverse codes in the quantization codebook . Detailed description of Ldiv is in Baevski et al . ( 2020 ) . The final training objective is denoted as : Lwv = Lctr + 0.1 · Ldiv , ( 1 ) where Lctr = ∑J j=1 Lctr ( cj , qj ) . HuBERT-conformer : This is another variant of wav2vec2-conformer model with two major differences : 1 ) Targets are k-means cluster ids which are computed over a small portion of input 2 ) Cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction of the context network ŷj and the k-means cluster id target yj . W2V-BERT : This model marries the concept of wav2vec2 and BERT model by including an additional context network Λ containing conformer blocks in addition to Ω as in wav2vec2 . The Λ receives the output of the Ω and strives to further learn refined contextual information to get H = Λ ( C ) . The targets of w2v-BERT yj is computed by taking an argmax over the codebook dimensions L of quantized representations qj , l as : yj = arg max l qj , l , l ∈ L ( 2 ) Finally , the cross-entropy loss Lce ( ŷj , yj ) is computed between the prediction ŷj = softmax ( hj ) and the target yj over the masked time instances J . The final training objective Lwb = Lce + Lwv is a combination of cross-entropy loss and wav2vec2 loss . A block diagrammatic overview of the above MSM architectures are available in appendix A.7 . 3 ASK2MASK ( ATM ) . The primary reason to employ pre-training models is to exploit the abundantly available unsupervised data for improving ASR under limited availability of supervised data . While the MSM models such as wav2vec2 and w2v-BERT described in Section 2 exploit the unsupervised data , they treat each data with equal weight for computing the final objective.Instead , we generate a score st for each encoded frame et . This is used to select relevant data in a fine-grained manner during masking for computing the loss objective . 3.1 METHODOLOGY . For each encoded feature frame et ∈ E , the scorer emits probabilities p ( vt = l |E ) ; l ∈ L of the frame belonging to a particular label . The scorer model is a CTC based frame-synchronous ASR model separately trained with a limited amount of data . Our initial intuition was to chose the scorer ’ s training data to match the target data condition , however our empirical analysis in ( cf . Section 5.3 ) shows that the performance is agnostic to the scorer model ’ s training data . Finally , the confidence score st of the frame is defined as the maximum probability across all labels : st = max l p ( vt = l |E ) ( 3 ) We sample K masking start indices { i1 , .. , ik } with probabilities : p ( ik = t ) = st∑ sv v/∈ { i1 , .. , ik−1 } · δt/∈ { i1. , ,ik−1 } , ( 4 ) That is , we sample beginning frames with probability proportional to the scores of each frame . The indicator function δt/∈ { i1. , ,ik−1 } ensures that we sample without replacement . This is the key difference between ATM and the random masking in prior works as described in Section 2.1 . Prior works uniformly sample the start indices of each masking block b1 : K , while the ATM uses the probability distribution induced by the scorer . K is determined by the percentage of frames to be masked . We hypothesize that frames with maximum confidence from an external scoring model will be 1 ) easiest to learn using an MSM training criteria and 2 ) most informative in for pretraining to facilitate fine-tuning . Conversely , the lowest confidence frames , those more confusable to an external scoring model , will be the least reliably learned by MSM and least informative for pretraining . The resulting frames are sent as input to the MSM architecture and the final loss objective L is determined by either of the MSM objectives Lwv or Lwb described in Sections 2.3 . This modified training objective allows the model to focus on learning from gradients calculated from the frames with high confidences . | This paper describes a weighted masking scheme for learning speech representations. Weights in this scheme are surrogates of confidence scores obtained from an external ASR system. The paper also describes how utterance-level confidence scores can be incorporate to down-weight contribution from utterance that are likely to be problematic for an ASR system. The paper makes use of Librispeech dataset for learning representations and Librispeech and AMI datasets for training external ASR systems. The paper evaluates both schemes on Librispeech, AMI, and some other datasets. Experimental results show that the proposed schemes offer small-to-medium gains over the unweighted reference masking scheme. | SP:8ce1eb305ad9b55f8e09159d9c26b51779977b6e |
On the Learning of Quasimetrics | 1 INTRODUCTION . Learned symmetrical metrics have been proven useful for innumerable tasks including dimensionality reduction ( Tenenbaum et al. , 2000 ) , clustering ( Xing et al. , 2002 ) , classification ( Weinberger et al. , 2006 ; Hoffer & Ailon , 2015 ) , and information retrieval ( Wang et al. , 2014 ) . However , the real world is largely asymmetrical , and symmetrical metrics can only capture a small fraction of it . Generalizing metrics , quasimetrics ( Defn . 2.1 ) allow for asymmetrical distances and can be found in a wide range of domains ( see Fig . 1 ) . Ubiquitous physical forces , such as gravity and wind , as well as human-defined rules , such as one-way roads , make the traveling time between places a quasimetric . Furthermore , many of our social artifacts are directed graphs— genealogy charts , follow-relation on Twitter ( Leskovec & Krevl , 2014 ) , citation graphs ( Price , 2011 ) , hyperlinks over the Internet , etc . Shortest paths on these graphs naturally induce quasimetric spaces . In fact , we can generalize to Markov Decision Processes ( MDPs ) and observe that optimal goal-reaching plan costs ( i.e. , universal value/Q-functions ( Schaul et al. , 2015 ; Sutton et al. , 2011 ) ) always form a quasimetric ( Bertsekas & Tsitsiklis , 1991 ; Tian et al. , 2020 ) . Moving onto more abstract structures , quasimetrics can also be found as expected hitting times in Markov chains , and as conditional Shannon entropy H ( · | · ) in information theory . ( See the appendix for proofs and discussions of these quasimetrics . ) In this work , we study the task of quasimetric learning . Given a sampled training set of pairs and their quasimetric distances , we ask : how well can we learn a quasimetric that fits the training data ? We define quasimetric learning in analogy to metric learning : whereas metric learning is the problem of learning a metric function , quasimetric learning is the problem of learning a quasimetric function . This may involve searching over a hypothesis space constrained to only include quasimetric functions ( which is what our method does ) or it could involve searching for approximately quasimetric functions ( we compare to and analyze such approaches ) . Successful formulations have many potential applications , such as good structural priors in reinforcement learning ( Schaul et al. , 2015 ; Tian et al. , 2020 ) , graph learning ( Rizi et al. , 2018 ) and causal relation learning ( Balashankar & Subramanian , 2021 ) . Towards this goal , our contributions are • We study the quasimetric learning task with two goals : ( 1 ) fitting training data well and ( 2 ) respecting quasimetric constraints ( Sec . 3 ) ; • We prove that a large family of algorithms , including unconstrained networks trained in the Neural Tangent Kernel ( NTK ) regime ( Jacot et al. , 2018 ) , fail at this task , while a learned embedding into a latent quasimetric space can potentially succeed ( Sec . 4 ) ; • We propose Poisson Quasimetric Embeddings ( PQEs ) , the first quasimetric embedding formulation learnable with gradient-based optimization , with strong theoretical guarantees ( Sec . 5 ) ; • Our experiments complement the theory and demonstrate the benefits of PQEs on random graphs , social graphs and offline Q-learning ( Sec . 6 ) . 2 PRELIMINARIES ON QUASIMETRICS AND POISSON PROCESSES . Quasimetric space is a generalization of metric space where all requirements of metrics are satisfied , except that the distances can be asymmetrical . Definition 2.1 ( Quasimetric Space ) . A quasimetric space is a pair ( X , d ) , where X is a set of points and d : X × X → [ 0 , ∞ ] is the quasimetric , satisfying the following conditions : ∀x , y ∈ X , x = y ⇐⇒ d ( x , y ) = 0 , ( Identity of Indiscernibles ) ∀x , y , z ∈ X , d ( x , y ) + d ( y , z ) ≥ d ( x , z ) . ( Triangle Inequality ) Being asymmetric , quasimetrics are often thought of as ( shortest-path ) distances of some ( possibly infinite ) weighted directed graph . A natural way to quantify the complexity of a quasimetric is to consider that of its underlying graph . Quasimetric treewidth is an instantiation of this idea . Definition 2.2 ( Treewidth of Quasimetric Spaces ( Mémoli et al. , 2018 ) ) . Consider a quasimetric space M as shortest-path distances on a positively-weighted directed graph . Treewidth of M is the minimum over all such graphs ’ treewidths . Poisson processes are commonly used to model events ( or points ) randomly occurring across a set A ( Kingman , 2005 ) , e.g. , raindrops hitting a windshield , photons captured by a camera . The number of such events within a subset of A is modeled as Poisson distribution , whose mean is given by a measure µ of A that determines how “ frequently the events happen at each location ” . Definition 2.3 ( Poisson Process ) . For nonatomic measure µ on set A , a Poisson process on A with mean measure µ is a random countable subset P ⊂ A ( i.e. , the random events / points ) such that • for any disjoint measurable subsets A1 , . . . , An of A , the random variables N ( A1 ) , . . . , N ( An ) are independent , where N ( B ) , # { P ∩B } is the number of points of P in B , and • N ( B ) has the Poisson distribution with mean µ ( B ) , denoted as Pois ( µ ( B ) ) . Fact 2.4 ( Differentiability of P [ N ( A1 ) ≤ N ( A2 ) ] ) . For two measurable subsets A1 , A2 , P [ N ( A1 ) ≤ N ( A2 ) ] = P [ Pois ( µ ( A1 \A2 ) ) ≤ Pois ( µ ( A2 \A1 ) ) ︸ ︷︷ ︸ two independent Poissons ] . ( 1 ) Furthermore , for independent X ∼ Pois ( µ1 ) , Y ∼ Pois ( µ2 ) is differentiable w.r.t . µ1 and µ2 . In the special case where µ1 or µ2 is zero , we can simply compute P [ X ≤ Y ] = { P [ 0 ≤ Y ] = 1 if µ1 = 0 P [ X ≤ 0 ] = P [ X = 0 ] = e−µ1 if µ2 = 0 ( Pois ( 0 ) is always 0 ) = exp ( − ( µ1 − µ2 ) + ) , ( 2 ) where x+ , max ( 0 , x ) . In general , this probability and its gradients can be obtained via a connection to noncentral χ2 distribution ( Johnson , 1959 ) , which we overview and derive formulas in the appendix . Therefore , if A1 and A2 are parametrized by some θ such that µ ( A1 \ A2 ) and µ ( A2 \ A1 ) are differentiable w.r.t . θ , so is P [ N ( A1 ) ≤ N ( A2 ) ] . a b c : Train : Test Triangle inequality =⇒ ? ≤ d ( a , b ) + d ( b , c ) = 31 ? ≥ d ( a , b ) − d ( c , b ) = 28 0 0 029 2 1 11 ? 0 20 40 60 80 100 Count Unconstrained Network ( Training MSE = 0.02 ± 0.06 ) 0 10 20 30 Valid Range 0 20 40 60 80 100 Euclidean Space Embedding ( Training MSE = 58.83 ± 0.00 ) 0 10 20 30 0 20 40 60 80 100 Poisson Quasimetric Embedding ( Training MSE = 0.02 ± 0.07 ) 0 10 20 30 Figure 2 : Quasimetric learning on a 3-element space . Leftmost : Training set contains all pairs except for ( a , c ) . Arrow labels show quasimetric distances ( rather than edge weights ) . A quasimetric d̂ should predict d̂ ( a , c ) ∈ [ 28 , 30 ] . Right three : Different formulations are trained to fit training pairs distances , and then predict on the test pair . Plots show distribution of the prediction over 100 runs . 3 QUASIMETRIC LEARNING . Consider a quasimetric space ( X , d ) . The quasimetric learning task aims to infer a quasimetric from observing a training set { ( xi , yi , d ( xi , yi ) ) } i ⊂ X × X × [ 0 , ∞ ] . Naturally , our goals for a learned predictor d̂ : X × X → R are : respecting the quasimetric constraints and fitting training distances . Crucially , we are not simply aiming for the usual sense of generalization , i.e. , low population error . Knowing that true distances have a quasimetric structure , we can better evaluate predictors and desire ones that fit the training data and are ( approximately ) quasimetrics . These objectives also indirectly capture generalization because a predictor failing either requirement must have large error on some pairs , whose true distances follow quasimetric constraints . We formalize this relation in Thm . 4.6 . 3.1 LEARNING ALGORITHMS AND MODEL CLASSES . Ideally , the learning should scale well with data , potentially generalize to unseen samples , and support integration with other deep learning systems ( e.g. , via differentiation ) . One option is to simply learn a generic function approximator that takes in ( x , y ) ∈ X × X ( as a concatenated input ) and outputs a scalar as the prediction of the pair ’ s distance , or some transformed version of it ( e.g. , log distance ) . This approach has been adopted by the community in learning graph distances ( Rizi et al. , 2018 ) and plan costs in MDPs ( Tian et al. , 2020 ) . When the function approximator is a deep neural network , we refer to such formulations as unconstrained ( deep neural ) networks . While deep networks are known to fit training data well ( Jacot et al. , 2018 ) , in this paper we also investigate whether they learn to be ( approximately ) quasimetrics . Alternatively , we can encode each input to a latent space , where a bivariate function outputs the distance prediction . When the function is a latent metric , we obtain metric embeddings . Our proposed Poisson Quasimetric Embedding ( PQE ) ( specified in Sec . 5 ) is also of this kind , where the function is a differentiable latent quasimetric that can approximate arbitrary quasimetrics in data space . 3.2 A TOY EXAMPLE . To build up intuition on how various models perform according to our two goals , we consider a toy quasimetric space with only 3 elements in Fig . 2 . The space has a total of 9 pairs , from which we use 8 as the training set . Due to quasimetric requirements ( esp . triangle inequality ) , knowing distances of these 8 pairs restricts valid values for the heldout pair to a particular range ( which is [ 28 , 31 ] in this case ) . If a model approximates 8 training pairs well and respects quasimetric constraints well , its prediction on that heldout pair should fall into this range . We train three models w.r.t . mean squared error ( MSE ) over the training set using gradient descent : • Unconstrained deep network that predicts distance , • Metric embedding into a latent Euclidean space with a deep encoder , • Quasimetric embedding into a latent PQE space with a deep encoder ( our method ) . ( Details of Poisson Quasimetric Embedding ( PQE ) are explained later in Sec . 5 . ) The three approaches exhibit interesting qualitative differences . Euclidean embedding , unable to model asymmetries in training data , fails to attain a low training error . While both other methods approximate training distances well , unconstrained networks greatly violate quasimetric constraints ; only PQEs respect the constraints and consistently predicts within the valid range . Here , the structural prior of embedding into a quasimetric latent space appears important to successful learning . Without any such prior , unconstrained networks fail badly . In the next section , we present a rigorous theoretical study of the quasimetric learning task , which confirms this intuition . | This paper studies the problem of learning of quasimetrics. It first proves that an orthogonal equivariant model cannot learn quasimetrics reliably, and then proposes the Poisson Quasimetric Embedding model which is both universal and differentiable. To be more precise, the Poisson process (or just a soft modification of Order Embedding) is differentiable and can be used to approximate quasipartitions, and quasipartitions can be used to approximate arbitrary quasimetrics. The paper also conducts extensive experiments and indeed PQE has better performance for many tasks. | SP:c3e21fdf74b4b85cf5d89766f7afc4ad0a0d03db |
On the Learning of Quasimetrics | 1 INTRODUCTION . Learned symmetrical metrics have been proven useful for innumerable tasks including dimensionality reduction ( Tenenbaum et al. , 2000 ) , clustering ( Xing et al. , 2002 ) , classification ( Weinberger et al. , 2006 ; Hoffer & Ailon , 2015 ) , and information retrieval ( Wang et al. , 2014 ) . However , the real world is largely asymmetrical , and symmetrical metrics can only capture a small fraction of it . Generalizing metrics , quasimetrics ( Defn . 2.1 ) allow for asymmetrical distances and can be found in a wide range of domains ( see Fig . 1 ) . Ubiquitous physical forces , such as gravity and wind , as well as human-defined rules , such as one-way roads , make the traveling time between places a quasimetric . Furthermore , many of our social artifacts are directed graphs— genealogy charts , follow-relation on Twitter ( Leskovec & Krevl , 2014 ) , citation graphs ( Price , 2011 ) , hyperlinks over the Internet , etc . Shortest paths on these graphs naturally induce quasimetric spaces . In fact , we can generalize to Markov Decision Processes ( MDPs ) and observe that optimal goal-reaching plan costs ( i.e. , universal value/Q-functions ( Schaul et al. , 2015 ; Sutton et al. , 2011 ) ) always form a quasimetric ( Bertsekas & Tsitsiklis , 1991 ; Tian et al. , 2020 ) . Moving onto more abstract structures , quasimetrics can also be found as expected hitting times in Markov chains , and as conditional Shannon entropy H ( · | · ) in information theory . ( See the appendix for proofs and discussions of these quasimetrics . ) In this work , we study the task of quasimetric learning . Given a sampled training set of pairs and their quasimetric distances , we ask : how well can we learn a quasimetric that fits the training data ? We define quasimetric learning in analogy to metric learning : whereas metric learning is the problem of learning a metric function , quasimetric learning is the problem of learning a quasimetric function . This may involve searching over a hypothesis space constrained to only include quasimetric functions ( which is what our method does ) or it could involve searching for approximately quasimetric functions ( we compare to and analyze such approaches ) . Successful formulations have many potential applications , such as good structural priors in reinforcement learning ( Schaul et al. , 2015 ; Tian et al. , 2020 ) , graph learning ( Rizi et al. , 2018 ) and causal relation learning ( Balashankar & Subramanian , 2021 ) . Towards this goal , our contributions are • We study the quasimetric learning task with two goals : ( 1 ) fitting training data well and ( 2 ) respecting quasimetric constraints ( Sec . 3 ) ; • We prove that a large family of algorithms , including unconstrained networks trained in the Neural Tangent Kernel ( NTK ) regime ( Jacot et al. , 2018 ) , fail at this task , while a learned embedding into a latent quasimetric space can potentially succeed ( Sec . 4 ) ; • We propose Poisson Quasimetric Embeddings ( PQEs ) , the first quasimetric embedding formulation learnable with gradient-based optimization , with strong theoretical guarantees ( Sec . 5 ) ; • Our experiments complement the theory and demonstrate the benefits of PQEs on random graphs , social graphs and offline Q-learning ( Sec . 6 ) . 2 PRELIMINARIES ON QUASIMETRICS AND POISSON PROCESSES . Quasimetric space is a generalization of metric space where all requirements of metrics are satisfied , except that the distances can be asymmetrical . Definition 2.1 ( Quasimetric Space ) . A quasimetric space is a pair ( X , d ) , where X is a set of points and d : X × X → [ 0 , ∞ ] is the quasimetric , satisfying the following conditions : ∀x , y ∈ X , x = y ⇐⇒ d ( x , y ) = 0 , ( Identity of Indiscernibles ) ∀x , y , z ∈ X , d ( x , y ) + d ( y , z ) ≥ d ( x , z ) . ( Triangle Inequality ) Being asymmetric , quasimetrics are often thought of as ( shortest-path ) distances of some ( possibly infinite ) weighted directed graph . A natural way to quantify the complexity of a quasimetric is to consider that of its underlying graph . Quasimetric treewidth is an instantiation of this idea . Definition 2.2 ( Treewidth of Quasimetric Spaces ( Mémoli et al. , 2018 ) ) . Consider a quasimetric space M as shortest-path distances on a positively-weighted directed graph . Treewidth of M is the minimum over all such graphs ’ treewidths . Poisson processes are commonly used to model events ( or points ) randomly occurring across a set A ( Kingman , 2005 ) , e.g. , raindrops hitting a windshield , photons captured by a camera . The number of such events within a subset of A is modeled as Poisson distribution , whose mean is given by a measure µ of A that determines how “ frequently the events happen at each location ” . Definition 2.3 ( Poisson Process ) . For nonatomic measure µ on set A , a Poisson process on A with mean measure µ is a random countable subset P ⊂ A ( i.e. , the random events / points ) such that • for any disjoint measurable subsets A1 , . . . , An of A , the random variables N ( A1 ) , . . . , N ( An ) are independent , where N ( B ) , # { P ∩B } is the number of points of P in B , and • N ( B ) has the Poisson distribution with mean µ ( B ) , denoted as Pois ( µ ( B ) ) . Fact 2.4 ( Differentiability of P [ N ( A1 ) ≤ N ( A2 ) ] ) . For two measurable subsets A1 , A2 , P [ N ( A1 ) ≤ N ( A2 ) ] = P [ Pois ( µ ( A1 \A2 ) ) ≤ Pois ( µ ( A2 \A1 ) ) ︸ ︷︷ ︸ two independent Poissons ] . ( 1 ) Furthermore , for independent X ∼ Pois ( µ1 ) , Y ∼ Pois ( µ2 ) is differentiable w.r.t . µ1 and µ2 . In the special case where µ1 or µ2 is zero , we can simply compute P [ X ≤ Y ] = { P [ 0 ≤ Y ] = 1 if µ1 = 0 P [ X ≤ 0 ] = P [ X = 0 ] = e−µ1 if µ2 = 0 ( Pois ( 0 ) is always 0 ) = exp ( − ( µ1 − µ2 ) + ) , ( 2 ) where x+ , max ( 0 , x ) . In general , this probability and its gradients can be obtained via a connection to noncentral χ2 distribution ( Johnson , 1959 ) , which we overview and derive formulas in the appendix . Therefore , if A1 and A2 are parametrized by some θ such that µ ( A1 \ A2 ) and µ ( A2 \ A1 ) are differentiable w.r.t . θ , so is P [ N ( A1 ) ≤ N ( A2 ) ] . a b c : Train : Test Triangle inequality =⇒ ? ≤ d ( a , b ) + d ( b , c ) = 31 ? ≥ d ( a , b ) − d ( c , b ) = 28 0 0 029 2 1 11 ? 0 20 40 60 80 100 Count Unconstrained Network ( Training MSE = 0.02 ± 0.06 ) 0 10 20 30 Valid Range 0 20 40 60 80 100 Euclidean Space Embedding ( Training MSE = 58.83 ± 0.00 ) 0 10 20 30 0 20 40 60 80 100 Poisson Quasimetric Embedding ( Training MSE = 0.02 ± 0.07 ) 0 10 20 30 Figure 2 : Quasimetric learning on a 3-element space . Leftmost : Training set contains all pairs except for ( a , c ) . Arrow labels show quasimetric distances ( rather than edge weights ) . A quasimetric d̂ should predict d̂ ( a , c ) ∈ [ 28 , 30 ] . Right three : Different formulations are trained to fit training pairs distances , and then predict on the test pair . Plots show distribution of the prediction over 100 runs . 3 QUASIMETRIC LEARNING . Consider a quasimetric space ( X , d ) . The quasimetric learning task aims to infer a quasimetric from observing a training set { ( xi , yi , d ( xi , yi ) ) } i ⊂ X × X × [ 0 , ∞ ] . Naturally , our goals for a learned predictor d̂ : X × X → R are : respecting the quasimetric constraints and fitting training distances . Crucially , we are not simply aiming for the usual sense of generalization , i.e. , low population error . Knowing that true distances have a quasimetric structure , we can better evaluate predictors and desire ones that fit the training data and are ( approximately ) quasimetrics . These objectives also indirectly capture generalization because a predictor failing either requirement must have large error on some pairs , whose true distances follow quasimetric constraints . We formalize this relation in Thm . 4.6 . 3.1 LEARNING ALGORITHMS AND MODEL CLASSES . Ideally , the learning should scale well with data , potentially generalize to unseen samples , and support integration with other deep learning systems ( e.g. , via differentiation ) . One option is to simply learn a generic function approximator that takes in ( x , y ) ∈ X × X ( as a concatenated input ) and outputs a scalar as the prediction of the pair ’ s distance , or some transformed version of it ( e.g. , log distance ) . This approach has been adopted by the community in learning graph distances ( Rizi et al. , 2018 ) and plan costs in MDPs ( Tian et al. , 2020 ) . When the function approximator is a deep neural network , we refer to such formulations as unconstrained ( deep neural ) networks . While deep networks are known to fit training data well ( Jacot et al. , 2018 ) , in this paper we also investigate whether they learn to be ( approximately ) quasimetrics . Alternatively , we can encode each input to a latent space , where a bivariate function outputs the distance prediction . When the function is a latent metric , we obtain metric embeddings . Our proposed Poisson Quasimetric Embedding ( PQE ) ( specified in Sec . 5 ) is also of this kind , where the function is a differentiable latent quasimetric that can approximate arbitrary quasimetrics in data space . 3.2 A TOY EXAMPLE . To build up intuition on how various models perform according to our two goals , we consider a toy quasimetric space with only 3 elements in Fig . 2 . The space has a total of 9 pairs , from which we use 8 as the training set . Due to quasimetric requirements ( esp . triangle inequality ) , knowing distances of these 8 pairs restricts valid values for the heldout pair to a particular range ( which is [ 28 , 31 ] in this case ) . If a model approximates 8 training pairs well and respects quasimetric constraints well , its prediction on that heldout pair should fall into this range . We train three models w.r.t . mean squared error ( MSE ) over the training set using gradient descent : • Unconstrained deep network that predicts distance , • Metric embedding into a latent Euclidean space with a deep encoder , • Quasimetric embedding into a latent PQE space with a deep encoder ( our method ) . ( Details of Poisson Quasimetric Embedding ( PQE ) are explained later in Sec . 5 . ) The three approaches exhibit interesting qualitative differences . Euclidean embedding , unable to model asymmetries in training data , fails to attain a low training error . While both other methods approximate training distances well , unconstrained networks greatly violate quasimetric constraints ; only PQEs respect the constraints and consistently predicts within the valid range . Here , the structural prior of embedding into a quasimetric latent space appears important to successful learning . Without any such prior , unconstrained networks fail badly . In the next section , we present a rigorous theoretical study of the quasimetric learning task , which confirms this intuition . | This paper considers the problem of learning Quasi-metrics. A quasi-metric is a non-negative function of two variables that satisfies the triangle inequality and that d(x,y) = 0 <=> x=y. Unlike metrics it does not satisfy triangle inequality. In this paper, the authors define the quasi-metric learning problem. They then proceed to show that algorithms invariant to orthogonal transforms (in a sense they define - such that it includes unconstrained multi-layer perceptron) can not learn transforms satisfy the quasimetric constraints with probability at least 1/2 - o(1). They then define a program called Poisson Quasimetric Embeddings (PQEs) to learn quasimetrics - which come in two related flavours. They conclude with empirical evaluation of PQE and a variety of algorithms. | SP:c3e21fdf74b4b85cf5d89766f7afc4ad0a0d03db |
On the Learning of Quasimetrics | 1 INTRODUCTION . Learned symmetrical metrics have been proven useful for innumerable tasks including dimensionality reduction ( Tenenbaum et al. , 2000 ) , clustering ( Xing et al. , 2002 ) , classification ( Weinberger et al. , 2006 ; Hoffer & Ailon , 2015 ) , and information retrieval ( Wang et al. , 2014 ) . However , the real world is largely asymmetrical , and symmetrical metrics can only capture a small fraction of it . Generalizing metrics , quasimetrics ( Defn . 2.1 ) allow for asymmetrical distances and can be found in a wide range of domains ( see Fig . 1 ) . Ubiquitous physical forces , such as gravity and wind , as well as human-defined rules , such as one-way roads , make the traveling time between places a quasimetric . Furthermore , many of our social artifacts are directed graphs— genealogy charts , follow-relation on Twitter ( Leskovec & Krevl , 2014 ) , citation graphs ( Price , 2011 ) , hyperlinks over the Internet , etc . Shortest paths on these graphs naturally induce quasimetric spaces . In fact , we can generalize to Markov Decision Processes ( MDPs ) and observe that optimal goal-reaching plan costs ( i.e. , universal value/Q-functions ( Schaul et al. , 2015 ; Sutton et al. , 2011 ) ) always form a quasimetric ( Bertsekas & Tsitsiklis , 1991 ; Tian et al. , 2020 ) . Moving onto more abstract structures , quasimetrics can also be found as expected hitting times in Markov chains , and as conditional Shannon entropy H ( · | · ) in information theory . ( See the appendix for proofs and discussions of these quasimetrics . ) In this work , we study the task of quasimetric learning . Given a sampled training set of pairs and their quasimetric distances , we ask : how well can we learn a quasimetric that fits the training data ? We define quasimetric learning in analogy to metric learning : whereas metric learning is the problem of learning a metric function , quasimetric learning is the problem of learning a quasimetric function . This may involve searching over a hypothesis space constrained to only include quasimetric functions ( which is what our method does ) or it could involve searching for approximately quasimetric functions ( we compare to and analyze such approaches ) . Successful formulations have many potential applications , such as good structural priors in reinforcement learning ( Schaul et al. , 2015 ; Tian et al. , 2020 ) , graph learning ( Rizi et al. , 2018 ) and causal relation learning ( Balashankar & Subramanian , 2021 ) . Towards this goal , our contributions are • We study the quasimetric learning task with two goals : ( 1 ) fitting training data well and ( 2 ) respecting quasimetric constraints ( Sec . 3 ) ; • We prove that a large family of algorithms , including unconstrained networks trained in the Neural Tangent Kernel ( NTK ) regime ( Jacot et al. , 2018 ) , fail at this task , while a learned embedding into a latent quasimetric space can potentially succeed ( Sec . 4 ) ; • We propose Poisson Quasimetric Embeddings ( PQEs ) , the first quasimetric embedding formulation learnable with gradient-based optimization , with strong theoretical guarantees ( Sec . 5 ) ; • Our experiments complement the theory and demonstrate the benefits of PQEs on random graphs , social graphs and offline Q-learning ( Sec . 6 ) . 2 PRELIMINARIES ON QUASIMETRICS AND POISSON PROCESSES . Quasimetric space is a generalization of metric space where all requirements of metrics are satisfied , except that the distances can be asymmetrical . Definition 2.1 ( Quasimetric Space ) . A quasimetric space is a pair ( X , d ) , where X is a set of points and d : X × X → [ 0 , ∞ ] is the quasimetric , satisfying the following conditions : ∀x , y ∈ X , x = y ⇐⇒ d ( x , y ) = 0 , ( Identity of Indiscernibles ) ∀x , y , z ∈ X , d ( x , y ) + d ( y , z ) ≥ d ( x , z ) . ( Triangle Inequality ) Being asymmetric , quasimetrics are often thought of as ( shortest-path ) distances of some ( possibly infinite ) weighted directed graph . A natural way to quantify the complexity of a quasimetric is to consider that of its underlying graph . Quasimetric treewidth is an instantiation of this idea . Definition 2.2 ( Treewidth of Quasimetric Spaces ( Mémoli et al. , 2018 ) ) . Consider a quasimetric space M as shortest-path distances on a positively-weighted directed graph . Treewidth of M is the minimum over all such graphs ’ treewidths . Poisson processes are commonly used to model events ( or points ) randomly occurring across a set A ( Kingman , 2005 ) , e.g. , raindrops hitting a windshield , photons captured by a camera . The number of such events within a subset of A is modeled as Poisson distribution , whose mean is given by a measure µ of A that determines how “ frequently the events happen at each location ” . Definition 2.3 ( Poisson Process ) . For nonatomic measure µ on set A , a Poisson process on A with mean measure µ is a random countable subset P ⊂ A ( i.e. , the random events / points ) such that • for any disjoint measurable subsets A1 , . . . , An of A , the random variables N ( A1 ) , . . . , N ( An ) are independent , where N ( B ) , # { P ∩B } is the number of points of P in B , and • N ( B ) has the Poisson distribution with mean µ ( B ) , denoted as Pois ( µ ( B ) ) . Fact 2.4 ( Differentiability of P [ N ( A1 ) ≤ N ( A2 ) ] ) . For two measurable subsets A1 , A2 , P [ N ( A1 ) ≤ N ( A2 ) ] = P [ Pois ( µ ( A1 \A2 ) ) ≤ Pois ( µ ( A2 \A1 ) ) ︸ ︷︷ ︸ two independent Poissons ] . ( 1 ) Furthermore , for independent X ∼ Pois ( µ1 ) , Y ∼ Pois ( µ2 ) is differentiable w.r.t . µ1 and µ2 . In the special case where µ1 or µ2 is zero , we can simply compute P [ X ≤ Y ] = { P [ 0 ≤ Y ] = 1 if µ1 = 0 P [ X ≤ 0 ] = P [ X = 0 ] = e−µ1 if µ2 = 0 ( Pois ( 0 ) is always 0 ) = exp ( − ( µ1 − µ2 ) + ) , ( 2 ) where x+ , max ( 0 , x ) . In general , this probability and its gradients can be obtained via a connection to noncentral χ2 distribution ( Johnson , 1959 ) , which we overview and derive formulas in the appendix . Therefore , if A1 and A2 are parametrized by some θ such that µ ( A1 \ A2 ) and µ ( A2 \ A1 ) are differentiable w.r.t . θ , so is P [ N ( A1 ) ≤ N ( A2 ) ] . a b c : Train : Test Triangle inequality =⇒ ? ≤ d ( a , b ) + d ( b , c ) = 31 ? ≥ d ( a , b ) − d ( c , b ) = 28 0 0 029 2 1 11 ? 0 20 40 60 80 100 Count Unconstrained Network ( Training MSE = 0.02 ± 0.06 ) 0 10 20 30 Valid Range 0 20 40 60 80 100 Euclidean Space Embedding ( Training MSE = 58.83 ± 0.00 ) 0 10 20 30 0 20 40 60 80 100 Poisson Quasimetric Embedding ( Training MSE = 0.02 ± 0.07 ) 0 10 20 30 Figure 2 : Quasimetric learning on a 3-element space . Leftmost : Training set contains all pairs except for ( a , c ) . Arrow labels show quasimetric distances ( rather than edge weights ) . A quasimetric d̂ should predict d̂ ( a , c ) ∈ [ 28 , 30 ] . Right three : Different formulations are trained to fit training pairs distances , and then predict on the test pair . Plots show distribution of the prediction over 100 runs . 3 QUASIMETRIC LEARNING . Consider a quasimetric space ( X , d ) . The quasimetric learning task aims to infer a quasimetric from observing a training set { ( xi , yi , d ( xi , yi ) ) } i ⊂ X × X × [ 0 , ∞ ] . Naturally , our goals for a learned predictor d̂ : X × X → R are : respecting the quasimetric constraints and fitting training distances . Crucially , we are not simply aiming for the usual sense of generalization , i.e. , low population error . Knowing that true distances have a quasimetric structure , we can better evaluate predictors and desire ones that fit the training data and are ( approximately ) quasimetrics . These objectives also indirectly capture generalization because a predictor failing either requirement must have large error on some pairs , whose true distances follow quasimetric constraints . We formalize this relation in Thm . 4.6 . 3.1 LEARNING ALGORITHMS AND MODEL CLASSES . Ideally , the learning should scale well with data , potentially generalize to unseen samples , and support integration with other deep learning systems ( e.g. , via differentiation ) . One option is to simply learn a generic function approximator that takes in ( x , y ) ∈ X × X ( as a concatenated input ) and outputs a scalar as the prediction of the pair ’ s distance , or some transformed version of it ( e.g. , log distance ) . This approach has been adopted by the community in learning graph distances ( Rizi et al. , 2018 ) and plan costs in MDPs ( Tian et al. , 2020 ) . When the function approximator is a deep neural network , we refer to such formulations as unconstrained ( deep neural ) networks . While deep networks are known to fit training data well ( Jacot et al. , 2018 ) , in this paper we also investigate whether they learn to be ( approximately ) quasimetrics . Alternatively , we can encode each input to a latent space , where a bivariate function outputs the distance prediction . When the function is a latent metric , we obtain metric embeddings . Our proposed Poisson Quasimetric Embedding ( PQE ) ( specified in Sec . 5 ) is also of this kind , where the function is a differentiable latent quasimetric that can approximate arbitrary quasimetrics in data space . 3.2 A TOY EXAMPLE . To build up intuition on how various models perform according to our two goals , we consider a toy quasimetric space with only 3 elements in Fig . 2 . The space has a total of 9 pairs , from which we use 8 as the training set . Due to quasimetric requirements ( esp . triangle inequality ) , knowing distances of these 8 pairs restricts valid values for the heldout pair to a particular range ( which is [ 28 , 31 ] in this case ) . If a model approximates 8 training pairs well and respects quasimetric constraints well , its prediction on that heldout pair should fall into this range . We train three models w.r.t . mean squared error ( MSE ) over the training set using gradient descent : • Unconstrained deep network that predicts distance , • Metric embedding into a latent Euclidean space with a deep encoder , • Quasimetric embedding into a latent PQE space with a deep encoder ( our method ) . ( Details of Poisson Quasimetric Embedding ( PQE ) are explained later in Sec . 5 . ) The three approaches exhibit interesting qualitative differences . Euclidean embedding , unable to model asymmetries in training data , fails to attain a low training error . While both other methods approximate training distances well , unconstrained networks greatly violate quasimetric constraints ; only PQEs respect the constraints and consistently predicts within the valid range . Here , the structural prior of embedding into a quasimetric latent space appears important to successful learning . Without any such prior , unconstrained networks fail badly . In the next section , we present a rigorous theoretical study of the quasimetric learning task , which confirms this intuition . | The paper proposes a Poisson Quasimetric Embedding (PQE) framework, that can be used to embed data to a quasimetric space. Quasimetrics are similar to distance metrics, except that symmetry property does not need to hold. The proposed PQE approach can be solved using gradient based methods. In addition, the paper shows that many common learning algorithms provably fail to learn a quasimetric consistent with training data. | SP:c3e21fdf74b4b85cf5d89766f7afc4ad0a0d03db |
Environment Predictive Coding for Visual Navigation | 1 INTRODUCTION . In visual navigation , an intelligent embodied agent must move around a 3D environment using its stream of egocentric observations to sense objects and obstacles , typically without the benefit of a pre-computed map . Significant recent progress on this problem can be attributed to the availability of large-scale visually rich 3D datasets ( Chang et al. , 2017 ; Xia et al. , 2018 ; Straub et al. , 2019 ) , and high-quality 3D simulators ( Kolve et al. , 2017 ; Savva et al. , 2019a ; Xia et al. , 2020 ) . End-to-end reinforcement learning ( RL ) has been shown to achieve state-of-the-art navigation performance ( Savva et al. , 2019a ; Wijmans et al. , 2020 ) . However , these approaches suffer from sample inefficiency and incur significant computational cost . Recent approaches try to mitigate these limitations by pre-training image representations offline and transferring them for navigation ( Mirowski et al. , 2016 ; Sax et al. , 2020 ) , or by performing auxiliary tasks and data augmentation in an online fashion during RL policy learning ( Gordon et al. , 2019 ; Kostrikov et al. , 2021 ; Ye et al. , 2020 ; 2021 ) . Current offline representation learning methods are flexible — once learned , the representations can be transferred to improve multiple embodied tasks . However , they are limited to learning image feature extractors ( Gupta et al. , 2017 ; Sax et al. , 2020 ) , or image-level proximity functions ( Savinov et al. , 2018 ; Chaplot et al. , 2020c ; Chang et al. , 2020 ) . Since embodied agents typically operate with limited field-of-view sensors , image representations only encode small parts of the scene in the nearby locality of the agent , and do not consider the broader context from the rest of the environment . We contend that embodied agents must learn higher-level semantic and geometric representations of the larger 3D environment around them , conditioned on their entire history of observations . To that end , we introduce environment predictive coding ( EPC ) , a self-supervised approach to learn environment-level representations that are transferrable to a variety of navigation-oriented tasks . The key idea is to learn an encoding of a 3D environment from a series of egocentric observations so as to be predictive of visual content that the agent has not yet observed . Consider the example in Fig . 1 . An agent has observed the living room , lounge , and the bedroom in an unfamiliar house . The agent ’ s encoding of the observed spaces ( i.e. , the red trajectory ) should be predictive of the visual features at an unseen location ( x , y , θ ) , e.g. , the green viewpoint , and enable inferences like “ there is a small kitchen ” , and “ it contains a sink and an oven ” . Learning such predictive representations can equip an agent with the ability to reason about 3D environments as it starts performing various 1 navigation-oriented tasks . The proposed EPC model aims to learn such representations that capture the natural statistics of real-world environments in a self-supervised fashion , by simply watching video walkthroughs recorded by other agents . To achieve this , we devise a self-supervised masked-zone prediction task in which the model learns environment embeddings in an offline fashion , by watching pre-collected video walkthroughs recorded by other agents navigating in 3D environments ( See Fig . 1 ) . The videos contain RGB-D and odometry . Specifically , we segment each video , into zones of temporally contiguous frames which capture local regions of the 3D environment . Then , we randomly mask out zones , and predict features for the masked zones conditioned on both the unmasked zones ’ views and the masked zones ’ camera poses . Since the overlap in scene content across zones is typically limited , the model needs to reason about the geometry and semantics of the environment to figure out what is missing . Our general strategy can be viewed as a context prediction task in sequential data ( Devlin et al. , 2018 ; Sun et al. , 2019b ; Han et al. , 2019 ) —but , very differently , aimed at learning high-level semantic and geometric representations of 3D environments to aid embodied agents acting in them . Unlike any prior video-based feature learning , our approach learns features conditioned on camera poses , explicitly grounding them in a 3D space ; we demonstrate the impact of this important distinction . Through simulated experiments in photorealistic scenes from Matterport3D ( Chang et al. , 2017 ) and Gibson ( Xia et al. , 2018 ) , we show that transferring the EPC environment-level representations leads to 2 - 6× higher sample-efficiency and up to 57 % better performance compared to only image-level transfer on 4 navigational tasks : room goal navigation , object visitation , flee , and area coverage . Our contributions are : ( 1 ) we propose environment-predictive coding ( EPC ) , a self-supervised approach to represent the underlying 3D environment given the observation sequences of an embodied agent , ( 2 ) we propose the proxy task of masked-zone prediction to learn environment-level representations from video walkthroughs captured by other agents , ( 3 ) we perform extensive experiments on Gibson and Matterport3D to demonstrate that EPC leads to good improvements on multiple navigation-oriented tasks , and study EPC ’ s design choices and noise robustness . 2 RELATED WORK . Self-supervised visual representation learning : Prior work leverages self-supervision to learn image and video representations from large unlabelled datasets . Image representation learning attempt proxy tasks such as inpainting ( Pathak et al. , 2016 ) and instance discrimination ( Oord et al. , 2018 ; Chen et al. , 2020a ; He et al. , 2020 ) , while video representation learning leverages signals such as temporal consistency ( Jayaraman & Grauman , 2015 ; Wei et al. , 2018 ; Kim et al. , 2019 ) and contrastive predictions ( Han et al. , 2019 ; Sun et al. , 2019a ) . VideoBERT ( Sun et al. , 2019a ; b ) jointly learns video and text representations from videos by filling in masked out information . Dense Predictive Coding ( Han et al. , 2019 ; 2020 ) learns video representations that capture the slow-moving semantics in videos . Whereas these methods tackle human activity recognition in videos , we aim to learn geometric and semantic cues in 3D spaces for embodied agents . Unlike the existing video models ( Sun et al. , 2019a ; b ; Han et al. , 2019 ) , which simply infer missing frame features conditioned on time , our approach explicitly grounds its predictions in the spatial structure of 3D environments . Representation learning via auxiliary tasks for RL : Reinforcement learning approaches often suffer from high sample complexity , sparse rewards , and unstable training . Prior work tackles these using auxiliary tasks for learning image-level representations during online RL training ( Mirowski et al. , 2016 ; Gordon et al. , 2019 ; Shen et al. , 2019 ; Ye et al. , 2020 ; 2021 ; Stooke et al. , 2021 ) . In contrast , we learn environment-level representations in an offline fashion from previously captured videos . Recent work also learns state representations via future prediction and implicit models ( Ha & Schmidhuber , 2018 ; Gregor et al. , 2019 ; Hafner et al. , 2019 ; Guo et al. , 2020 ) . In particular , neural rendering approaches achieve impressive reconstructions for arbitrary viewpoints ( Eslami et al. , 2018 ; Kumar et al. , 2018 ) . However , unlike our idea , they focus on pixelwise reconstruction , and their success has been limited to synthetically generated environments like DeepMind Lab ( Beattie et al. , 2016 ) . In contrast to any of the above , we use egocentric videos to learn predictive feature encodings that capture the naturally occurring regularities of photorealistic 3D environments . Scene completion : Prior scene completion work performs pixelwise ( Jayaraman & Grauman , 2018 ; Ramakrishnan et al. , 2019 ) or voxelwise ( Song et al. , 2017 ) reconstruction of 360 panoramas , image inpainting ( Pathak et al. , 2016 ) , and image-level extrapolation of depth and semantics ( Song et al. , 2018 ; Yang et al. , 2019 ) . Recent work on visual navigation extrapolates maps of roomtypes ( Wu et al. , 2019 ; Narasimhan et al. , 2020 ) and occupancy ( Ramakrishnan et al. , 2020 ) . While our approach is also motivated by anticipating unseen elements , we learn to extrapolate in a highdimensional feature space ( rather than pixels , voxels , or semantic categories ) and in a self-supervised manner without relying on human annotations . Further , the proposed model learns from egocentric video sequences captured by other agents without assuming access to detailed 3D reconstructions . Learning representations for visual navigation : Researchers are making steady advances in visual navigation architectures ( Gupta et al. , 2017 ; Chen et al. , 2019 ; Fang et al. , 2019 ; Wijmans et al. , 2020 ; Chaplot et al. , 2020b ; Lenton et al. , 2020 ) . Prior work further improves navigation by pretraining representations using supervised image annotations ( Gupta et al. , 2017 ; Anderson et al. , 2018b ; Chen et al. , 2019 ; Sax et al. , 2020 ; Chaplot et al. , 2020c ) , mined object relations ( Yang et al. , 2018 ) , unannotated videos ( Chang et al. , 2020 ) , and active exploration ( Du et al. , 2021 ) . However , these approaches are limited to learning image-level functions . In contrast , we learn environmentlevel representations of image sequences conditioned on the camera poses . We show that the two are complementary by augmenting a SoTA navigation architecture from Fang et al . ( 2019 ) . 3 APPROACH . We propose environment predictive coding ( EPC ) to learn environment-level representations via selfsupervision on video walkthroughs ( Sec . 3.1 ) . To demonstrate the utility of these representations , we integrate them into a transformer-based architecture and refine them for individual navigation tasks ( Sec . 3.2 ) . Finally , we describe our procedure for generating video walkthroughs ( Sec . 3.3 ) . 3.1 ENVIRONMENT PREDICTIVE CODING . Our hypothesis is that it is valuable for an embodied agent to learn a predictive coding of the environment . The agent must not just encode the individual views it observes , but also learn to leverage the encoded information to anticipate the unseen parts of the environment . We propose to train an encoder-decoder model that observes a subset of views from a video walkthrough in a 3D environment , and then infers the features of unobserved views conditioned on their camera poses . To successfully infer features from unobserved views , the encoder must build a predictive representation of the underlying physical environment using the observed views . By transferring this encoder to a navigation agent , we equip the agent with the structural and semantic priors of 3D environments to quickly perform new tasks in new spaces , like mapping the house or room goal navigation . We propose the self-supervised task of masked-zone prediction to achieve this goal ( see Fig . 2 ) . For this task , we use a dataset of egocentric video walkthroughs containing ( possibly noisy ) RGBD and odometer sensor readings collected by other agents deployed in various unseen simulated environments ( Fig . 2 , top ) . These environments are inaccessible for interactive RL training , and the agent policies are ignorant of our eventual downstream tasks ( see Sec . 3.3 ) Our method works as follows . First , we automatically segment each video into “ zones ” which contain temporally contiguous sets of frames . We then learn an environment encoder via the self-supervised maskedzone prediction task on the segmented videos . Finally , we transfer the learned environment encoder to an array of downstream navigation-oriented tasks . We explain each step in detail next . Zone generation At a glance , one might first consider masking arbitrary individual frames in the training videos . However , doing so can result in poor representation learning since shared content from nearby unmasked frames can make the prediction task trivial . Instead , our approach masks zones of frames at once . We define a zone to be a set of temporally contiguous frames in the video . By choosing a large-enough temporal window , we can reduce the amount of shared content with temporally adjacent zones . Given a video walkthrough of size L , we divide it into zones { Z0 , Z1 , · · · } of length N ( selected through validation ) : Zi = { ( ot , pt ) | ∀t ∈ [ ts , te ] } , ( 1 ) where ts = i×N , te = min ( ( i+ 1 ) ×N , L ) , ot is the RGB-D sensor reading , and pt is the camera pose obtained by accumulating odometer readings from time 0 to t ( see Fig . 2 , bottom left ) . While two zones may share visual content , we find that this simple approach works better than strictly limiting the overlap between zones ( see Appendix . A8 ) . Thus , the learning is guided by predicting parts of the environment that were never seen as well as those seen from different viewpoints . Masked-zone prediction Having segmented the video into zones , we next present our EPC masked-zone prediction task to learn environment embeddings ( see Fig . 2 ) . The main idea is to infer unseen zones in a video by previewing the context spanning multiple seen zones . We randomly divide the zones into seen zones { Zsi } ni=1 and unseen zones { Zui } mi=1 . Given the seen zones and the mean camera pose from an unseen zone pui , we need to infer a feature encoding of the unseen zone Zui . To perform this task efficiently , we first extract visual features xt from each RGB-D frame ot in the video using pretrained CNNs ( described in Sec . 3.2 ) . These features are concatenated with the corresponding pose pt and projected using an MLPM to obtain the image-level embedding . The target features for the unseen zone Zui are obtained by averaging 1 all the MLP projected features : fui = 1 |Zui | ∑ ∀x ∈ Zui M ( [ x , −→0 ] ) , ( 2 ) where we mask out the pose ( i.e. , p = −→ 0 ) in the target to avoid trivial solutions . We use a transformer encoder-decoder model ( Vaswani et al. , 2017 ) to infer the zone features ( see Fig . 2 , bottom ) . An environment encoder uses self-attention over the image-level embeddings from all the seen zones , i.e. , { M ( [ x , p ] ) | ∀ ( x , p ) ∈ Zsi , ∀i ∈ [ 1 , n ] } , to generate the environment embeddings E . A zone decoder then attends to E conditioned on the camera pose pui from the unseen zone and predicts the zone features : f̂ui = ZoneDecoder ( E , pui ) . ( 3 ) Following Fang et al . ( 2019 ) , we transform all poses in the input zones relative to pui before encoding , which provides the model an egocentric view of the world . As we will show in experiments , conditioning on pose is critical to learn useful representations . The environment encoder , zone decoder , and projection functionM are trained end-to-end using noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) . We use f̂ui as the anchor and f u i from Eqn . 2 as the positive . We sample 1We found this to be better than randomly sampling features within a zone . negatives from other unseen zones in the same video2 and from all zones in other videos . The former discourages the model from simply learning video-specific textures and patterns ; the latter expands the pool of negatives which was found to be beneficial in prior work ( Chen et al. , 2020b ; a ) . The loss for the ith unseen zone in the video is : Li = −log sim ( f̂ u i , f u i ) ∑ j sim ( f̂ui , fj ) + ∑ k sim ( f̂ui , f ′ k ) , ( 4 ) where f ′ k are zone features from other videos , and sim ( q , k ) = exp ( q·k |q||k| 1 τ ) is a similarity measure with temperature τ = 0.1 . The idea is to predict zone representations that are closer to the ground truth , while being sufficiently different from the negative zones . Since the seen and unseen zones may only have limited overlap , the model needs to effectively reason about the geometric and semantic context in the seen zones to perform this task . We qualitatively analyse the masked-zone prediction results from the learned EPC model in Fig . 4 . | The work builds upon the scene memory transformer (SMT, Fang et al., 2019) for visual navigation, which encodes and adds past observations to a memory and uses attention to exploit spatio-temporal dependencies. The authors propose a self-supervised pre-training for the observation encoder using an encoder-decoder architecture with the encoded memory as the bottleneck (the decoder is only used for pre-training). Self supervision is achieved by using sequences of observations (posed RGBD images) and splitting them into batches of temporally consecutive frames (termed “zones” in the paper). Considering a subset of the zones as not observed, i.e. not available as input for the network, the goal of the encoder-decoder is to predict the features of an unseen zone from the seen input zones, conditioned on the pose of the unseen zone. Compared to a frame based masking, the zone (=spatio-temporal consecutive frames) based exclusion of data results in less overlap between seen and unseen scene parts, which is argued to learn higher-level semantic and geometric representation of the 3D environment Contributions: - Approach for self supervision based on the prediction of visual-geometric features for unseen scenes. - Superior performance to SoTA on the navigation task. | SP:26997a5ee3a6684de64ef7d2edc2273df9cd0706 |
Environment Predictive Coding for Visual Navigation | 1 INTRODUCTION . In visual navigation , an intelligent embodied agent must move around a 3D environment using its stream of egocentric observations to sense objects and obstacles , typically without the benefit of a pre-computed map . Significant recent progress on this problem can be attributed to the availability of large-scale visually rich 3D datasets ( Chang et al. , 2017 ; Xia et al. , 2018 ; Straub et al. , 2019 ) , and high-quality 3D simulators ( Kolve et al. , 2017 ; Savva et al. , 2019a ; Xia et al. , 2020 ) . End-to-end reinforcement learning ( RL ) has been shown to achieve state-of-the-art navigation performance ( Savva et al. , 2019a ; Wijmans et al. , 2020 ) . However , these approaches suffer from sample inefficiency and incur significant computational cost . Recent approaches try to mitigate these limitations by pre-training image representations offline and transferring them for navigation ( Mirowski et al. , 2016 ; Sax et al. , 2020 ) , or by performing auxiliary tasks and data augmentation in an online fashion during RL policy learning ( Gordon et al. , 2019 ; Kostrikov et al. , 2021 ; Ye et al. , 2020 ; 2021 ) . Current offline representation learning methods are flexible — once learned , the representations can be transferred to improve multiple embodied tasks . However , they are limited to learning image feature extractors ( Gupta et al. , 2017 ; Sax et al. , 2020 ) , or image-level proximity functions ( Savinov et al. , 2018 ; Chaplot et al. , 2020c ; Chang et al. , 2020 ) . Since embodied agents typically operate with limited field-of-view sensors , image representations only encode small parts of the scene in the nearby locality of the agent , and do not consider the broader context from the rest of the environment . We contend that embodied agents must learn higher-level semantic and geometric representations of the larger 3D environment around them , conditioned on their entire history of observations . To that end , we introduce environment predictive coding ( EPC ) , a self-supervised approach to learn environment-level representations that are transferrable to a variety of navigation-oriented tasks . The key idea is to learn an encoding of a 3D environment from a series of egocentric observations so as to be predictive of visual content that the agent has not yet observed . Consider the example in Fig . 1 . An agent has observed the living room , lounge , and the bedroom in an unfamiliar house . The agent ’ s encoding of the observed spaces ( i.e. , the red trajectory ) should be predictive of the visual features at an unseen location ( x , y , θ ) , e.g. , the green viewpoint , and enable inferences like “ there is a small kitchen ” , and “ it contains a sink and an oven ” . Learning such predictive representations can equip an agent with the ability to reason about 3D environments as it starts performing various 1 navigation-oriented tasks . The proposed EPC model aims to learn such representations that capture the natural statistics of real-world environments in a self-supervised fashion , by simply watching video walkthroughs recorded by other agents . To achieve this , we devise a self-supervised masked-zone prediction task in which the model learns environment embeddings in an offline fashion , by watching pre-collected video walkthroughs recorded by other agents navigating in 3D environments ( See Fig . 1 ) . The videos contain RGB-D and odometry . Specifically , we segment each video , into zones of temporally contiguous frames which capture local regions of the 3D environment . Then , we randomly mask out zones , and predict features for the masked zones conditioned on both the unmasked zones ’ views and the masked zones ’ camera poses . Since the overlap in scene content across zones is typically limited , the model needs to reason about the geometry and semantics of the environment to figure out what is missing . Our general strategy can be viewed as a context prediction task in sequential data ( Devlin et al. , 2018 ; Sun et al. , 2019b ; Han et al. , 2019 ) —but , very differently , aimed at learning high-level semantic and geometric representations of 3D environments to aid embodied agents acting in them . Unlike any prior video-based feature learning , our approach learns features conditioned on camera poses , explicitly grounding them in a 3D space ; we demonstrate the impact of this important distinction . Through simulated experiments in photorealistic scenes from Matterport3D ( Chang et al. , 2017 ) and Gibson ( Xia et al. , 2018 ) , we show that transferring the EPC environment-level representations leads to 2 - 6× higher sample-efficiency and up to 57 % better performance compared to only image-level transfer on 4 navigational tasks : room goal navigation , object visitation , flee , and area coverage . Our contributions are : ( 1 ) we propose environment-predictive coding ( EPC ) , a self-supervised approach to represent the underlying 3D environment given the observation sequences of an embodied agent , ( 2 ) we propose the proxy task of masked-zone prediction to learn environment-level representations from video walkthroughs captured by other agents , ( 3 ) we perform extensive experiments on Gibson and Matterport3D to demonstrate that EPC leads to good improvements on multiple navigation-oriented tasks , and study EPC ’ s design choices and noise robustness . 2 RELATED WORK . Self-supervised visual representation learning : Prior work leverages self-supervision to learn image and video representations from large unlabelled datasets . Image representation learning attempt proxy tasks such as inpainting ( Pathak et al. , 2016 ) and instance discrimination ( Oord et al. , 2018 ; Chen et al. , 2020a ; He et al. , 2020 ) , while video representation learning leverages signals such as temporal consistency ( Jayaraman & Grauman , 2015 ; Wei et al. , 2018 ; Kim et al. , 2019 ) and contrastive predictions ( Han et al. , 2019 ; Sun et al. , 2019a ) . VideoBERT ( Sun et al. , 2019a ; b ) jointly learns video and text representations from videos by filling in masked out information . Dense Predictive Coding ( Han et al. , 2019 ; 2020 ) learns video representations that capture the slow-moving semantics in videos . Whereas these methods tackle human activity recognition in videos , we aim to learn geometric and semantic cues in 3D spaces for embodied agents . Unlike the existing video models ( Sun et al. , 2019a ; b ; Han et al. , 2019 ) , which simply infer missing frame features conditioned on time , our approach explicitly grounds its predictions in the spatial structure of 3D environments . Representation learning via auxiliary tasks for RL : Reinforcement learning approaches often suffer from high sample complexity , sparse rewards , and unstable training . Prior work tackles these using auxiliary tasks for learning image-level representations during online RL training ( Mirowski et al. , 2016 ; Gordon et al. , 2019 ; Shen et al. , 2019 ; Ye et al. , 2020 ; 2021 ; Stooke et al. , 2021 ) . In contrast , we learn environment-level representations in an offline fashion from previously captured videos . Recent work also learns state representations via future prediction and implicit models ( Ha & Schmidhuber , 2018 ; Gregor et al. , 2019 ; Hafner et al. , 2019 ; Guo et al. , 2020 ) . In particular , neural rendering approaches achieve impressive reconstructions for arbitrary viewpoints ( Eslami et al. , 2018 ; Kumar et al. , 2018 ) . However , unlike our idea , they focus on pixelwise reconstruction , and their success has been limited to synthetically generated environments like DeepMind Lab ( Beattie et al. , 2016 ) . In contrast to any of the above , we use egocentric videos to learn predictive feature encodings that capture the naturally occurring regularities of photorealistic 3D environments . Scene completion : Prior scene completion work performs pixelwise ( Jayaraman & Grauman , 2018 ; Ramakrishnan et al. , 2019 ) or voxelwise ( Song et al. , 2017 ) reconstruction of 360 panoramas , image inpainting ( Pathak et al. , 2016 ) , and image-level extrapolation of depth and semantics ( Song et al. , 2018 ; Yang et al. , 2019 ) . Recent work on visual navigation extrapolates maps of roomtypes ( Wu et al. , 2019 ; Narasimhan et al. , 2020 ) and occupancy ( Ramakrishnan et al. , 2020 ) . While our approach is also motivated by anticipating unseen elements , we learn to extrapolate in a highdimensional feature space ( rather than pixels , voxels , or semantic categories ) and in a self-supervised manner without relying on human annotations . Further , the proposed model learns from egocentric video sequences captured by other agents without assuming access to detailed 3D reconstructions . Learning representations for visual navigation : Researchers are making steady advances in visual navigation architectures ( Gupta et al. , 2017 ; Chen et al. , 2019 ; Fang et al. , 2019 ; Wijmans et al. , 2020 ; Chaplot et al. , 2020b ; Lenton et al. , 2020 ) . Prior work further improves navigation by pretraining representations using supervised image annotations ( Gupta et al. , 2017 ; Anderson et al. , 2018b ; Chen et al. , 2019 ; Sax et al. , 2020 ; Chaplot et al. , 2020c ) , mined object relations ( Yang et al. , 2018 ) , unannotated videos ( Chang et al. , 2020 ) , and active exploration ( Du et al. , 2021 ) . However , these approaches are limited to learning image-level functions . In contrast , we learn environmentlevel representations of image sequences conditioned on the camera poses . We show that the two are complementary by augmenting a SoTA navigation architecture from Fang et al . ( 2019 ) . 3 APPROACH . We propose environment predictive coding ( EPC ) to learn environment-level representations via selfsupervision on video walkthroughs ( Sec . 3.1 ) . To demonstrate the utility of these representations , we integrate them into a transformer-based architecture and refine them for individual navigation tasks ( Sec . 3.2 ) . Finally , we describe our procedure for generating video walkthroughs ( Sec . 3.3 ) . 3.1 ENVIRONMENT PREDICTIVE CODING . Our hypothesis is that it is valuable for an embodied agent to learn a predictive coding of the environment . The agent must not just encode the individual views it observes , but also learn to leverage the encoded information to anticipate the unseen parts of the environment . We propose to train an encoder-decoder model that observes a subset of views from a video walkthrough in a 3D environment , and then infers the features of unobserved views conditioned on their camera poses . To successfully infer features from unobserved views , the encoder must build a predictive representation of the underlying physical environment using the observed views . By transferring this encoder to a navigation agent , we equip the agent with the structural and semantic priors of 3D environments to quickly perform new tasks in new spaces , like mapping the house or room goal navigation . We propose the self-supervised task of masked-zone prediction to achieve this goal ( see Fig . 2 ) . For this task , we use a dataset of egocentric video walkthroughs containing ( possibly noisy ) RGBD and odometer sensor readings collected by other agents deployed in various unseen simulated environments ( Fig . 2 , top ) . These environments are inaccessible for interactive RL training , and the agent policies are ignorant of our eventual downstream tasks ( see Sec . 3.3 ) Our method works as follows . First , we automatically segment each video into “ zones ” which contain temporally contiguous sets of frames . We then learn an environment encoder via the self-supervised maskedzone prediction task on the segmented videos . Finally , we transfer the learned environment encoder to an array of downstream navigation-oriented tasks . We explain each step in detail next . Zone generation At a glance , one might first consider masking arbitrary individual frames in the training videos . However , doing so can result in poor representation learning since shared content from nearby unmasked frames can make the prediction task trivial . Instead , our approach masks zones of frames at once . We define a zone to be a set of temporally contiguous frames in the video . By choosing a large-enough temporal window , we can reduce the amount of shared content with temporally adjacent zones . Given a video walkthrough of size L , we divide it into zones { Z0 , Z1 , · · · } of length N ( selected through validation ) : Zi = { ( ot , pt ) | ∀t ∈ [ ts , te ] } , ( 1 ) where ts = i×N , te = min ( ( i+ 1 ) ×N , L ) , ot is the RGB-D sensor reading , and pt is the camera pose obtained by accumulating odometer readings from time 0 to t ( see Fig . 2 , bottom left ) . While two zones may share visual content , we find that this simple approach works better than strictly limiting the overlap between zones ( see Appendix . A8 ) . Thus , the learning is guided by predicting parts of the environment that were never seen as well as those seen from different viewpoints . Masked-zone prediction Having segmented the video into zones , we next present our EPC masked-zone prediction task to learn environment embeddings ( see Fig . 2 ) . The main idea is to infer unseen zones in a video by previewing the context spanning multiple seen zones . We randomly divide the zones into seen zones { Zsi } ni=1 and unseen zones { Zui } mi=1 . Given the seen zones and the mean camera pose from an unseen zone pui , we need to infer a feature encoding of the unseen zone Zui . To perform this task efficiently , we first extract visual features xt from each RGB-D frame ot in the video using pretrained CNNs ( described in Sec . 3.2 ) . These features are concatenated with the corresponding pose pt and projected using an MLPM to obtain the image-level embedding . The target features for the unseen zone Zui are obtained by averaging 1 all the MLP projected features : fui = 1 |Zui | ∑ ∀x ∈ Zui M ( [ x , −→0 ] ) , ( 2 ) where we mask out the pose ( i.e. , p = −→ 0 ) in the target to avoid trivial solutions . We use a transformer encoder-decoder model ( Vaswani et al. , 2017 ) to infer the zone features ( see Fig . 2 , bottom ) . An environment encoder uses self-attention over the image-level embeddings from all the seen zones , i.e. , { M ( [ x , p ] ) | ∀ ( x , p ) ∈ Zsi , ∀i ∈ [ 1 , n ] } , to generate the environment embeddings E . A zone decoder then attends to E conditioned on the camera pose pui from the unseen zone and predicts the zone features : f̂ui = ZoneDecoder ( E , pui ) . ( 3 ) Following Fang et al . ( 2019 ) , we transform all poses in the input zones relative to pui before encoding , which provides the model an egocentric view of the world . As we will show in experiments , conditioning on pose is critical to learn useful representations . The environment encoder , zone decoder , and projection functionM are trained end-to-end using noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) . We use f̂ui as the anchor and f u i from Eqn . 2 as the positive . We sample 1We found this to be better than randomly sampling features within a zone . negatives from other unseen zones in the same video2 and from all zones in other videos . The former discourages the model from simply learning video-specific textures and patterns ; the latter expands the pool of negatives which was found to be beneficial in prior work ( Chen et al. , 2020b ; a ) . The loss for the ith unseen zone in the video is : Li = −log sim ( f̂ u i , f u i ) ∑ j sim ( f̂ui , fj ) + ∑ k sim ( f̂ui , f ′ k ) , ( 4 ) where f ′ k are zone features from other videos , and sim ( q , k ) = exp ( q·k |q||k| 1 τ ) is a similarity measure with temperature τ = 0.1 . The idea is to predict zone representations that are closer to the ground truth , while being sufficiently different from the negative zones . Since the seen and unseen zones may only have limited overlap , the model needs to effectively reason about the geometric and semantic context in the seen zones to perform this task . We qualitatively analyse the masked-zone prediction results from the learned EPC model in Fig . 4 . | This paper focuses on the problem of efficiently training an intelligent embodied agent for navigation purposes. Technically, the manuscript introduces a technique named as Environment-Predictive Coding (EPC). It is a model for learning environment-level representations via self-supervision, just using video walkthroughs with masked zones. EPC proposes to learn an environment encoder, using a transformer-based encoding-decoding, that produces environment embeddings and that predicts feature encodings for the unseen areas. This is the main scientific contribution of the paper. This environment encoder is finally integrated in the Scene Memory Transformer (SMT) (Fang et al., 2019) for navigation purposes. A thorough experimental evaluation is offered, using Matterport3D (MP3D) (Chang et al., 2017) and Gibson (Xia et al., 2018) for 4 navigation tasks. Reported results seem to explain the benefits of incorporating such a self-supervision mechanism. | SP:26997a5ee3a6684de64ef7d2edc2273df9cd0706 |
Environment Predictive Coding for Visual Navigation | 1 INTRODUCTION . In visual navigation , an intelligent embodied agent must move around a 3D environment using its stream of egocentric observations to sense objects and obstacles , typically without the benefit of a pre-computed map . Significant recent progress on this problem can be attributed to the availability of large-scale visually rich 3D datasets ( Chang et al. , 2017 ; Xia et al. , 2018 ; Straub et al. , 2019 ) , and high-quality 3D simulators ( Kolve et al. , 2017 ; Savva et al. , 2019a ; Xia et al. , 2020 ) . End-to-end reinforcement learning ( RL ) has been shown to achieve state-of-the-art navigation performance ( Savva et al. , 2019a ; Wijmans et al. , 2020 ) . However , these approaches suffer from sample inefficiency and incur significant computational cost . Recent approaches try to mitigate these limitations by pre-training image representations offline and transferring them for navigation ( Mirowski et al. , 2016 ; Sax et al. , 2020 ) , or by performing auxiliary tasks and data augmentation in an online fashion during RL policy learning ( Gordon et al. , 2019 ; Kostrikov et al. , 2021 ; Ye et al. , 2020 ; 2021 ) . Current offline representation learning methods are flexible — once learned , the representations can be transferred to improve multiple embodied tasks . However , they are limited to learning image feature extractors ( Gupta et al. , 2017 ; Sax et al. , 2020 ) , or image-level proximity functions ( Savinov et al. , 2018 ; Chaplot et al. , 2020c ; Chang et al. , 2020 ) . Since embodied agents typically operate with limited field-of-view sensors , image representations only encode small parts of the scene in the nearby locality of the agent , and do not consider the broader context from the rest of the environment . We contend that embodied agents must learn higher-level semantic and geometric representations of the larger 3D environment around them , conditioned on their entire history of observations . To that end , we introduce environment predictive coding ( EPC ) , a self-supervised approach to learn environment-level representations that are transferrable to a variety of navigation-oriented tasks . The key idea is to learn an encoding of a 3D environment from a series of egocentric observations so as to be predictive of visual content that the agent has not yet observed . Consider the example in Fig . 1 . An agent has observed the living room , lounge , and the bedroom in an unfamiliar house . The agent ’ s encoding of the observed spaces ( i.e. , the red trajectory ) should be predictive of the visual features at an unseen location ( x , y , θ ) , e.g. , the green viewpoint , and enable inferences like “ there is a small kitchen ” , and “ it contains a sink and an oven ” . Learning such predictive representations can equip an agent with the ability to reason about 3D environments as it starts performing various 1 navigation-oriented tasks . The proposed EPC model aims to learn such representations that capture the natural statistics of real-world environments in a self-supervised fashion , by simply watching video walkthroughs recorded by other agents . To achieve this , we devise a self-supervised masked-zone prediction task in which the model learns environment embeddings in an offline fashion , by watching pre-collected video walkthroughs recorded by other agents navigating in 3D environments ( See Fig . 1 ) . The videos contain RGB-D and odometry . Specifically , we segment each video , into zones of temporally contiguous frames which capture local regions of the 3D environment . Then , we randomly mask out zones , and predict features for the masked zones conditioned on both the unmasked zones ’ views and the masked zones ’ camera poses . Since the overlap in scene content across zones is typically limited , the model needs to reason about the geometry and semantics of the environment to figure out what is missing . Our general strategy can be viewed as a context prediction task in sequential data ( Devlin et al. , 2018 ; Sun et al. , 2019b ; Han et al. , 2019 ) —but , very differently , aimed at learning high-level semantic and geometric representations of 3D environments to aid embodied agents acting in them . Unlike any prior video-based feature learning , our approach learns features conditioned on camera poses , explicitly grounding them in a 3D space ; we demonstrate the impact of this important distinction . Through simulated experiments in photorealistic scenes from Matterport3D ( Chang et al. , 2017 ) and Gibson ( Xia et al. , 2018 ) , we show that transferring the EPC environment-level representations leads to 2 - 6× higher sample-efficiency and up to 57 % better performance compared to only image-level transfer on 4 navigational tasks : room goal navigation , object visitation , flee , and area coverage . Our contributions are : ( 1 ) we propose environment-predictive coding ( EPC ) , a self-supervised approach to represent the underlying 3D environment given the observation sequences of an embodied agent , ( 2 ) we propose the proxy task of masked-zone prediction to learn environment-level representations from video walkthroughs captured by other agents , ( 3 ) we perform extensive experiments on Gibson and Matterport3D to demonstrate that EPC leads to good improvements on multiple navigation-oriented tasks , and study EPC ’ s design choices and noise robustness . 2 RELATED WORK . Self-supervised visual representation learning : Prior work leverages self-supervision to learn image and video representations from large unlabelled datasets . Image representation learning attempt proxy tasks such as inpainting ( Pathak et al. , 2016 ) and instance discrimination ( Oord et al. , 2018 ; Chen et al. , 2020a ; He et al. , 2020 ) , while video representation learning leverages signals such as temporal consistency ( Jayaraman & Grauman , 2015 ; Wei et al. , 2018 ; Kim et al. , 2019 ) and contrastive predictions ( Han et al. , 2019 ; Sun et al. , 2019a ) . VideoBERT ( Sun et al. , 2019a ; b ) jointly learns video and text representations from videos by filling in masked out information . Dense Predictive Coding ( Han et al. , 2019 ; 2020 ) learns video representations that capture the slow-moving semantics in videos . Whereas these methods tackle human activity recognition in videos , we aim to learn geometric and semantic cues in 3D spaces for embodied agents . Unlike the existing video models ( Sun et al. , 2019a ; b ; Han et al. , 2019 ) , which simply infer missing frame features conditioned on time , our approach explicitly grounds its predictions in the spatial structure of 3D environments . Representation learning via auxiliary tasks for RL : Reinforcement learning approaches often suffer from high sample complexity , sparse rewards , and unstable training . Prior work tackles these using auxiliary tasks for learning image-level representations during online RL training ( Mirowski et al. , 2016 ; Gordon et al. , 2019 ; Shen et al. , 2019 ; Ye et al. , 2020 ; 2021 ; Stooke et al. , 2021 ) . In contrast , we learn environment-level representations in an offline fashion from previously captured videos . Recent work also learns state representations via future prediction and implicit models ( Ha & Schmidhuber , 2018 ; Gregor et al. , 2019 ; Hafner et al. , 2019 ; Guo et al. , 2020 ) . In particular , neural rendering approaches achieve impressive reconstructions for arbitrary viewpoints ( Eslami et al. , 2018 ; Kumar et al. , 2018 ) . However , unlike our idea , they focus on pixelwise reconstruction , and their success has been limited to synthetically generated environments like DeepMind Lab ( Beattie et al. , 2016 ) . In contrast to any of the above , we use egocentric videos to learn predictive feature encodings that capture the naturally occurring regularities of photorealistic 3D environments . Scene completion : Prior scene completion work performs pixelwise ( Jayaraman & Grauman , 2018 ; Ramakrishnan et al. , 2019 ) or voxelwise ( Song et al. , 2017 ) reconstruction of 360 panoramas , image inpainting ( Pathak et al. , 2016 ) , and image-level extrapolation of depth and semantics ( Song et al. , 2018 ; Yang et al. , 2019 ) . Recent work on visual navigation extrapolates maps of roomtypes ( Wu et al. , 2019 ; Narasimhan et al. , 2020 ) and occupancy ( Ramakrishnan et al. , 2020 ) . While our approach is also motivated by anticipating unseen elements , we learn to extrapolate in a highdimensional feature space ( rather than pixels , voxels , or semantic categories ) and in a self-supervised manner without relying on human annotations . Further , the proposed model learns from egocentric video sequences captured by other agents without assuming access to detailed 3D reconstructions . Learning representations for visual navigation : Researchers are making steady advances in visual navigation architectures ( Gupta et al. , 2017 ; Chen et al. , 2019 ; Fang et al. , 2019 ; Wijmans et al. , 2020 ; Chaplot et al. , 2020b ; Lenton et al. , 2020 ) . Prior work further improves navigation by pretraining representations using supervised image annotations ( Gupta et al. , 2017 ; Anderson et al. , 2018b ; Chen et al. , 2019 ; Sax et al. , 2020 ; Chaplot et al. , 2020c ) , mined object relations ( Yang et al. , 2018 ) , unannotated videos ( Chang et al. , 2020 ) , and active exploration ( Du et al. , 2021 ) . However , these approaches are limited to learning image-level functions . In contrast , we learn environmentlevel representations of image sequences conditioned on the camera poses . We show that the two are complementary by augmenting a SoTA navigation architecture from Fang et al . ( 2019 ) . 3 APPROACH . We propose environment predictive coding ( EPC ) to learn environment-level representations via selfsupervision on video walkthroughs ( Sec . 3.1 ) . To demonstrate the utility of these representations , we integrate them into a transformer-based architecture and refine them for individual navigation tasks ( Sec . 3.2 ) . Finally , we describe our procedure for generating video walkthroughs ( Sec . 3.3 ) . 3.1 ENVIRONMENT PREDICTIVE CODING . Our hypothesis is that it is valuable for an embodied agent to learn a predictive coding of the environment . The agent must not just encode the individual views it observes , but also learn to leverage the encoded information to anticipate the unseen parts of the environment . We propose to train an encoder-decoder model that observes a subset of views from a video walkthrough in a 3D environment , and then infers the features of unobserved views conditioned on their camera poses . To successfully infer features from unobserved views , the encoder must build a predictive representation of the underlying physical environment using the observed views . By transferring this encoder to a navigation agent , we equip the agent with the structural and semantic priors of 3D environments to quickly perform new tasks in new spaces , like mapping the house or room goal navigation . We propose the self-supervised task of masked-zone prediction to achieve this goal ( see Fig . 2 ) . For this task , we use a dataset of egocentric video walkthroughs containing ( possibly noisy ) RGBD and odometer sensor readings collected by other agents deployed in various unseen simulated environments ( Fig . 2 , top ) . These environments are inaccessible for interactive RL training , and the agent policies are ignorant of our eventual downstream tasks ( see Sec . 3.3 ) Our method works as follows . First , we automatically segment each video into “ zones ” which contain temporally contiguous sets of frames . We then learn an environment encoder via the self-supervised maskedzone prediction task on the segmented videos . Finally , we transfer the learned environment encoder to an array of downstream navigation-oriented tasks . We explain each step in detail next . Zone generation At a glance , one might first consider masking arbitrary individual frames in the training videos . However , doing so can result in poor representation learning since shared content from nearby unmasked frames can make the prediction task trivial . Instead , our approach masks zones of frames at once . We define a zone to be a set of temporally contiguous frames in the video . By choosing a large-enough temporal window , we can reduce the amount of shared content with temporally adjacent zones . Given a video walkthrough of size L , we divide it into zones { Z0 , Z1 , · · · } of length N ( selected through validation ) : Zi = { ( ot , pt ) | ∀t ∈ [ ts , te ] } , ( 1 ) where ts = i×N , te = min ( ( i+ 1 ) ×N , L ) , ot is the RGB-D sensor reading , and pt is the camera pose obtained by accumulating odometer readings from time 0 to t ( see Fig . 2 , bottom left ) . While two zones may share visual content , we find that this simple approach works better than strictly limiting the overlap between zones ( see Appendix . A8 ) . Thus , the learning is guided by predicting parts of the environment that were never seen as well as those seen from different viewpoints . Masked-zone prediction Having segmented the video into zones , we next present our EPC masked-zone prediction task to learn environment embeddings ( see Fig . 2 ) . The main idea is to infer unseen zones in a video by previewing the context spanning multiple seen zones . We randomly divide the zones into seen zones { Zsi } ni=1 and unseen zones { Zui } mi=1 . Given the seen zones and the mean camera pose from an unseen zone pui , we need to infer a feature encoding of the unseen zone Zui . To perform this task efficiently , we first extract visual features xt from each RGB-D frame ot in the video using pretrained CNNs ( described in Sec . 3.2 ) . These features are concatenated with the corresponding pose pt and projected using an MLPM to obtain the image-level embedding . The target features for the unseen zone Zui are obtained by averaging 1 all the MLP projected features : fui = 1 |Zui | ∑ ∀x ∈ Zui M ( [ x , −→0 ] ) , ( 2 ) where we mask out the pose ( i.e. , p = −→ 0 ) in the target to avoid trivial solutions . We use a transformer encoder-decoder model ( Vaswani et al. , 2017 ) to infer the zone features ( see Fig . 2 , bottom ) . An environment encoder uses self-attention over the image-level embeddings from all the seen zones , i.e. , { M ( [ x , p ] ) | ∀ ( x , p ) ∈ Zsi , ∀i ∈ [ 1 , n ] } , to generate the environment embeddings E . A zone decoder then attends to E conditioned on the camera pose pui from the unseen zone and predicts the zone features : f̂ui = ZoneDecoder ( E , pui ) . ( 3 ) Following Fang et al . ( 2019 ) , we transform all poses in the input zones relative to pui before encoding , which provides the model an egocentric view of the world . As we will show in experiments , conditioning on pose is critical to learn useful representations . The environment encoder , zone decoder , and projection functionM are trained end-to-end using noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) . We use f̂ui as the anchor and f u i from Eqn . 2 as the positive . We sample 1We found this to be better than randomly sampling features within a zone . negatives from other unseen zones in the same video2 and from all zones in other videos . The former discourages the model from simply learning video-specific textures and patterns ; the latter expands the pool of negatives which was found to be beneficial in prior work ( Chen et al. , 2020b ; a ) . The loss for the ith unseen zone in the video is : Li = −log sim ( f̂ u i , f u i ) ∑ j sim ( f̂ui , fj ) + ∑ k sim ( f̂ui , f ′ k ) , ( 4 ) where f ′ k are zone features from other videos , and sim ( q , k ) = exp ( q·k |q||k| 1 τ ) is a similarity measure with temperature τ = 0.1 . The idea is to predict zone representations that are closer to the ground truth , while being sufficiently different from the negative zones . Since the seen and unseen zones may only have limited overlap , the model needs to effectively reason about the geometric and semantic context in the seen zones to perform this task . We qualitatively analyse the masked-zone prediction results from the learned EPC model in Fig . 4 . | The authors propose a self-supervised representation learning method called environment predictive coding inspired by the context prediction in other representation learning works. This explicit spatial conditioning encourages learning representations that capture the geometric and semantic regularities of 3D environments. The learned representations can be used for downstream navigation tasks, achieving higher sample efficiency over standard image-representation learning. | SP:26997a5ee3a6684de64ef7d2edc2273df9cd0706 |
Causal Discovery via Cholesky Factorization | 1 INTRODUCTION . As Schelling had said : “ The whole world is thoroughly to caught in reason , but the question is : how did it get caught in the network of reason in the first place ? ” ( Kuhn , 1942 ; Žižek & von Schelling , 1997 ) , people found that learning the causal inferences between the variables is a fundamental problem and has many applications in biology , machine learning , medicine , and economics . The problem usually is considered as finding a directed acyclic graph ( DAG ) from an observational joint distribution . Unfortunately , learning the DAG structure from the observations is proved to be an NP-hard problem ( Chickering , 1995 ; Chickering et al. , 2004 ) . The problem is generally formulated as the structural equation model ( SEM ) , where the variable of a child node is a function of its parents with additional noises . Depending on the types of functions ( linear or non-linear ) and noises ( Gaussian , Gumbel , etc . ) , there are several SEM families , e.g. , Spirtes et al . ( 2000 ) ; Geiger & Heckerman ( 1994 ) ; Shimizu et al . ( 2006 ) . In general , the graph can be identified from the joint distribution only up to Markov equivalence classes . Zhang & Hyvarinen ( 2012 ) ; Peters et al . ( 2014 ) ; Peters & Bühlmann ( 2014 ) ; Gao et al . ( 2020 ) propose several SEM forms that make the graph fully identifiable from the observed data . Various algorithms had been proposed to deal with the problem . Search-based algorithms ( Chickering , 2002 ; Friedman & Koller , 2003 ; Ramsey et al. , 2017 ; Tsamardinos et al. , 2006 ; Aragam & Zhou , 2015 ; Teyssier & Koller , 2005 ; Ye et al. , 2019 ; Lv et al. , 2021 ) generally adopt a score ( e.g. , BIC ( Peters et al. , 2014 ) score , Cholesky score ( Ye et al. , 2019 ) , remove-fill score ( Squires et al. , 2020 ) ) to measure the fitness of different graphs over data and then search over the legal DAG space to find the structure that achieves the highest score . However , exhaustive search over the legal DAG space is infeasible when p is large ( e.g. , there are 4.1e18 DAGs for p = 10 ( Sloane et al. , 2003 ) ) . Those algorithms go in quest of a trade-off between the performance and the time complexity . Since Zheng et al . ( 2018 ) proposed an approach that converts the traditional combinatorial optimization problem into a continuous program , many methods ( Yu et al. , 2019 ; Lee et al. , 2019 ; Ng et al. , 2019a ; b ; Zheng et al. , 2020 ; Lachapelle et al. , 2020 ; Squires et al. , 2020 ; Zhu et al. , 2021 ) have been proposed . Those algorithms formalize the problem as a data reconstruction task with various differentiable constraints on the DAG adjacent matrix and solve it via the augmented Lagrangian method . These algorithms are able to utilize neural networks to approximate the complicated relations between the features in the observed data and achieve good performances . Recently , reinforcement learning based algorithms ( Zhu et al. , 2020 ; Wang et al. , 2021 ) also improved the performance by exploring the possible DAG structure candidates . The algorithms update the parameters of the model via policy gradient as long as it explored a better DAG structure with a higher reward which measures how well an explored structure meets the requirement of DAG and the observed data . Topology order search algorithms ( TOSA ) ( Ghoshal & Honorio , 2017 ; 2018 ; Chen et al. , 2019 ; Gao et al. , 2020 ; Park , 2020 ) decompose the DAG learning problem into two phases : ( i ) Topology order learning via conditional variance of the observed data ; ( ii ) Graph estimation depends on the learned topology order . Those algorithms reduce the computation complexity into polynomial time and are guaranteed to recover the DAG structure under some identifiable assumptions . Our method in this paper is also a topology order search algorithm and it merges the two phases in TOSA into one . In each iteration , it attempts to find a child or a contemporary of the current node . Meanwhile , it also determines the corresponding column vector of the adjacent matrix . The mergence brings three main differences : First , the topology order in TOSA is recovered purely based on the conditional variance of the observed data , whereas our method may also take the sparsity of the adjacent matrix into account ; Second , the graph LASSO methods , which are commonly adopted to estimate the graph in the second phase in TOSA , encourage the sparsity of the precision matrix , whereas our method is able to encourage the sparsity of the adjacent matrix ; Third , the time complexity is reduced significantly . To be specific , the time complexity of our algorithm is O ( p2n + p3 ) , while the fastest algorithm before is O ( p5n ) ( Park , 2020 ; Gao et al. , 2020 ) . Here p and n are the numbers of nodes and samples , respectively . In addition , under proper assumptions , we show that our algorithm takes O ( log ( p ) ) or O ( p ) samples to exactly recover the DAG structure . Compared with previous TOSA algorithms , the sample complexity of our method is much better . Experimental results on synthetic data sets , proteins data sets , and knowledge base data set demonstrate the efficiency and effectiveness of our algorithm . For synthetic data sets , compared with previous baselines , our algorithm improves the performance with a significant margin and at least tens or hundreds of times faster . For the proteins data set , we achieve state-of-the-art performance . For the knowledge base data set , we can observe many reasonable structures of the discovered DAG . Our code is uploaded as supplementary material and will be open-sourced upon the acceptance of this paper . The rest of this paper is organized as follows . In Section 2 , we present our algorithm together with the theoretical analysis . In Section 3 , numerical results on synthetic data sets , proteins data set , and knowledge base data set are given . Finally , the paper is concluded in Section 4 . Notations . The symbol ‖ · ‖ stands for the Euclid norm of a vector or the spectral norm of a matrix . For a vector x = [ x1 , x2 , . . . , xp ] ∈ Rp , ‖ · ‖1 stands for the ` 1-norm , i.e. , ‖x1‖ = ∑p i=1 |xi| . For a matrix X = [ Xij ] ∈ Rm×n , ‖ · ‖2 , ∞ stands for the two-to-infinity norm , i.e. , ‖X‖2 , ∞ = max1≤i≤m ‖Xi , :‖ ; ‖ · ‖max stands for the max norm , ‖X‖max = maxi , j |Xij | . 2 CAUSAL DISCOVERY VIA CHOLESKY FACTORIZATION ( CDCF ) . In this section , we first present some preliminaries on DAG , then motivating our algorithm . Next , the detailed algorithm and theoretical guarantees for the exact recovery of the algorithm are given . 2.1 PRELIMINARIES . We assume the observed data is entailed by a DAG G = ( p , V , E ) , where p is the number of nodes , V = { v1 , ... , vp } and E = { ( vi , vj ) |i , j ∈ { 1 , ... p } } represent the set of nodes and edges , respectively . Each node vi is corresponding to a random variable Xi . The observed data matrix X = [ x1 , ... , xp ] ∈ Rn×p where xi is consisting of n i.i.d observations of the random variable Xi . The joint distribution of X is P ( X ) = ∏p i=1 P ( Xi|PaG ( Xi ) ) , where PaG ( Xi ) : = { Xj | ( vi , vj ) ∈ E } is the parents of node Xi . Given X , we seek to recover the latent DAG topology structure for the joint probability distribution ( Hoyer et al. , 2008 ; Peters et al. , 2017 ) . Generally , X is modeled via a structural equation model ( SEM ) with the form Xi = fi ( PaG ( Xi ) ) +Ni , ( i = 1 , ... , p ) , where fi is an arbitrary function representing the relation between Xi and its parents , Ni is the jointly independent noise variable . In this paper , we focus on the linear SEM defined by Xi = Xwi +Ni , ( i = 1 , ... , p ) , where wi ∈ Rp is a weighted column vector . Let W = [ w1 , . . . , wp ] ∈ Rp×p be the weighted adjacency matrix , N = [ n1 , . . . , np ] ∈ Rn×p be an additive independent noise matrix , where ni is n i.i.d observations following the noise variable Ni . Then the linear SEM model can be formulated as X = XW +N . ( 1 ) We assume the noise deviation of the child variable is approximately larger than that of its parents ( see Theorem 2.1 for details ) . Following this assumption , a classical identifiable form of SEM is the linear-Gaussian SEM , where all Ni are i.i.d . and homoscedastic ( Peters & Bühlmann , 2014 ) . 2.2 ALGORITHM MOTIVATION . As proposed in McKay et al . ( 2003 ) ; Nicholson ( 1975 ) , a graph is DAG if and only if the corresponding weighted adjacent matrix W can be decomposed into W = PTPT , ( 2 ) where P is a permutation matrix , T is a strict upper triangular matrix , i.e. , Tij = 0 for all i ≤ j . We denote the scaled permuted data matrix as X̂ = 1√ n XP , the scaled permuted noise matrix as N̂ = 1√ n NP , and the permutation order [ i∗1 , i ∗ 2 . . . , i ∗ p ] = [ 1 , 2 , . . . , p ] P . We can rewrite ( 1 ) as X̂ = X̂T + N̂ . Then it follows that X̂ = N̂ ( I − T ) −1 . ( 3 ) Let E ( N̂TN̂ ) = Σ̂2∗ = Σ̂TΣ̂ , ( 4 ) where Σ̂2∗ is the covariance matrix of the noise variables , Σ̂ is upper triangular – the Cholesky factor of Σ̂2∗ . Let the diagonal entries of Σ̂ be σ 2 i∗1 , σ2i∗2 , . . . , σ 2 i∗p . We know that σ2i∗k is the conditional variance of Ni∗k . Now using ( 3 ) and ( 4 ) , we have the covariance matrix of the permuted data : Ĉ∗ = E ( X̂TX̂ ) = ( I − T ) −TE ( N̂TN̂ ) ( I − T ) −1 = ( I − T ) −TΣ̂TΣ̂ ( I − T ) −1 . ( 5 ) Let L = ( I − T ) −TΣ̂T , then Ĉ∗ = LLT , which is the Cholesky factorization of the covariance matrix Ĉ∗ since L is lower triangular . Furthermore , we can see that the diagonal entries of L are the same as that of Σ̂ , i.e. , Lkk = σi∗k , the conditional variances of Xi∗k and Ni∗k are the same . The task becomes to find the permutation i∗ = [ i∗1 , i ∗ 2 , . . . , i ∗ p ] and an upper triangular matrix U such that U−TU−1 is a good approximation of the empirical estimation of the permuted covariance matrix Ĉ = 1nX T : ,i∗X : ,i∗ , and U satisfies some additional constraints , such as the sparsity , etc . | This paper proposes a method for recovering the causal graph of additive linear models from purely observational data, under some an identifiability assumption, that seems to be related to the forward step-size assumption of [1]. Their algorithm is based on iteratively identifying a root of the causal graph based on its conditional variance. Once a topological order is learned, the graph is constructed by thresholding the Cholesky factor of the permuted precision matrix. The proposed algorithm is then tested and compared on both synthetic and real-world data. | SP:4ecd8b71c57289caefdaac759e6cbded2f10a6bf |
Causal Discovery via Cholesky Factorization | 1 INTRODUCTION . As Schelling had said : “ The whole world is thoroughly to caught in reason , but the question is : how did it get caught in the network of reason in the first place ? ” ( Kuhn , 1942 ; Žižek & von Schelling , 1997 ) , people found that learning the causal inferences between the variables is a fundamental problem and has many applications in biology , machine learning , medicine , and economics . The problem usually is considered as finding a directed acyclic graph ( DAG ) from an observational joint distribution . Unfortunately , learning the DAG structure from the observations is proved to be an NP-hard problem ( Chickering , 1995 ; Chickering et al. , 2004 ) . The problem is generally formulated as the structural equation model ( SEM ) , where the variable of a child node is a function of its parents with additional noises . Depending on the types of functions ( linear or non-linear ) and noises ( Gaussian , Gumbel , etc . ) , there are several SEM families , e.g. , Spirtes et al . ( 2000 ) ; Geiger & Heckerman ( 1994 ) ; Shimizu et al . ( 2006 ) . In general , the graph can be identified from the joint distribution only up to Markov equivalence classes . Zhang & Hyvarinen ( 2012 ) ; Peters et al . ( 2014 ) ; Peters & Bühlmann ( 2014 ) ; Gao et al . ( 2020 ) propose several SEM forms that make the graph fully identifiable from the observed data . Various algorithms had been proposed to deal with the problem . Search-based algorithms ( Chickering , 2002 ; Friedman & Koller , 2003 ; Ramsey et al. , 2017 ; Tsamardinos et al. , 2006 ; Aragam & Zhou , 2015 ; Teyssier & Koller , 2005 ; Ye et al. , 2019 ; Lv et al. , 2021 ) generally adopt a score ( e.g. , BIC ( Peters et al. , 2014 ) score , Cholesky score ( Ye et al. , 2019 ) , remove-fill score ( Squires et al. , 2020 ) ) to measure the fitness of different graphs over data and then search over the legal DAG space to find the structure that achieves the highest score . However , exhaustive search over the legal DAG space is infeasible when p is large ( e.g. , there are 4.1e18 DAGs for p = 10 ( Sloane et al. , 2003 ) ) . Those algorithms go in quest of a trade-off between the performance and the time complexity . Since Zheng et al . ( 2018 ) proposed an approach that converts the traditional combinatorial optimization problem into a continuous program , many methods ( Yu et al. , 2019 ; Lee et al. , 2019 ; Ng et al. , 2019a ; b ; Zheng et al. , 2020 ; Lachapelle et al. , 2020 ; Squires et al. , 2020 ; Zhu et al. , 2021 ) have been proposed . Those algorithms formalize the problem as a data reconstruction task with various differentiable constraints on the DAG adjacent matrix and solve it via the augmented Lagrangian method . These algorithms are able to utilize neural networks to approximate the complicated relations between the features in the observed data and achieve good performances . Recently , reinforcement learning based algorithms ( Zhu et al. , 2020 ; Wang et al. , 2021 ) also improved the performance by exploring the possible DAG structure candidates . The algorithms update the parameters of the model via policy gradient as long as it explored a better DAG structure with a higher reward which measures how well an explored structure meets the requirement of DAG and the observed data . Topology order search algorithms ( TOSA ) ( Ghoshal & Honorio , 2017 ; 2018 ; Chen et al. , 2019 ; Gao et al. , 2020 ; Park , 2020 ) decompose the DAG learning problem into two phases : ( i ) Topology order learning via conditional variance of the observed data ; ( ii ) Graph estimation depends on the learned topology order . Those algorithms reduce the computation complexity into polynomial time and are guaranteed to recover the DAG structure under some identifiable assumptions . Our method in this paper is also a topology order search algorithm and it merges the two phases in TOSA into one . In each iteration , it attempts to find a child or a contemporary of the current node . Meanwhile , it also determines the corresponding column vector of the adjacent matrix . The mergence brings three main differences : First , the topology order in TOSA is recovered purely based on the conditional variance of the observed data , whereas our method may also take the sparsity of the adjacent matrix into account ; Second , the graph LASSO methods , which are commonly adopted to estimate the graph in the second phase in TOSA , encourage the sparsity of the precision matrix , whereas our method is able to encourage the sparsity of the adjacent matrix ; Third , the time complexity is reduced significantly . To be specific , the time complexity of our algorithm is O ( p2n + p3 ) , while the fastest algorithm before is O ( p5n ) ( Park , 2020 ; Gao et al. , 2020 ) . Here p and n are the numbers of nodes and samples , respectively . In addition , under proper assumptions , we show that our algorithm takes O ( log ( p ) ) or O ( p ) samples to exactly recover the DAG structure . Compared with previous TOSA algorithms , the sample complexity of our method is much better . Experimental results on synthetic data sets , proteins data sets , and knowledge base data set demonstrate the efficiency and effectiveness of our algorithm . For synthetic data sets , compared with previous baselines , our algorithm improves the performance with a significant margin and at least tens or hundreds of times faster . For the proteins data set , we achieve state-of-the-art performance . For the knowledge base data set , we can observe many reasonable structures of the discovered DAG . Our code is uploaded as supplementary material and will be open-sourced upon the acceptance of this paper . The rest of this paper is organized as follows . In Section 2 , we present our algorithm together with the theoretical analysis . In Section 3 , numerical results on synthetic data sets , proteins data set , and knowledge base data set are given . Finally , the paper is concluded in Section 4 . Notations . The symbol ‖ · ‖ stands for the Euclid norm of a vector or the spectral norm of a matrix . For a vector x = [ x1 , x2 , . . . , xp ] ∈ Rp , ‖ · ‖1 stands for the ` 1-norm , i.e. , ‖x1‖ = ∑p i=1 |xi| . For a matrix X = [ Xij ] ∈ Rm×n , ‖ · ‖2 , ∞ stands for the two-to-infinity norm , i.e. , ‖X‖2 , ∞ = max1≤i≤m ‖Xi , :‖ ; ‖ · ‖max stands for the max norm , ‖X‖max = maxi , j |Xij | . 2 CAUSAL DISCOVERY VIA CHOLESKY FACTORIZATION ( CDCF ) . In this section , we first present some preliminaries on DAG , then motivating our algorithm . Next , the detailed algorithm and theoretical guarantees for the exact recovery of the algorithm are given . 2.1 PRELIMINARIES . We assume the observed data is entailed by a DAG G = ( p , V , E ) , where p is the number of nodes , V = { v1 , ... , vp } and E = { ( vi , vj ) |i , j ∈ { 1 , ... p } } represent the set of nodes and edges , respectively . Each node vi is corresponding to a random variable Xi . The observed data matrix X = [ x1 , ... , xp ] ∈ Rn×p where xi is consisting of n i.i.d observations of the random variable Xi . The joint distribution of X is P ( X ) = ∏p i=1 P ( Xi|PaG ( Xi ) ) , where PaG ( Xi ) : = { Xj | ( vi , vj ) ∈ E } is the parents of node Xi . Given X , we seek to recover the latent DAG topology structure for the joint probability distribution ( Hoyer et al. , 2008 ; Peters et al. , 2017 ) . Generally , X is modeled via a structural equation model ( SEM ) with the form Xi = fi ( PaG ( Xi ) ) +Ni , ( i = 1 , ... , p ) , where fi is an arbitrary function representing the relation between Xi and its parents , Ni is the jointly independent noise variable . In this paper , we focus on the linear SEM defined by Xi = Xwi +Ni , ( i = 1 , ... , p ) , where wi ∈ Rp is a weighted column vector . Let W = [ w1 , . . . , wp ] ∈ Rp×p be the weighted adjacency matrix , N = [ n1 , . . . , np ] ∈ Rn×p be an additive independent noise matrix , where ni is n i.i.d observations following the noise variable Ni . Then the linear SEM model can be formulated as X = XW +N . ( 1 ) We assume the noise deviation of the child variable is approximately larger than that of its parents ( see Theorem 2.1 for details ) . Following this assumption , a classical identifiable form of SEM is the linear-Gaussian SEM , where all Ni are i.i.d . and homoscedastic ( Peters & Bühlmann , 2014 ) . 2.2 ALGORITHM MOTIVATION . As proposed in McKay et al . ( 2003 ) ; Nicholson ( 1975 ) , a graph is DAG if and only if the corresponding weighted adjacent matrix W can be decomposed into W = PTPT , ( 2 ) where P is a permutation matrix , T is a strict upper triangular matrix , i.e. , Tij = 0 for all i ≤ j . We denote the scaled permuted data matrix as X̂ = 1√ n XP , the scaled permuted noise matrix as N̂ = 1√ n NP , and the permutation order [ i∗1 , i ∗ 2 . . . , i ∗ p ] = [ 1 , 2 , . . . , p ] P . We can rewrite ( 1 ) as X̂ = X̂T + N̂ . Then it follows that X̂ = N̂ ( I − T ) −1 . ( 3 ) Let E ( N̂TN̂ ) = Σ̂2∗ = Σ̂TΣ̂ , ( 4 ) where Σ̂2∗ is the covariance matrix of the noise variables , Σ̂ is upper triangular – the Cholesky factor of Σ̂2∗ . Let the diagonal entries of Σ̂ be σ 2 i∗1 , σ2i∗2 , . . . , σ 2 i∗p . We know that σ2i∗k is the conditional variance of Ni∗k . Now using ( 3 ) and ( 4 ) , we have the covariance matrix of the permuted data : Ĉ∗ = E ( X̂TX̂ ) = ( I − T ) −TE ( N̂TN̂ ) ( I − T ) −1 = ( I − T ) −TΣ̂TΣ̂ ( I − T ) −1 . ( 5 ) Let L = ( I − T ) −TΣ̂T , then Ĉ∗ = LLT , which is the Cholesky factorization of the covariance matrix Ĉ∗ since L is lower triangular . Furthermore , we can see that the diagonal entries of L are the same as that of Σ̂ , i.e. , Lkk = σi∗k , the conditional variances of Xi∗k and Ni∗k are the same . The task becomes to find the permutation i∗ = [ i∗1 , i ∗ 2 , . . . , i ∗ p ] and an upper triangular matrix U such that U−TU−1 is a good approximation of the empirical estimation of the permuted covariance matrix Ĉ = 1nX T : ,i∗X : ,i∗ , and U satisfies some additional constraints , such as the sparsity , etc . | The paper works on causal discovery in the linear Gaussian case, on which the identifiability is based on (Peters & Bühlmann, 2014). The proposed method is based on Cholesky factorization and has better efficiency/time-complexity performance than the related state-of-art methods. Moreover, it also provides a theoretical analysis of the resulted graph, which is appreciated. The experiments can support the claims. | SP:4ecd8b71c57289caefdaac759e6cbded2f10a6bf |
Causal Discovery via Cholesky Factorization | 1 INTRODUCTION . As Schelling had said : “ The whole world is thoroughly to caught in reason , but the question is : how did it get caught in the network of reason in the first place ? ” ( Kuhn , 1942 ; Žižek & von Schelling , 1997 ) , people found that learning the causal inferences between the variables is a fundamental problem and has many applications in biology , machine learning , medicine , and economics . The problem usually is considered as finding a directed acyclic graph ( DAG ) from an observational joint distribution . Unfortunately , learning the DAG structure from the observations is proved to be an NP-hard problem ( Chickering , 1995 ; Chickering et al. , 2004 ) . The problem is generally formulated as the structural equation model ( SEM ) , where the variable of a child node is a function of its parents with additional noises . Depending on the types of functions ( linear or non-linear ) and noises ( Gaussian , Gumbel , etc . ) , there are several SEM families , e.g. , Spirtes et al . ( 2000 ) ; Geiger & Heckerman ( 1994 ) ; Shimizu et al . ( 2006 ) . In general , the graph can be identified from the joint distribution only up to Markov equivalence classes . Zhang & Hyvarinen ( 2012 ) ; Peters et al . ( 2014 ) ; Peters & Bühlmann ( 2014 ) ; Gao et al . ( 2020 ) propose several SEM forms that make the graph fully identifiable from the observed data . Various algorithms had been proposed to deal with the problem . Search-based algorithms ( Chickering , 2002 ; Friedman & Koller , 2003 ; Ramsey et al. , 2017 ; Tsamardinos et al. , 2006 ; Aragam & Zhou , 2015 ; Teyssier & Koller , 2005 ; Ye et al. , 2019 ; Lv et al. , 2021 ) generally adopt a score ( e.g. , BIC ( Peters et al. , 2014 ) score , Cholesky score ( Ye et al. , 2019 ) , remove-fill score ( Squires et al. , 2020 ) ) to measure the fitness of different graphs over data and then search over the legal DAG space to find the structure that achieves the highest score . However , exhaustive search over the legal DAG space is infeasible when p is large ( e.g. , there are 4.1e18 DAGs for p = 10 ( Sloane et al. , 2003 ) ) . Those algorithms go in quest of a trade-off between the performance and the time complexity . Since Zheng et al . ( 2018 ) proposed an approach that converts the traditional combinatorial optimization problem into a continuous program , many methods ( Yu et al. , 2019 ; Lee et al. , 2019 ; Ng et al. , 2019a ; b ; Zheng et al. , 2020 ; Lachapelle et al. , 2020 ; Squires et al. , 2020 ; Zhu et al. , 2021 ) have been proposed . Those algorithms formalize the problem as a data reconstruction task with various differentiable constraints on the DAG adjacent matrix and solve it via the augmented Lagrangian method . These algorithms are able to utilize neural networks to approximate the complicated relations between the features in the observed data and achieve good performances . Recently , reinforcement learning based algorithms ( Zhu et al. , 2020 ; Wang et al. , 2021 ) also improved the performance by exploring the possible DAG structure candidates . The algorithms update the parameters of the model via policy gradient as long as it explored a better DAG structure with a higher reward which measures how well an explored structure meets the requirement of DAG and the observed data . Topology order search algorithms ( TOSA ) ( Ghoshal & Honorio , 2017 ; 2018 ; Chen et al. , 2019 ; Gao et al. , 2020 ; Park , 2020 ) decompose the DAG learning problem into two phases : ( i ) Topology order learning via conditional variance of the observed data ; ( ii ) Graph estimation depends on the learned topology order . Those algorithms reduce the computation complexity into polynomial time and are guaranteed to recover the DAG structure under some identifiable assumptions . Our method in this paper is also a topology order search algorithm and it merges the two phases in TOSA into one . In each iteration , it attempts to find a child or a contemporary of the current node . Meanwhile , it also determines the corresponding column vector of the adjacent matrix . The mergence brings three main differences : First , the topology order in TOSA is recovered purely based on the conditional variance of the observed data , whereas our method may also take the sparsity of the adjacent matrix into account ; Second , the graph LASSO methods , which are commonly adopted to estimate the graph in the second phase in TOSA , encourage the sparsity of the precision matrix , whereas our method is able to encourage the sparsity of the adjacent matrix ; Third , the time complexity is reduced significantly . To be specific , the time complexity of our algorithm is O ( p2n + p3 ) , while the fastest algorithm before is O ( p5n ) ( Park , 2020 ; Gao et al. , 2020 ) . Here p and n are the numbers of nodes and samples , respectively . In addition , under proper assumptions , we show that our algorithm takes O ( log ( p ) ) or O ( p ) samples to exactly recover the DAG structure . Compared with previous TOSA algorithms , the sample complexity of our method is much better . Experimental results on synthetic data sets , proteins data sets , and knowledge base data set demonstrate the efficiency and effectiveness of our algorithm . For synthetic data sets , compared with previous baselines , our algorithm improves the performance with a significant margin and at least tens or hundreds of times faster . For the proteins data set , we achieve state-of-the-art performance . For the knowledge base data set , we can observe many reasonable structures of the discovered DAG . Our code is uploaded as supplementary material and will be open-sourced upon the acceptance of this paper . The rest of this paper is organized as follows . In Section 2 , we present our algorithm together with the theoretical analysis . In Section 3 , numerical results on synthetic data sets , proteins data set , and knowledge base data set are given . Finally , the paper is concluded in Section 4 . Notations . The symbol ‖ · ‖ stands for the Euclid norm of a vector or the spectral norm of a matrix . For a vector x = [ x1 , x2 , . . . , xp ] ∈ Rp , ‖ · ‖1 stands for the ` 1-norm , i.e. , ‖x1‖ = ∑p i=1 |xi| . For a matrix X = [ Xij ] ∈ Rm×n , ‖ · ‖2 , ∞ stands for the two-to-infinity norm , i.e. , ‖X‖2 , ∞ = max1≤i≤m ‖Xi , :‖ ; ‖ · ‖max stands for the max norm , ‖X‖max = maxi , j |Xij | . 2 CAUSAL DISCOVERY VIA CHOLESKY FACTORIZATION ( CDCF ) . In this section , we first present some preliminaries on DAG , then motivating our algorithm . Next , the detailed algorithm and theoretical guarantees for the exact recovery of the algorithm are given . 2.1 PRELIMINARIES . We assume the observed data is entailed by a DAG G = ( p , V , E ) , where p is the number of nodes , V = { v1 , ... , vp } and E = { ( vi , vj ) |i , j ∈ { 1 , ... p } } represent the set of nodes and edges , respectively . Each node vi is corresponding to a random variable Xi . The observed data matrix X = [ x1 , ... , xp ] ∈ Rn×p where xi is consisting of n i.i.d observations of the random variable Xi . The joint distribution of X is P ( X ) = ∏p i=1 P ( Xi|PaG ( Xi ) ) , where PaG ( Xi ) : = { Xj | ( vi , vj ) ∈ E } is the parents of node Xi . Given X , we seek to recover the latent DAG topology structure for the joint probability distribution ( Hoyer et al. , 2008 ; Peters et al. , 2017 ) . Generally , X is modeled via a structural equation model ( SEM ) with the form Xi = fi ( PaG ( Xi ) ) +Ni , ( i = 1 , ... , p ) , where fi is an arbitrary function representing the relation between Xi and its parents , Ni is the jointly independent noise variable . In this paper , we focus on the linear SEM defined by Xi = Xwi +Ni , ( i = 1 , ... , p ) , where wi ∈ Rp is a weighted column vector . Let W = [ w1 , . . . , wp ] ∈ Rp×p be the weighted adjacency matrix , N = [ n1 , . . . , np ] ∈ Rn×p be an additive independent noise matrix , where ni is n i.i.d observations following the noise variable Ni . Then the linear SEM model can be formulated as X = XW +N . ( 1 ) We assume the noise deviation of the child variable is approximately larger than that of its parents ( see Theorem 2.1 for details ) . Following this assumption , a classical identifiable form of SEM is the linear-Gaussian SEM , where all Ni are i.i.d . and homoscedastic ( Peters & Bühlmann , 2014 ) . 2.2 ALGORITHM MOTIVATION . As proposed in McKay et al . ( 2003 ) ; Nicholson ( 1975 ) , a graph is DAG if and only if the corresponding weighted adjacent matrix W can be decomposed into W = PTPT , ( 2 ) where P is a permutation matrix , T is a strict upper triangular matrix , i.e. , Tij = 0 for all i ≤ j . We denote the scaled permuted data matrix as X̂ = 1√ n XP , the scaled permuted noise matrix as N̂ = 1√ n NP , and the permutation order [ i∗1 , i ∗ 2 . . . , i ∗ p ] = [ 1 , 2 , . . . , p ] P . We can rewrite ( 1 ) as X̂ = X̂T + N̂ . Then it follows that X̂ = N̂ ( I − T ) −1 . ( 3 ) Let E ( N̂TN̂ ) = Σ̂2∗ = Σ̂TΣ̂ , ( 4 ) where Σ̂2∗ is the covariance matrix of the noise variables , Σ̂ is upper triangular – the Cholesky factor of Σ̂2∗ . Let the diagonal entries of Σ̂ be σ 2 i∗1 , σ2i∗2 , . . . , σ 2 i∗p . We know that σ2i∗k is the conditional variance of Ni∗k . Now using ( 3 ) and ( 4 ) , we have the covariance matrix of the permuted data : Ĉ∗ = E ( X̂TX̂ ) = ( I − T ) −TE ( N̂TN̂ ) ( I − T ) −1 = ( I − T ) −TΣ̂TΣ̂ ( I − T ) −1 . ( 5 ) Let L = ( I − T ) −TΣ̂T , then Ĉ∗ = LLT , which is the Cholesky factorization of the covariance matrix Ĉ∗ since L is lower triangular . Furthermore , we can see that the diagonal entries of L are the same as that of Σ̂ , i.e. , Lkk = σi∗k , the conditional variances of Xi∗k and Ni∗k are the same . The task becomes to find the permutation i∗ = [ i∗1 , i ∗ 2 , . . . , i ∗ p ] and an upper triangular matrix U such that U−TU−1 is a good approximation of the empirical estimation of the permuted covariance matrix Ĉ = 1nX T : ,i∗X : ,i∗ , and U satisfies some additional constraints , such as the sparsity , etc . | This paper develops a new algorithm for learning linear structural equation models using cholesky factorization. This paper explains that the proposed algorithm is consistent in high dimensional settings and computational feasible. This paper thoroughly discusses the recent studies of learning linear SEMs and provide a clear motivation. Furthermore, this paper provides a lot of numerical experiments to support its theoretical findings. | SP:4ecd8b71c57289caefdaac759e6cbded2f10a6bf |
Representing value functions in power systems using parametric network series | We describe a novel architecture for modeling the cost-to-go function in approximate dynamic programming problems involving country-scale , real-life electrical power generation systems . Our particular scenario features a heterogeneous power grid including dozens of renewable energy plants as well as traditional ones ; the corresponding state space is in the order of thousands of variables of different types and ranges . While Artificial Neural Networks are a natural choice for modeling such complex cost functions , their effective use hinges on exploiting the particular structure of the problem which , in this case , involves seasonal patterns at many different levels ( day , week , year ) . Our proposed model consists of a series of neural networks whose parameters are themselves parametric functions of a time variable . The parameters of such functions are learned during training along with the network parameters themselves . The new method is shown to outperform the standard backward dynamic programming program currently in use , both in terms of the objective function ( total cost of operation over a period ) and computational cost . Last , but not least , the resulting model is readily interpretable in terms of the parameters of the learned functions , which capture general trends of the problem , providing useful insight for future improvements . Keywords : energy dispatch , approximate dynamic programming , cost function approximation , artificial neural networks , parametric network series , reinforcement learning . 1 INTRODUCTION . The operation of electrical energy systems involving a mixture of thermal and renewable sources is particularly challenging due to a number of factors . The value of water stored in the dams needs to be assessed constantly depending on the availability of other sources and short , middle and long term forecasts , which are highly variable and depend on the seasons in complex ways . Other renewable sources such as wind and solar power also depend on highly variable factors . Thermal power plants , on the other hand , need to be bootstrapped over relatively long periods before reaching full capacity , so that the effect of turning them on and off also has lasting implications . Last but not least , the demand of electricity is highly variable and exhibits complex seasonal patterns at different scales . The concrete case that we are dealing with is the country-wide energy dispatch of Uruguay . This paper presents the preliminary implementation of a novel method for computing the optimal operation method of the Uruguayan grid . The method has been implemented within the Electric Energy Systems Platform ( SimSEE ) .1 The SimSEE system is currently in use by the Electric Market Administration ( ADME ) of Uruguay for continuously programming the optimal operation of the Uruguayan electrical system at several different time scales . Besides Uruguay , the SimSEE system is currently in use in República Dominicana and Belize . Besides optimizing the schedule , SimSEE is also capable of producing detailed simulations ( through precise physical models ) of the evolution of the system in terms of the actual continuous state-space . This feature is key in the development of our proposed method , which can be seen as a plug-in replacement for the operation optimization component of SimSEE . 1 { SimSEE } https : //simsee.org Methods based on Approximate Dynamic Programming ( ADP ) ( Bertsekas & Tsitsiklis , 1996 ; Sutton , 1995 ) , are the usual choice for optimizing the operation of energy systems . These methods rely on estimating the cost of operation for any possible initial state of the system . Unfortunately , when the number of state variables is large , ADP methods suffer from the so called Bellman ’ s curse of dimensionality ( Bellman , 1957 ) , meaning that the number of states and actions on which the cost function needs to be evaluated grows prohibitively large and thus can not be reliably estimated . This is true even for sophisticated variants of ADP such as Stochastic Dual Dynamic Programming ( SDDP ) ( Pereira & Pinto , 1991 ) . Moreover , the SDDP method is particularly sensitive to inputs with high variability such as renewable-energy sources . The aforementioned problem arises when attempting to explicitly evaluate all possible values of the state variable , whose number grows exponentially with the dimension of the state space . This is obvious even if the state variables are discrete . When the variables are continuous , traditional ADP methods transform them into discrete variables via some form of quantization . In such scenarios , a common strategy is to employ dimensionality reduction techniques such as Principal Component Analysis ( PCA ) ( Jolliffe , 2005 ) . Of course , the price of quantization and dimensionality reduction is that the true value function can only be evaluated in an approximate way . The current method used by SimSEE is a traditional Backward-ADP recursion applied over a quantized , reduced state-space of the whole Uruguayan system . The recent diversification of the power generation matrix has exerted a significant stress on the aforementioned method . This is particularly so for the short term operation , which is re-computed hourly . 1.1 VALUE FUNCTION APPROXIMATION . A recent alternative approach to the above techniques is to construct an implicit representation of the value function ( Powell , 2011 ; Sutton & Barto , 2018 ) . Instead of reducing the dimensions and/or quantizing the state space , a continuous model is built in the original state space based on a set of values of the function evaluated at arbitrary positions . Here , a rich set of tools from Approximation Theory is available to choose , construct and evaluate the appropriate approximation method for a particular task . Kernel methods ( Xu et al. , 2014 ) are a popular choice which is backed by the elegant theory of Reproducing Kernel Hilbert Spaces ( Paulsen & Raghupathi , 2016 ) . Another natural family of methods , more flexible , but also harder to characterize , is that of artificial neural networks ( ANN ) , which are well known for being universal function approximators ( R.Barron , 1994 ) . The above methods , however , have their drawbacks too . For instance , it has been shown that , if no additional measures are taken , the number of samples of the value function required for the overall approximation-based ADP method to converge can be even larger than that required by using traditional , explicit evaluation methods ( Du et al. , 2020 ) . Luckily , such requirement can be significantly relaxed if appropriate variance reduction techniques are applied , e.g. , Common Random Numbers ( Christophe et al. , 2015 ) . In the particular case of ANN approximators applied to an heterogeneous energy system , the above measure might not be enough . The great flexibility of ANNs also implies a great sensitivity to the input data , which in our case is highly variable due to the random nature of renewable energy sources . In this challenging scenario , further measures need to be taken in order to obtain parsimonious approximations . 1.2 PARAMETRIC NETWORK SERIES . Luckily for us , the signals and processes involved in the planning of energy dispatch usually exhibit regular patterns . This can be exploited to impose parsimonious approximations which extrapolate reasonably to unseen states . Our proposed method combines the flexibility of ANNs with prior information about the problem . In a nutshell , the value function , which is a function of state and time , is approximated by one neural network per time slot . The architecture of the network is the same for all time slots , reflecting the fact that the structure of the system itself does not change . The parameters do vary across networks , albeit in a controlled fashion : for any given link in the architecture , the corresponding weight is a function of time . The general idea is depicted in Figure 1 . 1.3 WHY NOT A SINGLE NET ? . Naturally , one could use a single parametric function to model the whole value function across all time steps . The reason for us to opt for a sequence of smaller models is again computational performance : instead of computing the whole approximation from scratch at each time step ( usually an hour ) , we can quickly update the overall model by dropping the first model ( at t = 1 ) , adding a new one at the end , and running a few iterations . We call this a sliding window strategy , in reference to similar modeling patterns used in other fields . 1.4 RELATED WORKS . As mentioned , the use of approximation in value functions is an established technique described in classic textbooks such as ( Bertsekas & Tsitsiklis , 1996 ; Powell , 2011 ; Sutton & Barto , 2018 ) . Also , incorporating time dependence in approximation models and , in particular , artificial neural networks , is an active line of research . The main difference between the related works in this matter is in how the time dependence is imbued into the architecture . Recurrent Neural Networks ( RNNs ) are widely deployed to capture time-dependent patterns using their current widely adopted incarnation , the so called Long-Short Term Memory ( LSTM ) networks ( Hochreiter & Schmidhuber , 1997 ) . In these models , the hidden layer outputs depend not only on their current input , but also on their own previous output , in a way similar to a recursive filter . Such architectures are able to produce outputs which depend not only on the current input , but on past inputs as well . However , these kind of architectures are incapable of capturing periodic patterns , especially if such patterns have low frequencies , such as periodic seasonal patterns . Another widespread technique to represent time in ANNs is generally known as positional encoding ( see Zheng et al . ( 2021 ) for a recent review on the subject ) . The typical positional encoding method involves auxiliary sinusoidal inputs to the network , usually several of them , with different frequencies . Although their typical use is in the context of language translation ( see e.g . ( Gehring et al. , 2017 ) ) , where the frequencies are high ( letter , word , phrase , a few time steps ) , nothing prevents one from using such techniques in a scenario such as the one described in this paper . The main difference between the “ positional encoding ” approach and our proposed method lies in the way that this periodical information is fed into the system . Whereas the former uses these auxiliary signals as inputs to the whole network , and their influence on the weights is implicitly learned through standard backpropagation techniques , our method imposes a periodic pattern explicitly on the weights themselves , giving them some room to accomodate for the particularities not captured by the periodic model . 1.5 CONTRIBUTIONS . In summary , the main contributions of this work are two . First , we develop a novel architecture for learning value functions in approximate dynamic programming problems ; the novelty lies in the use of a series of neural networks of identical architecture , one per time slot , where the weights are functions of time rather whose parameters are learned at training time . Second , we demonstrate the use of the proposed model on a real-life , complex case , where we can evaluate the actual performance of the model in terms of real operation cost savings . 1.6 DOCUMENT ORGANIZATION . The rest of the document is organized as follows . In Section 2 we provide a formal introduction to the problem and the notation used throughout the paper . Section 3 introduces the problem of electric systems operation . The proposed method is described in detail in Section 4.4 . Section 5 shows a detailed comparison between the current model in production and the proposed method , and discusses the results . Concluding remarks are given in Section 6 . | This paper provides a deep learning-based method to estimate value functions for multi-step dispatch on a power grid. This method entails training a different neural network to approximate the value function for each time step within a fixed horizon; supervision is provided via point-wise estimates of the states visited within rolled-out trajectories, as estimated via compound TD estimation. The method is demonstrated to have comparable performance to the "classic" Bellman iteration-based method that is currently used within the SimSEE dispatch system (currently employed by the Uruguayan electricity system operator), while running significantly (~150x) faster. | SP:bce1e3cda9067b6e3e14fca3143081e39763d733 |
Representing value functions in power systems using parametric network series | We describe a novel architecture for modeling the cost-to-go function in approximate dynamic programming problems involving country-scale , real-life electrical power generation systems . Our particular scenario features a heterogeneous power grid including dozens of renewable energy plants as well as traditional ones ; the corresponding state space is in the order of thousands of variables of different types and ranges . While Artificial Neural Networks are a natural choice for modeling such complex cost functions , their effective use hinges on exploiting the particular structure of the problem which , in this case , involves seasonal patterns at many different levels ( day , week , year ) . Our proposed model consists of a series of neural networks whose parameters are themselves parametric functions of a time variable . The parameters of such functions are learned during training along with the network parameters themselves . The new method is shown to outperform the standard backward dynamic programming program currently in use , both in terms of the objective function ( total cost of operation over a period ) and computational cost . Last , but not least , the resulting model is readily interpretable in terms of the parameters of the learned functions , which capture general trends of the problem , providing useful insight for future improvements . Keywords : energy dispatch , approximate dynamic programming , cost function approximation , artificial neural networks , parametric network series , reinforcement learning . 1 INTRODUCTION . The operation of electrical energy systems involving a mixture of thermal and renewable sources is particularly challenging due to a number of factors . The value of water stored in the dams needs to be assessed constantly depending on the availability of other sources and short , middle and long term forecasts , which are highly variable and depend on the seasons in complex ways . Other renewable sources such as wind and solar power also depend on highly variable factors . Thermal power plants , on the other hand , need to be bootstrapped over relatively long periods before reaching full capacity , so that the effect of turning them on and off also has lasting implications . Last but not least , the demand of electricity is highly variable and exhibits complex seasonal patterns at different scales . The concrete case that we are dealing with is the country-wide energy dispatch of Uruguay . This paper presents the preliminary implementation of a novel method for computing the optimal operation method of the Uruguayan grid . The method has been implemented within the Electric Energy Systems Platform ( SimSEE ) .1 The SimSEE system is currently in use by the Electric Market Administration ( ADME ) of Uruguay for continuously programming the optimal operation of the Uruguayan electrical system at several different time scales . Besides Uruguay , the SimSEE system is currently in use in República Dominicana and Belize . Besides optimizing the schedule , SimSEE is also capable of producing detailed simulations ( through precise physical models ) of the evolution of the system in terms of the actual continuous state-space . This feature is key in the development of our proposed method , which can be seen as a plug-in replacement for the operation optimization component of SimSEE . 1 { SimSEE } https : //simsee.org Methods based on Approximate Dynamic Programming ( ADP ) ( Bertsekas & Tsitsiklis , 1996 ; Sutton , 1995 ) , are the usual choice for optimizing the operation of energy systems . These methods rely on estimating the cost of operation for any possible initial state of the system . Unfortunately , when the number of state variables is large , ADP methods suffer from the so called Bellman ’ s curse of dimensionality ( Bellman , 1957 ) , meaning that the number of states and actions on which the cost function needs to be evaluated grows prohibitively large and thus can not be reliably estimated . This is true even for sophisticated variants of ADP such as Stochastic Dual Dynamic Programming ( SDDP ) ( Pereira & Pinto , 1991 ) . Moreover , the SDDP method is particularly sensitive to inputs with high variability such as renewable-energy sources . The aforementioned problem arises when attempting to explicitly evaluate all possible values of the state variable , whose number grows exponentially with the dimension of the state space . This is obvious even if the state variables are discrete . When the variables are continuous , traditional ADP methods transform them into discrete variables via some form of quantization . In such scenarios , a common strategy is to employ dimensionality reduction techniques such as Principal Component Analysis ( PCA ) ( Jolliffe , 2005 ) . Of course , the price of quantization and dimensionality reduction is that the true value function can only be evaluated in an approximate way . The current method used by SimSEE is a traditional Backward-ADP recursion applied over a quantized , reduced state-space of the whole Uruguayan system . The recent diversification of the power generation matrix has exerted a significant stress on the aforementioned method . This is particularly so for the short term operation , which is re-computed hourly . 1.1 VALUE FUNCTION APPROXIMATION . A recent alternative approach to the above techniques is to construct an implicit representation of the value function ( Powell , 2011 ; Sutton & Barto , 2018 ) . Instead of reducing the dimensions and/or quantizing the state space , a continuous model is built in the original state space based on a set of values of the function evaluated at arbitrary positions . Here , a rich set of tools from Approximation Theory is available to choose , construct and evaluate the appropriate approximation method for a particular task . Kernel methods ( Xu et al. , 2014 ) are a popular choice which is backed by the elegant theory of Reproducing Kernel Hilbert Spaces ( Paulsen & Raghupathi , 2016 ) . Another natural family of methods , more flexible , but also harder to characterize , is that of artificial neural networks ( ANN ) , which are well known for being universal function approximators ( R.Barron , 1994 ) . The above methods , however , have their drawbacks too . For instance , it has been shown that , if no additional measures are taken , the number of samples of the value function required for the overall approximation-based ADP method to converge can be even larger than that required by using traditional , explicit evaluation methods ( Du et al. , 2020 ) . Luckily , such requirement can be significantly relaxed if appropriate variance reduction techniques are applied , e.g. , Common Random Numbers ( Christophe et al. , 2015 ) . In the particular case of ANN approximators applied to an heterogeneous energy system , the above measure might not be enough . The great flexibility of ANNs also implies a great sensitivity to the input data , which in our case is highly variable due to the random nature of renewable energy sources . In this challenging scenario , further measures need to be taken in order to obtain parsimonious approximations . 1.2 PARAMETRIC NETWORK SERIES . Luckily for us , the signals and processes involved in the planning of energy dispatch usually exhibit regular patterns . This can be exploited to impose parsimonious approximations which extrapolate reasonably to unseen states . Our proposed method combines the flexibility of ANNs with prior information about the problem . In a nutshell , the value function , which is a function of state and time , is approximated by one neural network per time slot . The architecture of the network is the same for all time slots , reflecting the fact that the structure of the system itself does not change . The parameters do vary across networks , albeit in a controlled fashion : for any given link in the architecture , the corresponding weight is a function of time . The general idea is depicted in Figure 1 . 1.3 WHY NOT A SINGLE NET ? . Naturally , one could use a single parametric function to model the whole value function across all time steps . The reason for us to opt for a sequence of smaller models is again computational performance : instead of computing the whole approximation from scratch at each time step ( usually an hour ) , we can quickly update the overall model by dropping the first model ( at t = 1 ) , adding a new one at the end , and running a few iterations . We call this a sliding window strategy , in reference to similar modeling patterns used in other fields . 1.4 RELATED WORKS . As mentioned , the use of approximation in value functions is an established technique described in classic textbooks such as ( Bertsekas & Tsitsiklis , 1996 ; Powell , 2011 ; Sutton & Barto , 2018 ) . Also , incorporating time dependence in approximation models and , in particular , artificial neural networks , is an active line of research . The main difference between the related works in this matter is in how the time dependence is imbued into the architecture . Recurrent Neural Networks ( RNNs ) are widely deployed to capture time-dependent patterns using their current widely adopted incarnation , the so called Long-Short Term Memory ( LSTM ) networks ( Hochreiter & Schmidhuber , 1997 ) . In these models , the hidden layer outputs depend not only on their current input , but also on their own previous output , in a way similar to a recursive filter . Such architectures are able to produce outputs which depend not only on the current input , but on past inputs as well . However , these kind of architectures are incapable of capturing periodic patterns , especially if such patterns have low frequencies , such as periodic seasonal patterns . Another widespread technique to represent time in ANNs is generally known as positional encoding ( see Zheng et al . ( 2021 ) for a recent review on the subject ) . The typical positional encoding method involves auxiliary sinusoidal inputs to the network , usually several of them , with different frequencies . Although their typical use is in the context of language translation ( see e.g . ( Gehring et al. , 2017 ) ) , where the frequencies are high ( letter , word , phrase , a few time steps ) , nothing prevents one from using such techniques in a scenario such as the one described in this paper . The main difference between the “ positional encoding ” approach and our proposed method lies in the way that this periodical information is fed into the system . Whereas the former uses these auxiliary signals as inputs to the whole network , and their influence on the weights is implicitly learned through standard backpropagation techniques , our method imposes a periodic pattern explicitly on the weights themselves , giving them some room to accomodate for the particularities not captured by the periodic model . 1.5 CONTRIBUTIONS . In summary , the main contributions of this work are two . First , we develop a novel architecture for learning value functions in approximate dynamic programming problems ; the novelty lies in the use of a series of neural networks of identical architecture , one per time slot , where the weights are functions of time rather whose parameters are learned at training time . Second , we demonstrate the use of the proposed model on a real-life , complex case , where we can evaluate the actual performance of the model in terms of real operation cost savings . 1.6 DOCUMENT ORGANIZATION . The rest of the document is organized as follows . In Section 2 we provide a formal introduction to the problem and the notation used throughout the paper . Section 3 introduces the problem of electric systems operation . The proposed method is described in detail in Section 4.4 . Section 5 shows a detailed comparison between the current model in production and the proposed method , and discusses the results . Concluding remarks are given in Section 6 . | The paper provides an approximation of the cost-to-go for a particular system. The particular system is the Uruguayan system. The results are compared to the approximate dynamic programming as provided in some classical books that are cited in the paper. | SP:bce1e3cda9067b6e3e14fca3143081e39763d733 |
Representing value functions in power systems using parametric network series | We describe a novel architecture for modeling the cost-to-go function in approximate dynamic programming problems involving country-scale , real-life electrical power generation systems . Our particular scenario features a heterogeneous power grid including dozens of renewable energy plants as well as traditional ones ; the corresponding state space is in the order of thousands of variables of different types and ranges . While Artificial Neural Networks are a natural choice for modeling such complex cost functions , their effective use hinges on exploiting the particular structure of the problem which , in this case , involves seasonal patterns at many different levels ( day , week , year ) . Our proposed model consists of a series of neural networks whose parameters are themselves parametric functions of a time variable . The parameters of such functions are learned during training along with the network parameters themselves . The new method is shown to outperform the standard backward dynamic programming program currently in use , both in terms of the objective function ( total cost of operation over a period ) and computational cost . Last , but not least , the resulting model is readily interpretable in terms of the parameters of the learned functions , which capture general trends of the problem , providing useful insight for future improvements . Keywords : energy dispatch , approximate dynamic programming , cost function approximation , artificial neural networks , parametric network series , reinforcement learning . 1 INTRODUCTION . The operation of electrical energy systems involving a mixture of thermal and renewable sources is particularly challenging due to a number of factors . The value of water stored in the dams needs to be assessed constantly depending on the availability of other sources and short , middle and long term forecasts , which are highly variable and depend on the seasons in complex ways . Other renewable sources such as wind and solar power also depend on highly variable factors . Thermal power plants , on the other hand , need to be bootstrapped over relatively long periods before reaching full capacity , so that the effect of turning them on and off also has lasting implications . Last but not least , the demand of electricity is highly variable and exhibits complex seasonal patterns at different scales . The concrete case that we are dealing with is the country-wide energy dispatch of Uruguay . This paper presents the preliminary implementation of a novel method for computing the optimal operation method of the Uruguayan grid . The method has been implemented within the Electric Energy Systems Platform ( SimSEE ) .1 The SimSEE system is currently in use by the Electric Market Administration ( ADME ) of Uruguay for continuously programming the optimal operation of the Uruguayan electrical system at several different time scales . Besides Uruguay , the SimSEE system is currently in use in República Dominicana and Belize . Besides optimizing the schedule , SimSEE is also capable of producing detailed simulations ( through precise physical models ) of the evolution of the system in terms of the actual continuous state-space . This feature is key in the development of our proposed method , which can be seen as a plug-in replacement for the operation optimization component of SimSEE . 1 { SimSEE } https : //simsee.org Methods based on Approximate Dynamic Programming ( ADP ) ( Bertsekas & Tsitsiklis , 1996 ; Sutton , 1995 ) , are the usual choice for optimizing the operation of energy systems . These methods rely on estimating the cost of operation for any possible initial state of the system . Unfortunately , when the number of state variables is large , ADP methods suffer from the so called Bellman ’ s curse of dimensionality ( Bellman , 1957 ) , meaning that the number of states and actions on which the cost function needs to be evaluated grows prohibitively large and thus can not be reliably estimated . This is true even for sophisticated variants of ADP such as Stochastic Dual Dynamic Programming ( SDDP ) ( Pereira & Pinto , 1991 ) . Moreover , the SDDP method is particularly sensitive to inputs with high variability such as renewable-energy sources . The aforementioned problem arises when attempting to explicitly evaluate all possible values of the state variable , whose number grows exponentially with the dimension of the state space . This is obvious even if the state variables are discrete . When the variables are continuous , traditional ADP methods transform them into discrete variables via some form of quantization . In such scenarios , a common strategy is to employ dimensionality reduction techniques such as Principal Component Analysis ( PCA ) ( Jolliffe , 2005 ) . Of course , the price of quantization and dimensionality reduction is that the true value function can only be evaluated in an approximate way . The current method used by SimSEE is a traditional Backward-ADP recursion applied over a quantized , reduced state-space of the whole Uruguayan system . The recent diversification of the power generation matrix has exerted a significant stress on the aforementioned method . This is particularly so for the short term operation , which is re-computed hourly . 1.1 VALUE FUNCTION APPROXIMATION . A recent alternative approach to the above techniques is to construct an implicit representation of the value function ( Powell , 2011 ; Sutton & Barto , 2018 ) . Instead of reducing the dimensions and/or quantizing the state space , a continuous model is built in the original state space based on a set of values of the function evaluated at arbitrary positions . Here , a rich set of tools from Approximation Theory is available to choose , construct and evaluate the appropriate approximation method for a particular task . Kernel methods ( Xu et al. , 2014 ) are a popular choice which is backed by the elegant theory of Reproducing Kernel Hilbert Spaces ( Paulsen & Raghupathi , 2016 ) . Another natural family of methods , more flexible , but also harder to characterize , is that of artificial neural networks ( ANN ) , which are well known for being universal function approximators ( R.Barron , 1994 ) . The above methods , however , have their drawbacks too . For instance , it has been shown that , if no additional measures are taken , the number of samples of the value function required for the overall approximation-based ADP method to converge can be even larger than that required by using traditional , explicit evaluation methods ( Du et al. , 2020 ) . Luckily , such requirement can be significantly relaxed if appropriate variance reduction techniques are applied , e.g. , Common Random Numbers ( Christophe et al. , 2015 ) . In the particular case of ANN approximators applied to an heterogeneous energy system , the above measure might not be enough . The great flexibility of ANNs also implies a great sensitivity to the input data , which in our case is highly variable due to the random nature of renewable energy sources . In this challenging scenario , further measures need to be taken in order to obtain parsimonious approximations . 1.2 PARAMETRIC NETWORK SERIES . Luckily for us , the signals and processes involved in the planning of energy dispatch usually exhibit regular patterns . This can be exploited to impose parsimonious approximations which extrapolate reasonably to unseen states . Our proposed method combines the flexibility of ANNs with prior information about the problem . In a nutshell , the value function , which is a function of state and time , is approximated by one neural network per time slot . The architecture of the network is the same for all time slots , reflecting the fact that the structure of the system itself does not change . The parameters do vary across networks , albeit in a controlled fashion : for any given link in the architecture , the corresponding weight is a function of time . The general idea is depicted in Figure 1 . 1.3 WHY NOT A SINGLE NET ? . Naturally , one could use a single parametric function to model the whole value function across all time steps . The reason for us to opt for a sequence of smaller models is again computational performance : instead of computing the whole approximation from scratch at each time step ( usually an hour ) , we can quickly update the overall model by dropping the first model ( at t = 1 ) , adding a new one at the end , and running a few iterations . We call this a sliding window strategy , in reference to similar modeling patterns used in other fields . 1.4 RELATED WORKS . As mentioned , the use of approximation in value functions is an established technique described in classic textbooks such as ( Bertsekas & Tsitsiklis , 1996 ; Powell , 2011 ; Sutton & Barto , 2018 ) . Also , incorporating time dependence in approximation models and , in particular , artificial neural networks , is an active line of research . The main difference between the related works in this matter is in how the time dependence is imbued into the architecture . Recurrent Neural Networks ( RNNs ) are widely deployed to capture time-dependent patterns using their current widely adopted incarnation , the so called Long-Short Term Memory ( LSTM ) networks ( Hochreiter & Schmidhuber , 1997 ) . In these models , the hidden layer outputs depend not only on their current input , but also on their own previous output , in a way similar to a recursive filter . Such architectures are able to produce outputs which depend not only on the current input , but on past inputs as well . However , these kind of architectures are incapable of capturing periodic patterns , especially if such patterns have low frequencies , such as periodic seasonal patterns . Another widespread technique to represent time in ANNs is generally known as positional encoding ( see Zheng et al . ( 2021 ) for a recent review on the subject ) . The typical positional encoding method involves auxiliary sinusoidal inputs to the network , usually several of them , with different frequencies . Although their typical use is in the context of language translation ( see e.g . ( Gehring et al. , 2017 ) ) , where the frequencies are high ( letter , word , phrase , a few time steps ) , nothing prevents one from using such techniques in a scenario such as the one described in this paper . The main difference between the “ positional encoding ” approach and our proposed method lies in the way that this periodical information is fed into the system . Whereas the former uses these auxiliary signals as inputs to the whole network , and their influence on the weights is implicitly learned through standard backpropagation techniques , our method imposes a periodic pattern explicitly on the weights themselves , giving them some room to accomodate for the particularities not captured by the periodic model . 1.5 CONTRIBUTIONS . In summary , the main contributions of this work are two . First , we develop a novel architecture for learning value functions in approximate dynamic programming problems ; the novelty lies in the use of a series of neural networks of identical architecture , one per time slot , where the weights are functions of time rather whose parameters are learned at training time . Second , we demonstrate the use of the proposed model on a real-life , complex case , where we can evaluate the actual performance of the model in terms of real operation cost savings . 1.6 DOCUMENT ORGANIZATION . The rest of the document is organized as follows . In Section 2 we provide a formal introduction to the problem and the notation used throughout the paper . Section 3 introduces the problem of electric systems operation . The proposed method is described in detail in Section 4.4 . Section 5 shows a detailed comparison between the current model in production and the proposed method , and discusses the results . Concluding remarks are given in Section 6 . | This paper proposed using time-dependent parameters to model the value function for evaluating the cost-to-go function in power systems. This work can be regarded as an extension from the traditional adaptive dynamic programming (ADP) with the study on how to represent the value function that fits the uncertainty of the dynamics of power systems induced by the installation decentralized energy resources (DERs). This work shows the performance of the proposed method on a realistic simulation. The background knowledge is well written and clear. | SP:bce1e3cda9067b6e3e14fca3143081e39763d733 |
Self-Supervised Inference in State-Space Models | We perform approximate inference in state-space models with nonlinear state transitions . Without parameterizing a generative model , we apply Bayesian update formulas using a local linearity approximation parameterized by neural networks . It comes accompanied by a maximum likelihood objective that requires no supervision via uncorrupt observations or ground truth latent states . The optimization backpropagates through a recursion similar to the classical Kalman filter and smoother . Additionally , using an approximate conditional independence , we can perform smoothing without having to parameterize a separate model . In scientific applications , domain knowledge can give a linear approximation of the latent transition maps , which we can easily incorporate into our model . Usage of such domain knowledge is reflected in excellent results ( despite our model ’ s simplicity ) on the chaotic Lorenz system compared to fully supervised and variational inference methods . Finally , we show competitive results on an audio denoising experiment . 1 INTRODUCTION . Many sequential processes in industry and research involve noisy measurements that describe latent dynamics . A state-space model is a type of graphical model that effectively represents such noise-afflicted data ( Bishop , 2006 ) . The joint distribution is assumed to factorize according to a directed graph that encodes the dependency between variables using conditional probabilities . One is usually interested in performing inference , meaning to obtain reasonable estimates of the posterior distribution of the latent states or uncorrupt measurements . Approaches involving sampling ( Neal et al. , 2011 ) , variational inference ( Kingma & Welling , 2013 ) , or belief propagation ( Koller & Friedman , 2009 ) have been proposed before . Assuming a hidden Markov process ( Koller & Friedman , 2009 ) , the celebrated Kalman filter and smoother ( Kalman , 1960 ; Rauch et al. , 1965 ) are classical approaches to solving the posterior inference problem . However , the Markov assumption , together with linear Gaussian transition and emission probabilities , limit their flexibility . We present filtering and smoothing methods that are related to the classical Kalman filter updates but are augmented with flexible function estimators without using a constrained graphical model . By noting that the filtering and smoothing recursions can be back-propagated through , these estimators can be trained with a principled maximum-likelihood objective reminiscent of the noise2noise objective ( Lehtinen et al. , 2018 ; Laine et al. , 2019 ) . By using a locally linear transition distribution , the posterior distribution remains tractable despite the use of non-linear function estimators . Further , we show how a linearized smoothing procedure can be applied directly to the filtering distributions , discarding the need to train a separate model for smoothing . To verify what is claimed , we perform three experiments . ( 1 ) A linear dynamics filtering experiment , where we show how our models approximate the optimal solution with sufficient data . We also report that including expert knowledge can yield better estimates of latent states . ( 2 ) A more challenging chaotic Lorenz smoothing experiment that shows how our models perform on par with recently proposed supervised models . ( 3 ) An audio denoising experiment that uses real-world noise showing practical applicability of the methods . Our contributions can be summarized as follows . 1 . We show that the posterior inference distribution of a state-space model is tractable while parameter estimation is performed by neural networks . This means that we can apply the classical recursive Bayesian updates , akin to the Kalman filter and smoother , with mild assumptions on the generative process . 2 . Our proposed method is optimized using maximum likelihood in a self-supervised manner . That is , ground truth values of states and measurements are not assumed to be available for training . Still , despite our model ’ s simplicity , our experiments show that it performs better or on par with several baselines . 3 . We show that the model can be combined with prior knowledge about the transition and emission probabilities , allowing for better applicability in low data regimes and incentivizing the model to provide more interpretable estimates of the latent states . 4 . A linearized smoothing approach is presented that does not require explicit additional parameterization and learning of the smoothing distribution . 2 RELATED WORK . Becker et al . ( 2019 ) provide a detailed discussion of recent related work , which we build on here and in table 1 . An early method that extends the earlier introduced Kalman filter by allowing nonlinear transitions and emissions is the Extended Kalman filter ( Ljung , 1979 ) . It is limited due to the naive approach to locally linearize the transition and emission distributions . Furthermore , the transition and emission mechanisms are usually assumed to be known , or estimated with Expectation Maximization ( Moon , 1996 ) . More flexible methods that combine deep learning with variational inference include Black Box Variational Inference ( Archer et al. , 2015 ) , Structured Inference Networks ( Krishnan et al. , 2017 ) , Kalman Variational Autoencoder ( Fraccaro et al. , 2017 ) , Deep Variational Bayes Filters ( Karl et al. , 2017 ) , Variational Sequential Monte Carlo ( Naesseth et al. , 2018 ) and Disentangled Sequential Autoencoder ( Yingzhen & Mandt , 2018 ) . However , the lower-bound objective makes the approach less scalable and accurate ( see also Becker et al . ( 2019 ) . Furthermore , all of the above methods explicitly assume a graphical model , imposing a strong but potentially harmful inductive bias . The BackpropKF ( Haarnoja et al. , 2016 ) and Recurrent Kalman Network ( Becker et al. , 2019 ) move away from variational inference and borrow Bayesian filtering techniques from the Kalman filter . We follow this direction but do not require supervision through ground truth latent states or uncorrupt emissions . Satorras et al . ( 2019 ) combine Kalman filters through message passing with graph neural networks to perform hybrid inference . We perform some of their experiments by also incorporating expert knowledge . However , contrary to their approach , we do not need supervision . Finally , concurrently to this work , Revach et al . ( 2021 ) develop KalmanNet . It proposes similar techniques but evaluates them in a supervised manner . The authors , however , do suggest that an unsupervised approach can also be feasible . Additionally , we more explicitly state what generative assumptions are required , then target the posterior distribution of interest , and develop the model and objective function from there . Moreover , the current paper includes linearized smoothing ( section 6 ) , parameterized smoothing ( appendix A ) , and the recurrent model ( appendix C ) . We also denote theoretical guarantees under the noise2noise objective . scalable state est . uncertainty noise dir . opt . self-sup . Ljung ( 1979 ) ✓/× ✓ ✓ ✓ × × Hochreiter et . al . ( 1997 ) ✓ ✓ ✓/× ✓ ✓ × Cho et al . ( 2014 ) ✓ ✓ ✓/× ✓ ✓ × Wahlström et al . ( 2015 ) ✓ ✓ ✓/× × ✓ × Watter et al . ( 2015 ) ✓ × ✓ ✓ × ✓ Archer et al . ( 2015 ) ✓/× × ✓ ✓ × ✓ Krishnan et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Fraccaro et al . ( 2017 ) ✓/× × ✓ ✓ × ✓ Karl et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Naesseth et al . ( 2018 ) ✓ × ✓ ✓ × ✓ Yingzhen et al . ( 2018 ) ✓ × ✓ × × ✓ Rangapuram et al . ( 2018 ) ✓/× ✓ ( 1D ) ✓ × ✓ ✓ Doerr et al . ( 2018 ) × ✓ ✓ ✓ ✓ ✓ Satorras et al . ( 2019 ) ✓ ✓ × ✓ ✓ × Haarnoja et al . ( 2016 ) ✓ ✓ ✓ ✓ ✓ × Becker et al . ( 2019 ) ✓ ✓ ✓ ✓ ✓ × Ours ✓/× ✓ ✓ ✓ ✓ ✓ Table 1 : We compare whether algorithms are scalable , state estimation can be performed , models provide uncertainty estimates , noisy or missing data can be handled , optimization is performed directly and if supervision is required . “ ✓/× ” means that it depends on the parameterization . 3 GENERATIVE MODEL ASSUMPTIONS . In this section , we explicitly state the model ’ s generative process assumptions . First , we assume that we can measure ( at least ) one run of ( noise-afflicted ) sequential data y0 : K : = ( y0 , . . . , yK ) , where each yk ∈ RM , k = 0 , . . . , K. We abbreviate : yl : k : = ( yl , . . . , yk ) and y < k : = y0 : k−1 and y≤k : = y0 : k and y−k : = ( y0 : k−1 , yk+1 : K ) . We then assume that y0 : K is the result of some possibly non-linear probabilistic latent dynamics , i.e. , of a distribution p ( x0 : K ) , whose variables are given by x0 : K : = ( x0 , . . . , xK ) with xk ∈ RN . Each yk is assumed to be drawn from some shared noisy emission probability p ( yk | xk ) . The joint probability is then assumed to factorize as : p ( y0 : K , x0 : K ) = p ( x0 : K ) K∏ k=0 p ( yk | xk ) . ( 1 ) Further implicit assumptions about the generative model are imposed via inference model choices ( see section 7 ) . Note that this factorization encodes several conditional independences like yk ⊥⊥ ( y−k , x−k ) | xk . ( 2 ) Typical models that follow these assumptions are linear dynamical systems , hidden Markov models , but also nonlinear state-space models with higher-order Markov chains in latent space like presented in fig . 2 . In contrast to other approaches ( e.g. , Krishnan et al . ( 2015 ) ; Johnson et al . ( 2016 ) ; Krishnan et al . ( 2017 ) ) where one tries to model the latent dynamics with transition probabilities p ( xk | xk−1 ) and possibly non-linear emission probabilities p ( yk | xk ) , we go the other way around . We assume that all the non-linear dynamics are captured inside the latent distribution p ( x0 : K ) , where at this point we make no further assumption about its factorization , and the emission probabilities are ( wellapproximated with ) a linear Gaussian noise model : p ( yk | xk ) = N ( yk |Hxk , R ) , ( 3 ) where the matrix H represents the measurement device and R is the covariance matrix of the independent additive noise . We make a brief argument why this assumption is not too restrictive . First , if one is interested in denoising corrupted measurements , any nonlinear emission can be captured directly inside the latent states xk . To see this , let zk ∈ RN−M denote non-emitted state variables . We then put xk : = [ yk zk ] ⊤ , where yk is computed by applying the nonlinear emission to zk . We thus include the measurements in the modeled latent state xk . Then we can put H : = [ IM 0M× ( N−M ) ] . Second , techniques proposed by Laine et al . ( 2019 ) allow for nonGaussian noise models , relaxing the need for assumption eq . ( 3 ) . Third , we can locally linearize the emission ( Ljung , 1979 ) . Finally , industrial or academic applications include cases where emissions are ( sparse ) Gaussian measurements and the challenging nonlinear dynamics occur in latent space . Examples can be found in MRI imaging ( Lustig et al. , 2007 ) and radio astronomy ( Thompson et al. , 2017 ) . | A Kalman filter typically requires specifying a state update equation, along with noise covariance matrices for state transition and observation. Determining these can be a challenge in certain scenarios. The manuscript proposes to replace these unknowns with trainable neural networks. The input to the neural networks are the observations, and the output are the unknown parameters (or their factorizations, to ensure positive definiteness). The manuscript validates the approach through numerical experiments. | SP:8a4f77f65471c5c4841c9a58fd564c09b85d450a |
Self-Supervised Inference in State-Space Models | We perform approximate inference in state-space models with nonlinear state transitions . Without parameterizing a generative model , we apply Bayesian update formulas using a local linearity approximation parameterized by neural networks . It comes accompanied by a maximum likelihood objective that requires no supervision via uncorrupt observations or ground truth latent states . The optimization backpropagates through a recursion similar to the classical Kalman filter and smoother . Additionally , using an approximate conditional independence , we can perform smoothing without having to parameterize a separate model . In scientific applications , domain knowledge can give a linear approximation of the latent transition maps , which we can easily incorporate into our model . Usage of such domain knowledge is reflected in excellent results ( despite our model ’ s simplicity ) on the chaotic Lorenz system compared to fully supervised and variational inference methods . Finally , we show competitive results on an audio denoising experiment . 1 INTRODUCTION . Many sequential processes in industry and research involve noisy measurements that describe latent dynamics . A state-space model is a type of graphical model that effectively represents such noise-afflicted data ( Bishop , 2006 ) . The joint distribution is assumed to factorize according to a directed graph that encodes the dependency between variables using conditional probabilities . One is usually interested in performing inference , meaning to obtain reasonable estimates of the posterior distribution of the latent states or uncorrupt measurements . Approaches involving sampling ( Neal et al. , 2011 ) , variational inference ( Kingma & Welling , 2013 ) , or belief propagation ( Koller & Friedman , 2009 ) have been proposed before . Assuming a hidden Markov process ( Koller & Friedman , 2009 ) , the celebrated Kalman filter and smoother ( Kalman , 1960 ; Rauch et al. , 1965 ) are classical approaches to solving the posterior inference problem . However , the Markov assumption , together with linear Gaussian transition and emission probabilities , limit their flexibility . We present filtering and smoothing methods that are related to the classical Kalman filter updates but are augmented with flexible function estimators without using a constrained graphical model . By noting that the filtering and smoothing recursions can be back-propagated through , these estimators can be trained with a principled maximum-likelihood objective reminiscent of the noise2noise objective ( Lehtinen et al. , 2018 ; Laine et al. , 2019 ) . By using a locally linear transition distribution , the posterior distribution remains tractable despite the use of non-linear function estimators . Further , we show how a linearized smoothing procedure can be applied directly to the filtering distributions , discarding the need to train a separate model for smoothing . To verify what is claimed , we perform three experiments . ( 1 ) A linear dynamics filtering experiment , where we show how our models approximate the optimal solution with sufficient data . We also report that including expert knowledge can yield better estimates of latent states . ( 2 ) A more challenging chaotic Lorenz smoothing experiment that shows how our models perform on par with recently proposed supervised models . ( 3 ) An audio denoising experiment that uses real-world noise showing practical applicability of the methods . Our contributions can be summarized as follows . 1 . We show that the posterior inference distribution of a state-space model is tractable while parameter estimation is performed by neural networks . This means that we can apply the classical recursive Bayesian updates , akin to the Kalman filter and smoother , with mild assumptions on the generative process . 2 . Our proposed method is optimized using maximum likelihood in a self-supervised manner . That is , ground truth values of states and measurements are not assumed to be available for training . Still , despite our model ’ s simplicity , our experiments show that it performs better or on par with several baselines . 3 . We show that the model can be combined with prior knowledge about the transition and emission probabilities , allowing for better applicability in low data regimes and incentivizing the model to provide more interpretable estimates of the latent states . 4 . A linearized smoothing approach is presented that does not require explicit additional parameterization and learning of the smoothing distribution . 2 RELATED WORK . Becker et al . ( 2019 ) provide a detailed discussion of recent related work , which we build on here and in table 1 . An early method that extends the earlier introduced Kalman filter by allowing nonlinear transitions and emissions is the Extended Kalman filter ( Ljung , 1979 ) . It is limited due to the naive approach to locally linearize the transition and emission distributions . Furthermore , the transition and emission mechanisms are usually assumed to be known , or estimated with Expectation Maximization ( Moon , 1996 ) . More flexible methods that combine deep learning with variational inference include Black Box Variational Inference ( Archer et al. , 2015 ) , Structured Inference Networks ( Krishnan et al. , 2017 ) , Kalman Variational Autoencoder ( Fraccaro et al. , 2017 ) , Deep Variational Bayes Filters ( Karl et al. , 2017 ) , Variational Sequential Monte Carlo ( Naesseth et al. , 2018 ) and Disentangled Sequential Autoencoder ( Yingzhen & Mandt , 2018 ) . However , the lower-bound objective makes the approach less scalable and accurate ( see also Becker et al . ( 2019 ) . Furthermore , all of the above methods explicitly assume a graphical model , imposing a strong but potentially harmful inductive bias . The BackpropKF ( Haarnoja et al. , 2016 ) and Recurrent Kalman Network ( Becker et al. , 2019 ) move away from variational inference and borrow Bayesian filtering techniques from the Kalman filter . We follow this direction but do not require supervision through ground truth latent states or uncorrupt emissions . Satorras et al . ( 2019 ) combine Kalman filters through message passing with graph neural networks to perform hybrid inference . We perform some of their experiments by also incorporating expert knowledge . However , contrary to their approach , we do not need supervision . Finally , concurrently to this work , Revach et al . ( 2021 ) develop KalmanNet . It proposes similar techniques but evaluates them in a supervised manner . The authors , however , do suggest that an unsupervised approach can also be feasible . Additionally , we more explicitly state what generative assumptions are required , then target the posterior distribution of interest , and develop the model and objective function from there . Moreover , the current paper includes linearized smoothing ( section 6 ) , parameterized smoothing ( appendix A ) , and the recurrent model ( appendix C ) . We also denote theoretical guarantees under the noise2noise objective . scalable state est . uncertainty noise dir . opt . self-sup . Ljung ( 1979 ) ✓/× ✓ ✓ ✓ × × Hochreiter et . al . ( 1997 ) ✓ ✓ ✓/× ✓ ✓ × Cho et al . ( 2014 ) ✓ ✓ ✓/× ✓ ✓ × Wahlström et al . ( 2015 ) ✓ ✓ ✓/× × ✓ × Watter et al . ( 2015 ) ✓ × ✓ ✓ × ✓ Archer et al . ( 2015 ) ✓/× × ✓ ✓ × ✓ Krishnan et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Fraccaro et al . ( 2017 ) ✓/× × ✓ ✓ × ✓ Karl et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Naesseth et al . ( 2018 ) ✓ × ✓ ✓ × ✓ Yingzhen et al . ( 2018 ) ✓ × ✓ × × ✓ Rangapuram et al . ( 2018 ) ✓/× ✓ ( 1D ) ✓ × ✓ ✓ Doerr et al . ( 2018 ) × ✓ ✓ ✓ ✓ ✓ Satorras et al . ( 2019 ) ✓ ✓ × ✓ ✓ × Haarnoja et al . ( 2016 ) ✓ ✓ ✓ ✓ ✓ × Becker et al . ( 2019 ) ✓ ✓ ✓ ✓ ✓ × Ours ✓/× ✓ ✓ ✓ ✓ ✓ Table 1 : We compare whether algorithms are scalable , state estimation can be performed , models provide uncertainty estimates , noisy or missing data can be handled , optimization is performed directly and if supervision is required . “ ✓/× ” means that it depends on the parameterization . 3 GENERATIVE MODEL ASSUMPTIONS . In this section , we explicitly state the model ’ s generative process assumptions . First , we assume that we can measure ( at least ) one run of ( noise-afflicted ) sequential data y0 : K : = ( y0 , . . . , yK ) , where each yk ∈ RM , k = 0 , . . . , K. We abbreviate : yl : k : = ( yl , . . . , yk ) and y < k : = y0 : k−1 and y≤k : = y0 : k and y−k : = ( y0 : k−1 , yk+1 : K ) . We then assume that y0 : K is the result of some possibly non-linear probabilistic latent dynamics , i.e. , of a distribution p ( x0 : K ) , whose variables are given by x0 : K : = ( x0 , . . . , xK ) with xk ∈ RN . Each yk is assumed to be drawn from some shared noisy emission probability p ( yk | xk ) . The joint probability is then assumed to factorize as : p ( y0 : K , x0 : K ) = p ( x0 : K ) K∏ k=0 p ( yk | xk ) . ( 1 ) Further implicit assumptions about the generative model are imposed via inference model choices ( see section 7 ) . Note that this factorization encodes several conditional independences like yk ⊥⊥ ( y−k , x−k ) | xk . ( 2 ) Typical models that follow these assumptions are linear dynamical systems , hidden Markov models , but also nonlinear state-space models with higher-order Markov chains in latent space like presented in fig . 2 . In contrast to other approaches ( e.g. , Krishnan et al . ( 2015 ) ; Johnson et al . ( 2016 ) ; Krishnan et al . ( 2017 ) ) where one tries to model the latent dynamics with transition probabilities p ( xk | xk−1 ) and possibly non-linear emission probabilities p ( yk | xk ) , we go the other way around . We assume that all the non-linear dynamics are captured inside the latent distribution p ( x0 : K ) , where at this point we make no further assumption about its factorization , and the emission probabilities are ( wellapproximated with ) a linear Gaussian noise model : p ( yk | xk ) = N ( yk |Hxk , R ) , ( 3 ) where the matrix H represents the measurement device and R is the covariance matrix of the independent additive noise . We make a brief argument why this assumption is not too restrictive . First , if one is interested in denoising corrupted measurements , any nonlinear emission can be captured directly inside the latent states xk . To see this , let zk ∈ RN−M denote non-emitted state variables . We then put xk : = [ yk zk ] ⊤ , where yk is computed by applying the nonlinear emission to zk . We thus include the measurements in the modeled latent state xk . Then we can put H : = [ IM 0M× ( N−M ) ] . Second , techniques proposed by Laine et al . ( 2019 ) allow for nonGaussian noise models , relaxing the need for assumption eq . ( 3 ) . Third , we can locally linearize the emission ( Ljung , 1979 ) . Finally , industrial or academic applications include cases where emissions are ( sparse ) Gaussian measurements and the challenging nonlinear dynamics occur in latent space . Examples can be found in MRI imaging ( Lustig et al. , 2007 ) and radio astronomy ( Thompson et al. , 2017 ) . | The authors describe a parametrized inference approach for nonlinear dynamical models with linear observations. They borrow ideas from the well-known Kalman filter, and use Bayesian filtering and smoothing approaches to recursively estimate the states of the nonlinear model. The parameterization makes use of a locally linear transition between subsequent states using neural networks; thus the authors are still able to perform the Kalman-like filtering and smoothing. | SP:8a4f77f65471c5c4841c9a58fd564c09b85d450a |
Self-Supervised Inference in State-Space Models | We perform approximate inference in state-space models with nonlinear state transitions . Without parameterizing a generative model , we apply Bayesian update formulas using a local linearity approximation parameterized by neural networks . It comes accompanied by a maximum likelihood objective that requires no supervision via uncorrupt observations or ground truth latent states . The optimization backpropagates through a recursion similar to the classical Kalman filter and smoother . Additionally , using an approximate conditional independence , we can perform smoothing without having to parameterize a separate model . In scientific applications , domain knowledge can give a linear approximation of the latent transition maps , which we can easily incorporate into our model . Usage of such domain knowledge is reflected in excellent results ( despite our model ’ s simplicity ) on the chaotic Lorenz system compared to fully supervised and variational inference methods . Finally , we show competitive results on an audio denoising experiment . 1 INTRODUCTION . Many sequential processes in industry and research involve noisy measurements that describe latent dynamics . A state-space model is a type of graphical model that effectively represents such noise-afflicted data ( Bishop , 2006 ) . The joint distribution is assumed to factorize according to a directed graph that encodes the dependency between variables using conditional probabilities . One is usually interested in performing inference , meaning to obtain reasonable estimates of the posterior distribution of the latent states or uncorrupt measurements . Approaches involving sampling ( Neal et al. , 2011 ) , variational inference ( Kingma & Welling , 2013 ) , or belief propagation ( Koller & Friedman , 2009 ) have been proposed before . Assuming a hidden Markov process ( Koller & Friedman , 2009 ) , the celebrated Kalman filter and smoother ( Kalman , 1960 ; Rauch et al. , 1965 ) are classical approaches to solving the posterior inference problem . However , the Markov assumption , together with linear Gaussian transition and emission probabilities , limit their flexibility . We present filtering and smoothing methods that are related to the classical Kalman filter updates but are augmented with flexible function estimators without using a constrained graphical model . By noting that the filtering and smoothing recursions can be back-propagated through , these estimators can be trained with a principled maximum-likelihood objective reminiscent of the noise2noise objective ( Lehtinen et al. , 2018 ; Laine et al. , 2019 ) . By using a locally linear transition distribution , the posterior distribution remains tractable despite the use of non-linear function estimators . Further , we show how a linearized smoothing procedure can be applied directly to the filtering distributions , discarding the need to train a separate model for smoothing . To verify what is claimed , we perform three experiments . ( 1 ) A linear dynamics filtering experiment , where we show how our models approximate the optimal solution with sufficient data . We also report that including expert knowledge can yield better estimates of latent states . ( 2 ) A more challenging chaotic Lorenz smoothing experiment that shows how our models perform on par with recently proposed supervised models . ( 3 ) An audio denoising experiment that uses real-world noise showing practical applicability of the methods . Our contributions can be summarized as follows . 1 . We show that the posterior inference distribution of a state-space model is tractable while parameter estimation is performed by neural networks . This means that we can apply the classical recursive Bayesian updates , akin to the Kalman filter and smoother , with mild assumptions on the generative process . 2 . Our proposed method is optimized using maximum likelihood in a self-supervised manner . That is , ground truth values of states and measurements are not assumed to be available for training . Still , despite our model ’ s simplicity , our experiments show that it performs better or on par with several baselines . 3 . We show that the model can be combined with prior knowledge about the transition and emission probabilities , allowing for better applicability in low data regimes and incentivizing the model to provide more interpretable estimates of the latent states . 4 . A linearized smoothing approach is presented that does not require explicit additional parameterization and learning of the smoothing distribution . 2 RELATED WORK . Becker et al . ( 2019 ) provide a detailed discussion of recent related work , which we build on here and in table 1 . An early method that extends the earlier introduced Kalman filter by allowing nonlinear transitions and emissions is the Extended Kalman filter ( Ljung , 1979 ) . It is limited due to the naive approach to locally linearize the transition and emission distributions . Furthermore , the transition and emission mechanisms are usually assumed to be known , or estimated with Expectation Maximization ( Moon , 1996 ) . More flexible methods that combine deep learning with variational inference include Black Box Variational Inference ( Archer et al. , 2015 ) , Structured Inference Networks ( Krishnan et al. , 2017 ) , Kalman Variational Autoencoder ( Fraccaro et al. , 2017 ) , Deep Variational Bayes Filters ( Karl et al. , 2017 ) , Variational Sequential Monte Carlo ( Naesseth et al. , 2018 ) and Disentangled Sequential Autoencoder ( Yingzhen & Mandt , 2018 ) . However , the lower-bound objective makes the approach less scalable and accurate ( see also Becker et al . ( 2019 ) . Furthermore , all of the above methods explicitly assume a graphical model , imposing a strong but potentially harmful inductive bias . The BackpropKF ( Haarnoja et al. , 2016 ) and Recurrent Kalman Network ( Becker et al. , 2019 ) move away from variational inference and borrow Bayesian filtering techniques from the Kalman filter . We follow this direction but do not require supervision through ground truth latent states or uncorrupt emissions . Satorras et al . ( 2019 ) combine Kalman filters through message passing with graph neural networks to perform hybrid inference . We perform some of their experiments by also incorporating expert knowledge . However , contrary to their approach , we do not need supervision . Finally , concurrently to this work , Revach et al . ( 2021 ) develop KalmanNet . It proposes similar techniques but evaluates them in a supervised manner . The authors , however , do suggest that an unsupervised approach can also be feasible . Additionally , we more explicitly state what generative assumptions are required , then target the posterior distribution of interest , and develop the model and objective function from there . Moreover , the current paper includes linearized smoothing ( section 6 ) , parameterized smoothing ( appendix A ) , and the recurrent model ( appendix C ) . We also denote theoretical guarantees under the noise2noise objective . scalable state est . uncertainty noise dir . opt . self-sup . Ljung ( 1979 ) ✓/× ✓ ✓ ✓ × × Hochreiter et . al . ( 1997 ) ✓ ✓ ✓/× ✓ ✓ × Cho et al . ( 2014 ) ✓ ✓ ✓/× ✓ ✓ × Wahlström et al . ( 2015 ) ✓ ✓ ✓/× × ✓ × Watter et al . ( 2015 ) ✓ × ✓ ✓ × ✓ Archer et al . ( 2015 ) ✓/× × ✓ ✓ × ✓ Krishnan et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Fraccaro et al . ( 2017 ) ✓/× × ✓ ✓ × ✓ Karl et al . ( 2017 ) ✓ × ✓ ✓ × ✓ Naesseth et al . ( 2018 ) ✓ × ✓ ✓ × ✓ Yingzhen et al . ( 2018 ) ✓ × ✓ × × ✓ Rangapuram et al . ( 2018 ) ✓/× ✓ ( 1D ) ✓ × ✓ ✓ Doerr et al . ( 2018 ) × ✓ ✓ ✓ ✓ ✓ Satorras et al . ( 2019 ) ✓ ✓ × ✓ ✓ × Haarnoja et al . ( 2016 ) ✓ ✓ ✓ ✓ ✓ × Becker et al . ( 2019 ) ✓ ✓ ✓ ✓ ✓ × Ours ✓/× ✓ ✓ ✓ ✓ ✓ Table 1 : We compare whether algorithms are scalable , state estimation can be performed , models provide uncertainty estimates , noisy or missing data can be handled , optimization is performed directly and if supervision is required . “ ✓/× ” means that it depends on the parameterization . 3 GENERATIVE MODEL ASSUMPTIONS . In this section , we explicitly state the model ’ s generative process assumptions . First , we assume that we can measure ( at least ) one run of ( noise-afflicted ) sequential data y0 : K : = ( y0 , . . . , yK ) , where each yk ∈ RM , k = 0 , . . . , K. We abbreviate : yl : k : = ( yl , . . . , yk ) and y < k : = y0 : k−1 and y≤k : = y0 : k and y−k : = ( y0 : k−1 , yk+1 : K ) . We then assume that y0 : K is the result of some possibly non-linear probabilistic latent dynamics , i.e. , of a distribution p ( x0 : K ) , whose variables are given by x0 : K : = ( x0 , . . . , xK ) with xk ∈ RN . Each yk is assumed to be drawn from some shared noisy emission probability p ( yk | xk ) . The joint probability is then assumed to factorize as : p ( y0 : K , x0 : K ) = p ( x0 : K ) K∏ k=0 p ( yk | xk ) . ( 1 ) Further implicit assumptions about the generative model are imposed via inference model choices ( see section 7 ) . Note that this factorization encodes several conditional independences like yk ⊥⊥ ( y−k , x−k ) | xk . ( 2 ) Typical models that follow these assumptions are linear dynamical systems , hidden Markov models , but also nonlinear state-space models with higher-order Markov chains in latent space like presented in fig . 2 . In contrast to other approaches ( e.g. , Krishnan et al . ( 2015 ) ; Johnson et al . ( 2016 ) ; Krishnan et al . ( 2017 ) ) where one tries to model the latent dynamics with transition probabilities p ( xk | xk−1 ) and possibly non-linear emission probabilities p ( yk | xk ) , we go the other way around . We assume that all the non-linear dynamics are captured inside the latent distribution p ( x0 : K ) , where at this point we make no further assumption about its factorization , and the emission probabilities are ( wellapproximated with ) a linear Gaussian noise model : p ( yk | xk ) = N ( yk |Hxk , R ) , ( 3 ) where the matrix H represents the measurement device and R is the covariance matrix of the independent additive noise . We make a brief argument why this assumption is not too restrictive . First , if one is interested in denoising corrupted measurements , any nonlinear emission can be captured directly inside the latent states xk . To see this , let zk ∈ RN−M denote non-emitted state variables . We then put xk : = [ yk zk ] ⊤ , where yk is computed by applying the nonlinear emission to zk . We thus include the measurements in the modeled latent state xk . Then we can put H : = [ IM 0M× ( N−M ) ] . Second , techniques proposed by Laine et al . ( 2019 ) allow for nonGaussian noise models , relaxing the need for assumption eq . ( 3 ) . Third , we can locally linearize the emission ( Ljung , 1979 ) . Finally , industrial or academic applications include cases where emissions are ( sparse ) Gaussian measurements and the challenging nonlinear dynamics occur in latent space . Examples can be found in MRI imaging ( Lustig et al. , 2007 ) and radio astronomy ( Thompson et al. , 2017 ) . | The authors proposed a new inference method for state-space model with nonlinear latent states. They showed that their inference model can be incorporated with domain knowledge and optimized in a self-supervised manner. They also demonstrated that their model can achieve competitive results through both simulated and real audio denoising tasks. | SP:8a4f77f65471c5c4841c9a58fd564c09b85d450a |
Topic Aware Neural Language Model: Domain Adaptation of Unconditional Text Generation Models | 1 INTRODUCTION . Our goal is to adapt pre-trained neural language models ( NLMs ) to the unconditional text generation task for the target domain . As with global semantic information , topic models ( Blei et al. , 2003 ; Kawamae , 2018 ; Wang et al. , 2020 ) and their extensions take a global statistical view and look at the word distributions of topics across a given corpus ; they represent each document as a bag-of-word ( BOW ) vector . Topics are global variables , describes the distributions over all tokens in the vocabulary , and form interpretable representations over texts . Although these models organize a given corpus into small sets of prominent topics and have been proven to be powerful tools for uncovering latent structure , they are not , in the strict sense , sequence models . Recently , Transformer has been applied as pre-trained NLMs ( Vaswani et al. , 2017 ; Yang et al. , 2019 ) , and are shown to be highly successful in the domain of natural language processing . Their success motivate us to explore how to adapt Transformer based NLMs for reflecting a given fine-tuning data and generating more private text with a few modifications than ever before . The corpus size of this fine-tuning is generally smaller than that of pre-training corpora , and may be unbalanced for training NLMs . For example , the size of the popular pre-training data , Giga5en ( Parker et al. , 2011 ) , and ClueWeb 2012-B1 is 16G , and 25TB , respectively . The fine-tuning needs a different approach to training NLMs than the pretraining approach , as pre-trained NLMs should be biased towards the patterns of language used in the training data ( Keskar et al. , 2019 ) , and may not lead to domain adaptation . To tackle this imbalance problem , we explore how to adapt pre-trained Transformer based NLMs to the target domain in the fine-tuning , while preserving their advantages . Since topics exist over these datasets and represents their semantic structures such as higher-order and non-linear interaction between words , our model , Topic Aware Neural Language Model ( TAN ) , focuses on topics to resolve this imbalance between these corpora and bridge their semantic gap . As topics reflect a set of co-occurring words , semantic information , and their 1https : //www.lemurproject.org/clueweb09.php/ syntactic structure , as global statistical information , TAN introduces a new manipulation , “ topic-alignment ( TA ) ” , and new training tasks such as Topic Distribution Modeling ( TDM ) and Topic Embedding Modeling ( TEM ) While previous Transformer based NLMs are better at learning from the predefined segment length such as the context , local information using Multi-head attention ( Vaswani et al. , 2017 ) , TAN injects topics into Transformer to train NLMs by fine-tuning with emphasizing these dependencies over segments in the target domain via topics . This model not only captures global semantic coherence of all segments and word concurrence patterns , but also enriches the representation of each token by adapting it to its local context , which goes beyond the segment it resides in and can be flexibly defined according to the target task . Experiments confirm that TAN and its augmentations supports existing state-of-the-art NLMs and verify its following advantages ; •Theoretical contributions : TAN adapts Transformer based pre-trained NLMs to the unconditional text generation task via topics while preserving their architectuures . •Practical contributions : As TAN is a flexible plug-and-play model , and does not need to update the parameters of pre-trained Transformer NLMs , it generates more target-specific text at a lower computational cost than using previous NLMs alone . 2 PREVIOUS WORK . Recently , pre-trained neural language models ( NLMs ) , such as BERT ( Devlin et al. , 2019 ) , GPT2 ( Radford et al. , 2019 ) , XLNet ( Yang et al. , 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and ALBERT ( Lan et al. , 2020 ) use of Transformer ( Vaswani et al. , 2017 ) for learning contextualized text representations , and have yielded great advances for NLP tasks . These NLMs can be fine-tuned on many natural language understanding ( NLU ) tasks such as named entity recognition , question answering and text classification . Though achieving appealing performances , these Transformer-based models are better at exploring the relationships among local tokens than the document global semantics ( Wang et al. , 2020 ) . As no Transformer-based model considers these explicit semantics , Wang et al ( Wang et al. , 2020 ) rearrange and further explore the semantics of the topic model and develop a friendly topic assistant for Transformer-based abstractive summarization models . UNIfied pre-trained Language Model ( UNILM ) ( Dong et al. , 2019 ) is applied to NLU and natural language generation ( NLG ) tasks by employing a shared Transformer network and utilizing specific self-attention masks to control what context the prediction is conditioned on . However , Transformers are usually trained on disjoint fixed-length segments , without any information flow across segments ( Dai et al. , 2019 ) , limiting the contextualization within the current segment . Therefore , they often fail to take full advantage of many other rich contextual information , such as longer-range word dependencies beyond the segment length and semantic relationships between neighboring segments . While BertSUM ( Wang et al. , 2020 ) notes that topic models are better at learning explicit document semantics than Transformers , our model is applied to the domain adaptation of text generation task , and has the different architecture and training tasks to perform topic transfer between domains . 3 Methodology . 3.1 Problem formulation . Our approach aims to adapt pre-trained NLMs so that they generate unconditional texts reflecting the target-domain corpus more than corpora used in the pre-training . In NLP , language models are trained as conditional language models for specific tasks that require text generation Bengio et al . ( 2003 ) . Given text sequence x = { x1 , · · · , xT } and a dataset D = { x1 , · · · , xD } , NLMs are pre-trained by minimizing the negative likelihood under forward autoregressive factorization : minθLLM ( θ ) = minθ − |D|∑ d=1 T∑ t=1 logPθ ( xd , t|xd,1 : t−1 ) , ( 1 ) where θ represents model parameters . Since our approach focuses on the fact that the gap between the corpora for pre-trained models and the corpus of target domain is different in this distribution , it aims to train these models by bringing these distributions to the distributions observed in the target domain . For example , given “ My favorite artist is ” , the pre-trained model predicts “ Michelangelo ” as the next word , while the fine-tuned model predicts “ Botticelli ” . This leads us to introduce topics , z , into the NLMs and then modify Eq ( 1 ) to : minθLTLN ( θ ) = minθ − |D|∑ d=1 T∑ t=1 log Z∑ zt=1 Pθ ( xd , t|zt ) Pθ ( zt|xd,1 : t−1 ) , ( 2 ) where zt denotes the topic of t-th token , and Z is the number of topics . Different from the previous NLMs , TAN explicitly introduces topics into the generative process to provide richer contextual information for improving NLMs . This paper explores how to discover these topics , and fit this obtained these topics to existing pre-trained NLMs . 3.2 Our motivation and Architecture design . Our motivation for adaptation is to discover topics from a target domain and teach them to pre-trained NLMs while preserving the semantic meaning and language structural information�that these NLMs have . While Transformer encodes context , as local information , it requires the large size of source target data set to learn the higher-order and non-linear interaction between words , and will need more parameters , computation resource and time . Further , due to the limited position index during pre-training , most Transformer-based models have a maximum capacity of input tokens . Thus , they often truncate the length of a document to satisfy the length limitation of the encoder , which may lose some important semantics , especially for long documents . It is often observed that the learned attentive patterns of many heads are not as reasonable as we expect ( Michel et al. , 2019 ) , and we might obtain this global information in the upper blocks by increasing the number of blocks in transformers ( Dosovitskiy et al. , 2021 ) , where the transformer architecture requires a large number of parameters and its computational cost is very high . This motivates us to discover explicitly topics from a target domain share them with pre-trained NLMs . As 1 ) a topic describes a co-occurrence pattern of tokens with similar semantics , and 2 ) the differences between pre-training and fine-tuning data sets are not only in the topic itself , but also in the ratio of topics , our model needs to be trained separately from pre-trained NLMs so that topics , z , are not buried . This leads our model to have both the encoder and the decoder , as shown in Figure 1 . The encoder discovers topics from a given target domain and fuses topics to the decoder with their distributions . The difference between this encoder and the other encoders is in finding topic distributions from a given target domain , aligning topics between the encoder and the decoder on the top level encoder/decoder block , and replacing the word generation network in the decoder with these topic distributions . The decoder can reuse pre-trained NLMs ( e.g. , GPT2 ) , jointly learns and shares topics with the encoder . Therefore , this model does not break any structure of the original Transformer network , and can preserve the power of pre-trained NLMs . 3.3 Input . Given a target domain corpus , TAN feeds the same text as input to the encoder ( the source text ) , and the decoder each ( the target text ) , from each of this target , as shown in Fig 1 It layers convert the inputs into token ( linguistic ) embedding , and adds special tokens [ CLS ] , [ SEP ] , [ EOS ] , and < s > . Following the text preprocessing of other Transformer based NLMs , TAN tokenizes each input text as the linguistic input of token embedding , where each subword is embedded with Word Piece ( Wu et al. , 2016 ) or other model-specific tokenizer ( e.g. , Byte-Pair Encoding ( BPE ) vocabulary ( Radford et al. , 2019 ) ) whose length equals the length of its input . [ CLS ] token is only inserted prior to the token , and denotes the class of each source text . [ SEP ] token is assigned to the end of each sentence in each input sequence , and indicates a sentence break . [ EOS ] token is assigned only after the last token in each input sequence . < s > token is only inserted prior to the token in each target text . A learnable sequence position embedding is added to every input element indicating its order in the input sequence , the same as other models . Because the Transformer encoder has no recurrence , it adds some information about positions into the input embeddings . As the positions of [ CLS ] , [ SEP ] and [ EOS ] , are fixed in every input sequence , their position embeddings are also fixed as constant values for every input sequence . The final representation for each token is obtained by summing these embedding . | The paper proposes a new topic-aware transformer-based language model with better domain adaptation ability. The paper introduces topic alignment to the NLMs. The paper treats the topic as an additional latent variable in the NLMs. The authors test their models on two datasets. The contribution is to introduce topics into the pre-trained language model. | SP:9a9356cd2dae5c33ed248eebbadd88d2a6fd8f82 |
Topic Aware Neural Language Model: Domain Adaptation of Unconditional Text Generation Models | 1 INTRODUCTION . Our goal is to adapt pre-trained neural language models ( NLMs ) to the unconditional text generation task for the target domain . As with global semantic information , topic models ( Blei et al. , 2003 ; Kawamae , 2018 ; Wang et al. , 2020 ) and their extensions take a global statistical view and look at the word distributions of topics across a given corpus ; they represent each document as a bag-of-word ( BOW ) vector . Topics are global variables , describes the distributions over all tokens in the vocabulary , and form interpretable representations over texts . Although these models organize a given corpus into small sets of prominent topics and have been proven to be powerful tools for uncovering latent structure , they are not , in the strict sense , sequence models . Recently , Transformer has been applied as pre-trained NLMs ( Vaswani et al. , 2017 ; Yang et al. , 2019 ) , and are shown to be highly successful in the domain of natural language processing . Their success motivate us to explore how to adapt Transformer based NLMs for reflecting a given fine-tuning data and generating more private text with a few modifications than ever before . The corpus size of this fine-tuning is generally smaller than that of pre-training corpora , and may be unbalanced for training NLMs . For example , the size of the popular pre-training data , Giga5en ( Parker et al. , 2011 ) , and ClueWeb 2012-B1 is 16G , and 25TB , respectively . The fine-tuning needs a different approach to training NLMs than the pretraining approach , as pre-trained NLMs should be biased towards the patterns of language used in the training data ( Keskar et al. , 2019 ) , and may not lead to domain adaptation . To tackle this imbalance problem , we explore how to adapt pre-trained Transformer based NLMs to the target domain in the fine-tuning , while preserving their advantages . Since topics exist over these datasets and represents their semantic structures such as higher-order and non-linear interaction between words , our model , Topic Aware Neural Language Model ( TAN ) , focuses on topics to resolve this imbalance between these corpora and bridge their semantic gap . As topics reflect a set of co-occurring words , semantic information , and their 1https : //www.lemurproject.org/clueweb09.php/ syntactic structure , as global statistical information , TAN introduces a new manipulation , “ topic-alignment ( TA ) ” , and new training tasks such as Topic Distribution Modeling ( TDM ) and Topic Embedding Modeling ( TEM ) While previous Transformer based NLMs are better at learning from the predefined segment length such as the context , local information using Multi-head attention ( Vaswani et al. , 2017 ) , TAN injects topics into Transformer to train NLMs by fine-tuning with emphasizing these dependencies over segments in the target domain via topics . This model not only captures global semantic coherence of all segments and word concurrence patterns , but also enriches the representation of each token by adapting it to its local context , which goes beyond the segment it resides in and can be flexibly defined according to the target task . Experiments confirm that TAN and its augmentations supports existing state-of-the-art NLMs and verify its following advantages ; •Theoretical contributions : TAN adapts Transformer based pre-trained NLMs to the unconditional text generation task via topics while preserving their architectuures . •Practical contributions : As TAN is a flexible plug-and-play model , and does not need to update the parameters of pre-trained Transformer NLMs , it generates more target-specific text at a lower computational cost than using previous NLMs alone . 2 PREVIOUS WORK . Recently , pre-trained neural language models ( NLMs ) , such as BERT ( Devlin et al. , 2019 ) , GPT2 ( Radford et al. , 2019 ) , XLNet ( Yang et al. , 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and ALBERT ( Lan et al. , 2020 ) use of Transformer ( Vaswani et al. , 2017 ) for learning contextualized text representations , and have yielded great advances for NLP tasks . These NLMs can be fine-tuned on many natural language understanding ( NLU ) tasks such as named entity recognition , question answering and text classification . Though achieving appealing performances , these Transformer-based models are better at exploring the relationships among local tokens than the document global semantics ( Wang et al. , 2020 ) . As no Transformer-based model considers these explicit semantics , Wang et al ( Wang et al. , 2020 ) rearrange and further explore the semantics of the topic model and develop a friendly topic assistant for Transformer-based abstractive summarization models . UNIfied pre-trained Language Model ( UNILM ) ( Dong et al. , 2019 ) is applied to NLU and natural language generation ( NLG ) tasks by employing a shared Transformer network and utilizing specific self-attention masks to control what context the prediction is conditioned on . However , Transformers are usually trained on disjoint fixed-length segments , without any information flow across segments ( Dai et al. , 2019 ) , limiting the contextualization within the current segment . Therefore , they often fail to take full advantage of many other rich contextual information , such as longer-range word dependencies beyond the segment length and semantic relationships between neighboring segments . While BertSUM ( Wang et al. , 2020 ) notes that topic models are better at learning explicit document semantics than Transformers , our model is applied to the domain adaptation of text generation task , and has the different architecture and training tasks to perform topic transfer between domains . 3 Methodology . 3.1 Problem formulation . Our approach aims to adapt pre-trained NLMs so that they generate unconditional texts reflecting the target-domain corpus more than corpora used in the pre-training . In NLP , language models are trained as conditional language models for specific tasks that require text generation Bengio et al . ( 2003 ) . Given text sequence x = { x1 , · · · , xT } and a dataset D = { x1 , · · · , xD } , NLMs are pre-trained by minimizing the negative likelihood under forward autoregressive factorization : minθLLM ( θ ) = minθ − |D|∑ d=1 T∑ t=1 logPθ ( xd , t|xd,1 : t−1 ) , ( 1 ) where θ represents model parameters . Since our approach focuses on the fact that the gap between the corpora for pre-trained models and the corpus of target domain is different in this distribution , it aims to train these models by bringing these distributions to the distributions observed in the target domain . For example , given “ My favorite artist is ” , the pre-trained model predicts “ Michelangelo ” as the next word , while the fine-tuned model predicts “ Botticelli ” . This leads us to introduce topics , z , into the NLMs and then modify Eq ( 1 ) to : minθLTLN ( θ ) = minθ − |D|∑ d=1 T∑ t=1 log Z∑ zt=1 Pθ ( xd , t|zt ) Pθ ( zt|xd,1 : t−1 ) , ( 2 ) where zt denotes the topic of t-th token , and Z is the number of topics . Different from the previous NLMs , TAN explicitly introduces topics into the generative process to provide richer contextual information for improving NLMs . This paper explores how to discover these topics , and fit this obtained these topics to existing pre-trained NLMs . 3.2 Our motivation and Architecture design . Our motivation for adaptation is to discover topics from a target domain and teach them to pre-trained NLMs while preserving the semantic meaning and language structural information�that these NLMs have . While Transformer encodes context , as local information , it requires the large size of source target data set to learn the higher-order and non-linear interaction between words , and will need more parameters , computation resource and time . Further , due to the limited position index during pre-training , most Transformer-based models have a maximum capacity of input tokens . Thus , they often truncate the length of a document to satisfy the length limitation of the encoder , which may lose some important semantics , especially for long documents . It is often observed that the learned attentive patterns of many heads are not as reasonable as we expect ( Michel et al. , 2019 ) , and we might obtain this global information in the upper blocks by increasing the number of blocks in transformers ( Dosovitskiy et al. , 2021 ) , where the transformer architecture requires a large number of parameters and its computational cost is very high . This motivates us to discover explicitly topics from a target domain share them with pre-trained NLMs . As 1 ) a topic describes a co-occurrence pattern of tokens with similar semantics , and 2 ) the differences between pre-training and fine-tuning data sets are not only in the topic itself , but also in the ratio of topics , our model needs to be trained separately from pre-trained NLMs so that topics , z , are not buried . This leads our model to have both the encoder and the decoder , as shown in Figure 1 . The encoder discovers topics from a given target domain and fuses topics to the decoder with their distributions . The difference between this encoder and the other encoders is in finding topic distributions from a given target domain , aligning topics between the encoder and the decoder on the top level encoder/decoder block , and replacing the word generation network in the decoder with these topic distributions . The decoder can reuse pre-trained NLMs ( e.g. , GPT2 ) , jointly learns and shares topics with the encoder . Therefore , this model does not break any structure of the original Transformer network , and can preserve the power of pre-trained NLMs . 3.3 Input . Given a target domain corpus , TAN feeds the same text as input to the encoder ( the source text ) , and the decoder each ( the target text ) , from each of this target , as shown in Fig 1 It layers convert the inputs into token ( linguistic ) embedding , and adds special tokens [ CLS ] , [ SEP ] , [ EOS ] , and < s > . Following the text preprocessing of other Transformer based NLMs , TAN tokenizes each input text as the linguistic input of token embedding , where each subword is embedded with Word Piece ( Wu et al. , 2016 ) or other model-specific tokenizer ( e.g. , Byte-Pair Encoding ( BPE ) vocabulary ( Radford et al. , 2019 ) ) whose length equals the length of its input . [ CLS ] token is only inserted prior to the token , and denotes the class of each source text . [ SEP ] token is assigned to the end of each sentence in each input sequence , and indicates a sentence break . [ EOS ] token is assigned only after the last token in each input sequence . < s > token is only inserted prior to the token in each target text . A learnable sequence position embedding is added to every input element indicating its order in the input sequence , the same as other models . Because the Transformer encoder has no recurrence , it adds some information about positions into the input embeddings . As the positions of [ CLS ] , [ SEP ] and [ EOS ] , are fixed in every input sequence , their position embeddings are also fixed as constant values for every input sequence . The final representation for each token is obtained by summing these embedding . | The paper describes an approach to adapting pre-trained Transformer-based NLMs to learn a topic distribution along with the language model. Motivated by the inability of Transformers to capture global semantic context from documents, they propose TAN, to fine-tune using the topic distribution on a target domain dataset. Experimental results on topic coherence and text generation show the strength of their model to ourperform benchmarks. | SP:9a9356cd2dae5c33ed248eebbadd88d2a6fd8f82 |
Topic Aware Neural Language Model: Domain Adaptation of Unconditional Text Generation Models | 1 INTRODUCTION . Our goal is to adapt pre-trained neural language models ( NLMs ) to the unconditional text generation task for the target domain . As with global semantic information , topic models ( Blei et al. , 2003 ; Kawamae , 2018 ; Wang et al. , 2020 ) and their extensions take a global statistical view and look at the word distributions of topics across a given corpus ; they represent each document as a bag-of-word ( BOW ) vector . Topics are global variables , describes the distributions over all tokens in the vocabulary , and form interpretable representations over texts . Although these models organize a given corpus into small sets of prominent topics and have been proven to be powerful tools for uncovering latent structure , they are not , in the strict sense , sequence models . Recently , Transformer has been applied as pre-trained NLMs ( Vaswani et al. , 2017 ; Yang et al. , 2019 ) , and are shown to be highly successful in the domain of natural language processing . Their success motivate us to explore how to adapt Transformer based NLMs for reflecting a given fine-tuning data and generating more private text with a few modifications than ever before . The corpus size of this fine-tuning is generally smaller than that of pre-training corpora , and may be unbalanced for training NLMs . For example , the size of the popular pre-training data , Giga5en ( Parker et al. , 2011 ) , and ClueWeb 2012-B1 is 16G , and 25TB , respectively . The fine-tuning needs a different approach to training NLMs than the pretraining approach , as pre-trained NLMs should be biased towards the patterns of language used in the training data ( Keskar et al. , 2019 ) , and may not lead to domain adaptation . To tackle this imbalance problem , we explore how to adapt pre-trained Transformer based NLMs to the target domain in the fine-tuning , while preserving their advantages . Since topics exist over these datasets and represents their semantic structures such as higher-order and non-linear interaction between words , our model , Topic Aware Neural Language Model ( TAN ) , focuses on topics to resolve this imbalance between these corpora and bridge their semantic gap . As topics reflect a set of co-occurring words , semantic information , and their 1https : //www.lemurproject.org/clueweb09.php/ syntactic structure , as global statistical information , TAN introduces a new manipulation , “ topic-alignment ( TA ) ” , and new training tasks such as Topic Distribution Modeling ( TDM ) and Topic Embedding Modeling ( TEM ) While previous Transformer based NLMs are better at learning from the predefined segment length such as the context , local information using Multi-head attention ( Vaswani et al. , 2017 ) , TAN injects topics into Transformer to train NLMs by fine-tuning with emphasizing these dependencies over segments in the target domain via topics . This model not only captures global semantic coherence of all segments and word concurrence patterns , but also enriches the representation of each token by adapting it to its local context , which goes beyond the segment it resides in and can be flexibly defined according to the target task . Experiments confirm that TAN and its augmentations supports existing state-of-the-art NLMs and verify its following advantages ; •Theoretical contributions : TAN adapts Transformer based pre-trained NLMs to the unconditional text generation task via topics while preserving their architectuures . •Practical contributions : As TAN is a flexible plug-and-play model , and does not need to update the parameters of pre-trained Transformer NLMs , it generates more target-specific text at a lower computational cost than using previous NLMs alone . 2 PREVIOUS WORK . Recently , pre-trained neural language models ( NLMs ) , such as BERT ( Devlin et al. , 2019 ) , GPT2 ( Radford et al. , 2019 ) , XLNet ( Yang et al. , 2019 ) , RoBERTa ( Liu et al. , 2019 ) , and ALBERT ( Lan et al. , 2020 ) use of Transformer ( Vaswani et al. , 2017 ) for learning contextualized text representations , and have yielded great advances for NLP tasks . These NLMs can be fine-tuned on many natural language understanding ( NLU ) tasks such as named entity recognition , question answering and text classification . Though achieving appealing performances , these Transformer-based models are better at exploring the relationships among local tokens than the document global semantics ( Wang et al. , 2020 ) . As no Transformer-based model considers these explicit semantics , Wang et al ( Wang et al. , 2020 ) rearrange and further explore the semantics of the topic model and develop a friendly topic assistant for Transformer-based abstractive summarization models . UNIfied pre-trained Language Model ( UNILM ) ( Dong et al. , 2019 ) is applied to NLU and natural language generation ( NLG ) tasks by employing a shared Transformer network and utilizing specific self-attention masks to control what context the prediction is conditioned on . However , Transformers are usually trained on disjoint fixed-length segments , without any information flow across segments ( Dai et al. , 2019 ) , limiting the contextualization within the current segment . Therefore , they often fail to take full advantage of many other rich contextual information , such as longer-range word dependencies beyond the segment length and semantic relationships between neighboring segments . While BertSUM ( Wang et al. , 2020 ) notes that topic models are better at learning explicit document semantics than Transformers , our model is applied to the domain adaptation of text generation task , and has the different architecture and training tasks to perform topic transfer between domains . 3 Methodology . 3.1 Problem formulation . Our approach aims to adapt pre-trained NLMs so that they generate unconditional texts reflecting the target-domain corpus more than corpora used in the pre-training . In NLP , language models are trained as conditional language models for specific tasks that require text generation Bengio et al . ( 2003 ) . Given text sequence x = { x1 , · · · , xT } and a dataset D = { x1 , · · · , xD } , NLMs are pre-trained by minimizing the negative likelihood under forward autoregressive factorization : minθLLM ( θ ) = minθ − |D|∑ d=1 T∑ t=1 logPθ ( xd , t|xd,1 : t−1 ) , ( 1 ) where θ represents model parameters . Since our approach focuses on the fact that the gap between the corpora for pre-trained models and the corpus of target domain is different in this distribution , it aims to train these models by bringing these distributions to the distributions observed in the target domain . For example , given “ My favorite artist is ” , the pre-trained model predicts “ Michelangelo ” as the next word , while the fine-tuned model predicts “ Botticelli ” . This leads us to introduce topics , z , into the NLMs and then modify Eq ( 1 ) to : minθLTLN ( θ ) = minθ − |D|∑ d=1 T∑ t=1 log Z∑ zt=1 Pθ ( xd , t|zt ) Pθ ( zt|xd,1 : t−1 ) , ( 2 ) where zt denotes the topic of t-th token , and Z is the number of topics . Different from the previous NLMs , TAN explicitly introduces topics into the generative process to provide richer contextual information for improving NLMs . This paper explores how to discover these topics , and fit this obtained these topics to existing pre-trained NLMs . 3.2 Our motivation and Architecture design . Our motivation for adaptation is to discover topics from a target domain and teach them to pre-trained NLMs while preserving the semantic meaning and language structural information�that these NLMs have . While Transformer encodes context , as local information , it requires the large size of source target data set to learn the higher-order and non-linear interaction between words , and will need more parameters , computation resource and time . Further , due to the limited position index during pre-training , most Transformer-based models have a maximum capacity of input tokens . Thus , they often truncate the length of a document to satisfy the length limitation of the encoder , which may lose some important semantics , especially for long documents . It is often observed that the learned attentive patterns of many heads are not as reasonable as we expect ( Michel et al. , 2019 ) , and we might obtain this global information in the upper blocks by increasing the number of blocks in transformers ( Dosovitskiy et al. , 2021 ) , where the transformer architecture requires a large number of parameters and its computational cost is very high . This motivates us to discover explicitly topics from a target domain share them with pre-trained NLMs . As 1 ) a topic describes a co-occurrence pattern of tokens with similar semantics , and 2 ) the differences between pre-training and fine-tuning data sets are not only in the topic itself , but also in the ratio of topics , our model needs to be trained separately from pre-trained NLMs so that topics , z , are not buried . This leads our model to have both the encoder and the decoder , as shown in Figure 1 . The encoder discovers topics from a given target domain and fuses topics to the decoder with their distributions . The difference between this encoder and the other encoders is in finding topic distributions from a given target domain , aligning topics between the encoder and the decoder on the top level encoder/decoder block , and replacing the word generation network in the decoder with these topic distributions . The decoder can reuse pre-trained NLMs ( e.g. , GPT2 ) , jointly learns and shares topics with the encoder . Therefore , this model does not break any structure of the original Transformer network , and can preserve the power of pre-trained NLMs . 3.3 Input . Given a target domain corpus , TAN feeds the same text as input to the encoder ( the source text ) , and the decoder each ( the target text ) , from each of this target , as shown in Fig 1 It layers convert the inputs into token ( linguistic ) embedding , and adds special tokens [ CLS ] , [ SEP ] , [ EOS ] , and < s > . Following the text preprocessing of other Transformer based NLMs , TAN tokenizes each input text as the linguistic input of token embedding , where each subword is embedded with Word Piece ( Wu et al. , 2016 ) or other model-specific tokenizer ( e.g. , Byte-Pair Encoding ( BPE ) vocabulary ( Radford et al. , 2019 ) ) whose length equals the length of its input . [ CLS ] token is only inserted prior to the token , and denotes the class of each source text . [ SEP ] token is assigned to the end of each sentence in each input sequence , and indicates a sentence break . [ EOS ] token is assigned only after the last token in each input sequence . < s > token is only inserted prior to the token in each target text . A learnable sequence position embedding is added to every input element indicating its order in the input sequence , the same as other models . Because the Transformer encoder has no recurrence , it adds some information about positions into the input embeddings . As the positions of [ CLS ] , [ SEP ] and [ EOS ] , are fixed in every input sequence , their position embeddings are also fixed as constant values for every input sequence . The final representation for each token is obtained by summing these embedding . | This work presents topic aware language model for unconditional text generation. Basic idea is to introduce a topic latent variable $z_t$ and prediction of the next symbol $x_t $is conditioned on $z_t$ together with the topic prediction from the history of previously generated symbols $x_{<t}$. The distribution is marginalized by summing over $z-t$. The proposed model is based on GPT-2, but formulated as an encoder-decoder by concatenating the encoder and decoder in a single network, and BERT like encoding is used to predict topic distribution. Experiments are carried out on text classification data set, e.g., Amazon and Yelp, with topic annotations, and show gains in terms of perplexity and BLEU. The contribution of this work is: - A topic aware model for language model with an encoder and decoder framework implemented within GPT-2 model structure. | SP:9a9356cd2dae5c33ed248eebbadd88d2a6fd8f82 |
PRIMA: Planner-Reasoner Inside a Multi-task Reasoning Agent | 1 INTRODUCTION . Multi-task learning ( MTL ) ( Zhang & Yang , 2021 ; Zhou et al. , 2011 ) demonstrates superior sample complexity and generalizability compared with the conventional “ one model per task ” style to solve multiple tasks . Recent research has additionally leveraged the great success of deep learning ( LeCun et al. , 2015 ) to empower learning deep multi-task models ( Zhang & Yang , 2021 ; Crawshaw , 2020 ) . Deep MTL models either learn a common multi-task feature representation by sharing several bottom layers of deep neural networks ( Zhang et al. , 2014 ; Liu et al. , 2015 ; Zhang et al. , 2015a ; Mrksic et al. , 2015 ; Li et al. , 2015 ) , or learn task-invariant and task-specific neural modules ( Shinohara , 2016 ; Liu et al. , 2017 ) via generative adversarial networks ( Goodfellow et al. , 2014 ) . Although MTL is successful in many applications , a major challenge is the often impractically large MTL models . Although still smaller than piling up all models across different tasks , existing MTL models are significantly larger than a single model for tackling a specific task . This results from the intrinsic conflict underlying all MTL algorithms : balancing across-task generalization capability to perform different tasks with single-task efficiency in executing a specific task . On one hand , good generalization ability requires an MTL agent to be equipped with a large set of skills that can be combined to solve many different tasks . On the other hand , solving one particular task does not require all these skills . Instead , the agent needs to compose only a ( small ) subset of these skills into an efficient solution for a specific task . This conflict often hobbles existing MTL approaches . This paper focuses on multi-task reasoning ( MTR ) , a subarea of MTL that uses logic reasoning to solve multiple tasks . MTR is ubiquitous in human reasoning , where humans construct different reasoning paths for multiple tasks from the same set of reasoning skills . Conventional deep learning , although capable of strong expressive power , falls short in reasoning capabilities ( Bengio , 2019 ) . Considerable research has been devoted to endowing deep learning with logic reasoning abilities , the results of which include Deep Neural Reasoning ( Jaeger , 2016 ) , Neural Logic Reasoning ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) , Neural Logic Machines ( Dong et al. , 2019 ) , and other approaches ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) . However , these approaches consider only single-task reasoning rather than a multi-task setting , and applying 1The code will be released after acceptance . existing MTL approaches to learning these neural reasoning models leads to the same conflict between across-task generalization capability and single-task efficiency . To strike a balance between reasoning capability and efficiency in MTR , we develop a PlannerReasoner architecture Inside a Multi-task reasoning Agent ( PRIMA ) ( Section 2 ) , wherein the reasoner defines a set of neural logic operators for modeling reusable reasoning meta-rules ( “ skills ” ) across tasks ( Section 2.2 ) . When defining the logic operators , we focus on first-order logic because of its simplicity and wide applicability to many reasoning problems , such as automated theorem proving ( Fitting , 2012 ; Gallier , 2015 ) and knowledge-based systems ( Van Harmelen et al. , 2008 ) . A separate planner module activates only a small subset of the meta-rules necessary for a given task and composes them into a deduction process ( Section 2.3 ) . Thus , our planner-reasoner architecture features the dual capabilities of composing and pruning a logic deduction process , achieving a graceful capability-efficiency trade-off in MTR ( Section 2.4 ) . The model architecture is trained in an end-to-end manner using deep reinforcement learning ( Section 3 ) , and experimental results on several benchmarks demonstrate that this framework leads to a more principled predicate space search and reduces reasoning complexity ( Section 4 ) . We discuss related works in Section 5 , and conclude our paper in Section 6 . 2 PLANNER-REASONER FOR MULTI-TASK REASONING . This section proposes the Planner-Reasoner framework for MTR . To that end , we first formally state the logic reasoning problem in Section 2.1 , and then in Sections 2.2 and 2.3 , we describe the Planner-Reasoner Inside a Single Reasoning Agent ( PRISA ) framework . This is a plannerreasoner architecture , which is a neural-logic architecture for traversing the first-order predicate space . Typically , logical reasoning can be reduced to learning to search for a reasoning path with logical operators and then derive a logical consequence from premises . Therefore , a reasoning problem can be addressed in two steps : ( i ) constructing the elementary logical operators and ( ii ) selecting a reasoning path that chains these logical operators together . This key observation motivates the Reasoner ( Section 2.2 ) and Planner ( Section 2.3 ) modules in our framework . In Section 2.4 , the PRISA framework is extended to the MTR setting , which results in the Planner-Reasoner Inside a Multi-task Reasoning Agent ( PRIMA ) framework . 2.1 PROBLEM FORMULATION . Logic reasoning We begin with a brief introduction of the logic reasoning problem . Specifically , we consider a special variant of the First-Order Logic ( FOL ) system , which only consists of individual variables , constants and up to r-ary predicate variables . That is , we do not consider functions that map individual variables/constants into terms . An r-ary predicate p ( x1 , . . . , xr ) can be considered as a relation between r constants , which takes the value of True or False . An atom p ( x1 , · · · , xr ) is an r-ary predicate with its arguments x1 , · · · , xr being either variables or constants . A well-defined formula in our FOL system is a logical expression that is composed from atoms , logical connectives ( e.g. , negation ¬ , conjunction ^ , disjunction _ , implication ) , and possibly existential 9 and universal 8 quantifiers according to certain formation rules ( see Andrews ( 2002 ) for the details ) . In particular , the quantifiers 9 and 8 are only allowed to be applied to individual variables in FOL . In Fig . 1 , we give an example from the AdjacentToRed task ( Graves et al. , 2016 ) and show how it could be formulated as a logical reasoning problem . Specifically , we are given a random graph along with the properties ( i.e. , the color ) of the nodes and the relations ( i.e. , connectivity ) between nodes . In our context , each node i in the graph is a constant and an individual variable x takes values in the set of constants { 1 , . . . , 5 } . The properties of nodes and the relations between nodes are modeled as the unary predicate IsRed ( x ) ( 5⇥ 1 vector ) and the binary predicate HasEdge ( x , y ) ( 5⇥ 5 matrix ) , respectively . The objective of logical reasoning is to deduce the value of the unary predicate AdjacentToRed ( x ) ( i.e. , whether a node x has a neighbor of red color ) from the base predicates IsRed ( x ) and HasEdge ( x , y ) ( see Fig . 1 for an example of the deduction process ) . Multi-Task Reasoning Next , we introduce the definition of MTR . With a slight abuse of notations , let { p ( x1 , . . . , xr ) : r 2 [ 1 , n ] } be the set of input predicates sampled from any of the k different reasoning tasks , where x1 , . . . , xr are the individual variables and n is the maximum arity . A multi-task reasoning model takes p ( x1 , . . . , xr ) as its input and seeks to predict the corresponding ground-truth output predicates q ( x1 , . . . , xr ) . The aim is to learn multiple reasoning tasks jointly in a single model so that the reasoning skills in a task can be leveraged by other tasks to improve the general performance of all tasks at hand . 2.2 REASONER : TRANSFORMING LOGIC RULES INTO NEURAL OPERATORS . The Reasoner module conducts logical deduction using a set of neural operators constructed from first-order logic rules ( more specifically , a set of “ learnable ” Horn clauses ) . Its architecture is inspired by NLM ( Dong et al. , 2019 ) ( details about the difference can be found in Appendix D ) . Three logic rules are considered as essential meta-rules : BooleanLogic , Expansion , and Reduction . BooleanLogic : expression ( x1 , x2 , · · · , xr ) ! p̂ ( x1 , x2 , · · · , xr ) , where expression is composed of a combination of Boolean operations ( AND , OR , and NOT ) and p̂ is the output predicate . For a given r-ary predicate and a given permutation 2 Sn , we define p ( x1 , · · · , xr ) = p ( x ( 1 ) , · · · , x ( r ) ) where Sn is the set of all possible permutations as the arguments to an input predicate . The corresponding neural implementation of BooleanLogic is ( MLP ( p ( x1 , · · · , xr ) ) ; ✓ ) , where is the sigmoid activation function , MLP refers to a multilayer perceptron , a Permute ( · ) neural operator transforms input predicates to p ( x1 , · · · , xr ) , and ✓ is the learnable parameter within the model . This is similar to the implicit Horn clause with the universal quantifier ( 8 ) , e.g. , p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) implicitly denoting 8x p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) . The class of neural operators can be viewed as “ learnable ” Horn clauses . Expansion , and Reduction are two types of meta-rules for quantification that bridge predicates of different arities with logic quantifiers ( 8 and 9 ) . Expansion introduces a new and distinct variable xr+1 for a set of r-ary predicates with the universal quantifier ( 8 ) . For this reason , Expansion creates a new predicate q from p. Expansion : p ( x1 , x2 , · · · , xr ) ! 8xr+1 , q ( x1 , x2 , · · · , xr , xr+1 ) , where xr+1 /2 { xi } ri=1 . The corresponding neural implementation of Expansion , denoted by Expand ( · ) , expands the r-ary predicates into the ( r + 1 ) -ary predicates by repeating the r-ary predicates and stacking them in a new dimension . Conversely , Reduction removes the variable xr+1 in a set of ( r + 1 ) -ary predicates via the quantifiers of 8 or 9 . Reduction : 8xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) , or 9xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) . The corresponding neural implementation of Reduction , denoted by Reduce ( · ) , reducing the ( r+1 ) ary predicates into the r-ary predicates by taking the minimum ( resp . maximum ) along the dimension of xr+1 due to the universal quantifier 8 ( resp . existential quantifier 9 ) . | This paper presents PRIMA (“Planner-Reasoner Inside a Multi-Task Reasoning Agent”), a multi-task reasoning model that can be applied to several tasks that require first order logical reasoning. Notably, this paper seeks to address a problem that plagues multi-task learning more generally — the tradeoff between cross-task generalizability, and single-task effectiveness. Prior work in multi-task learning shows that it’s hard to strike this balance, and most work in building neural systems for logical reasoning focus on the single task setting. The main contribution of this paper is first a single task planning-based agent that learns to reason for an individual logical task (e.g., a graph reasoning task like `4-Connectivity` or `1-Outdegree`) by routing input problem representations (predicates describing the problem) through a planning module; this planner acts as a high-level policy that (over multiple steps) routes the input through individual “reasoning” components that are “neural” versions of first-order logic meta-operators. This is a compact, two-party approach for solving complex reasoning problems; the reasoner defines the atomic operations, while the planner figures out what operations to apply, in what order. The full system is learned via reinforcement learning, first via model-free methods such as REINFORCE and PPO, but with significantly better results using the structure of the problem (we can always roll-out through the planner) to use Model-based RL, specifically the MuZero formulation. Using MuZero/MCTS to learn the Planner/Reasoner, PRIMA shows competitive performance on single-tasks, and to generalize to multiple tasks, we simply add a “nullary predicate” that specifies the task ID. PRIMA performs well, comparably to other approaches for logical reasoning, even when prior approaches (such as the Neural Logic Machine) are extended to multi-task settings in the same way (adding this extra task conditioning information). Where PRIMA shows benefits over prior approaches are in aggregate FLOPs (showing that PRIMA may be learning to reason more efficiently), and in a single probing experiment showing how PRIMA can generalize to new input classes unseen at training. | SP:ea50a5b16a1cc041ec8de4bcecc058edb117ca79 |
PRIMA: Planner-Reasoner Inside a Multi-task Reasoning Agent | 1 INTRODUCTION . Multi-task learning ( MTL ) ( Zhang & Yang , 2021 ; Zhou et al. , 2011 ) demonstrates superior sample complexity and generalizability compared with the conventional “ one model per task ” style to solve multiple tasks . Recent research has additionally leveraged the great success of deep learning ( LeCun et al. , 2015 ) to empower learning deep multi-task models ( Zhang & Yang , 2021 ; Crawshaw , 2020 ) . Deep MTL models either learn a common multi-task feature representation by sharing several bottom layers of deep neural networks ( Zhang et al. , 2014 ; Liu et al. , 2015 ; Zhang et al. , 2015a ; Mrksic et al. , 2015 ; Li et al. , 2015 ) , or learn task-invariant and task-specific neural modules ( Shinohara , 2016 ; Liu et al. , 2017 ) via generative adversarial networks ( Goodfellow et al. , 2014 ) . Although MTL is successful in many applications , a major challenge is the often impractically large MTL models . Although still smaller than piling up all models across different tasks , existing MTL models are significantly larger than a single model for tackling a specific task . This results from the intrinsic conflict underlying all MTL algorithms : balancing across-task generalization capability to perform different tasks with single-task efficiency in executing a specific task . On one hand , good generalization ability requires an MTL agent to be equipped with a large set of skills that can be combined to solve many different tasks . On the other hand , solving one particular task does not require all these skills . Instead , the agent needs to compose only a ( small ) subset of these skills into an efficient solution for a specific task . This conflict often hobbles existing MTL approaches . This paper focuses on multi-task reasoning ( MTR ) , a subarea of MTL that uses logic reasoning to solve multiple tasks . MTR is ubiquitous in human reasoning , where humans construct different reasoning paths for multiple tasks from the same set of reasoning skills . Conventional deep learning , although capable of strong expressive power , falls short in reasoning capabilities ( Bengio , 2019 ) . Considerable research has been devoted to endowing deep learning with logic reasoning abilities , the results of which include Deep Neural Reasoning ( Jaeger , 2016 ) , Neural Logic Reasoning ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) , Neural Logic Machines ( Dong et al. , 2019 ) , and other approaches ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) . However , these approaches consider only single-task reasoning rather than a multi-task setting , and applying 1The code will be released after acceptance . existing MTL approaches to learning these neural reasoning models leads to the same conflict between across-task generalization capability and single-task efficiency . To strike a balance between reasoning capability and efficiency in MTR , we develop a PlannerReasoner architecture Inside a Multi-task reasoning Agent ( PRIMA ) ( Section 2 ) , wherein the reasoner defines a set of neural logic operators for modeling reusable reasoning meta-rules ( “ skills ” ) across tasks ( Section 2.2 ) . When defining the logic operators , we focus on first-order logic because of its simplicity and wide applicability to many reasoning problems , such as automated theorem proving ( Fitting , 2012 ; Gallier , 2015 ) and knowledge-based systems ( Van Harmelen et al. , 2008 ) . A separate planner module activates only a small subset of the meta-rules necessary for a given task and composes them into a deduction process ( Section 2.3 ) . Thus , our planner-reasoner architecture features the dual capabilities of composing and pruning a logic deduction process , achieving a graceful capability-efficiency trade-off in MTR ( Section 2.4 ) . The model architecture is trained in an end-to-end manner using deep reinforcement learning ( Section 3 ) , and experimental results on several benchmarks demonstrate that this framework leads to a more principled predicate space search and reduces reasoning complexity ( Section 4 ) . We discuss related works in Section 5 , and conclude our paper in Section 6 . 2 PLANNER-REASONER FOR MULTI-TASK REASONING . This section proposes the Planner-Reasoner framework for MTR . To that end , we first formally state the logic reasoning problem in Section 2.1 , and then in Sections 2.2 and 2.3 , we describe the Planner-Reasoner Inside a Single Reasoning Agent ( PRISA ) framework . This is a plannerreasoner architecture , which is a neural-logic architecture for traversing the first-order predicate space . Typically , logical reasoning can be reduced to learning to search for a reasoning path with logical operators and then derive a logical consequence from premises . Therefore , a reasoning problem can be addressed in two steps : ( i ) constructing the elementary logical operators and ( ii ) selecting a reasoning path that chains these logical operators together . This key observation motivates the Reasoner ( Section 2.2 ) and Planner ( Section 2.3 ) modules in our framework . In Section 2.4 , the PRISA framework is extended to the MTR setting , which results in the Planner-Reasoner Inside a Multi-task Reasoning Agent ( PRIMA ) framework . 2.1 PROBLEM FORMULATION . Logic reasoning We begin with a brief introduction of the logic reasoning problem . Specifically , we consider a special variant of the First-Order Logic ( FOL ) system , which only consists of individual variables , constants and up to r-ary predicate variables . That is , we do not consider functions that map individual variables/constants into terms . An r-ary predicate p ( x1 , . . . , xr ) can be considered as a relation between r constants , which takes the value of True or False . An atom p ( x1 , · · · , xr ) is an r-ary predicate with its arguments x1 , · · · , xr being either variables or constants . A well-defined formula in our FOL system is a logical expression that is composed from atoms , logical connectives ( e.g. , negation ¬ , conjunction ^ , disjunction _ , implication ) , and possibly existential 9 and universal 8 quantifiers according to certain formation rules ( see Andrews ( 2002 ) for the details ) . In particular , the quantifiers 9 and 8 are only allowed to be applied to individual variables in FOL . In Fig . 1 , we give an example from the AdjacentToRed task ( Graves et al. , 2016 ) and show how it could be formulated as a logical reasoning problem . Specifically , we are given a random graph along with the properties ( i.e. , the color ) of the nodes and the relations ( i.e. , connectivity ) between nodes . In our context , each node i in the graph is a constant and an individual variable x takes values in the set of constants { 1 , . . . , 5 } . The properties of nodes and the relations between nodes are modeled as the unary predicate IsRed ( x ) ( 5⇥ 1 vector ) and the binary predicate HasEdge ( x , y ) ( 5⇥ 5 matrix ) , respectively . The objective of logical reasoning is to deduce the value of the unary predicate AdjacentToRed ( x ) ( i.e. , whether a node x has a neighbor of red color ) from the base predicates IsRed ( x ) and HasEdge ( x , y ) ( see Fig . 1 for an example of the deduction process ) . Multi-Task Reasoning Next , we introduce the definition of MTR . With a slight abuse of notations , let { p ( x1 , . . . , xr ) : r 2 [ 1 , n ] } be the set of input predicates sampled from any of the k different reasoning tasks , where x1 , . . . , xr are the individual variables and n is the maximum arity . A multi-task reasoning model takes p ( x1 , . . . , xr ) as its input and seeks to predict the corresponding ground-truth output predicates q ( x1 , . . . , xr ) . The aim is to learn multiple reasoning tasks jointly in a single model so that the reasoning skills in a task can be leveraged by other tasks to improve the general performance of all tasks at hand . 2.2 REASONER : TRANSFORMING LOGIC RULES INTO NEURAL OPERATORS . The Reasoner module conducts logical deduction using a set of neural operators constructed from first-order logic rules ( more specifically , a set of “ learnable ” Horn clauses ) . Its architecture is inspired by NLM ( Dong et al. , 2019 ) ( details about the difference can be found in Appendix D ) . Three logic rules are considered as essential meta-rules : BooleanLogic , Expansion , and Reduction . BooleanLogic : expression ( x1 , x2 , · · · , xr ) ! p̂ ( x1 , x2 , · · · , xr ) , where expression is composed of a combination of Boolean operations ( AND , OR , and NOT ) and p̂ is the output predicate . For a given r-ary predicate and a given permutation 2 Sn , we define p ( x1 , · · · , xr ) = p ( x ( 1 ) , · · · , x ( r ) ) where Sn is the set of all possible permutations as the arguments to an input predicate . The corresponding neural implementation of BooleanLogic is ( MLP ( p ( x1 , · · · , xr ) ) ; ✓ ) , where is the sigmoid activation function , MLP refers to a multilayer perceptron , a Permute ( · ) neural operator transforms input predicates to p ( x1 , · · · , xr ) , and ✓ is the learnable parameter within the model . This is similar to the implicit Horn clause with the universal quantifier ( 8 ) , e.g. , p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) implicitly denoting 8x p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) . The class of neural operators can be viewed as “ learnable ” Horn clauses . Expansion , and Reduction are two types of meta-rules for quantification that bridge predicates of different arities with logic quantifiers ( 8 and 9 ) . Expansion introduces a new and distinct variable xr+1 for a set of r-ary predicates with the universal quantifier ( 8 ) . For this reason , Expansion creates a new predicate q from p. Expansion : p ( x1 , x2 , · · · , xr ) ! 8xr+1 , q ( x1 , x2 , · · · , xr , xr+1 ) , where xr+1 /2 { xi } ri=1 . The corresponding neural implementation of Expansion , denoted by Expand ( · ) , expands the r-ary predicates into the ( r + 1 ) -ary predicates by repeating the r-ary predicates and stacking them in a new dimension . Conversely , Reduction removes the variable xr+1 in a set of ( r + 1 ) -ary predicates via the quantifiers of 8 or 9 . Reduction : 8xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) , or 9xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) . The corresponding neural implementation of Reduction , denoted by Reduce ( · ) , reducing the ( r+1 ) ary predicates into the r-ary predicates by taking the minimum ( resp . maximum ) along the dimension of xr+1 due to the universal quantifier 8 ( resp . existential quantifier 9 ) . | The paper introduces a neuro-symbolic framework for multi-task reasoning that builds on NLM. Specifically, the method tries to achieve higher efficiency at the inference time, by using an RL component that controls the operations performed as part of the reasoning process. They adapt the system for multi-task settings by introducing nullary predicates that capture the specific task details. The method is compared to multiple baselines, including an adaptation of NLM to the multi-task setting. While the methods perform similar to the baselines in terms of the overall accuracy, the approach does result in a lower number of floating-point operations at the inference time. | SP:ea50a5b16a1cc041ec8de4bcecc058edb117ca79 |
PRIMA: Planner-Reasoner Inside a Multi-task Reasoning Agent | 1 INTRODUCTION . Multi-task learning ( MTL ) ( Zhang & Yang , 2021 ; Zhou et al. , 2011 ) demonstrates superior sample complexity and generalizability compared with the conventional “ one model per task ” style to solve multiple tasks . Recent research has additionally leveraged the great success of deep learning ( LeCun et al. , 2015 ) to empower learning deep multi-task models ( Zhang & Yang , 2021 ; Crawshaw , 2020 ) . Deep MTL models either learn a common multi-task feature representation by sharing several bottom layers of deep neural networks ( Zhang et al. , 2014 ; Liu et al. , 2015 ; Zhang et al. , 2015a ; Mrksic et al. , 2015 ; Li et al. , 2015 ) , or learn task-invariant and task-specific neural modules ( Shinohara , 2016 ; Liu et al. , 2017 ) via generative adversarial networks ( Goodfellow et al. , 2014 ) . Although MTL is successful in many applications , a major challenge is the often impractically large MTL models . Although still smaller than piling up all models across different tasks , existing MTL models are significantly larger than a single model for tackling a specific task . This results from the intrinsic conflict underlying all MTL algorithms : balancing across-task generalization capability to perform different tasks with single-task efficiency in executing a specific task . On one hand , good generalization ability requires an MTL agent to be equipped with a large set of skills that can be combined to solve many different tasks . On the other hand , solving one particular task does not require all these skills . Instead , the agent needs to compose only a ( small ) subset of these skills into an efficient solution for a specific task . This conflict often hobbles existing MTL approaches . This paper focuses on multi-task reasoning ( MTR ) , a subarea of MTL that uses logic reasoning to solve multiple tasks . MTR is ubiquitous in human reasoning , where humans construct different reasoning paths for multiple tasks from the same set of reasoning skills . Conventional deep learning , although capable of strong expressive power , falls short in reasoning capabilities ( Bengio , 2019 ) . Considerable research has been devoted to endowing deep learning with logic reasoning abilities , the results of which include Deep Neural Reasoning ( Jaeger , 2016 ) , Neural Logic Reasoning ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) , Neural Logic Machines ( Dong et al. , 2019 ) , and other approaches ( Besold et al. , 2017 ; Bader et al. , 2004 ; Bader & Hitzler , 2005 ) . However , these approaches consider only single-task reasoning rather than a multi-task setting , and applying 1The code will be released after acceptance . existing MTL approaches to learning these neural reasoning models leads to the same conflict between across-task generalization capability and single-task efficiency . To strike a balance between reasoning capability and efficiency in MTR , we develop a PlannerReasoner architecture Inside a Multi-task reasoning Agent ( PRIMA ) ( Section 2 ) , wherein the reasoner defines a set of neural logic operators for modeling reusable reasoning meta-rules ( “ skills ” ) across tasks ( Section 2.2 ) . When defining the logic operators , we focus on first-order logic because of its simplicity and wide applicability to many reasoning problems , such as automated theorem proving ( Fitting , 2012 ; Gallier , 2015 ) and knowledge-based systems ( Van Harmelen et al. , 2008 ) . A separate planner module activates only a small subset of the meta-rules necessary for a given task and composes them into a deduction process ( Section 2.3 ) . Thus , our planner-reasoner architecture features the dual capabilities of composing and pruning a logic deduction process , achieving a graceful capability-efficiency trade-off in MTR ( Section 2.4 ) . The model architecture is trained in an end-to-end manner using deep reinforcement learning ( Section 3 ) , and experimental results on several benchmarks demonstrate that this framework leads to a more principled predicate space search and reduces reasoning complexity ( Section 4 ) . We discuss related works in Section 5 , and conclude our paper in Section 6 . 2 PLANNER-REASONER FOR MULTI-TASK REASONING . This section proposes the Planner-Reasoner framework for MTR . To that end , we first formally state the logic reasoning problem in Section 2.1 , and then in Sections 2.2 and 2.3 , we describe the Planner-Reasoner Inside a Single Reasoning Agent ( PRISA ) framework . This is a plannerreasoner architecture , which is a neural-logic architecture for traversing the first-order predicate space . Typically , logical reasoning can be reduced to learning to search for a reasoning path with logical operators and then derive a logical consequence from premises . Therefore , a reasoning problem can be addressed in two steps : ( i ) constructing the elementary logical operators and ( ii ) selecting a reasoning path that chains these logical operators together . This key observation motivates the Reasoner ( Section 2.2 ) and Planner ( Section 2.3 ) modules in our framework . In Section 2.4 , the PRISA framework is extended to the MTR setting , which results in the Planner-Reasoner Inside a Multi-task Reasoning Agent ( PRIMA ) framework . 2.1 PROBLEM FORMULATION . Logic reasoning We begin with a brief introduction of the logic reasoning problem . Specifically , we consider a special variant of the First-Order Logic ( FOL ) system , which only consists of individual variables , constants and up to r-ary predicate variables . That is , we do not consider functions that map individual variables/constants into terms . An r-ary predicate p ( x1 , . . . , xr ) can be considered as a relation between r constants , which takes the value of True or False . An atom p ( x1 , · · · , xr ) is an r-ary predicate with its arguments x1 , · · · , xr being either variables or constants . A well-defined formula in our FOL system is a logical expression that is composed from atoms , logical connectives ( e.g. , negation ¬ , conjunction ^ , disjunction _ , implication ) , and possibly existential 9 and universal 8 quantifiers according to certain formation rules ( see Andrews ( 2002 ) for the details ) . In particular , the quantifiers 9 and 8 are only allowed to be applied to individual variables in FOL . In Fig . 1 , we give an example from the AdjacentToRed task ( Graves et al. , 2016 ) and show how it could be formulated as a logical reasoning problem . Specifically , we are given a random graph along with the properties ( i.e. , the color ) of the nodes and the relations ( i.e. , connectivity ) between nodes . In our context , each node i in the graph is a constant and an individual variable x takes values in the set of constants { 1 , . . . , 5 } . The properties of nodes and the relations between nodes are modeled as the unary predicate IsRed ( x ) ( 5⇥ 1 vector ) and the binary predicate HasEdge ( x , y ) ( 5⇥ 5 matrix ) , respectively . The objective of logical reasoning is to deduce the value of the unary predicate AdjacentToRed ( x ) ( i.e. , whether a node x has a neighbor of red color ) from the base predicates IsRed ( x ) and HasEdge ( x , y ) ( see Fig . 1 for an example of the deduction process ) . Multi-Task Reasoning Next , we introduce the definition of MTR . With a slight abuse of notations , let { p ( x1 , . . . , xr ) : r 2 [ 1 , n ] } be the set of input predicates sampled from any of the k different reasoning tasks , where x1 , . . . , xr are the individual variables and n is the maximum arity . A multi-task reasoning model takes p ( x1 , . . . , xr ) as its input and seeks to predict the corresponding ground-truth output predicates q ( x1 , . . . , xr ) . The aim is to learn multiple reasoning tasks jointly in a single model so that the reasoning skills in a task can be leveraged by other tasks to improve the general performance of all tasks at hand . 2.2 REASONER : TRANSFORMING LOGIC RULES INTO NEURAL OPERATORS . The Reasoner module conducts logical deduction using a set of neural operators constructed from first-order logic rules ( more specifically , a set of “ learnable ” Horn clauses ) . Its architecture is inspired by NLM ( Dong et al. , 2019 ) ( details about the difference can be found in Appendix D ) . Three logic rules are considered as essential meta-rules : BooleanLogic , Expansion , and Reduction . BooleanLogic : expression ( x1 , x2 , · · · , xr ) ! p̂ ( x1 , x2 , · · · , xr ) , where expression is composed of a combination of Boolean operations ( AND , OR , and NOT ) and p̂ is the output predicate . For a given r-ary predicate and a given permutation 2 Sn , we define p ( x1 , · · · , xr ) = p ( x ( 1 ) , · · · , x ( r ) ) where Sn is the set of all possible permutations as the arguments to an input predicate . The corresponding neural implementation of BooleanLogic is ( MLP ( p ( x1 , · · · , xr ) ) ; ✓ ) , where is the sigmoid activation function , MLP refers to a multilayer perceptron , a Permute ( · ) neural operator transforms input predicates to p ( x1 , · · · , xr ) , and ✓ is the learnable parameter within the model . This is similar to the implicit Horn clause with the universal quantifier ( 8 ) , e.g. , p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) implicitly denoting 8x p1 ( x ) ^ p2 ( x ) ! p̂ ( x ) . The class of neural operators can be viewed as “ learnable ” Horn clauses . Expansion , and Reduction are two types of meta-rules for quantification that bridge predicates of different arities with logic quantifiers ( 8 and 9 ) . Expansion introduces a new and distinct variable xr+1 for a set of r-ary predicates with the universal quantifier ( 8 ) . For this reason , Expansion creates a new predicate q from p. Expansion : p ( x1 , x2 , · · · , xr ) ! 8xr+1 , q ( x1 , x2 , · · · , xr , xr+1 ) , where xr+1 /2 { xi } ri=1 . The corresponding neural implementation of Expansion , denoted by Expand ( · ) , expands the r-ary predicates into the ( r + 1 ) -ary predicates by repeating the r-ary predicates and stacking them in a new dimension . Conversely , Reduction removes the variable xr+1 in a set of ( r + 1 ) -ary predicates via the quantifiers of 8 or 9 . Reduction : 8xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) , or 9xr+1 p ( x1 , x2 , · · · , xr , xr+1 ) ! q ( x1 , x2 , · · · , xr ) . The corresponding neural implementation of Reduction , denoted by Reduce ( · ) , reducing the ( r+1 ) ary predicates into the r-ary predicates by taking the minimum ( resp . maximum ) along the dimension of xr+1 due to the universal quantifier 8 ( resp . existential quantifier 9 ) . | The paper presents PRIMA, a framework designed to solve the problem of multi-task reasoning. PRIMA consists of two parts: a reasoner, which produces logical deductions using a set of neural operators built by translating FOL rules; and a planner, which activates the reasoner operators and creates reasoning paths to solve the task. The paper presents several tests that achieve performance usually stable on 100% succesful seeds. | SP:ea50a5b16a1cc041ec8de4bcecc058edb117ca79 |
Domain-wise Adversarial Training for Out-of-Distribution Generalization | 1 INTRODUCTION . Modern deep learning techniques have achieved remarkable success on many tasks ( He et al. , 2016 ; Brown et al. , 2020 ) . Yet , under some scenarios , deep models will suffer a catastrophic performance degradation since they tend to seize on spurious correlations in the training data ( Beery et al. , 2018 ) . One of those representative scenarios is the Out-of-Distribution ( OOD ) generalization , where one expects the trained model to perform well at the test time even when the training and testing data come from different distributions1 . Another representative scenario under which deep models are unstable is the adversarial example . Researchers have found that deep models are quite brittle since one can inject imperceptible perturbations into the input and cause the model to make wrong predictions with extremely high confidence ( Szegedy et al. , 2014 ) . These two issues have some similarities to each other . They both arise because deep networks do not learn the essential causal associations ( or intrinsic features ) . Nevertheless , in their corresponding fields , different approaches have been proposed . For OOD generalization , a large class of methods called Invariant Causal Prediction ( ICP ) ( Peters et al. , 2016 ) are proposed . Among them , Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) attracts significant attention , which intends to extract features that are invariant across different data distributions and expects the model to ignore information related to the environment . While for adversarial robustness against adversarial examples , Adversarial Training ( AT ) ( Madry et al. , 2018 ) is the most effective approach at the current stage ( Athalye et al. , 2018 ) . It trains a model on adversarial examples that are generated by injecting perturbations optimized for each image into natural examples . These two fields seem to be independent , and their connections are rarely studied . That is exactly what we are exploring in this paper . Although IRM and its variants have shown promise on certain tasks , e.g. , CMNIST ( Arjovsky et al. , 2019 ) , recent studies ( Gulrajani & Lopez-Paz , 2021 ) show that on a large-scale controlled experiment on OOD generalization , all these methods fail to exceed the simplest i.i.d . baseline , i.e. , Empirical Risk Minimization ( ERM ) . Through a dissection of the benchmark datasets , Ye et al . ( 2021 ) 1In current literature , the terminologies of “ domain ” , “ environment ” and “ distribution ” are often used interchangeably , so we do the same in the whole paper . notice that there are actually two types of distribution shifts : correlation shift ( same support , different correlation ) and diversity shift ( different support , same correlation ) . IRM variants can only perform well under ( some ) correlation shift while performing poorly under diversity shift . Thus , we need to seek better alternatives for OOD generalization , while AT seems to be a promising candidate from both theoretical and empirical aspects . Theoretically , by learning invariance w.r.t . local input perturbations , AT can be regarded as Distributionally Robust Optimization ( DRO ) ( Sinha et al. , 2018 ; Volpi et al. , 2018 ; Rahimian & Mehrotra , 2019 ; Duchi et al. , 2021 ) over ` p-bounded distributional shift . Thus , AT could reliably extract robust features , e.g. , the object shape , from the input . Empirically , several recent works show that AT has better domain transferability than ERM ( Salman et al. , 2020 ) . These findings naturally leads to the questions : Will AT perform better than IRM ? Will AT be helpful for OOD generalization ? In this paper , we take a further step to answering these intriguing questions . We first reveal the connections between IRM and AT , and find that IRM can be regarded as an instance-reweighted version of Domain-wise Adversarial Training ( DAT ) , a new version of adversarial training that we propose for generalizing Universal Adversarial Training ( Moosavi-Dezfooli et al. , 2017 ) to multiple domains . Inspired by this connection , we further explore how DAT performs for OOD data . We first notice that DAT is suitable for solving domain generalization problems as it can effectively remove the relatively static background information with domain-wise perturbations . We further verify this intuition on both synthetic tasks ( Xiao et al. , 2021 ) and real-world datasets , where we show clear advantages over ERM . At last , we conduct extensive experiments on benchmark datasets and show our DAT can outperform ERM consistently on tasks dominated by both correlation shift and diversity shift , and as a result , achieve state-of-the-art performance ( in average ) on these datasets . We summarize our contributions as follows : • We develop a new kind of adversarial training , Domain-wise Adversarial Training ( DAT ) , for domain generalization , and we establish the intrinsic similarity between IRM and domain-wise AT objectives . • We analyze how DAT will benefit learning invariant features and verify our hypothesis through both synthetic data and real-world datasets . • Extensive experiments on benchmark datasets show that DAT does not only perform better than ERM under correlation shift like IRM but also outperforms ERM under diversity shift like ( sample-wise ) AT . Therefore , our methods achieve state-of-the-art results by surpassing ERM at both kinds of distribution shifts . 2 RELATED WORKS . IRM and Its Variants Invariant Risk Minimization ( IRM ) ( Arjovsky et al . ( 2019 ) ) develops a paradigm to extract causal ( invariant ) features and find the optimal invariant classifier on top over several given training environments . The work of Kamath et al . ( 2021 ) reveals the gap between IRM and IRMv1 , show that even in a simple model that echos the idea of the original IRM objective , IRMv1 can fail catastrophically . Rosenfeld et al . ( 2021 ) prove that when the number of training environments is not large enough , IRM can face the risk of using environmental features . There also exists a predictor feasible for IRMv1 that is very similar to the ERM solution . AT and Its Variants Szegedy et al . ( 2014 ) report one can inject imperceptible perturbations to fool deep models . Athalye et al . ( 2018 ) reveal that among the proposed defenses , adversarial training was the only effective one . Adversarial Training ( AT ) ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) is the representative approach to train robust models . Recently , Kamath et al . ( 2021 ) show adversarially learned features can transfer better than standardly trained models , while various works ( Volpi et al. , 2018 ; Sinha et al. , 2018 ; Ford et al. , 2019 ; Qiao et al. , 2020 ; Yi et al. , 2021 ; Gokhale et al. , 2021 ) adopt sample-wise adversarial training or adversarial data augmentation to improve OOD robustness . However , most of the discussions are limited to distributional robustness w.r.t . Wasserstein distance , making it less practical for accounting real-world OOD scenarios as discussed in this work . Evaluating OOD Robustness Gulrajani & Lopez-Paz ( 2021 ) recently noticed that the evaluation criteria are crucial for fair comparison of OOD robustness , where under fair settings , no algorithm has performed consistently better than vanilla ERM . Ye et al . ( 2021 ) further identifies two kinds of distribution shifts in current benchmark datasets : diversity shift and correlation shift . Diversity shift refers to the shift of the distribution support of spurious feature z , while correlation shift refers to the change of conditional probability of label y given spurious feature z on the same support . We present an illustrative example in Figure 1 . In particular , they show that there seems to be a tradeoff between the two tasks as an algorithm that performs well at one task tends to perform poorly on the other . Instead , in this work , we show that our DAT can achieve superior performance on both correlation shift and diversity shift tasks . Universal Adversarial Training Universal adversarial perturbation proposed by Moosavi-Dezfooli et al . ( 2017 ) is a type of adversarial attack that adopts a universal perturbation for all images . Universal adversarial training ( UAT ) ( Shafahi et al. , 2020 ) is then proposed to defend against this attack by training against universally perturbed data . Instead , in our work , we firstly show that we can adapt UAT for solving domain generalization problems . 3 ON THE RELATIONSHIP BETWEEN IRM AND AT . 3.1 PRELIMINARY . Notation Let Φ : X ⊂ Rn → Rd denotes the representation of a θ-parameterized piecewise linear classifier , i.e. , Φ ( · ) = φL ( WLφL−1 ( . . . ) + bL−1 ) + bL , where φL is the activation function , and WL , bL denote the layer-wise weight matrix and bias vector , collectively denoted by θ. Additionally , let β be the linear classifier on top , and the output of the network is β · Φ ( x ) = β > Φ ( x ) . Let ` ( ŷ , y ) = − log σ ( yŷ ) be the sample logistic loss . We consider a two-class ( y = ±1 ) classification setting with output dimension d = 1 , and our discussion can be easily extended to the general cases . ERM The traditional Empirical Risk Minimization ( ERM ) algorithm optimizes over the loss on i.i.d . data , i.e. , min β , Φ R ( β · Φ ) , where R ( β · Φ ) = E ( x , y ) ∼D ` ( β > Φ ( x ) , y ) . ( 1 ) In OOD generalization problem , one faces a set of ( training ) environments E , where each environment e ∈ E corresponds to a unique data distribution De . When facing multiple environments , the ERM objective simply mixes the data together and takes the form ( ERM ) min β , Φ ∑ e Re ( β · Φ ) , where Re ( β · Φ ) = E ( x , y ) ∼De ` ( β > Φ ( x ) , y ) . ( 2 ) IRM and IRMv1 Instead of simply mixing the data together , IRM seeks to learn an invariant representation Φ such that it can be minimizing with the same classifier β . Formally we have ( IRM ) min β , Φ ∑ e∈E Re ( β · Φ ) s.t . β ∈ arg min β̄ Re ( β̄ · Φ ) , ∀e ∈ E . ( 3 ) Since this bi-level optimization problem is difficult to solve , the practical version IRMv1 as regularized ERM , where the gradient penalty is calculated w.r.t . a dummy variable w : ( IRMv1 ) min β , Φ ∑ e∈E [ Re ( β · Φ ) + λ · ||∇w|w=1.0Re ( w · ( β · Φ ) ) ||2︸ ︷︷ ︸ PenaltyIRM ] . ( 4 ) AT Adversarial Training ( Madry et al. , 2018 ) ) instead replaces ERM with a minimax objective , ( AT ) min β , Φ RAT ( β · Φ ) = min β , Φ E ( x , y ) ∼D max ||δx||p≤ε ` ( β > Φ ( x+ δx ) , y ) , ( 5 ) where one maximizes the inner loss by injecting sample-wise perturbations δx and solve the outer minimization w.r.t . parameters β , Φ on the perturbed sample ( x+ δx , y ) . Typically , the perturbation is constrained within an ` p ball with radius ε . In this way , AT can learn models that are robust to ` p perturbations . UAT Instead of injecting sample-wise perturbations , Moosavi-Dezfooli et al . ( 2017 ) notice that we can also adopt a universal perturbation δ for all samples , which results in the Unversarial Adversarial Training ( UAT ) objective as follows : ( UAT ) min β , Φ RUAT ( β · Φ ) = min β , Φ max ||δ||p≤ε E ( x , y ) ∼De ` ( β > Φ ( x+ δ ) , y ) , ( 6 ) | The paper investigates whether adversarial training (AT) could be used for extracting domain-invariant features, and whether AT can benefit OOD generalization. The paper first shows the relationship between AT and IRM (invariant risk minimization). A new version of AT is proposed -- called "Domain-wise Adversarial Training (DAT)"; with IRM being a version of DAT. Results suggest that DAT can outperform ERM under correlation-shift and diversity shift. | SP:cd6a7d6bb8b530c68ccefe214b744c60421621c3 |
Domain-wise Adversarial Training for Out-of-Distribution Generalization | 1 INTRODUCTION . Modern deep learning techniques have achieved remarkable success on many tasks ( He et al. , 2016 ; Brown et al. , 2020 ) . Yet , under some scenarios , deep models will suffer a catastrophic performance degradation since they tend to seize on spurious correlations in the training data ( Beery et al. , 2018 ) . One of those representative scenarios is the Out-of-Distribution ( OOD ) generalization , where one expects the trained model to perform well at the test time even when the training and testing data come from different distributions1 . Another representative scenario under which deep models are unstable is the adversarial example . Researchers have found that deep models are quite brittle since one can inject imperceptible perturbations into the input and cause the model to make wrong predictions with extremely high confidence ( Szegedy et al. , 2014 ) . These two issues have some similarities to each other . They both arise because deep networks do not learn the essential causal associations ( or intrinsic features ) . Nevertheless , in their corresponding fields , different approaches have been proposed . For OOD generalization , a large class of methods called Invariant Causal Prediction ( ICP ) ( Peters et al. , 2016 ) are proposed . Among them , Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) attracts significant attention , which intends to extract features that are invariant across different data distributions and expects the model to ignore information related to the environment . While for adversarial robustness against adversarial examples , Adversarial Training ( AT ) ( Madry et al. , 2018 ) is the most effective approach at the current stage ( Athalye et al. , 2018 ) . It trains a model on adversarial examples that are generated by injecting perturbations optimized for each image into natural examples . These two fields seem to be independent , and their connections are rarely studied . That is exactly what we are exploring in this paper . Although IRM and its variants have shown promise on certain tasks , e.g. , CMNIST ( Arjovsky et al. , 2019 ) , recent studies ( Gulrajani & Lopez-Paz , 2021 ) show that on a large-scale controlled experiment on OOD generalization , all these methods fail to exceed the simplest i.i.d . baseline , i.e. , Empirical Risk Minimization ( ERM ) . Through a dissection of the benchmark datasets , Ye et al . ( 2021 ) 1In current literature , the terminologies of “ domain ” , “ environment ” and “ distribution ” are often used interchangeably , so we do the same in the whole paper . notice that there are actually two types of distribution shifts : correlation shift ( same support , different correlation ) and diversity shift ( different support , same correlation ) . IRM variants can only perform well under ( some ) correlation shift while performing poorly under diversity shift . Thus , we need to seek better alternatives for OOD generalization , while AT seems to be a promising candidate from both theoretical and empirical aspects . Theoretically , by learning invariance w.r.t . local input perturbations , AT can be regarded as Distributionally Robust Optimization ( DRO ) ( Sinha et al. , 2018 ; Volpi et al. , 2018 ; Rahimian & Mehrotra , 2019 ; Duchi et al. , 2021 ) over ` p-bounded distributional shift . Thus , AT could reliably extract robust features , e.g. , the object shape , from the input . Empirically , several recent works show that AT has better domain transferability than ERM ( Salman et al. , 2020 ) . These findings naturally leads to the questions : Will AT perform better than IRM ? Will AT be helpful for OOD generalization ? In this paper , we take a further step to answering these intriguing questions . We first reveal the connections between IRM and AT , and find that IRM can be regarded as an instance-reweighted version of Domain-wise Adversarial Training ( DAT ) , a new version of adversarial training that we propose for generalizing Universal Adversarial Training ( Moosavi-Dezfooli et al. , 2017 ) to multiple domains . Inspired by this connection , we further explore how DAT performs for OOD data . We first notice that DAT is suitable for solving domain generalization problems as it can effectively remove the relatively static background information with domain-wise perturbations . We further verify this intuition on both synthetic tasks ( Xiao et al. , 2021 ) and real-world datasets , where we show clear advantages over ERM . At last , we conduct extensive experiments on benchmark datasets and show our DAT can outperform ERM consistently on tasks dominated by both correlation shift and diversity shift , and as a result , achieve state-of-the-art performance ( in average ) on these datasets . We summarize our contributions as follows : • We develop a new kind of adversarial training , Domain-wise Adversarial Training ( DAT ) , for domain generalization , and we establish the intrinsic similarity between IRM and domain-wise AT objectives . • We analyze how DAT will benefit learning invariant features and verify our hypothesis through both synthetic data and real-world datasets . • Extensive experiments on benchmark datasets show that DAT does not only perform better than ERM under correlation shift like IRM but also outperforms ERM under diversity shift like ( sample-wise ) AT . Therefore , our methods achieve state-of-the-art results by surpassing ERM at both kinds of distribution shifts . 2 RELATED WORKS . IRM and Its Variants Invariant Risk Minimization ( IRM ) ( Arjovsky et al . ( 2019 ) ) develops a paradigm to extract causal ( invariant ) features and find the optimal invariant classifier on top over several given training environments . The work of Kamath et al . ( 2021 ) reveals the gap between IRM and IRMv1 , show that even in a simple model that echos the idea of the original IRM objective , IRMv1 can fail catastrophically . Rosenfeld et al . ( 2021 ) prove that when the number of training environments is not large enough , IRM can face the risk of using environmental features . There also exists a predictor feasible for IRMv1 that is very similar to the ERM solution . AT and Its Variants Szegedy et al . ( 2014 ) report one can inject imperceptible perturbations to fool deep models . Athalye et al . ( 2018 ) reveal that among the proposed defenses , adversarial training was the only effective one . Adversarial Training ( AT ) ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) is the representative approach to train robust models . Recently , Kamath et al . ( 2021 ) show adversarially learned features can transfer better than standardly trained models , while various works ( Volpi et al. , 2018 ; Sinha et al. , 2018 ; Ford et al. , 2019 ; Qiao et al. , 2020 ; Yi et al. , 2021 ; Gokhale et al. , 2021 ) adopt sample-wise adversarial training or adversarial data augmentation to improve OOD robustness . However , most of the discussions are limited to distributional robustness w.r.t . Wasserstein distance , making it less practical for accounting real-world OOD scenarios as discussed in this work . Evaluating OOD Robustness Gulrajani & Lopez-Paz ( 2021 ) recently noticed that the evaluation criteria are crucial for fair comparison of OOD robustness , where under fair settings , no algorithm has performed consistently better than vanilla ERM . Ye et al . ( 2021 ) further identifies two kinds of distribution shifts in current benchmark datasets : diversity shift and correlation shift . Diversity shift refers to the shift of the distribution support of spurious feature z , while correlation shift refers to the change of conditional probability of label y given spurious feature z on the same support . We present an illustrative example in Figure 1 . In particular , they show that there seems to be a tradeoff between the two tasks as an algorithm that performs well at one task tends to perform poorly on the other . Instead , in this work , we show that our DAT can achieve superior performance on both correlation shift and diversity shift tasks . Universal Adversarial Training Universal adversarial perturbation proposed by Moosavi-Dezfooli et al . ( 2017 ) is a type of adversarial attack that adopts a universal perturbation for all images . Universal adversarial training ( UAT ) ( Shafahi et al. , 2020 ) is then proposed to defend against this attack by training against universally perturbed data . Instead , in our work , we firstly show that we can adapt UAT for solving domain generalization problems . 3 ON THE RELATIONSHIP BETWEEN IRM AND AT . 3.1 PRELIMINARY . Notation Let Φ : X ⊂ Rn → Rd denotes the representation of a θ-parameterized piecewise linear classifier , i.e. , Φ ( · ) = φL ( WLφL−1 ( . . . ) + bL−1 ) + bL , where φL is the activation function , and WL , bL denote the layer-wise weight matrix and bias vector , collectively denoted by θ. Additionally , let β be the linear classifier on top , and the output of the network is β · Φ ( x ) = β > Φ ( x ) . Let ` ( ŷ , y ) = − log σ ( yŷ ) be the sample logistic loss . We consider a two-class ( y = ±1 ) classification setting with output dimension d = 1 , and our discussion can be easily extended to the general cases . ERM The traditional Empirical Risk Minimization ( ERM ) algorithm optimizes over the loss on i.i.d . data , i.e. , min β , Φ R ( β · Φ ) , where R ( β · Φ ) = E ( x , y ) ∼D ` ( β > Φ ( x ) , y ) . ( 1 ) In OOD generalization problem , one faces a set of ( training ) environments E , where each environment e ∈ E corresponds to a unique data distribution De . When facing multiple environments , the ERM objective simply mixes the data together and takes the form ( ERM ) min β , Φ ∑ e Re ( β · Φ ) , where Re ( β · Φ ) = E ( x , y ) ∼De ` ( β > Φ ( x ) , y ) . ( 2 ) IRM and IRMv1 Instead of simply mixing the data together , IRM seeks to learn an invariant representation Φ such that it can be minimizing with the same classifier β . Formally we have ( IRM ) min β , Φ ∑ e∈E Re ( β · Φ ) s.t . β ∈ arg min β̄ Re ( β̄ · Φ ) , ∀e ∈ E . ( 3 ) Since this bi-level optimization problem is difficult to solve , the practical version IRMv1 as regularized ERM , where the gradient penalty is calculated w.r.t . a dummy variable w : ( IRMv1 ) min β , Φ ∑ e∈E [ Re ( β · Φ ) + λ · ||∇w|w=1.0Re ( w · ( β · Φ ) ) ||2︸ ︷︷ ︸ PenaltyIRM ] . ( 4 ) AT Adversarial Training ( Madry et al. , 2018 ) ) instead replaces ERM with a minimax objective , ( AT ) min β , Φ RAT ( β · Φ ) = min β , Φ E ( x , y ) ∼D max ||δx||p≤ε ` ( β > Φ ( x+ δx ) , y ) , ( 5 ) where one maximizes the inner loss by injecting sample-wise perturbations δx and solve the outer minimization w.r.t . parameters β , Φ on the perturbed sample ( x+ δx , y ) . Typically , the perturbation is constrained within an ` p ball with radius ε . In this way , AT can learn models that are robust to ` p perturbations . UAT Instead of injecting sample-wise perturbations , Moosavi-Dezfooli et al . ( 2017 ) notice that we can also adopt a universal perturbation δ for all samples , which results in the Unversarial Adversarial Training ( UAT ) objective as follows : ( UAT ) min β , Φ RUAT ( β · Φ ) = min β , Φ max ||δ||p≤ε E ( x , y ) ∼De ` ( β > Φ ( x+ δ ) , y ) , ( 6 ) | The paper tackles the problem of out-of-distribution (OOD) generalization of deep learning models with a novel adversarial training formulation (DAT) that introduces a shared adversarial perturbation per training domain. The paper further establishes a connection between DAT, Invariant Risk Minimization (IRM), and standard adversarial training (AT). The authors posit that DAT inherits the advantages of IRM (which is effective for correlation shift while it performs more poorly on diversity shift) and AT, which improves upon Empirical Risk Minimization (ERM) for diversity shift. Experiments on several OOD benchmark datasets show that DAT outperforms prior works and ERM on average. | SP:cd6a7d6bb8b530c68ccefe214b744c60421621c3 |
Domain-wise Adversarial Training for Out-of-Distribution Generalization | 1 INTRODUCTION . Modern deep learning techniques have achieved remarkable success on many tasks ( He et al. , 2016 ; Brown et al. , 2020 ) . Yet , under some scenarios , deep models will suffer a catastrophic performance degradation since they tend to seize on spurious correlations in the training data ( Beery et al. , 2018 ) . One of those representative scenarios is the Out-of-Distribution ( OOD ) generalization , where one expects the trained model to perform well at the test time even when the training and testing data come from different distributions1 . Another representative scenario under which deep models are unstable is the adversarial example . Researchers have found that deep models are quite brittle since one can inject imperceptible perturbations into the input and cause the model to make wrong predictions with extremely high confidence ( Szegedy et al. , 2014 ) . These two issues have some similarities to each other . They both arise because deep networks do not learn the essential causal associations ( or intrinsic features ) . Nevertheless , in their corresponding fields , different approaches have been proposed . For OOD generalization , a large class of methods called Invariant Causal Prediction ( ICP ) ( Peters et al. , 2016 ) are proposed . Among them , Invariant Risk Minimization ( IRM ) ( Arjovsky et al. , 2019 ) attracts significant attention , which intends to extract features that are invariant across different data distributions and expects the model to ignore information related to the environment . While for adversarial robustness against adversarial examples , Adversarial Training ( AT ) ( Madry et al. , 2018 ) is the most effective approach at the current stage ( Athalye et al. , 2018 ) . It trains a model on adversarial examples that are generated by injecting perturbations optimized for each image into natural examples . These two fields seem to be independent , and their connections are rarely studied . That is exactly what we are exploring in this paper . Although IRM and its variants have shown promise on certain tasks , e.g. , CMNIST ( Arjovsky et al. , 2019 ) , recent studies ( Gulrajani & Lopez-Paz , 2021 ) show that on a large-scale controlled experiment on OOD generalization , all these methods fail to exceed the simplest i.i.d . baseline , i.e. , Empirical Risk Minimization ( ERM ) . Through a dissection of the benchmark datasets , Ye et al . ( 2021 ) 1In current literature , the terminologies of “ domain ” , “ environment ” and “ distribution ” are often used interchangeably , so we do the same in the whole paper . notice that there are actually two types of distribution shifts : correlation shift ( same support , different correlation ) and diversity shift ( different support , same correlation ) . IRM variants can only perform well under ( some ) correlation shift while performing poorly under diversity shift . Thus , we need to seek better alternatives for OOD generalization , while AT seems to be a promising candidate from both theoretical and empirical aspects . Theoretically , by learning invariance w.r.t . local input perturbations , AT can be regarded as Distributionally Robust Optimization ( DRO ) ( Sinha et al. , 2018 ; Volpi et al. , 2018 ; Rahimian & Mehrotra , 2019 ; Duchi et al. , 2021 ) over ` p-bounded distributional shift . Thus , AT could reliably extract robust features , e.g. , the object shape , from the input . Empirically , several recent works show that AT has better domain transferability than ERM ( Salman et al. , 2020 ) . These findings naturally leads to the questions : Will AT perform better than IRM ? Will AT be helpful for OOD generalization ? In this paper , we take a further step to answering these intriguing questions . We first reveal the connections between IRM and AT , and find that IRM can be regarded as an instance-reweighted version of Domain-wise Adversarial Training ( DAT ) , a new version of adversarial training that we propose for generalizing Universal Adversarial Training ( Moosavi-Dezfooli et al. , 2017 ) to multiple domains . Inspired by this connection , we further explore how DAT performs for OOD data . We first notice that DAT is suitable for solving domain generalization problems as it can effectively remove the relatively static background information with domain-wise perturbations . We further verify this intuition on both synthetic tasks ( Xiao et al. , 2021 ) and real-world datasets , where we show clear advantages over ERM . At last , we conduct extensive experiments on benchmark datasets and show our DAT can outperform ERM consistently on tasks dominated by both correlation shift and diversity shift , and as a result , achieve state-of-the-art performance ( in average ) on these datasets . We summarize our contributions as follows : • We develop a new kind of adversarial training , Domain-wise Adversarial Training ( DAT ) , for domain generalization , and we establish the intrinsic similarity between IRM and domain-wise AT objectives . • We analyze how DAT will benefit learning invariant features and verify our hypothesis through both synthetic data and real-world datasets . • Extensive experiments on benchmark datasets show that DAT does not only perform better than ERM under correlation shift like IRM but also outperforms ERM under diversity shift like ( sample-wise ) AT . Therefore , our methods achieve state-of-the-art results by surpassing ERM at both kinds of distribution shifts . 2 RELATED WORKS . IRM and Its Variants Invariant Risk Minimization ( IRM ) ( Arjovsky et al . ( 2019 ) ) develops a paradigm to extract causal ( invariant ) features and find the optimal invariant classifier on top over several given training environments . The work of Kamath et al . ( 2021 ) reveals the gap between IRM and IRMv1 , show that even in a simple model that echos the idea of the original IRM objective , IRMv1 can fail catastrophically . Rosenfeld et al . ( 2021 ) prove that when the number of training environments is not large enough , IRM can face the risk of using environmental features . There also exists a predictor feasible for IRMv1 that is very similar to the ERM solution . AT and Its Variants Szegedy et al . ( 2014 ) report one can inject imperceptible perturbations to fool deep models . Athalye et al . ( 2018 ) reveal that among the proposed defenses , adversarial training was the only effective one . Adversarial Training ( AT ) ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) is the representative approach to train robust models . Recently , Kamath et al . ( 2021 ) show adversarially learned features can transfer better than standardly trained models , while various works ( Volpi et al. , 2018 ; Sinha et al. , 2018 ; Ford et al. , 2019 ; Qiao et al. , 2020 ; Yi et al. , 2021 ; Gokhale et al. , 2021 ) adopt sample-wise adversarial training or adversarial data augmentation to improve OOD robustness . However , most of the discussions are limited to distributional robustness w.r.t . Wasserstein distance , making it less practical for accounting real-world OOD scenarios as discussed in this work . Evaluating OOD Robustness Gulrajani & Lopez-Paz ( 2021 ) recently noticed that the evaluation criteria are crucial for fair comparison of OOD robustness , where under fair settings , no algorithm has performed consistently better than vanilla ERM . Ye et al . ( 2021 ) further identifies two kinds of distribution shifts in current benchmark datasets : diversity shift and correlation shift . Diversity shift refers to the shift of the distribution support of spurious feature z , while correlation shift refers to the change of conditional probability of label y given spurious feature z on the same support . We present an illustrative example in Figure 1 . In particular , they show that there seems to be a tradeoff between the two tasks as an algorithm that performs well at one task tends to perform poorly on the other . Instead , in this work , we show that our DAT can achieve superior performance on both correlation shift and diversity shift tasks . Universal Adversarial Training Universal adversarial perturbation proposed by Moosavi-Dezfooli et al . ( 2017 ) is a type of adversarial attack that adopts a universal perturbation for all images . Universal adversarial training ( UAT ) ( Shafahi et al. , 2020 ) is then proposed to defend against this attack by training against universally perturbed data . Instead , in our work , we firstly show that we can adapt UAT for solving domain generalization problems . 3 ON THE RELATIONSHIP BETWEEN IRM AND AT . 3.1 PRELIMINARY . Notation Let Φ : X ⊂ Rn → Rd denotes the representation of a θ-parameterized piecewise linear classifier , i.e. , Φ ( · ) = φL ( WLφL−1 ( . . . ) + bL−1 ) + bL , where φL is the activation function , and WL , bL denote the layer-wise weight matrix and bias vector , collectively denoted by θ. Additionally , let β be the linear classifier on top , and the output of the network is β · Φ ( x ) = β > Φ ( x ) . Let ` ( ŷ , y ) = − log σ ( yŷ ) be the sample logistic loss . We consider a two-class ( y = ±1 ) classification setting with output dimension d = 1 , and our discussion can be easily extended to the general cases . ERM The traditional Empirical Risk Minimization ( ERM ) algorithm optimizes over the loss on i.i.d . data , i.e. , min β , Φ R ( β · Φ ) , where R ( β · Φ ) = E ( x , y ) ∼D ` ( β > Φ ( x ) , y ) . ( 1 ) In OOD generalization problem , one faces a set of ( training ) environments E , where each environment e ∈ E corresponds to a unique data distribution De . When facing multiple environments , the ERM objective simply mixes the data together and takes the form ( ERM ) min β , Φ ∑ e Re ( β · Φ ) , where Re ( β · Φ ) = E ( x , y ) ∼De ` ( β > Φ ( x ) , y ) . ( 2 ) IRM and IRMv1 Instead of simply mixing the data together , IRM seeks to learn an invariant representation Φ such that it can be minimizing with the same classifier β . Formally we have ( IRM ) min β , Φ ∑ e∈E Re ( β · Φ ) s.t . β ∈ arg min β̄ Re ( β̄ · Φ ) , ∀e ∈ E . ( 3 ) Since this bi-level optimization problem is difficult to solve , the practical version IRMv1 as regularized ERM , where the gradient penalty is calculated w.r.t . a dummy variable w : ( IRMv1 ) min β , Φ ∑ e∈E [ Re ( β · Φ ) + λ · ||∇w|w=1.0Re ( w · ( β · Φ ) ) ||2︸ ︷︷ ︸ PenaltyIRM ] . ( 4 ) AT Adversarial Training ( Madry et al. , 2018 ) ) instead replaces ERM with a minimax objective , ( AT ) min β , Φ RAT ( β · Φ ) = min β , Φ E ( x , y ) ∼D max ||δx||p≤ε ` ( β > Φ ( x+ δx ) , y ) , ( 5 ) where one maximizes the inner loss by injecting sample-wise perturbations δx and solve the outer minimization w.r.t . parameters β , Φ on the perturbed sample ( x+ δx , y ) . Typically , the perturbation is constrained within an ` p ball with radius ε . In this way , AT can learn models that are robust to ` p perturbations . UAT Instead of injecting sample-wise perturbations , Moosavi-Dezfooli et al . ( 2017 ) notice that we can also adopt a universal perturbation δ for all samples , which results in the Unversarial Adversarial Training ( UAT ) objective as follows : ( UAT ) min β , Φ RUAT ( β · Φ ) = min β , Φ max ||δ||p≤ε E ( x , y ) ∼De ` ( β > Φ ( x+ δ ) , y ) , ( 6 ) | This paper focuses on domain generalization (DG). It proposes a method based on adversarial training (AT): the main idea is learning universal adversarial perturbations at domain level (domain adversarial perturbations, DAT), and rely on those within a standard AT routine. The relation between the proposed DAT and invariant risk minimization (IRM) is provided, and the method is empirically tested on standard domain generalization benchmarks. | SP:cd6a7d6bb8b530c68ccefe214b744c60421621c3 |
SERCNN: Stacked Embedding Recurrent Convolutional Neural Network in Depression Detection on Twitter | 1 INTRODUCTION . Depression is a serious yet common mental disorder that affects more than 264 million people worldwide . The number is projected to grow amid the war against the pandemic of COVID-19 . Unlike the usual mood fluctuations and emotional responses , the long-lasting sadness , emptiness , or irritation in one ’ s day-to-day life , accompanied by somatic and cognitive changes that heavily disrupt an individual ’ s capacity to function normally . Hence , depression is often associated with suicide at its worst . In the latest Word Health Statistics 2021 ( World Health Organization , 2021 ) , 28 % increases the suicide rate in the United States in this period , which may result from the increasing pressure on the loss of loved ones and incomes , city lockdowns , social distancing , and the reduction of human interactions . Existing screening methods , such as psychometric self-reporting questionnaires and clinical interviews , are expensive , not scalable , not reachable to many , and have limitations . For example , the Diagnostic and Statistical Manual of Mental Disorders ( DSM-5 ) ( American Psychiatric Association et al. , 2013 ) requires patients to be involved and disclose truthful information during clinical interviews . Besides that , people who suffer from depression tend to be unaware of their condition because there is no specific feedback from the body like common physical injuries do . To get diagnosed with depression , one must first consult a doctor or mental health professional . Up to date , global provision and service for identifying , supporting , and treating mental health issues are insufficient despite the disruption of essential health services , community mistrust , and fears of COVID-19 infections . The lack of mental health awareness in the Southeast Asia Region is another contributing factor in the sky-high figure of depression . Social media has become part and parcel of everyday life . It has become a valuable source of information that led to a new research direction for detecting depression . Here , social media data can serve as a lifelog that records users ’ activities in the text , image , audio , and video . The enormous amount of time series first-person narrative posts can provide insights about one ’ s thoughts , feelings , behavior , or mood for some time , allowing an unintrusive way to study patients ’ conditions before an actual clinical diagnosis is made . Motivated by previous studies that demonstrated great potentials for using social media posts to monitor and predict one ’ s mental health status , this paper utilizes natural language processing and machine learning techniques on social media data to predict one ’ s risk of depression . We propose Stacked Embedding Recurrent Neural Network ( SERCNN ) , which can effectively learn the representation from dirty and unstructured social media text without the need to pursue multimodal learning . Instead of using the recent transformer model , we suggest a meta-embedding approach for our feature extraction . We utilize two widely available yet low dimensional pretrained GloVe embeddings trained on different domain datasets to provide a more robust and accurate representation of the dirty and unstructured social media text that often contains typos . Our SERCNN can achieve a state-of-the-art performance without using all the social media posts in the user posting history , providing a perspective on the number of posts required to make a reliable prediction . It is worth pointing out that there is still room in social media text that is worth exploring . The contributions of this paper can be summarized as below . 1 . SERCNN can retrieve a more robust and richer representation of the social media text by stacking multiple low dimensional pretrained embeddings . 2 . Provides insights on how the different number of posts influence the prediction model ’ s accuracy . 2 RELATED WORK . In this section , we provide an overview of the current research landscape and how previous works convert information extracted from social media posts into more representative features that can be used to identify depressed individuals . Depression detection on social media Evidence from various published works has shown the viability of using social media data to predict depression and other mental disorders . The seminal work by Holleran ( 2010 ) has inspired natural language processing ( NLP ) researchers to identify potential markers of mental disorder from social media posts . In contrast to the 14 days of observation stated in DSM-5 , Hu et al . ( 2015 ) and Tsugawa et al . ( 2015 ) . empirically suggested that features extracted over two months are sufficiently be used to identify one ’ s depression condition . Coppersmith et al . have presented a. novel method to collect ground truth on social media related to depression and PTSD . The dataset is then being used for the shared task of The Workshop on Computational Linguistics and Clinical Psychology ( CLPsych ) ( Coppersmith et al. , 2015 ) . A similar workshop , CLEF eRisk ( Losada et al. , 2017 ) , focuses on the early depression symptoms discoveries on social media . Workshop tasks such as depression detection ( CLPsych 2015 ( Coppersmith et al. , 2015 ) ) and early detection of signs of depression ( CLEF eRisk 2017 ( Losada et al. , 2017 ) ) have generated significant numbers of novel approaches in identifying depression on social media . Feature representation for depression classification Modeling feature representations is a crucial task in machine learning ; features that are not discriminative and representative will result in poor and faulty model performance . Hence , earlier research works are mainly focused on feature extraction techniques . Choudhury et al . ( 2013 ) ; Tsugawa et al . ( 2015 ) have found that depressed users tend to be emotional . Wang et al . ( 2013 ) found that using sentiment analysis in depression detection can achieve about 80 % accuracy . Tsugawa et al . ( 2015 ) ; Resnik et al . ( 2015 ) extracted topics distribution with Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) to differentiate depressed individuals from the healthy controls . Researchers also extracted features based on criteria stated in the industrystandard - Diagnostic and Statistical Manual of Mental Disorders ( DSM ) , such as the insomnia index derived from the user posting time . Linguistic Inquiry and Word Count ( LIWC ) ( Tausczik & Pen- nebaker , 2010 ) is a widely used word matching-based feature extraction tool that builds on top of Pennebaker et al. ’ s findings ( Rude et al. , 2004 ; Gortner et al. , 2006 ) decades ago . ( Choudhury et al. , 2013 ; Shen et al. , 2017 ) show that depressed users tend to have high self-attentional focus , increased medicinal concerns , and increased expression of religious thoughts . These findings are aligned with the Rude et al . ( 2004 ) work where depressive indicators can be found on the human-generated content . However , LIWC and word matching-based sentiment analysis approaches are often ineffective . The nature of social media text being dirty and unstructured often required extensive data cleaning and preprocessing for the tools to act as intended . Recent works ( Gui et al. , 2019a ; b ; Rao et al. , 2020 ) have shown that using the word embedding and deep learning models are effective than the handcrafted features with minimal effort of text preprocessing . We observed that most works that employed deep learning models tend to use hierarchical document modeling to generate their input representation . This raises the question of whether depression classification using social media data actually takes advantage of the hierarchical document modeling . 3 STACKED EMBEDDING RECURRENT CONVOLUTIONAL NEURAL . NETWORK ( SERCNN ) Overview Our goal is to improve the performance of depression classification on social media by learning a much robust user representation . Given that our dataset , d , consists of N1 number of social media users , u , where each user ’ s N2 number of social media posts , p , within a month were collected , and each post has N3 words , w , we denote the dataset as d = { u1 , ... , uN1 } , social media user as u = { p1 , ... , pN2 } , and the post as p = { w1 , ... , wN3 } . We propose Stacked Embedding Recurrent Convolutional Neural Network ( SERCNN ) which is made up of a Stacked Embedding ( SE ) and Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) . The overall architecture of SERCNN is simple , consisting a SE layer , single directional LSTM , a max-pooling layer and an output layer which is a fully connected layer with sigmoid function , as visualized in Figure 1 . 3.1 FEATURE EXTRACTION WITH STACKED EMBEDDING . Unlike previous works , we model our user representation by firstly concatenating N2 social media posts in chronological order . For a random user ui , the concatenated text representation can be formulated into : ui = { p1 + ... + pN2 } ( 1 ) ui = { w11 + ... + w1N3 + ... + w N2 N3 } ( 2 ) This concatenated post can be viewed as a single ” monthly diary ” , journal or large document that characterizes the user . Then , we extract the distributed text representation of each word with the SE , which is an ensemble embedding , commonly known as the Meta-embedding technique . The concept of Meta-embedding was first introduced by Yin & Schütze ( 2016 ) to utilize and learn the meta of existing well-trained pretrained embeddings and extend the vocabulary . Since different pretrained embeddings were trained on different datasets , each embedding can now complement each other allowing an improved vocabulary coverage and reducing out-of-vocabulary words . As the name suggests , SE is formed by stacking the collection of dense vectors ( pretrained weights ) E = { E1 , ... , EN4 } extracted from N4 number of pretrained embeddings included : ESE = { E1 + ... +EN4 } ( 3 ) where the embedding vector , x , of a given word , w can be obtained via : x = ESE ( w ) ( 4 ) The vocabulary of SE , VSE , is now considered as the vocabulary union of the N4 pretrained embeddings , resulting in a more extensive vocabulary than a single embedding : VSE = N4⋃ n=1 Vn ( 5 ) In this study , our SE is the simple stacked vector made up of two pretrained GloVe embeddings ( Pennington et al. , 2014 ) trained on Twitter and Wikipedia 2014 + Gigaword 5 datasets , respectively : 1 . GloVe Twitter ( 25 dimensions ) trained using global word co-occurrences information by Pennington et al . ( 2014 ) under an uncased setting , using 2 billion tweets , with 27 billion tokens . The resulting vector consists of 1.2 million vocabularies learned from the corpus . 2 . GloVe Wikipedia 2014 + Gigaword 5 ( 100 dimensions ) ( Pennington et al. , 2014 ) , similar to the GloVe Twitter embedding , this embedding is trained using global word co-occurrences information but using a different corpus , which is the combination of Wikipedia 2014 and Gigaword 5 datasets . There are approximately 400 thousand words in the vocabulary . 3.2 REPRESENTATION LEARNING AND DEPRESSION CLASSIFICATION WITH RCNN . Recurrent neural network ( RNN ) is capable of capturing contextual information over a long sequence . However , the RNN model favors the later words than words in the earlier sequence . In depression detection on social media , where posts are collected over a time interval , we are interested in identifying words throughout that period , rather than just words that occurred later . Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) overcomes the limitation of the existing RNN model by incorporating a max-pooling layer to extract key features from both the embedding features and the context learned . The max-pooling layer reconsiders embedding features instead of just the context learned in the conventional RNN-based setting , selecting the important features for the classification task . The overall architecture of our RCNN model is visualized in Figure 3 . Instead of using bidirectional Long Short Term Memory ( LSTM ) as described in Lai et al . ( 2015 ) , we use a generic single Forward LSTM to learn the context , c , from the embedding vector , v. With j refers to the jth social media post and k refers to the kth number of words in the post , we can formulate the context for a given word : ( c ( wjk ) , h ( w j k ) ) = LSTM ( c ( wjk−1 ) , h ( w j k−1 ) , v ( w j k ) ) ( 6 ) where |c| ∈ R and h is the output vector . The output of the LSTM is then concatenated with the embedding features , forming an extended context vector : yjk = [ c ( w j k ) ; x j k ] ( 7 ) A max-pooling layer is applied after the RCNN representation of the user is computed : ỹ = L max l=1 yl ( 8 ) , where the total number of words , L , can be calculated by multiplying the total number of social media posts , N2 , by the number of words in each post , N3 . A fully connected layer is then used to discriminate the max-pooled context with a sigmoid function , presenting the classification output , ŷ , as probabilities : ŷi = p ( ỹ | ui ) = 1 1 + exp− ( Wcui+bc ) ∈ [ 0 , 1 ] ( 9 ) | This paper proposes a deep learning approach, called SERCNN, for depression detection from social media data (tweets). The proposed approach is flexible and stacks different embeddings (Glove pretrained model, and a learned embedding vector from LSTM) for robust and richer tweets representation. Overall, the contributions of this approach are third folds: i) leveraging social media as a valuable source of information for depression detection; ii) the authors employ stacked-embeddings is a good technique to handle out-of-vocabulary words; and iii) Using a few training examples (e.g., 10 tweets per user), the proposed approach showed a remarkable performance (78% accuracy) in depression prediction. Further, the authors conduct a set of experiments on a public Twitter dataset for depression detection and compare it with different baselines. | SP:e635477a7c6a11809327a8367eaf896b65463b15 |
SERCNN: Stacked Embedding Recurrent Convolutional Neural Network in Depression Detection on Twitter | 1 INTRODUCTION . Depression is a serious yet common mental disorder that affects more than 264 million people worldwide . The number is projected to grow amid the war against the pandemic of COVID-19 . Unlike the usual mood fluctuations and emotional responses , the long-lasting sadness , emptiness , or irritation in one ’ s day-to-day life , accompanied by somatic and cognitive changes that heavily disrupt an individual ’ s capacity to function normally . Hence , depression is often associated with suicide at its worst . In the latest Word Health Statistics 2021 ( World Health Organization , 2021 ) , 28 % increases the suicide rate in the United States in this period , which may result from the increasing pressure on the loss of loved ones and incomes , city lockdowns , social distancing , and the reduction of human interactions . Existing screening methods , such as psychometric self-reporting questionnaires and clinical interviews , are expensive , not scalable , not reachable to many , and have limitations . For example , the Diagnostic and Statistical Manual of Mental Disorders ( DSM-5 ) ( American Psychiatric Association et al. , 2013 ) requires patients to be involved and disclose truthful information during clinical interviews . Besides that , people who suffer from depression tend to be unaware of their condition because there is no specific feedback from the body like common physical injuries do . To get diagnosed with depression , one must first consult a doctor or mental health professional . Up to date , global provision and service for identifying , supporting , and treating mental health issues are insufficient despite the disruption of essential health services , community mistrust , and fears of COVID-19 infections . The lack of mental health awareness in the Southeast Asia Region is another contributing factor in the sky-high figure of depression . Social media has become part and parcel of everyday life . It has become a valuable source of information that led to a new research direction for detecting depression . Here , social media data can serve as a lifelog that records users ’ activities in the text , image , audio , and video . The enormous amount of time series first-person narrative posts can provide insights about one ’ s thoughts , feelings , behavior , or mood for some time , allowing an unintrusive way to study patients ’ conditions before an actual clinical diagnosis is made . Motivated by previous studies that demonstrated great potentials for using social media posts to monitor and predict one ’ s mental health status , this paper utilizes natural language processing and machine learning techniques on social media data to predict one ’ s risk of depression . We propose Stacked Embedding Recurrent Neural Network ( SERCNN ) , which can effectively learn the representation from dirty and unstructured social media text without the need to pursue multimodal learning . Instead of using the recent transformer model , we suggest a meta-embedding approach for our feature extraction . We utilize two widely available yet low dimensional pretrained GloVe embeddings trained on different domain datasets to provide a more robust and accurate representation of the dirty and unstructured social media text that often contains typos . Our SERCNN can achieve a state-of-the-art performance without using all the social media posts in the user posting history , providing a perspective on the number of posts required to make a reliable prediction . It is worth pointing out that there is still room in social media text that is worth exploring . The contributions of this paper can be summarized as below . 1 . SERCNN can retrieve a more robust and richer representation of the social media text by stacking multiple low dimensional pretrained embeddings . 2 . Provides insights on how the different number of posts influence the prediction model ’ s accuracy . 2 RELATED WORK . In this section , we provide an overview of the current research landscape and how previous works convert information extracted from social media posts into more representative features that can be used to identify depressed individuals . Depression detection on social media Evidence from various published works has shown the viability of using social media data to predict depression and other mental disorders . The seminal work by Holleran ( 2010 ) has inspired natural language processing ( NLP ) researchers to identify potential markers of mental disorder from social media posts . In contrast to the 14 days of observation stated in DSM-5 , Hu et al . ( 2015 ) and Tsugawa et al . ( 2015 ) . empirically suggested that features extracted over two months are sufficiently be used to identify one ’ s depression condition . Coppersmith et al . have presented a. novel method to collect ground truth on social media related to depression and PTSD . The dataset is then being used for the shared task of The Workshop on Computational Linguistics and Clinical Psychology ( CLPsych ) ( Coppersmith et al. , 2015 ) . A similar workshop , CLEF eRisk ( Losada et al. , 2017 ) , focuses on the early depression symptoms discoveries on social media . Workshop tasks such as depression detection ( CLPsych 2015 ( Coppersmith et al. , 2015 ) ) and early detection of signs of depression ( CLEF eRisk 2017 ( Losada et al. , 2017 ) ) have generated significant numbers of novel approaches in identifying depression on social media . Feature representation for depression classification Modeling feature representations is a crucial task in machine learning ; features that are not discriminative and representative will result in poor and faulty model performance . Hence , earlier research works are mainly focused on feature extraction techniques . Choudhury et al . ( 2013 ) ; Tsugawa et al . ( 2015 ) have found that depressed users tend to be emotional . Wang et al . ( 2013 ) found that using sentiment analysis in depression detection can achieve about 80 % accuracy . Tsugawa et al . ( 2015 ) ; Resnik et al . ( 2015 ) extracted topics distribution with Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) to differentiate depressed individuals from the healthy controls . Researchers also extracted features based on criteria stated in the industrystandard - Diagnostic and Statistical Manual of Mental Disorders ( DSM ) , such as the insomnia index derived from the user posting time . Linguistic Inquiry and Word Count ( LIWC ) ( Tausczik & Pen- nebaker , 2010 ) is a widely used word matching-based feature extraction tool that builds on top of Pennebaker et al. ’ s findings ( Rude et al. , 2004 ; Gortner et al. , 2006 ) decades ago . ( Choudhury et al. , 2013 ; Shen et al. , 2017 ) show that depressed users tend to have high self-attentional focus , increased medicinal concerns , and increased expression of religious thoughts . These findings are aligned with the Rude et al . ( 2004 ) work where depressive indicators can be found on the human-generated content . However , LIWC and word matching-based sentiment analysis approaches are often ineffective . The nature of social media text being dirty and unstructured often required extensive data cleaning and preprocessing for the tools to act as intended . Recent works ( Gui et al. , 2019a ; b ; Rao et al. , 2020 ) have shown that using the word embedding and deep learning models are effective than the handcrafted features with minimal effort of text preprocessing . We observed that most works that employed deep learning models tend to use hierarchical document modeling to generate their input representation . This raises the question of whether depression classification using social media data actually takes advantage of the hierarchical document modeling . 3 STACKED EMBEDDING RECURRENT CONVOLUTIONAL NEURAL . NETWORK ( SERCNN ) Overview Our goal is to improve the performance of depression classification on social media by learning a much robust user representation . Given that our dataset , d , consists of N1 number of social media users , u , where each user ’ s N2 number of social media posts , p , within a month were collected , and each post has N3 words , w , we denote the dataset as d = { u1 , ... , uN1 } , social media user as u = { p1 , ... , pN2 } , and the post as p = { w1 , ... , wN3 } . We propose Stacked Embedding Recurrent Convolutional Neural Network ( SERCNN ) which is made up of a Stacked Embedding ( SE ) and Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) . The overall architecture of SERCNN is simple , consisting a SE layer , single directional LSTM , a max-pooling layer and an output layer which is a fully connected layer with sigmoid function , as visualized in Figure 1 . 3.1 FEATURE EXTRACTION WITH STACKED EMBEDDING . Unlike previous works , we model our user representation by firstly concatenating N2 social media posts in chronological order . For a random user ui , the concatenated text representation can be formulated into : ui = { p1 + ... + pN2 } ( 1 ) ui = { w11 + ... + w1N3 + ... + w N2 N3 } ( 2 ) This concatenated post can be viewed as a single ” monthly diary ” , journal or large document that characterizes the user . Then , we extract the distributed text representation of each word with the SE , which is an ensemble embedding , commonly known as the Meta-embedding technique . The concept of Meta-embedding was first introduced by Yin & Schütze ( 2016 ) to utilize and learn the meta of existing well-trained pretrained embeddings and extend the vocabulary . Since different pretrained embeddings were trained on different datasets , each embedding can now complement each other allowing an improved vocabulary coverage and reducing out-of-vocabulary words . As the name suggests , SE is formed by stacking the collection of dense vectors ( pretrained weights ) E = { E1 , ... , EN4 } extracted from N4 number of pretrained embeddings included : ESE = { E1 + ... +EN4 } ( 3 ) where the embedding vector , x , of a given word , w can be obtained via : x = ESE ( w ) ( 4 ) The vocabulary of SE , VSE , is now considered as the vocabulary union of the N4 pretrained embeddings , resulting in a more extensive vocabulary than a single embedding : VSE = N4⋃ n=1 Vn ( 5 ) In this study , our SE is the simple stacked vector made up of two pretrained GloVe embeddings ( Pennington et al. , 2014 ) trained on Twitter and Wikipedia 2014 + Gigaword 5 datasets , respectively : 1 . GloVe Twitter ( 25 dimensions ) trained using global word co-occurrences information by Pennington et al . ( 2014 ) under an uncased setting , using 2 billion tweets , with 27 billion tokens . The resulting vector consists of 1.2 million vocabularies learned from the corpus . 2 . GloVe Wikipedia 2014 + Gigaword 5 ( 100 dimensions ) ( Pennington et al. , 2014 ) , similar to the GloVe Twitter embedding , this embedding is trained using global word co-occurrences information but using a different corpus , which is the combination of Wikipedia 2014 and Gigaword 5 datasets . There are approximately 400 thousand words in the vocabulary . 3.2 REPRESENTATION LEARNING AND DEPRESSION CLASSIFICATION WITH RCNN . Recurrent neural network ( RNN ) is capable of capturing contextual information over a long sequence . However , the RNN model favors the later words than words in the earlier sequence . In depression detection on social media , where posts are collected over a time interval , we are interested in identifying words throughout that period , rather than just words that occurred later . Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) overcomes the limitation of the existing RNN model by incorporating a max-pooling layer to extract key features from both the embedding features and the context learned . The max-pooling layer reconsiders embedding features instead of just the context learned in the conventional RNN-based setting , selecting the important features for the classification task . The overall architecture of our RCNN model is visualized in Figure 3 . Instead of using bidirectional Long Short Term Memory ( LSTM ) as described in Lai et al . ( 2015 ) , we use a generic single Forward LSTM to learn the context , c , from the embedding vector , v. With j refers to the jth social media post and k refers to the kth number of words in the post , we can formulate the context for a given word : ( c ( wjk ) , h ( w j k ) ) = LSTM ( c ( wjk−1 ) , h ( w j k−1 ) , v ( w j k ) ) ( 6 ) where |c| ∈ R and h is the output vector . The output of the LSTM is then concatenated with the embedding features , forming an extended context vector : yjk = [ c ( w j k ) ; x j k ] ( 7 ) A max-pooling layer is applied after the RCNN representation of the user is computed : ỹ = L max l=1 yl ( 8 ) , where the total number of words , L , can be calculated by multiplying the total number of social media posts , N2 , by the number of words in each post , N3 . A fully connected layer is then used to discriminate the max-pooled context with a sigmoid function , presenting the classification output , ŷ , as probabilities : ŷi = p ( ỹ | ui ) = 1 1 + exp− ( Wcui+bc ) ∈ [ 0 , 1 ] ( 9 ) | This paper develops a SERCNN, which consists of stacked embeddings and Recurrent CNN (RCNN), for depression detection from Twitter text. The key idea of stacked embeddings is to concatenate two embeddings, based on two different word embeddings models (pre-trained on Twitter and Wikipedia copora), into a single embedding vector, which is fed into RCNN. Experimental results on the Twitter Depression dataset show reasonable performance when trained on 10 posts from each user, which was further improved when trained on more data. | SP:e635477a7c6a11809327a8367eaf896b65463b15 |
SERCNN: Stacked Embedding Recurrent Convolutional Neural Network in Depression Detection on Twitter | 1 INTRODUCTION . Depression is a serious yet common mental disorder that affects more than 264 million people worldwide . The number is projected to grow amid the war against the pandemic of COVID-19 . Unlike the usual mood fluctuations and emotional responses , the long-lasting sadness , emptiness , or irritation in one ’ s day-to-day life , accompanied by somatic and cognitive changes that heavily disrupt an individual ’ s capacity to function normally . Hence , depression is often associated with suicide at its worst . In the latest Word Health Statistics 2021 ( World Health Organization , 2021 ) , 28 % increases the suicide rate in the United States in this period , which may result from the increasing pressure on the loss of loved ones and incomes , city lockdowns , social distancing , and the reduction of human interactions . Existing screening methods , such as psychometric self-reporting questionnaires and clinical interviews , are expensive , not scalable , not reachable to many , and have limitations . For example , the Diagnostic and Statistical Manual of Mental Disorders ( DSM-5 ) ( American Psychiatric Association et al. , 2013 ) requires patients to be involved and disclose truthful information during clinical interviews . Besides that , people who suffer from depression tend to be unaware of their condition because there is no specific feedback from the body like common physical injuries do . To get diagnosed with depression , one must first consult a doctor or mental health professional . Up to date , global provision and service for identifying , supporting , and treating mental health issues are insufficient despite the disruption of essential health services , community mistrust , and fears of COVID-19 infections . The lack of mental health awareness in the Southeast Asia Region is another contributing factor in the sky-high figure of depression . Social media has become part and parcel of everyday life . It has become a valuable source of information that led to a new research direction for detecting depression . Here , social media data can serve as a lifelog that records users ’ activities in the text , image , audio , and video . The enormous amount of time series first-person narrative posts can provide insights about one ’ s thoughts , feelings , behavior , or mood for some time , allowing an unintrusive way to study patients ’ conditions before an actual clinical diagnosis is made . Motivated by previous studies that demonstrated great potentials for using social media posts to monitor and predict one ’ s mental health status , this paper utilizes natural language processing and machine learning techniques on social media data to predict one ’ s risk of depression . We propose Stacked Embedding Recurrent Neural Network ( SERCNN ) , which can effectively learn the representation from dirty and unstructured social media text without the need to pursue multimodal learning . Instead of using the recent transformer model , we suggest a meta-embedding approach for our feature extraction . We utilize two widely available yet low dimensional pretrained GloVe embeddings trained on different domain datasets to provide a more robust and accurate representation of the dirty and unstructured social media text that often contains typos . Our SERCNN can achieve a state-of-the-art performance without using all the social media posts in the user posting history , providing a perspective on the number of posts required to make a reliable prediction . It is worth pointing out that there is still room in social media text that is worth exploring . The contributions of this paper can be summarized as below . 1 . SERCNN can retrieve a more robust and richer representation of the social media text by stacking multiple low dimensional pretrained embeddings . 2 . Provides insights on how the different number of posts influence the prediction model ’ s accuracy . 2 RELATED WORK . In this section , we provide an overview of the current research landscape and how previous works convert information extracted from social media posts into more representative features that can be used to identify depressed individuals . Depression detection on social media Evidence from various published works has shown the viability of using social media data to predict depression and other mental disorders . The seminal work by Holleran ( 2010 ) has inspired natural language processing ( NLP ) researchers to identify potential markers of mental disorder from social media posts . In contrast to the 14 days of observation stated in DSM-5 , Hu et al . ( 2015 ) and Tsugawa et al . ( 2015 ) . empirically suggested that features extracted over two months are sufficiently be used to identify one ’ s depression condition . Coppersmith et al . have presented a. novel method to collect ground truth on social media related to depression and PTSD . The dataset is then being used for the shared task of The Workshop on Computational Linguistics and Clinical Psychology ( CLPsych ) ( Coppersmith et al. , 2015 ) . A similar workshop , CLEF eRisk ( Losada et al. , 2017 ) , focuses on the early depression symptoms discoveries on social media . Workshop tasks such as depression detection ( CLPsych 2015 ( Coppersmith et al. , 2015 ) ) and early detection of signs of depression ( CLEF eRisk 2017 ( Losada et al. , 2017 ) ) have generated significant numbers of novel approaches in identifying depression on social media . Feature representation for depression classification Modeling feature representations is a crucial task in machine learning ; features that are not discriminative and representative will result in poor and faulty model performance . Hence , earlier research works are mainly focused on feature extraction techniques . Choudhury et al . ( 2013 ) ; Tsugawa et al . ( 2015 ) have found that depressed users tend to be emotional . Wang et al . ( 2013 ) found that using sentiment analysis in depression detection can achieve about 80 % accuracy . Tsugawa et al . ( 2015 ) ; Resnik et al . ( 2015 ) extracted topics distribution with Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) to differentiate depressed individuals from the healthy controls . Researchers also extracted features based on criteria stated in the industrystandard - Diagnostic and Statistical Manual of Mental Disorders ( DSM ) , such as the insomnia index derived from the user posting time . Linguistic Inquiry and Word Count ( LIWC ) ( Tausczik & Pen- nebaker , 2010 ) is a widely used word matching-based feature extraction tool that builds on top of Pennebaker et al. ’ s findings ( Rude et al. , 2004 ; Gortner et al. , 2006 ) decades ago . ( Choudhury et al. , 2013 ; Shen et al. , 2017 ) show that depressed users tend to have high self-attentional focus , increased medicinal concerns , and increased expression of religious thoughts . These findings are aligned with the Rude et al . ( 2004 ) work where depressive indicators can be found on the human-generated content . However , LIWC and word matching-based sentiment analysis approaches are often ineffective . The nature of social media text being dirty and unstructured often required extensive data cleaning and preprocessing for the tools to act as intended . Recent works ( Gui et al. , 2019a ; b ; Rao et al. , 2020 ) have shown that using the word embedding and deep learning models are effective than the handcrafted features with minimal effort of text preprocessing . We observed that most works that employed deep learning models tend to use hierarchical document modeling to generate their input representation . This raises the question of whether depression classification using social media data actually takes advantage of the hierarchical document modeling . 3 STACKED EMBEDDING RECURRENT CONVOLUTIONAL NEURAL . NETWORK ( SERCNN ) Overview Our goal is to improve the performance of depression classification on social media by learning a much robust user representation . Given that our dataset , d , consists of N1 number of social media users , u , where each user ’ s N2 number of social media posts , p , within a month were collected , and each post has N3 words , w , we denote the dataset as d = { u1 , ... , uN1 } , social media user as u = { p1 , ... , pN2 } , and the post as p = { w1 , ... , wN3 } . We propose Stacked Embedding Recurrent Convolutional Neural Network ( SERCNN ) which is made up of a Stacked Embedding ( SE ) and Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) . The overall architecture of SERCNN is simple , consisting a SE layer , single directional LSTM , a max-pooling layer and an output layer which is a fully connected layer with sigmoid function , as visualized in Figure 1 . 3.1 FEATURE EXTRACTION WITH STACKED EMBEDDING . Unlike previous works , we model our user representation by firstly concatenating N2 social media posts in chronological order . For a random user ui , the concatenated text representation can be formulated into : ui = { p1 + ... + pN2 } ( 1 ) ui = { w11 + ... + w1N3 + ... + w N2 N3 } ( 2 ) This concatenated post can be viewed as a single ” monthly diary ” , journal or large document that characterizes the user . Then , we extract the distributed text representation of each word with the SE , which is an ensemble embedding , commonly known as the Meta-embedding technique . The concept of Meta-embedding was first introduced by Yin & Schütze ( 2016 ) to utilize and learn the meta of existing well-trained pretrained embeddings and extend the vocabulary . Since different pretrained embeddings were trained on different datasets , each embedding can now complement each other allowing an improved vocabulary coverage and reducing out-of-vocabulary words . As the name suggests , SE is formed by stacking the collection of dense vectors ( pretrained weights ) E = { E1 , ... , EN4 } extracted from N4 number of pretrained embeddings included : ESE = { E1 + ... +EN4 } ( 3 ) where the embedding vector , x , of a given word , w can be obtained via : x = ESE ( w ) ( 4 ) The vocabulary of SE , VSE , is now considered as the vocabulary union of the N4 pretrained embeddings , resulting in a more extensive vocabulary than a single embedding : VSE = N4⋃ n=1 Vn ( 5 ) In this study , our SE is the simple stacked vector made up of two pretrained GloVe embeddings ( Pennington et al. , 2014 ) trained on Twitter and Wikipedia 2014 + Gigaword 5 datasets , respectively : 1 . GloVe Twitter ( 25 dimensions ) trained using global word co-occurrences information by Pennington et al . ( 2014 ) under an uncased setting , using 2 billion tweets , with 27 billion tokens . The resulting vector consists of 1.2 million vocabularies learned from the corpus . 2 . GloVe Wikipedia 2014 + Gigaword 5 ( 100 dimensions ) ( Pennington et al. , 2014 ) , similar to the GloVe Twitter embedding , this embedding is trained using global word co-occurrences information but using a different corpus , which is the combination of Wikipedia 2014 and Gigaword 5 datasets . There are approximately 400 thousand words in the vocabulary . 3.2 REPRESENTATION LEARNING AND DEPRESSION CLASSIFICATION WITH RCNN . Recurrent neural network ( RNN ) is capable of capturing contextual information over a long sequence . However , the RNN model favors the later words than words in the earlier sequence . In depression detection on social media , where posts are collected over a time interval , we are interested in identifying words throughout that period , rather than just words that occurred later . Lai et al . ( 2015 ) Recurrent Convolutional Neural Network ( RCNN ) overcomes the limitation of the existing RNN model by incorporating a max-pooling layer to extract key features from both the embedding features and the context learned . The max-pooling layer reconsiders embedding features instead of just the context learned in the conventional RNN-based setting , selecting the important features for the classification task . The overall architecture of our RCNN model is visualized in Figure 3 . Instead of using bidirectional Long Short Term Memory ( LSTM ) as described in Lai et al . ( 2015 ) , we use a generic single Forward LSTM to learn the context , c , from the embedding vector , v. With j refers to the jth social media post and k refers to the kth number of words in the post , we can formulate the context for a given word : ( c ( wjk ) , h ( w j k ) ) = LSTM ( c ( wjk−1 ) , h ( w j k−1 ) , v ( w j k ) ) ( 6 ) where |c| ∈ R and h is the output vector . The output of the LSTM is then concatenated with the embedding features , forming an extended context vector : yjk = [ c ( w j k ) ; x j k ] ( 7 ) A max-pooling layer is applied after the RCNN representation of the user is computed : ỹ = L max l=1 yl ( 8 ) , where the total number of words , L , can be calculated by multiplying the total number of social media posts , N2 , by the number of words in each post , N3 . A fully connected layer is then used to discriminate the max-pooled context with a sigmoid function , presenting the classification output , ŷ , as probabilities : ŷi = p ( ỹ | ui ) = 1 1 + exp− ( Wcui+bc ) ∈ [ 0 , 1 ] ( 9 ) | This paper proposes a stacked embedding recurrent neural network, named SERCNN, to detect depression from Twitter. First, the authors use stacked meta-embedding to gain the stacked word information. Then, the RCNN structure is utilized to capture contextual features. The experimental results show the effectiveness of the proposed model. | SP:e635477a7c6a11809327a8367eaf896b65463b15 |
Towards Unknown-aware Deep Q-Learning | 1 INTRODUCTION . As reinforcement learning ( RL ) becomes increasingly important for sequential decision-making tasks , it must entail strong safety and reliability guarantees . In particular , RL agents deployed in open-world environments are naturally subject to sudden environmental shifts or data distributional changes . Unfortunately , current RL models commonly make the closed-world assumption , i.e. , the state transitions follow a potentially time-varying Markov Decision Process st+1 ∼ T ( · | st , at ) , where T is the transition model and st , at are the state and action at timestamp t. An RL agent in deployment may encounter and fail to identify unknown out-of-distribution ( OOD ) states — i.e. , state st that is not from the training environment . Such unexpected states can be potentially catastrophic . For example , if a self-driving agent trained for an urban driving environment would be exposed to OOD states such as mountain roads with rocks , it would still output an action but may be a consequential one . This gives rise to the importance of detecting and mitigating unexpected OOD states , which allows the agent to avoid non-safe actions . Currently , the study of handling OOD states in RL remains underexplored . Our paper aims to bridge this critical gap . As a motivating example , we first show that state-of-the-art reinforcement learning networks do not necessarily know what they don ’ t know , and can assign abnormally high Q values for OOD states ( Figure 1 ) . Previous works on OOD detection in RL ( Sedlmeier et al. , 2019 ; Hoel et al. , 2020 ) rely on an ensemble of neural networks to estimate the variances of Q values ( Osband et al. , 2016 ; 2018 ) , which do not fundamentally mitigate the issue of the incorrectly high Q values in the presence of OOD inputs ( see Section 3.1 ) . Moreover , ensemble-based approaches can be computationally expensive as both the training and inference time will increase accordingly with the ensemble size . To this end , we propose a novel unknown-aware deep Q-learning framework—enabling the RL agent to perform OOD uncertainty estimation while guaranteeing the performance on the original in-distribution ( ID ) environment . We formalize ID and OOD states in RL ( Section 2 ) , and tackle the problem of detecting OOD states without extra Bayesian modeling ( Section 3 ) . Specifically , We propose to estimate the OOD uncertainty using the uncertainty score derived directly from the { Q ( st , a ) , a ∈ A } values . This determines the validity of st , which can be either in-distribution or OOD . Our key idea is to regularize the training process so that OOD states will have higher uncertainty scores , while in-distribution states will have relatively lower scores , therefore making them distinguishable . This is in contrast with vanilla Q-learning algorithms that do not take into account unknowns during training . During inference time , our OOD uncertainty estimation score can be flexibly computed on a single deployed model without variance estimation required . We provide theoretical guarantees that our method can improve OOD uncertainty estimation while ensuring the convergence of ID performance ( Section 4 ) . Empirically , we demonstrate state-of-theart performance on six diverse environments from OpenAI gym ( Brockman et al. , 2016 ) , including Atari games ( with discrete state space ) and classic control task ( with continuous state space ) . In all environments , our method consistently achieves near-optimal OOD detection performance , outperforming the baselines by a substantial margin . Our method can be easily plugged into existing Q-learning algorithms including DQN ( Mnih et al. , 2015 ) and QR-DQN ( Dabney et al. , 2018b ) and render stronger OOD detection performance and RL safety ( Section 5 ) . Our main contributions are summarized as follows : • We propose a novel Q-learning framework for improving OOD uncertainty estimation , which aims at mitigating the critical issue of incorrectly high Q values from OOD state inputs in vanilla Q-learning algorithms ; • We provide theoretical guarantees that our regularization improves OOD detection while maintaining the convergence performance of ID in Q-learning ; • Our method establishes state-of-the-art OOD detection performance on a wide range of RL environments , including Atari games and classic control . Extensive ablation studies are conducted to show the efficacy of our algorithm . 2 PRELIMINARIES AND PROBLEM STATEMENT . 2.1 PRELIMINARIES : REINFORCEMENT LEARNING AND Q-LEARNING . Markov decision processes ( MDP ) . In reinforcement learning , the agent explores an environment and maximizes the cumulative reward . Markov decision processes ( MDPs ) are used to model RL . MDPs are defined by the tuples ( S , A , R , T ) , where S indicates the state space , A is the set of actions , T is the transition model between states , andR is the reward model . At each timestep t , the agent observes a state st ∈ S , chooses an action at ∈ A , receives a reward rt ∈ R , and transits to a new state st+1 determined by T ( st+1|st , at ) . The goal is to find a policy π ∈ Π : S → A , which maximizes the discounted return over a potentially infinite horizon : Rt = Σ ∞ k=0γ krt+k , ( 1 ) where γ ∈ [ 0 , 1 ] is the discount factor . For notation brevity , we use s′ = st+1 and omit the timestamp t when the context is clear . Reinforcement learning and Q-learning . To find the optimal policy π∗ , we focus on Qlearning ( Watkins & Dayan , 1992 ) , a commonly used value-based approach . In Q-learning , the action-value function Q : S × A → R describes the expected return when the agent takes action a in state s , and then following policy π for all states afterwards . The optimal function Q∗ is defined as : Q∗ ( s , a ) = max π Eπ [ R|s , a ] . ( 2 ) Given a tuple of one-step transition ( s , a , s′ , r ) , we have the Bellman equation Q∗ ( s , a ) = r + γmaxa′ Q ∗ ( s′ , a′ ) using dynamic programming . The one-step TD error is used to update Q values : TD ( s , a , r , s′ ) = r + γmax a′ Q ( s′ , a′ ) −Q ( s , a ) . ( 3 ) In tabular cases , a table of Q values are maintained for finite state-action pairs , and are updated according to the TD error : Q ( s , a ) ← Q ( s , a ) +α ( r+ γmaxa′ Q ( s′ , a′ ) −Q ( s , a ) ) , where α is the learning rate . This can also be viewed as gradient updates that minimize the L2 norm of TD error . Deep Q-Networks ( DQN ) . In high-dimensional settings or when learning in continuous statespaces , it is common to use parameterized functions such as neural networks to approximate the action-value function Q ( s , a ) . We use the deep Q-networks ( Mnih et al. , 2015 ) parameterized by θ , with corresponding action-value function Qθ . The norm of the TD error is minimized during training to update the parameter θ . 2.2 OUT-OF-DISTRIBUTION DETECTION IN REINFORCEMENT LEARNING . When deploying an RL agent in open-world environments , it is paramount for the agent to detect OOD states and refrain from taking actions according to policy π in the presence of OOD states . Here we provide the definition of OOD states in the setting of RL . In-distribution ( ID ) states . Given an environment and a learning algorithm , we can estimate the distribution of the states encountered by the agent during training . We denote P as in-distribution . Out-of-distribution ( OOD ) states . The general notion of OOD refers to inference-time inputs which deviate substantially from the data encountered during training1 . In other words , OOD states are unexpected and should not have occurred in the ID environment . Importantly , OOD states should not be confused with under-explored states : the latter still belongs to ID with more epistemic uncertainty than ID states , and are crucial for exploration ( Osband et al. , 2016 ) . In contrast , OOD states are not safe to explore , since the agent has no knowledge on such states during training . We expect significantly lower Q values from OOD states , because unlike the underexplored states , the agent should not be encouraged to explore OOD states . OOD state detection . The goal of OOD detection is to define a decision function G such that : G ( s ) = { 1 if s ∼ P , 0 otherwise . In other words , the agent should be able to know what it does not know . The agent should take action a ∼ π ( s ) only if s is in-distribution . 3 METHOD . In this section , we begin with a motivating example that existing Q-learning algorithms can produce incorrectly high Q values for OOD states ( Section 3.1 ) . To mitigate this issue , we introduce our proposed unknown-aware Q-learning method in Section 3.2 . 3.1 A MOTIVATING EXAMPLE . Incorrectly high Q values for OOD states . Here we present a motivating example of possible incorrect estimation of Q values for OOD states using existing Q-learning algorithms , particularly vanilla DQN ( Mnih et al. , 2015 ) and bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) . We show that such incorrectly high extrapolation of Q values can not be mitigated by traditional uncertainty estimation . For simplicity , we use the chain environment to illustrate the problem ; see Figure 1 ( a ) . Action 0 indicates move left and Action 1 indicates move right . The start state is selected uniformly randomly among 5 states { 1 , 2 , 3 , 4 , 5 } . If the agent arrives on state 0 or 6 , a reward of 1 is received and the terminal is reached . Otherwise , the reward is 0 . We train a vanilla DQN and bootstrapped DQN ( with an ensemble size 10 ) , both under the same MLP architecture for 100,000 steps . The MLP has two hidden layers with 256 units each . Figure 1 1By “ inference-time ” , we assume the RL agent has already converged to policy π ; this policy is now fixed and used to behave in the environment , which includes the majority of cases in RL deployment . ( b ) ( c ) show the Q values for action 0 and 1 respectively . We observe that they give the same estimation for in-distribution Q values , which indicates that they both achieve convergence . Vanilla DQN fails to extrapolate reasonably on OOD states ( states < 0 and > 6 ) , where the corresponding Q values are incorrectly high . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) ( denoted as the ensemble in the plots ) displays higher variance for OOD state inputs , but the overall estimated distribution of OOD Q values are still incorrectly high . Motivated by this , we now introduce our method , which regularizes the Q values of OOD states and improves OOD detection without compromising the in-distribution Q values ; see the orange lines shown in Figure 1 ( b ) and ( c ) . | This paper proposes a new method based on Q-learning that is able to detect out-of-distribution states during deployment time. In order to accomplish this, an energy-based regulizeer has been introduced in which it pushes down Q-values for out-of-distribution states during training time. In order to create out-of-distribution states during training, this paper utilizes some heuristic such as cropping applied to random locations to input images. To evaluate the proposed method, this paper utilizes 4 Atari games and Cartpole environment. | SP:44fcecd2c331123bb795336eb5dd299ed2d641e8 |
Towards Unknown-aware Deep Q-Learning | 1 INTRODUCTION . As reinforcement learning ( RL ) becomes increasingly important for sequential decision-making tasks , it must entail strong safety and reliability guarantees . In particular , RL agents deployed in open-world environments are naturally subject to sudden environmental shifts or data distributional changes . Unfortunately , current RL models commonly make the closed-world assumption , i.e. , the state transitions follow a potentially time-varying Markov Decision Process st+1 ∼ T ( · | st , at ) , where T is the transition model and st , at are the state and action at timestamp t. An RL agent in deployment may encounter and fail to identify unknown out-of-distribution ( OOD ) states — i.e. , state st that is not from the training environment . Such unexpected states can be potentially catastrophic . For example , if a self-driving agent trained for an urban driving environment would be exposed to OOD states such as mountain roads with rocks , it would still output an action but may be a consequential one . This gives rise to the importance of detecting and mitigating unexpected OOD states , which allows the agent to avoid non-safe actions . Currently , the study of handling OOD states in RL remains underexplored . Our paper aims to bridge this critical gap . As a motivating example , we first show that state-of-the-art reinforcement learning networks do not necessarily know what they don ’ t know , and can assign abnormally high Q values for OOD states ( Figure 1 ) . Previous works on OOD detection in RL ( Sedlmeier et al. , 2019 ; Hoel et al. , 2020 ) rely on an ensemble of neural networks to estimate the variances of Q values ( Osband et al. , 2016 ; 2018 ) , which do not fundamentally mitigate the issue of the incorrectly high Q values in the presence of OOD inputs ( see Section 3.1 ) . Moreover , ensemble-based approaches can be computationally expensive as both the training and inference time will increase accordingly with the ensemble size . To this end , we propose a novel unknown-aware deep Q-learning framework—enabling the RL agent to perform OOD uncertainty estimation while guaranteeing the performance on the original in-distribution ( ID ) environment . We formalize ID and OOD states in RL ( Section 2 ) , and tackle the problem of detecting OOD states without extra Bayesian modeling ( Section 3 ) . Specifically , We propose to estimate the OOD uncertainty using the uncertainty score derived directly from the { Q ( st , a ) , a ∈ A } values . This determines the validity of st , which can be either in-distribution or OOD . Our key idea is to regularize the training process so that OOD states will have higher uncertainty scores , while in-distribution states will have relatively lower scores , therefore making them distinguishable . This is in contrast with vanilla Q-learning algorithms that do not take into account unknowns during training . During inference time , our OOD uncertainty estimation score can be flexibly computed on a single deployed model without variance estimation required . We provide theoretical guarantees that our method can improve OOD uncertainty estimation while ensuring the convergence of ID performance ( Section 4 ) . Empirically , we demonstrate state-of-theart performance on six diverse environments from OpenAI gym ( Brockman et al. , 2016 ) , including Atari games ( with discrete state space ) and classic control task ( with continuous state space ) . In all environments , our method consistently achieves near-optimal OOD detection performance , outperforming the baselines by a substantial margin . Our method can be easily plugged into existing Q-learning algorithms including DQN ( Mnih et al. , 2015 ) and QR-DQN ( Dabney et al. , 2018b ) and render stronger OOD detection performance and RL safety ( Section 5 ) . Our main contributions are summarized as follows : • We propose a novel Q-learning framework for improving OOD uncertainty estimation , which aims at mitigating the critical issue of incorrectly high Q values from OOD state inputs in vanilla Q-learning algorithms ; • We provide theoretical guarantees that our regularization improves OOD detection while maintaining the convergence performance of ID in Q-learning ; • Our method establishes state-of-the-art OOD detection performance on a wide range of RL environments , including Atari games and classic control . Extensive ablation studies are conducted to show the efficacy of our algorithm . 2 PRELIMINARIES AND PROBLEM STATEMENT . 2.1 PRELIMINARIES : REINFORCEMENT LEARNING AND Q-LEARNING . Markov decision processes ( MDP ) . In reinforcement learning , the agent explores an environment and maximizes the cumulative reward . Markov decision processes ( MDPs ) are used to model RL . MDPs are defined by the tuples ( S , A , R , T ) , where S indicates the state space , A is the set of actions , T is the transition model between states , andR is the reward model . At each timestep t , the agent observes a state st ∈ S , chooses an action at ∈ A , receives a reward rt ∈ R , and transits to a new state st+1 determined by T ( st+1|st , at ) . The goal is to find a policy π ∈ Π : S → A , which maximizes the discounted return over a potentially infinite horizon : Rt = Σ ∞ k=0γ krt+k , ( 1 ) where γ ∈ [ 0 , 1 ] is the discount factor . For notation brevity , we use s′ = st+1 and omit the timestamp t when the context is clear . Reinforcement learning and Q-learning . To find the optimal policy π∗ , we focus on Qlearning ( Watkins & Dayan , 1992 ) , a commonly used value-based approach . In Q-learning , the action-value function Q : S × A → R describes the expected return when the agent takes action a in state s , and then following policy π for all states afterwards . The optimal function Q∗ is defined as : Q∗ ( s , a ) = max π Eπ [ R|s , a ] . ( 2 ) Given a tuple of one-step transition ( s , a , s′ , r ) , we have the Bellman equation Q∗ ( s , a ) = r + γmaxa′ Q ∗ ( s′ , a′ ) using dynamic programming . The one-step TD error is used to update Q values : TD ( s , a , r , s′ ) = r + γmax a′ Q ( s′ , a′ ) −Q ( s , a ) . ( 3 ) In tabular cases , a table of Q values are maintained for finite state-action pairs , and are updated according to the TD error : Q ( s , a ) ← Q ( s , a ) +α ( r+ γmaxa′ Q ( s′ , a′ ) −Q ( s , a ) ) , where α is the learning rate . This can also be viewed as gradient updates that minimize the L2 norm of TD error . Deep Q-Networks ( DQN ) . In high-dimensional settings or when learning in continuous statespaces , it is common to use parameterized functions such as neural networks to approximate the action-value function Q ( s , a ) . We use the deep Q-networks ( Mnih et al. , 2015 ) parameterized by θ , with corresponding action-value function Qθ . The norm of the TD error is minimized during training to update the parameter θ . 2.2 OUT-OF-DISTRIBUTION DETECTION IN REINFORCEMENT LEARNING . When deploying an RL agent in open-world environments , it is paramount for the agent to detect OOD states and refrain from taking actions according to policy π in the presence of OOD states . Here we provide the definition of OOD states in the setting of RL . In-distribution ( ID ) states . Given an environment and a learning algorithm , we can estimate the distribution of the states encountered by the agent during training . We denote P as in-distribution . Out-of-distribution ( OOD ) states . The general notion of OOD refers to inference-time inputs which deviate substantially from the data encountered during training1 . In other words , OOD states are unexpected and should not have occurred in the ID environment . Importantly , OOD states should not be confused with under-explored states : the latter still belongs to ID with more epistemic uncertainty than ID states , and are crucial for exploration ( Osband et al. , 2016 ) . In contrast , OOD states are not safe to explore , since the agent has no knowledge on such states during training . We expect significantly lower Q values from OOD states , because unlike the underexplored states , the agent should not be encouraged to explore OOD states . OOD state detection . The goal of OOD detection is to define a decision function G such that : G ( s ) = { 1 if s ∼ P , 0 otherwise . In other words , the agent should be able to know what it does not know . The agent should take action a ∼ π ( s ) only if s is in-distribution . 3 METHOD . In this section , we begin with a motivating example that existing Q-learning algorithms can produce incorrectly high Q values for OOD states ( Section 3.1 ) . To mitigate this issue , we introduce our proposed unknown-aware Q-learning method in Section 3.2 . 3.1 A MOTIVATING EXAMPLE . Incorrectly high Q values for OOD states . Here we present a motivating example of possible incorrect estimation of Q values for OOD states using existing Q-learning algorithms , particularly vanilla DQN ( Mnih et al. , 2015 ) and bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) . We show that such incorrectly high extrapolation of Q values can not be mitigated by traditional uncertainty estimation . For simplicity , we use the chain environment to illustrate the problem ; see Figure 1 ( a ) . Action 0 indicates move left and Action 1 indicates move right . The start state is selected uniformly randomly among 5 states { 1 , 2 , 3 , 4 , 5 } . If the agent arrives on state 0 or 6 , a reward of 1 is received and the terminal is reached . Otherwise , the reward is 0 . We train a vanilla DQN and bootstrapped DQN ( with an ensemble size 10 ) , both under the same MLP architecture for 100,000 steps . The MLP has two hidden layers with 256 units each . Figure 1 1By “ inference-time ” , we assume the RL agent has already converged to policy π ; this policy is now fixed and used to behave in the environment , which includes the majority of cases in RL deployment . ( b ) ( c ) show the Q values for action 0 and 1 respectively . We observe that they give the same estimation for in-distribution Q values , which indicates that they both achieve convergence . Vanilla DQN fails to extrapolate reasonably on OOD states ( states < 0 and > 6 ) , where the corresponding Q values are incorrectly high . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) ( denoted as the ensemble in the plots ) displays higher variance for OOD state inputs , but the overall estimated distribution of OOD Q values are still incorrectly high . Motivated by this , we now introduce our method , which regularizes the Q values of OOD states and improves OOD detection without compromising the in-distribution Q values ; see the orange lines shown in Figure 1 ( b ) and ( c ) . | This paper considers the problem of detecting out-of-distribution states to avoid taking actions at states that the policy has not been trained on. The general approach is to synthesize "out-of-distribution" states, and penalize the value function at these states to be below some pre-determined threshold, and using this threshold to determine whether or not states at test-time are out-of-distribution. The approach is tested on a synthetic Atari suite. | SP:44fcecd2c331123bb795336eb5dd299ed2d641e8 |
Towards Unknown-aware Deep Q-Learning | 1 INTRODUCTION . As reinforcement learning ( RL ) becomes increasingly important for sequential decision-making tasks , it must entail strong safety and reliability guarantees . In particular , RL agents deployed in open-world environments are naturally subject to sudden environmental shifts or data distributional changes . Unfortunately , current RL models commonly make the closed-world assumption , i.e. , the state transitions follow a potentially time-varying Markov Decision Process st+1 ∼ T ( · | st , at ) , where T is the transition model and st , at are the state and action at timestamp t. An RL agent in deployment may encounter and fail to identify unknown out-of-distribution ( OOD ) states — i.e. , state st that is not from the training environment . Such unexpected states can be potentially catastrophic . For example , if a self-driving agent trained for an urban driving environment would be exposed to OOD states such as mountain roads with rocks , it would still output an action but may be a consequential one . This gives rise to the importance of detecting and mitigating unexpected OOD states , which allows the agent to avoid non-safe actions . Currently , the study of handling OOD states in RL remains underexplored . Our paper aims to bridge this critical gap . As a motivating example , we first show that state-of-the-art reinforcement learning networks do not necessarily know what they don ’ t know , and can assign abnormally high Q values for OOD states ( Figure 1 ) . Previous works on OOD detection in RL ( Sedlmeier et al. , 2019 ; Hoel et al. , 2020 ) rely on an ensemble of neural networks to estimate the variances of Q values ( Osband et al. , 2016 ; 2018 ) , which do not fundamentally mitigate the issue of the incorrectly high Q values in the presence of OOD inputs ( see Section 3.1 ) . Moreover , ensemble-based approaches can be computationally expensive as both the training and inference time will increase accordingly with the ensemble size . To this end , we propose a novel unknown-aware deep Q-learning framework—enabling the RL agent to perform OOD uncertainty estimation while guaranteeing the performance on the original in-distribution ( ID ) environment . We formalize ID and OOD states in RL ( Section 2 ) , and tackle the problem of detecting OOD states without extra Bayesian modeling ( Section 3 ) . Specifically , We propose to estimate the OOD uncertainty using the uncertainty score derived directly from the { Q ( st , a ) , a ∈ A } values . This determines the validity of st , which can be either in-distribution or OOD . Our key idea is to regularize the training process so that OOD states will have higher uncertainty scores , while in-distribution states will have relatively lower scores , therefore making them distinguishable . This is in contrast with vanilla Q-learning algorithms that do not take into account unknowns during training . During inference time , our OOD uncertainty estimation score can be flexibly computed on a single deployed model without variance estimation required . We provide theoretical guarantees that our method can improve OOD uncertainty estimation while ensuring the convergence of ID performance ( Section 4 ) . Empirically , we demonstrate state-of-theart performance on six diverse environments from OpenAI gym ( Brockman et al. , 2016 ) , including Atari games ( with discrete state space ) and classic control task ( with continuous state space ) . In all environments , our method consistently achieves near-optimal OOD detection performance , outperforming the baselines by a substantial margin . Our method can be easily plugged into existing Q-learning algorithms including DQN ( Mnih et al. , 2015 ) and QR-DQN ( Dabney et al. , 2018b ) and render stronger OOD detection performance and RL safety ( Section 5 ) . Our main contributions are summarized as follows : • We propose a novel Q-learning framework for improving OOD uncertainty estimation , which aims at mitigating the critical issue of incorrectly high Q values from OOD state inputs in vanilla Q-learning algorithms ; • We provide theoretical guarantees that our regularization improves OOD detection while maintaining the convergence performance of ID in Q-learning ; • Our method establishes state-of-the-art OOD detection performance on a wide range of RL environments , including Atari games and classic control . Extensive ablation studies are conducted to show the efficacy of our algorithm . 2 PRELIMINARIES AND PROBLEM STATEMENT . 2.1 PRELIMINARIES : REINFORCEMENT LEARNING AND Q-LEARNING . Markov decision processes ( MDP ) . In reinforcement learning , the agent explores an environment and maximizes the cumulative reward . Markov decision processes ( MDPs ) are used to model RL . MDPs are defined by the tuples ( S , A , R , T ) , where S indicates the state space , A is the set of actions , T is the transition model between states , andR is the reward model . At each timestep t , the agent observes a state st ∈ S , chooses an action at ∈ A , receives a reward rt ∈ R , and transits to a new state st+1 determined by T ( st+1|st , at ) . The goal is to find a policy π ∈ Π : S → A , which maximizes the discounted return over a potentially infinite horizon : Rt = Σ ∞ k=0γ krt+k , ( 1 ) where γ ∈ [ 0 , 1 ] is the discount factor . For notation brevity , we use s′ = st+1 and omit the timestamp t when the context is clear . Reinforcement learning and Q-learning . To find the optimal policy π∗ , we focus on Qlearning ( Watkins & Dayan , 1992 ) , a commonly used value-based approach . In Q-learning , the action-value function Q : S × A → R describes the expected return when the agent takes action a in state s , and then following policy π for all states afterwards . The optimal function Q∗ is defined as : Q∗ ( s , a ) = max π Eπ [ R|s , a ] . ( 2 ) Given a tuple of one-step transition ( s , a , s′ , r ) , we have the Bellman equation Q∗ ( s , a ) = r + γmaxa′ Q ∗ ( s′ , a′ ) using dynamic programming . The one-step TD error is used to update Q values : TD ( s , a , r , s′ ) = r + γmax a′ Q ( s′ , a′ ) −Q ( s , a ) . ( 3 ) In tabular cases , a table of Q values are maintained for finite state-action pairs , and are updated according to the TD error : Q ( s , a ) ← Q ( s , a ) +α ( r+ γmaxa′ Q ( s′ , a′ ) −Q ( s , a ) ) , where α is the learning rate . This can also be viewed as gradient updates that minimize the L2 norm of TD error . Deep Q-Networks ( DQN ) . In high-dimensional settings or when learning in continuous statespaces , it is common to use parameterized functions such as neural networks to approximate the action-value function Q ( s , a ) . We use the deep Q-networks ( Mnih et al. , 2015 ) parameterized by θ , with corresponding action-value function Qθ . The norm of the TD error is minimized during training to update the parameter θ . 2.2 OUT-OF-DISTRIBUTION DETECTION IN REINFORCEMENT LEARNING . When deploying an RL agent in open-world environments , it is paramount for the agent to detect OOD states and refrain from taking actions according to policy π in the presence of OOD states . Here we provide the definition of OOD states in the setting of RL . In-distribution ( ID ) states . Given an environment and a learning algorithm , we can estimate the distribution of the states encountered by the agent during training . We denote P as in-distribution . Out-of-distribution ( OOD ) states . The general notion of OOD refers to inference-time inputs which deviate substantially from the data encountered during training1 . In other words , OOD states are unexpected and should not have occurred in the ID environment . Importantly , OOD states should not be confused with under-explored states : the latter still belongs to ID with more epistemic uncertainty than ID states , and are crucial for exploration ( Osband et al. , 2016 ) . In contrast , OOD states are not safe to explore , since the agent has no knowledge on such states during training . We expect significantly lower Q values from OOD states , because unlike the underexplored states , the agent should not be encouraged to explore OOD states . OOD state detection . The goal of OOD detection is to define a decision function G such that : G ( s ) = { 1 if s ∼ P , 0 otherwise . In other words , the agent should be able to know what it does not know . The agent should take action a ∼ π ( s ) only if s is in-distribution . 3 METHOD . In this section , we begin with a motivating example that existing Q-learning algorithms can produce incorrectly high Q values for OOD states ( Section 3.1 ) . To mitigate this issue , we introduce our proposed unknown-aware Q-learning method in Section 3.2 . 3.1 A MOTIVATING EXAMPLE . Incorrectly high Q values for OOD states . Here we present a motivating example of possible incorrect estimation of Q values for OOD states using existing Q-learning algorithms , particularly vanilla DQN ( Mnih et al. , 2015 ) and bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) . We show that such incorrectly high extrapolation of Q values can not be mitigated by traditional uncertainty estimation . For simplicity , we use the chain environment to illustrate the problem ; see Figure 1 ( a ) . Action 0 indicates move left and Action 1 indicates move right . The start state is selected uniformly randomly among 5 states { 1 , 2 , 3 , 4 , 5 } . If the agent arrives on state 0 or 6 , a reward of 1 is received and the terminal is reached . Otherwise , the reward is 0 . We train a vanilla DQN and bootstrapped DQN ( with an ensemble size 10 ) , both under the same MLP architecture for 100,000 steps . The MLP has two hidden layers with 256 units each . Figure 1 1By “ inference-time ” , we assume the RL agent has already converged to policy π ; this policy is now fixed and used to behave in the environment , which includes the majority of cases in RL deployment . ( b ) ( c ) show the Q values for action 0 and 1 respectively . We observe that they give the same estimation for in-distribution Q values , which indicates that they both achieve convergence . Vanilla DQN fails to extrapolate reasonably on OOD states ( states < 0 and > 6 ) , where the corresponding Q values are incorrectly high . Bootstrapped DQN ( Osband et al. , 2016 ; 2018 ) ( denoted as the ensemble in the plots ) displays higher variance for OOD state inputs , but the overall estimated distribution of OOD Q values are still incorrectly high . Motivated by this , we now introduce our method , which regularizes the Q values of OOD states and improves OOD detection without compromising the in-distribution Q values ; see the orange lines shown in Figure 1 ( b ) and ( c ) . | This paper proposed a regularized loss for punishing the Q values for OOD states. They theoretically show this added loss will not influence the performance of vanilla DQN in both the tabular case and the DQN case. The theoretical analyses are intuitive with remarks that help the reader understand the importance of these results. They design experiments for evaluating the OOD detection performance and game performance. The rich ablation study helps the reader understand how the hyper-parameters are tuned. | SP:44fcecd2c331123bb795336eb5dd299ed2d641e8 |
Fixed Neural Network Steganography: Train the images, not the network | 1 INTRODUCTION . Image steganography aims to hide a secret digital message within a cover image ( Morkel et al. , 2005 ) — ideally , through minimal alterations , such that only intended recipients are aware of the hidden secret . Steganography has been widely used in applications such as watermarking ( Wolfgang & Delp , 1996 ) , copyright certification ( Lu , 2004 ) or private information storage ( Srinivasan et al. , 2004 ) . Classic steganography tools use image pixel statistics to hide information in images ( Pevnỳ et al. , 2010 ) . Secret messages hidden with these methods can be recovered with 0 % error , but to evade detection by steganalysis tools , they can only hide up to 0.4 bits per pixel ( bpp ) of information ( Pevnỳ et al. , 2010 ; Holub & Fridrich , 2012 ; Holub et al. , 2014 ) . Encouraged by data-driven deep learning techniques , recent works propose training deep encoder-decoder networks to hide and recover a larger number of bits per pixel in image ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ; Wu et al. , 2018 ; Hayes & Danezis , 2017 ) . These methods do indeed achieve higher bpp rates , but they also result in high error rates for the retrieved message ( Zhang et al. , 2019a ) . Many applications have stricter requirements for the steganography algorithm . In some scenarios , the hidden message has no redundancy , and there is zero tolerance for even a single incorrectly recovered bit . For example , if the secret message is encrypted , it will be a random bit string that must be recovered 100 % intact for successful decryption . In this paper , we propose a novel approach for image steganography that aims to simultaneously achieve high steganographic capacity and reliably low error rates . Notably , we achieve 0.0 % error when encoding up to 3 bpp . We make no assumptions on the secret message and allow it to be any arbitrary bit string . We show that our method can be used with randomly initialized neural networks or in conjunction with pre-trained networks . Unlike previous steganography methods that train deep networks to hide and recover messages in a specific dataset ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ) , our method is based upon a very different approach , which originated in the context of adversarial attacks on neural networks ( Szegedy et al. , 2013 ) . Adversarial attacks are based on the key insight that deep neural networks are highly sensitive to small changes to the input . An adversary can therefore manipulate an image with imperceptible perturbations to influence the prediction of a neural network that uses this image as input . The last eight years have witnessed an outpouring of analysis ( Kurakin et al. , 2016b ; Carlini & Wagner , 2016 ; Xu et al. , 2017 ; Shafahi et al. , 2018 ; Meng & Chen , 2017 ; Li & Li , 2017 ; Lu et al. , 2017a ; Graese et al. , 2016 ; Dziugaite et al. , 2016 ; Lu et al. , 2017b ; Gu & Rigazio , 2015 ; Kurakin et al. , 2016a ; Miyato et al. , 2015 ; Nokland , 2015 ; Cisse et al. , 2017 ; Hu et al. , 2019 ; Guo et al. , 2020 ; 2017 ) and methods ( Liu et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ; Tramèr et al. , 2017 ; Papernot et al. , 2017 ; 2016 ; Biggio et al. , 2013 ) to understand and create adversarial perturbations . Notably , it is fair to say that vulnerability to adversarial attacks is generally considered inevitable in most settings ( Shafahi et al. , 2018 ) and frustratingly hard to defend against ( Carlini & Wagner , 2017 ; Dziugaite et al. , 2016 ) , especially when the target network architecture is known to the adversary ( which is generally referred to as white-box setting ) . Adversarial attacks are typically considered a nuisance , or a limitation of machine learning . However , in this paper we utilize their persistence and reliability as a desired feature for what we refer to as Fixed Neural Network Steganography ( FNNS ) . In a nutshell , FNNS is based on the following procedure ( see Figure 1 ) : We initialize a neural network ( decoder ) that takes as input an image and produces sufficient binary outputs . Given a secret message and a cover image , the sender ( Alice ) perturbs the original image in a fashion similar to adversarial perturbations ( Madry et al. , 2017 ) . However , instead of targeting a single prediction bit ( e.g . the classification of an image ) , the sender manipulates thousands or even millions of output bits simultaneously . The intended recipient ( Bob ) can use the same decoder network and recover the hidden message . We show that FNNS reliably yields 0 % error rate for up to 3 bpp and lower error rates than current state-of-the art methods for higher bit rates on multiple datasets . FNNS can also be used in conjunction with existing trained encoder-decoder methods ( like SteganoGAN ( Zhang et al. , 2019a ) ) to further reduce the error rates obtained by the trained methods . Additionally , we show that FNNS evades existing statistical steganalysis methods ( Boehm , 2014 ; Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and can be made resistant to JPEG compression ( Wallace , 1992 ) for low bpp . Finally , we introduce an example application of error-free steganography for anonymized image sharing : We replace faces in images with GAN generated substitutes that contain the original faces encrypted and hidden through FNNS — ensuring that only intended recipients ( with the secret key ) can recover the original images . 2 RELATED WORK . Statistical image steganography methods ( Pevnỳ et al. , 2010 ) typically pre-date the use of neural networks . Least-Significant Bit ( LSB ) methods modify the lowest-order bits of each image pixel to encode a secret message ( Van Schyndel et al. , 1994 ; Wolfgang & Delp , 1996 ; Katzenbeisser & Petitcolas , 2000 ) . Although compellingly simple and lossless , these methods are easily detectable ( Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and often lack robustness ( Qin et al. , 2010 ) . Many statistical image steganography methods were proposed to evade detection by stegoanalysis algorithms . Highly Undetectable Steganography ( HUGO ) ( Pevnỳ et al. , 2010 ) use hand crafted features to measure distortion caused by modifying pixels . Pixels that cause the least amount of distortion are then modified . Wavelet Obtained Weights ( WOW ) ( Holub & Fridrich , 2012 ) use directional high-pass filters to find regions of the cover image with high texture and penalize changes in low textured regions . S-UNIWARD ( Holub et al. , 2014 ) is similar to WOW but is designed to work with non-spatial domains ( for e.g . frequency domain ) . The main limitation of statistical methods is that the number of bits they encode is relatively low ( ≤ 0.4 bpp ) . Deep learning image steganography methods have recently achieved impressive results in terms of bpp payload ( Zhang et al. , 2020 ; Baluja , 2017 ; Rahim et al. , 2018 ; Zhang et al. , 2019b ) . In general , they mostly share a similar pipeline that can be trained end-to-end : An encoder network takes as input a cover image and a message that should be concealed within it . From these inputs it generates a steganographic image that has hidden information but is visually similar to the cover image . A subsequent decoder network recovers the hidden message from the steganographic image . Multiple loss functions ensure that 1 ) the generated image is close to the original one ; 2 ) the decoder ’ s output matches the secret message . Zhu et al . ( 2018 ) ’ s HiddenNet pioneered such an encoder-decoder pipeline , and their HiddenNet can hide up to 0.2 bpp with error rate 10−5 . SteganoGAN ( Zhang et al. , 2019a ) introduces an additional critic that ensures the produced image looks realistic , like a natural image , which enables much higher bit rates . The authors show experiments of hiding up to 6 bpp with an error rate of 5-30 % ( depending on how many bits are hidden ) . In a similar vein , AdvSGAN ( Li et al. , 2021 ) achieves up to 1.0 bpp by learning an image steganography scheme that plays an adversarial game between a restricted neural coder and a critic . Deep Steganography ( Baluja , Fixed Decoder Network 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , , , , 1 , , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , , , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , , 1 , 0 , , , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , , 0 , , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , , , 0 , , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , , 0 , , , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , , , 1 , , , 1 , 1 , 0 , 1 , 0 , 1 , 1 , , , , , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , , , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , , 1 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , , 0 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 1 0 , , 1 , 0 , 1 , 1 , 0 , 1 , 1 , , , 1 , , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , Decoding BCE Loss LBCE Fixed Decoder Network Encoding Input Decoding Gradient Cover Image X Perturbed Image X̃ Decoder Output F ( X̃ ) Secret Message MPerturbations δ F F Figure 1 : FNNS workflow : Alice ( sender ) encodes the messageM into image X̃ such that F ( X̃ ) = M ; Bob ( receiver ) decodes the message with the same decoder F . Alice generates perturbed image X̃ by optimizing the difference between decoder output F ( X̃ ) and secret messageM . After FNNS , the perturbed image X̃ is visually indistinguishable from the cover imageX . 2017 ) , ISGAN ( Dong et al. , 2018 ) , Attention Based Data Hiding ( Yu , 2020 ) and End-to-end CNN for Image Steganography ( Rahim et al. , 2018 ) use similar encoder-decoder architectures to hide and recover structured images instead of random bits . These methods assume the secret message is an image , which allows them to learn image priors that aid in hiding the secret image . Despite handling a large number of bits , these end-to-end neural approaches also share a set of disadvantages : 1 ) the error rate for the recovered messages is very high , 2 ) they assume access to hundreds or even thousands of training images from the target domain to train encoder and decoder pairs , and 3 ) there is little recourse if the model produces an image with high error rate or strong distortions . Imperceptible image perturbations . Adversarial examples ( Goodfellow et al. , 2014 ) are inputs to machine learning models that an attacker has intentionally designed to cause the model to make a mistake . Many approaches ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Guo et al. , 2019 ; Xu et al. , 2020 ; De Palma et al. , 2021 ; Yuan et al. , 2019 ) try to construct adversarial examples by perturbing image pixels . Moosavi-Dezfooli et al . ( 2017 ) propose a systematic algorithm for computing universal perturbations that many deep neural networks are highly vulnerable to . Su et al . ( 2019 ) propose a differential evolution method to generate low dimensional one-pixel adversarial perturbations that change the output of a classification network . Athalye et al . ( 2018b ) create adversarial examples that are robust to affine image transformations , noise , and other distortions . Projected gradient descent ( PGD ) ( Madry et al. , 2017 ) is one of the most widely used algorithms to generate adversarial examples by adding small perturbations to the input . This method iteratively updates the input with gradient descent until a desired output is obtained . The input is projected , or more precisely clipped to be within [ − , ] at the end of every step . This precaution ensures that the perturbations stay reasonably small for all pixels and remain imperceptible . Ghamizi et al . ( 2019 ) propose performing stenography by finding perturbations using PGD with a classification network . However , the amount of information they are able to hide is low and they need multiple images to hide long messages . | The paper proposes a novel neural image steganography method. The fundamental idea is that the sensitivity of neural networks to adversarial perturbations can be leveraged to encode an arbitrary hidden message into imperceptible perturbations. The authors' method heavily outperforms current classical and neural image steganography methods. They also perform several relevant experiments, such as robustness of the method to lossy compression and avoiding steganalysis. The authors also propose to apply their method to protect persons' identities in pictures by detecting all faces present in a picture, in-painting them with a GAN and hiding the picture of the original face in the GAN-generated image. | SP:6bb3601527f33b4d40aaaad204f783b9e3f668e5 |
Fixed Neural Network Steganography: Train the images, not the network | 1 INTRODUCTION . Image steganography aims to hide a secret digital message within a cover image ( Morkel et al. , 2005 ) — ideally , through minimal alterations , such that only intended recipients are aware of the hidden secret . Steganography has been widely used in applications such as watermarking ( Wolfgang & Delp , 1996 ) , copyright certification ( Lu , 2004 ) or private information storage ( Srinivasan et al. , 2004 ) . Classic steganography tools use image pixel statistics to hide information in images ( Pevnỳ et al. , 2010 ) . Secret messages hidden with these methods can be recovered with 0 % error , but to evade detection by steganalysis tools , they can only hide up to 0.4 bits per pixel ( bpp ) of information ( Pevnỳ et al. , 2010 ; Holub & Fridrich , 2012 ; Holub et al. , 2014 ) . Encouraged by data-driven deep learning techniques , recent works propose training deep encoder-decoder networks to hide and recover a larger number of bits per pixel in image ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ; Wu et al. , 2018 ; Hayes & Danezis , 2017 ) . These methods do indeed achieve higher bpp rates , but they also result in high error rates for the retrieved message ( Zhang et al. , 2019a ) . Many applications have stricter requirements for the steganography algorithm . In some scenarios , the hidden message has no redundancy , and there is zero tolerance for even a single incorrectly recovered bit . For example , if the secret message is encrypted , it will be a random bit string that must be recovered 100 % intact for successful decryption . In this paper , we propose a novel approach for image steganography that aims to simultaneously achieve high steganographic capacity and reliably low error rates . Notably , we achieve 0.0 % error when encoding up to 3 bpp . We make no assumptions on the secret message and allow it to be any arbitrary bit string . We show that our method can be used with randomly initialized neural networks or in conjunction with pre-trained networks . Unlike previous steganography methods that train deep networks to hide and recover messages in a specific dataset ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ) , our method is based upon a very different approach , which originated in the context of adversarial attacks on neural networks ( Szegedy et al. , 2013 ) . Adversarial attacks are based on the key insight that deep neural networks are highly sensitive to small changes to the input . An adversary can therefore manipulate an image with imperceptible perturbations to influence the prediction of a neural network that uses this image as input . The last eight years have witnessed an outpouring of analysis ( Kurakin et al. , 2016b ; Carlini & Wagner , 2016 ; Xu et al. , 2017 ; Shafahi et al. , 2018 ; Meng & Chen , 2017 ; Li & Li , 2017 ; Lu et al. , 2017a ; Graese et al. , 2016 ; Dziugaite et al. , 2016 ; Lu et al. , 2017b ; Gu & Rigazio , 2015 ; Kurakin et al. , 2016a ; Miyato et al. , 2015 ; Nokland , 2015 ; Cisse et al. , 2017 ; Hu et al. , 2019 ; Guo et al. , 2020 ; 2017 ) and methods ( Liu et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ; Tramèr et al. , 2017 ; Papernot et al. , 2017 ; 2016 ; Biggio et al. , 2013 ) to understand and create adversarial perturbations . Notably , it is fair to say that vulnerability to adversarial attacks is generally considered inevitable in most settings ( Shafahi et al. , 2018 ) and frustratingly hard to defend against ( Carlini & Wagner , 2017 ; Dziugaite et al. , 2016 ) , especially when the target network architecture is known to the adversary ( which is generally referred to as white-box setting ) . Adversarial attacks are typically considered a nuisance , or a limitation of machine learning . However , in this paper we utilize their persistence and reliability as a desired feature for what we refer to as Fixed Neural Network Steganography ( FNNS ) . In a nutshell , FNNS is based on the following procedure ( see Figure 1 ) : We initialize a neural network ( decoder ) that takes as input an image and produces sufficient binary outputs . Given a secret message and a cover image , the sender ( Alice ) perturbs the original image in a fashion similar to adversarial perturbations ( Madry et al. , 2017 ) . However , instead of targeting a single prediction bit ( e.g . the classification of an image ) , the sender manipulates thousands or even millions of output bits simultaneously . The intended recipient ( Bob ) can use the same decoder network and recover the hidden message . We show that FNNS reliably yields 0 % error rate for up to 3 bpp and lower error rates than current state-of-the art methods for higher bit rates on multiple datasets . FNNS can also be used in conjunction with existing trained encoder-decoder methods ( like SteganoGAN ( Zhang et al. , 2019a ) ) to further reduce the error rates obtained by the trained methods . Additionally , we show that FNNS evades existing statistical steganalysis methods ( Boehm , 2014 ; Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and can be made resistant to JPEG compression ( Wallace , 1992 ) for low bpp . Finally , we introduce an example application of error-free steganography for anonymized image sharing : We replace faces in images with GAN generated substitutes that contain the original faces encrypted and hidden through FNNS — ensuring that only intended recipients ( with the secret key ) can recover the original images . 2 RELATED WORK . Statistical image steganography methods ( Pevnỳ et al. , 2010 ) typically pre-date the use of neural networks . Least-Significant Bit ( LSB ) methods modify the lowest-order bits of each image pixel to encode a secret message ( Van Schyndel et al. , 1994 ; Wolfgang & Delp , 1996 ; Katzenbeisser & Petitcolas , 2000 ) . Although compellingly simple and lossless , these methods are easily detectable ( Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and often lack robustness ( Qin et al. , 2010 ) . Many statistical image steganography methods were proposed to evade detection by stegoanalysis algorithms . Highly Undetectable Steganography ( HUGO ) ( Pevnỳ et al. , 2010 ) use hand crafted features to measure distortion caused by modifying pixels . Pixels that cause the least amount of distortion are then modified . Wavelet Obtained Weights ( WOW ) ( Holub & Fridrich , 2012 ) use directional high-pass filters to find regions of the cover image with high texture and penalize changes in low textured regions . S-UNIWARD ( Holub et al. , 2014 ) is similar to WOW but is designed to work with non-spatial domains ( for e.g . frequency domain ) . The main limitation of statistical methods is that the number of bits they encode is relatively low ( ≤ 0.4 bpp ) . Deep learning image steganography methods have recently achieved impressive results in terms of bpp payload ( Zhang et al. , 2020 ; Baluja , 2017 ; Rahim et al. , 2018 ; Zhang et al. , 2019b ) . In general , they mostly share a similar pipeline that can be trained end-to-end : An encoder network takes as input a cover image and a message that should be concealed within it . From these inputs it generates a steganographic image that has hidden information but is visually similar to the cover image . A subsequent decoder network recovers the hidden message from the steganographic image . Multiple loss functions ensure that 1 ) the generated image is close to the original one ; 2 ) the decoder ’ s output matches the secret message . Zhu et al . ( 2018 ) ’ s HiddenNet pioneered such an encoder-decoder pipeline , and their HiddenNet can hide up to 0.2 bpp with error rate 10−5 . SteganoGAN ( Zhang et al. , 2019a ) introduces an additional critic that ensures the produced image looks realistic , like a natural image , which enables much higher bit rates . The authors show experiments of hiding up to 6 bpp with an error rate of 5-30 % ( depending on how many bits are hidden ) . In a similar vein , AdvSGAN ( Li et al. , 2021 ) achieves up to 1.0 bpp by learning an image steganography scheme that plays an adversarial game between a restricted neural coder and a critic . Deep Steganography ( Baluja , Fixed Decoder Network 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , , , , 1 , , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , , , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , , 1 , 0 , , , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , , 0 , , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , , , 0 , , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , , 0 , , , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , , , 1 , , , 1 , 1 , 0 , 1 , 0 , 1 , 1 , , , , , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , , , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , , 1 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , , 0 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 1 0 , , 1 , 0 , 1 , 1 , 0 , 1 , 1 , , , 1 , , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , Decoding BCE Loss LBCE Fixed Decoder Network Encoding Input Decoding Gradient Cover Image X Perturbed Image X̃ Decoder Output F ( X̃ ) Secret Message MPerturbations δ F F Figure 1 : FNNS workflow : Alice ( sender ) encodes the messageM into image X̃ such that F ( X̃ ) = M ; Bob ( receiver ) decodes the message with the same decoder F . Alice generates perturbed image X̃ by optimizing the difference between decoder output F ( X̃ ) and secret messageM . After FNNS , the perturbed image X̃ is visually indistinguishable from the cover imageX . 2017 ) , ISGAN ( Dong et al. , 2018 ) , Attention Based Data Hiding ( Yu , 2020 ) and End-to-end CNN for Image Steganography ( Rahim et al. , 2018 ) use similar encoder-decoder architectures to hide and recover structured images instead of random bits . These methods assume the secret message is an image , which allows them to learn image priors that aid in hiding the secret image . Despite handling a large number of bits , these end-to-end neural approaches also share a set of disadvantages : 1 ) the error rate for the recovered messages is very high , 2 ) they assume access to hundreds or even thousands of training images from the target domain to train encoder and decoder pairs , and 3 ) there is little recourse if the model produces an image with high error rate or strong distortions . Imperceptible image perturbations . Adversarial examples ( Goodfellow et al. , 2014 ) are inputs to machine learning models that an attacker has intentionally designed to cause the model to make a mistake . Many approaches ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Guo et al. , 2019 ; Xu et al. , 2020 ; De Palma et al. , 2021 ; Yuan et al. , 2019 ) try to construct adversarial examples by perturbing image pixels . Moosavi-Dezfooli et al . ( 2017 ) propose a systematic algorithm for computing universal perturbations that many deep neural networks are highly vulnerable to . Su et al . ( 2019 ) propose a differential evolution method to generate low dimensional one-pixel adversarial perturbations that change the output of a classification network . Athalye et al . ( 2018b ) create adversarial examples that are robust to affine image transformations , noise , and other distortions . Projected gradient descent ( PGD ) ( Madry et al. , 2017 ) is one of the most widely used algorithms to generate adversarial examples by adding small perturbations to the input . This method iteratively updates the input with gradient descent until a desired output is obtained . The input is projected , or more precisely clipped to be within [ − , ] at the end of every step . This precaution ensures that the perturbations stay reasonably small for all pixels and remain imperceptible . Ghamizi et al . ( 2019 ) propose performing stenography by finding perturbations using PGD with a classification network . However , the amount of information they are able to hide is low and they need multiple images to hide long messages . | This paper proposes a method for image steganography based on adversarial attacks. Unlike previous works such as SteganoGAN, the proposed method fixes the decoder and performs an inference-time attack to produce a perturbation which maps to the correct message. Empirical results show the proposed method out-performs existing encoder decoder based design, and is also more robust in out-of-domain applications. | SP:6bb3601527f33b4d40aaaad204f783b9e3f668e5 |
Fixed Neural Network Steganography: Train the images, not the network | 1 INTRODUCTION . Image steganography aims to hide a secret digital message within a cover image ( Morkel et al. , 2005 ) — ideally , through minimal alterations , such that only intended recipients are aware of the hidden secret . Steganography has been widely used in applications such as watermarking ( Wolfgang & Delp , 1996 ) , copyright certification ( Lu , 2004 ) or private information storage ( Srinivasan et al. , 2004 ) . Classic steganography tools use image pixel statistics to hide information in images ( Pevnỳ et al. , 2010 ) . Secret messages hidden with these methods can be recovered with 0 % error , but to evade detection by steganalysis tools , they can only hide up to 0.4 bits per pixel ( bpp ) of information ( Pevnỳ et al. , 2010 ; Holub & Fridrich , 2012 ; Holub et al. , 2014 ) . Encouraged by data-driven deep learning techniques , recent works propose training deep encoder-decoder networks to hide and recover a larger number of bits per pixel in image ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ; Wu et al. , 2018 ; Hayes & Danezis , 2017 ) . These methods do indeed achieve higher bpp rates , but they also result in high error rates for the retrieved message ( Zhang et al. , 2019a ) . Many applications have stricter requirements for the steganography algorithm . In some scenarios , the hidden message has no redundancy , and there is zero tolerance for even a single incorrectly recovered bit . For example , if the secret message is encrypted , it will be a random bit string that must be recovered 100 % intact for successful decryption . In this paper , we propose a novel approach for image steganography that aims to simultaneously achieve high steganographic capacity and reliably low error rates . Notably , we achieve 0.0 % error when encoding up to 3 bpp . We make no assumptions on the secret message and allow it to be any arbitrary bit string . We show that our method can be used with randomly initialized neural networks or in conjunction with pre-trained networks . Unlike previous steganography methods that train deep networks to hide and recover messages in a specific dataset ( Zhang et al. , 2019a ; Zhu et al. , 2018 ; Baluja , 2017 ) , our method is based upon a very different approach , which originated in the context of adversarial attacks on neural networks ( Szegedy et al. , 2013 ) . Adversarial attacks are based on the key insight that deep neural networks are highly sensitive to small changes to the input . An adversary can therefore manipulate an image with imperceptible perturbations to influence the prediction of a neural network that uses this image as input . The last eight years have witnessed an outpouring of analysis ( Kurakin et al. , 2016b ; Carlini & Wagner , 2016 ; Xu et al. , 2017 ; Shafahi et al. , 2018 ; Meng & Chen , 2017 ; Li & Li , 2017 ; Lu et al. , 2017a ; Graese et al. , 2016 ; Dziugaite et al. , 2016 ; Lu et al. , 2017b ; Gu & Rigazio , 2015 ; Kurakin et al. , 2016a ; Miyato et al. , 2015 ; Nokland , 2015 ; Cisse et al. , 2017 ; Hu et al. , 2019 ; Guo et al. , 2020 ; 2017 ) and methods ( Liu et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017 ; Tramèr et al. , 2017 ; Papernot et al. , 2017 ; 2016 ; Biggio et al. , 2013 ) to understand and create adversarial perturbations . Notably , it is fair to say that vulnerability to adversarial attacks is generally considered inevitable in most settings ( Shafahi et al. , 2018 ) and frustratingly hard to defend against ( Carlini & Wagner , 2017 ; Dziugaite et al. , 2016 ) , especially when the target network architecture is known to the adversary ( which is generally referred to as white-box setting ) . Adversarial attacks are typically considered a nuisance , or a limitation of machine learning . However , in this paper we utilize their persistence and reliability as a desired feature for what we refer to as Fixed Neural Network Steganography ( FNNS ) . In a nutshell , FNNS is based on the following procedure ( see Figure 1 ) : We initialize a neural network ( decoder ) that takes as input an image and produces sufficient binary outputs . Given a secret message and a cover image , the sender ( Alice ) perturbs the original image in a fashion similar to adversarial perturbations ( Madry et al. , 2017 ) . However , instead of targeting a single prediction bit ( e.g . the classification of an image ) , the sender manipulates thousands or even millions of output bits simultaneously . The intended recipient ( Bob ) can use the same decoder network and recover the hidden message . We show that FNNS reliably yields 0 % error rate for up to 3 bpp and lower error rates than current state-of-the art methods for higher bit rates on multiple datasets . FNNS can also be used in conjunction with existing trained encoder-decoder methods ( like SteganoGAN ( Zhang et al. , 2019a ) ) to further reduce the error rates obtained by the trained methods . Additionally , we show that FNNS evades existing statistical steganalysis methods ( Boehm , 2014 ; Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and can be made resistant to JPEG compression ( Wallace , 1992 ) for low bpp . Finally , we introduce an example application of error-free steganography for anonymized image sharing : We replace faces in images with GAN generated substitutes that contain the original faces encrypted and hidden through FNNS — ensuring that only intended recipients ( with the secret key ) can recover the original images . 2 RELATED WORK . Statistical image steganography methods ( Pevnỳ et al. , 2010 ) typically pre-date the use of neural networks . Least-Significant Bit ( LSB ) methods modify the lowest-order bits of each image pixel to encode a secret message ( Van Schyndel et al. , 1994 ; Wolfgang & Delp , 1996 ; Katzenbeisser & Petitcolas , 2000 ) . Although compellingly simple and lossless , these methods are easily detectable ( Dumitrescu et al. , 2002a ; b ; Böhme & Westfeld , 2004 ; Zhang & Ping , 2003 ) and often lack robustness ( Qin et al. , 2010 ) . Many statistical image steganography methods were proposed to evade detection by stegoanalysis algorithms . Highly Undetectable Steganography ( HUGO ) ( Pevnỳ et al. , 2010 ) use hand crafted features to measure distortion caused by modifying pixels . Pixels that cause the least amount of distortion are then modified . Wavelet Obtained Weights ( WOW ) ( Holub & Fridrich , 2012 ) use directional high-pass filters to find regions of the cover image with high texture and penalize changes in low textured regions . S-UNIWARD ( Holub et al. , 2014 ) is similar to WOW but is designed to work with non-spatial domains ( for e.g . frequency domain ) . The main limitation of statistical methods is that the number of bits they encode is relatively low ( ≤ 0.4 bpp ) . Deep learning image steganography methods have recently achieved impressive results in terms of bpp payload ( Zhang et al. , 2020 ; Baluja , 2017 ; Rahim et al. , 2018 ; Zhang et al. , 2019b ) . In general , they mostly share a similar pipeline that can be trained end-to-end : An encoder network takes as input a cover image and a message that should be concealed within it . From these inputs it generates a steganographic image that has hidden information but is visually similar to the cover image . A subsequent decoder network recovers the hidden message from the steganographic image . Multiple loss functions ensure that 1 ) the generated image is close to the original one ; 2 ) the decoder ’ s output matches the secret message . Zhu et al . ( 2018 ) ’ s HiddenNet pioneered such an encoder-decoder pipeline , and their HiddenNet can hide up to 0.2 bpp with error rate 10−5 . SteganoGAN ( Zhang et al. , 2019a ) introduces an additional critic that ensures the produced image looks realistic , like a natural image , which enables much higher bit rates . The authors show experiments of hiding up to 6 bpp with an error rate of 5-30 % ( depending on how many bits are hidden ) . In a similar vein , AdvSGAN ( Li et al. , 2021 ) achieves up to 1.0 bpp by learning an image steganography scheme that plays an adversarial game between a restricted neural coder and a critic . Deep Steganography ( Baluja , Fixed Decoder Network 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , , , , 1 , , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , , , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , , 1 , 0 , , , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , , 0 , , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , , , 0 , , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , , 0 , , , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , , , 1 , , , 1 , 1 , 0 , 1 , 0 , 1 , 1 , , , , , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , , , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , , 0 , , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , , 1 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , , 0 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 1 0 , , 1 , 0 , 1 , 1 , 0 , 1 , 1 , , , 1 , , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , , , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , Decoding BCE Loss LBCE Fixed Decoder Network Encoding Input Decoding Gradient Cover Image X Perturbed Image X̃ Decoder Output F ( X̃ ) Secret Message MPerturbations δ F F Figure 1 : FNNS workflow : Alice ( sender ) encodes the messageM into image X̃ such that F ( X̃ ) = M ; Bob ( receiver ) decodes the message with the same decoder F . Alice generates perturbed image X̃ by optimizing the difference between decoder output F ( X̃ ) and secret messageM . After FNNS , the perturbed image X̃ is visually indistinguishable from the cover imageX . 2017 ) , ISGAN ( Dong et al. , 2018 ) , Attention Based Data Hiding ( Yu , 2020 ) and End-to-end CNN for Image Steganography ( Rahim et al. , 2018 ) use similar encoder-decoder architectures to hide and recover structured images instead of random bits . These methods assume the secret message is an image , which allows them to learn image priors that aid in hiding the secret image . Despite handling a large number of bits , these end-to-end neural approaches also share a set of disadvantages : 1 ) the error rate for the recovered messages is very high , 2 ) they assume access to hundreds or even thousands of training images from the target domain to train encoder and decoder pairs , and 3 ) there is little recourse if the model produces an image with high error rate or strong distortions . Imperceptible image perturbations . Adversarial examples ( Goodfellow et al. , 2014 ) are inputs to machine learning models that an attacker has intentionally designed to cause the model to make a mistake . Many approaches ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Guo et al. , 2019 ; Xu et al. , 2020 ; De Palma et al. , 2021 ; Yuan et al. , 2019 ) try to construct adversarial examples by perturbing image pixels . Moosavi-Dezfooli et al . ( 2017 ) propose a systematic algorithm for computing universal perturbations that many deep neural networks are highly vulnerable to . Su et al . ( 2019 ) propose a differential evolution method to generate low dimensional one-pixel adversarial perturbations that change the output of a classification network . Athalye et al . ( 2018b ) create adversarial examples that are robust to affine image transformations , noise , and other distortions . Projected gradient descent ( PGD ) ( Madry et al. , 2017 ) is one of the most widely used algorithms to generate adversarial examples by adding small perturbations to the input . This method iteratively updates the input with gradient descent until a desired output is obtained . The input is projected , or more precisely clipped to be within [ − , ] at the end of every step . This precaution ensures that the perturbations stay reasonably small for all pixels and remain imperceptible . Ghamizi et al . ( 2019 ) propose performing stenography by finding perturbations using PGD with a classification network . However , the amount of information they are able to hide is low and they need multiple images to hide long messages . | This submission deals with steganographic paradigm : hiding a secret message in a cover content while remaining undetectable. The authors use a purely ML-based pipeline. They intend to achieve zero message-retrieval-error (which is normally a must-have for steganographic approaches). They use a neural network decoder and exploit adversarial perturbations to compute the stego version of the cover image. The loss from which gradients originate is the sum of binary cross-entropies between decoder output and message to embed. | SP:6bb3601527f33b4d40aaaad204f783b9e3f668e5 |
Polygonal Unadjusted Langevin Algorithms: Creating stable and efficient adaptive algorithms for neural networks | 1 INTRODUCTION . Modern machine learning models including deep neural networks are successfully trained when they are finely tuned via the optimization of their associated loss functions . Two aspects of such optimization tasks pose significant challenges , namely the non-convex nature of loss functions and the highly nonlinear features of many types of neural networks . Moreover , the analysis in Lovas et al . ( 2020 ) shows that the gradients of such non-convex loss functions typically grow faster than linearly and are only locally Lipschitz continuous . Naturally , stability issues are observed , which are known as the ‘ exploding gradient ’ phenomenon ( Bengio et al. , 1994 ; Pascanu et al. , 2013 ) , when vanilla stochastic gradient descent ( SGDs ) or certain types of adaptive algorithms are used for fine tuning . The sparsity of gradients of neural networks is another challenging issue , which is extensively studied in the literature . For example , momentum methods and adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) , Adam ( Kingma & Ba ( 2015 ) ) have been developed to tackle this problem and improve training speed by diagonally scaling the gradient by some function of the past gradients . A family of Langevin based algorithms has been another important stream of literature on the stochastic optimization . They are built on the theoretical fact that the Langevin stochastic differential equation , ( 6 ) , converges to its unique invariant measure , which concentrates on the global minimizers of the objective function as β →∞ , see Hwang ( 1980 ) . Since the convergence property remains true for nonconvex optimization problems , the global convergence of the stochastic gradient Langevin dynamics ( SGLD ) and its variants has been extensively studied in a nonconvex setting ( Raginsky et al. , 2017 ; Xu et al. , 2018 ; Erdogdu et al. , 2018 ; Brosse et al. , 2018 ; Lovas et al. , 2020 ) . Moreover , it is worth noting that Langevin based algorithms have been a key element in statistics and Bayesian learning ( Roberts & Tweedie , 1996 ; Durmus & Moulines , 2017 ; Dalalyan , 2017 ; Brosse et al. , 2019 ; Welling & Teh , 2011 ; Deng et al. , 2020a ; b ) . Motivated by the aforementioned developments in the field , we propose a new class of Langevin algorithms which is based on recent advances of Euler ’ s polygonal approximations for Langevin SDEs . The idea of this new form of Euler ’ s polygonal approximations for SDEs with monotone coefficients originates from the articles Krylov ( 1985 ) and Krylov ( 1990 ) . We name this new class as polygonal unadjusted Langevin algorithms . Moreover , it is versatile enough to incorporate further features to address other known shortcomings of adaptive optimizers . Mathematically , it is described as follows : Given an i.i.d . sequence of random variables { Xn } n≥0 of interest , which typically represent available data , the algorithm follows θλ0 : = θ0 , θ λ n+1 : = θ λ n − λGλ ( θλn , Xn+1 ) + √ 2λβ−1ξn+1 , n ∈ N , ( 1 ) where θ0 is an Rd-valued random variable , λ > 0 denotes the step size of the algorithm , β > 0 is the so-called inverse temperature , ( ξn ) n∈N is an Rd-valued Gaussian process with i.i.d . components and Gλ : Rd × Rm → Rd satisfies the following three properties : 1 . For every λ > 0 , There exist constants Kλ > 0 and ρ1 ≥ 0 such that |Gλ ( θ , x ) | ≤ Kλ ( 1 + |x| ) ρ1 ( 1 + |θ| ) for every θ ∈ Rd and x ∈ Rm . 2 . There exist constants γ ≥ 1/2 , K2 > 0 and ρ2 , ρ3 ≥ 0 such that for all λ > 0 , |Gλ ( θ , x ) −G ( θ , x ) | ≤ λγK2 ( 1 + |x| ) ρ2 ( 1 + |θ| ) ρ3 for every θ ∈ Rd and x ∈ Rm , whereG is the ( unbiased ) stochastic gradient of the objective function of the optimization problem under study . 3 . There exist constants λmax and δ ∈ { 1 , 2 } such that for any λ ≤ λmax , lim inf |θ|→∞ E [ 〈 θ |θ|δ , Gλ ( θ , X0 ) 〉 − 2λ |θ|δ |Gλ ( θ , X0 ) |2 ] > 0 . One obtains our new algorithm THεO POULA by considering the case where Gλ ( θ , x ) is the vector with entries H ( i ) λ , c ( θ , x ) as given by ( 8 ) , for i ∈ { 1 , . . . , d } . Its name is formed from its description , namely Tamed Hybrid ε-Order POlygonal Unadjusted Langevin Algorithm and its full detailed analysis ( including its convergence properties ) are given in Section 3 . We note that THεO POULA and TUSLA ( Lovas et al . ( 2020 ) ) satisfy the above three properties with δ = 2 and γ = 1/2 , whereas TULA ( Brosse et al . ( 2019 ) ) satisfies them with δ = γ = 1 as it assumes only deterministic gradients ( and thus the i.i.d . data sequence reduces to a constant ) . 1.1 RELATED WORK : LANGEVIN BASED ALGORITHMS AND ADAPTIVE LEARNING RATE METHODS . Most research on Langevin based algorithms in the literature has been focused on theoretical aspects . Raginsky et al . ( 2017 ) demonstrated the links between Langevin based algorithms and stochastic optimization in neural networks , stimulating further the development and analysis of such algorithms . Xu et al . ( 2018 ) analyzed the global convergence of GLD , SGLD and SVRG-LD . The incorporation of dependent data streams in the analysis of SGLD algorithms has been achieved in Barkhagen et al . ( 2021 ) and in Chau et al . ( 2019 ) , and local conditions have been studied in Zhang et al . ( 2019 ) . Recently , TUSLA of Lovas et al . ( 2020 ) has been proposed based on a new generation of tamed Euler approximations for stochastic differential equations ( SDEs ) with monotone coefficients in nonconvex optimization problems . See Hutzenthaler et al . ( 2012 ) and Sabanis ( 2013 ) for the rationale of taming techniques . Despite their elegant theoretical results , the use of Langevin based algorithms for training deep learning models has been limited in practice as their empirical performance lacked behind in comparison to other popular adaptive gradient methods . We refer to Appendix F.3 for the reader who is interested in recent progress on sampling and Bayesian neural networks . Adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) and Adam ( Kingma & Ba ( 2015 ) ) have been successfully applied to neural network models due to their fast training speed . Since the appearance of Adam , a large number of variants of Adam-type optimizers have been proposed to address the theoretical and practical challenges of Adam . For example , Reddi et al . ( 2018 ) provided a simple example that demonstrates the non-convergence issue of Adam and proposed a simple modification , called AMSGrad , to solve this problem . Chen et al . ( 2019 ) discussed the convergence of Adam-type optimizers in a nonconvex setting . RAdam to rectify the variance of adaptive learning rate has been proposed in Liu et al . ( 2020 ) . Wilson et al . ( 2017 ) revealed that the generalization ability of adaptive learning rate methods is worse than a global learning method like SGD . AdaBound of Luo et al . ( 2019 ) attempts to overcome the drawback by employing dynamic bounds on learning rates . Recently , AdaBelief ( Zhuang et al . ( 2020 ) ) and AdamP ( Heo et al . ( 2021 ) ) demonstrated their fast convergence and good generalization via extensive experiments . Nevertheless , the convergence analysis of these ( and other ) adaptive learning rate methods is still restrictive since it is only guaranteed to converge to a stationary point ( which can be a local minimum or a saddle point ) under strong assumptions . Namely , the stochastic gradient is globally Lipschitz continuous and bounded . Note though that none of these two assumptions hold true in a typical optimization problem involving neural networks . This is particularly evident in complex neural network architectures . 1.2 OUR CONTRIBUTIONS . The proposed algorithm , THεO POULA , tries to combines both advantages : namely , global convergence in Langevin based algorithms and powerful empirical performance in adaptive learning rate methods . To the best of the authors ’ knowledge , our algorithm is the first Langevin based algorithm to outperform popular stochastic optimization methods such as SGD , Adam , AMSGrad , RMSProp , AdaBound and AdaBelief for deep learning tasks . The major strengths of our work over related algorithms are summarized as follows : • ( Global convergence ) We provide a global convergence analysis of THεO POULA for nonconvex optimization where the stochastic gradient of the objective is locally Lipscthiz continuous . Moreover , non-asymptotic estimates for the expected excess risk are derived . • ( Stable and fast training ) THεO POULA achieves a stable and fast training process using the ( element-wise ) taming technique , ( element-wise ) boosting function and averaging , which are theoretically well-designed . Furthermore , we validate the effectiveness of the taming and boosting functions through several empirical experiments . • ( Good generalization ) While THεO POULA behaves like adaptive learning rate methods in the early training phase , it takes an almost global learning rate near an optimal point . That is , THεO POULA is quickly switched from adaptive methods to SGD . As a result , it inherits the good generalization ability of SGD . Our experiments support this fact by showing that THεO POULA outperforms the other optimization methods in generalization measured by test accuracy for various deep learning tasks . 2 MOTIVATING EXAMPLE . The local Lipschitz continuity of gradients and its effect on the performance of optimization methods are relatively under-studied . Most relevant studies assume that the stochastic gradient is global Lipscthiz continuous and bounded ( Kingma & Ba , 2015 ; Xu et al. , 2018 ; Brosse et al. , 2018 ; Duchi et al. , 2011 ; Tieleman & Hinton , 2012 ; Reddi et al. , 2018 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Luo et al. , 2019 ; Zhuang et al. , 2020 ) although it is not true for neural network problems . This section provides a simple , one-dimensional optimization problem that illustrates the convergence issue of popular stochastic gradient methods when the stochastic gradient is locally Lipschitz continuous , i.e. , the gradient can be super-linearly growing 1 . Consider the following optimization problem : min θ u ( θ ) = min θ E [ U ( θ , X ) ] , ( 2 ) where U : R× R→ R is defined as U ( θ , x ) = { θ2 ( 1 + 1x≤1 ) + θ 30 , |θ| ≤ 1 , ( 2|θ| − 1 ) ( 1 + 1x≤1 ) + θ30 , |θ| > 1 , and X is uniformly distributed over ( −2 , 2 ) , that is , fX ( x ) = 141|x|≤2 . Furthermore , the stochastic gradient G : R× R→ R is given by G ( θ , x ) = { 2θ ( 1 + 1x≤1 ) + 30θ 29 , |θ| ≤ 1 , 2 ( 1 + 1x≤1 ) sgn ( θ ) + 30θ 29 , |θ| > 1 , where sgn ( · ) is the sign function . Note that the stochastic gradientG is locally Lipschitz continuous , which satisfies |G ( θ , x ) −G ( θ′ , x ) | ≤ 34 ( 1 + |θ|+ |θ′| ) 28|θ − θ′| 1Lovas et al . ( 2020 ) used a similar example to show the stability of TUSLA with a different taming function . for all x ∈ R and θ , θ′ ∈ R. Also , the optimal value is attained at θ = 0 . See Appendix A for more details . Following Reddi et al . ( 2018 ) , adaptive stochastic gradient methods can be generally written as follows , for n ∈ N , mn = φn ( G1 , · · · , Gn ) , Vn = ψn ( G1 , · · · , Gn ) , θn+1 = θn − λn mn ε+ √ V n ( 3 ) where Gi : = G ( θi , Xi ) is the stochastic gradient evaluated at the i-th iteration , λn is the step size and all operations are applied element-wise . Table 1 provides the details for some of the most popular stochastic optimization methods with corresponding averaging functions φn and ψn . We use SGD , Adam , AMSGrad and RMSprop to solve the optimization problem with initial value θ0 = 5 . For hyperparameters of optimization algorithms , we use their default settings provided in PyTorch . Figure 1 ( a ) shows the trajectories of approximate solutions generated by each optimizer . While SGD , Adam , AMSGrad and RMSProp fail to converge to the optimal solution 0 , the proposed algorithm , THεO POULA , finds the optimal solution with a reasonable step size , say , 0.01 . Intuitively , the undesirable phenomenon occurs because , in the iterating rule ( 3 ) , the denominator√ V n excessively dominates the numerator mn , causing the vanishing gradient problem in the presence of the superlinear gradient . On the contrary , SGD suffers from the exploding gradient problem . Moreover , Figure 1 ( b ) highlights that the problematic behavior can not be simply resolved by adjusting the learning rate within the Adam-type framework , while THεO POULA perform extremely well even in the presence of such violent non-linearities . 3 NEW ALGORITHM : THεO POULA We propose a new stochastic optimization algorithm by combining ideas from taming methods specifically designed to approximate Langevin SDEs with a hybrid approach based on recent advances of polygonal Euler approximations . The latter is achieved by identifying a suitable boosting function ( of order ε 1 ) to efficiently deal with the sparsity of ( stochastic ) gradients of neural networks . In other words , the novelty of our algorithm is to utilize a taming function and a boosting function , rather than designing a new Vn as in Adam-type optimizers . We proceed with the necessary preliminary information , main assumptions and formal introduction of the new algorithm . | The goal of this work is to bridge the gap between the theoretical qualities of Langevin based algorithms for optimisation and their empirical inability to match SOTA optimisation methods such as SGD or ADAM. To begin with, the authors propose a new iterative scheme, similar to TUSLA [1], involving an adaptive preconditioned for the gradient term only, and a temperature parameter for the noise term (equations 7-8). They show convergence of the proposed scheme, in a very similar way to what is done in [1]. Finally, they test a modified version of their algorithm, in which the returned value is the average value of past iterates, and show competitive performance compared to SOTA algorithms. [1] A. Lovas, I. Lytas, M. Rasonyi, and S. Sabanis. Taming neural networks with tusla: Non-convex learning via adaptive stochastic gradient langevin algorithms. | SP:ab6e769032215b166589f2e9cc1512594a2e5277 |
Polygonal Unadjusted Langevin Algorithms: Creating stable and efficient adaptive algorithms for neural networks | 1 INTRODUCTION . Modern machine learning models including deep neural networks are successfully trained when they are finely tuned via the optimization of their associated loss functions . Two aspects of such optimization tasks pose significant challenges , namely the non-convex nature of loss functions and the highly nonlinear features of many types of neural networks . Moreover , the analysis in Lovas et al . ( 2020 ) shows that the gradients of such non-convex loss functions typically grow faster than linearly and are only locally Lipschitz continuous . Naturally , stability issues are observed , which are known as the ‘ exploding gradient ’ phenomenon ( Bengio et al. , 1994 ; Pascanu et al. , 2013 ) , when vanilla stochastic gradient descent ( SGDs ) or certain types of adaptive algorithms are used for fine tuning . The sparsity of gradients of neural networks is another challenging issue , which is extensively studied in the literature . For example , momentum methods and adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) , Adam ( Kingma & Ba ( 2015 ) ) have been developed to tackle this problem and improve training speed by diagonally scaling the gradient by some function of the past gradients . A family of Langevin based algorithms has been another important stream of literature on the stochastic optimization . They are built on the theoretical fact that the Langevin stochastic differential equation , ( 6 ) , converges to its unique invariant measure , which concentrates on the global minimizers of the objective function as β →∞ , see Hwang ( 1980 ) . Since the convergence property remains true for nonconvex optimization problems , the global convergence of the stochastic gradient Langevin dynamics ( SGLD ) and its variants has been extensively studied in a nonconvex setting ( Raginsky et al. , 2017 ; Xu et al. , 2018 ; Erdogdu et al. , 2018 ; Brosse et al. , 2018 ; Lovas et al. , 2020 ) . Moreover , it is worth noting that Langevin based algorithms have been a key element in statistics and Bayesian learning ( Roberts & Tweedie , 1996 ; Durmus & Moulines , 2017 ; Dalalyan , 2017 ; Brosse et al. , 2019 ; Welling & Teh , 2011 ; Deng et al. , 2020a ; b ) . Motivated by the aforementioned developments in the field , we propose a new class of Langevin algorithms which is based on recent advances of Euler ’ s polygonal approximations for Langevin SDEs . The idea of this new form of Euler ’ s polygonal approximations for SDEs with monotone coefficients originates from the articles Krylov ( 1985 ) and Krylov ( 1990 ) . We name this new class as polygonal unadjusted Langevin algorithms . Moreover , it is versatile enough to incorporate further features to address other known shortcomings of adaptive optimizers . Mathematically , it is described as follows : Given an i.i.d . sequence of random variables { Xn } n≥0 of interest , which typically represent available data , the algorithm follows θλ0 : = θ0 , θ λ n+1 : = θ λ n − λGλ ( θλn , Xn+1 ) + √ 2λβ−1ξn+1 , n ∈ N , ( 1 ) where θ0 is an Rd-valued random variable , λ > 0 denotes the step size of the algorithm , β > 0 is the so-called inverse temperature , ( ξn ) n∈N is an Rd-valued Gaussian process with i.i.d . components and Gλ : Rd × Rm → Rd satisfies the following three properties : 1 . For every λ > 0 , There exist constants Kλ > 0 and ρ1 ≥ 0 such that |Gλ ( θ , x ) | ≤ Kλ ( 1 + |x| ) ρ1 ( 1 + |θ| ) for every θ ∈ Rd and x ∈ Rm . 2 . There exist constants γ ≥ 1/2 , K2 > 0 and ρ2 , ρ3 ≥ 0 such that for all λ > 0 , |Gλ ( θ , x ) −G ( θ , x ) | ≤ λγK2 ( 1 + |x| ) ρ2 ( 1 + |θ| ) ρ3 for every θ ∈ Rd and x ∈ Rm , whereG is the ( unbiased ) stochastic gradient of the objective function of the optimization problem under study . 3 . There exist constants λmax and δ ∈ { 1 , 2 } such that for any λ ≤ λmax , lim inf |θ|→∞ E [ 〈 θ |θ|δ , Gλ ( θ , X0 ) 〉 − 2λ |θ|δ |Gλ ( θ , X0 ) |2 ] > 0 . One obtains our new algorithm THεO POULA by considering the case where Gλ ( θ , x ) is the vector with entries H ( i ) λ , c ( θ , x ) as given by ( 8 ) , for i ∈ { 1 , . . . , d } . Its name is formed from its description , namely Tamed Hybrid ε-Order POlygonal Unadjusted Langevin Algorithm and its full detailed analysis ( including its convergence properties ) are given in Section 3 . We note that THεO POULA and TUSLA ( Lovas et al . ( 2020 ) ) satisfy the above three properties with δ = 2 and γ = 1/2 , whereas TULA ( Brosse et al . ( 2019 ) ) satisfies them with δ = γ = 1 as it assumes only deterministic gradients ( and thus the i.i.d . data sequence reduces to a constant ) . 1.1 RELATED WORK : LANGEVIN BASED ALGORITHMS AND ADAPTIVE LEARNING RATE METHODS . Most research on Langevin based algorithms in the literature has been focused on theoretical aspects . Raginsky et al . ( 2017 ) demonstrated the links between Langevin based algorithms and stochastic optimization in neural networks , stimulating further the development and analysis of such algorithms . Xu et al . ( 2018 ) analyzed the global convergence of GLD , SGLD and SVRG-LD . The incorporation of dependent data streams in the analysis of SGLD algorithms has been achieved in Barkhagen et al . ( 2021 ) and in Chau et al . ( 2019 ) , and local conditions have been studied in Zhang et al . ( 2019 ) . Recently , TUSLA of Lovas et al . ( 2020 ) has been proposed based on a new generation of tamed Euler approximations for stochastic differential equations ( SDEs ) with monotone coefficients in nonconvex optimization problems . See Hutzenthaler et al . ( 2012 ) and Sabanis ( 2013 ) for the rationale of taming techniques . Despite their elegant theoretical results , the use of Langevin based algorithms for training deep learning models has been limited in practice as their empirical performance lacked behind in comparison to other popular adaptive gradient methods . We refer to Appendix F.3 for the reader who is interested in recent progress on sampling and Bayesian neural networks . Adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) and Adam ( Kingma & Ba ( 2015 ) ) have been successfully applied to neural network models due to their fast training speed . Since the appearance of Adam , a large number of variants of Adam-type optimizers have been proposed to address the theoretical and practical challenges of Adam . For example , Reddi et al . ( 2018 ) provided a simple example that demonstrates the non-convergence issue of Adam and proposed a simple modification , called AMSGrad , to solve this problem . Chen et al . ( 2019 ) discussed the convergence of Adam-type optimizers in a nonconvex setting . RAdam to rectify the variance of adaptive learning rate has been proposed in Liu et al . ( 2020 ) . Wilson et al . ( 2017 ) revealed that the generalization ability of adaptive learning rate methods is worse than a global learning method like SGD . AdaBound of Luo et al . ( 2019 ) attempts to overcome the drawback by employing dynamic bounds on learning rates . Recently , AdaBelief ( Zhuang et al . ( 2020 ) ) and AdamP ( Heo et al . ( 2021 ) ) demonstrated their fast convergence and good generalization via extensive experiments . Nevertheless , the convergence analysis of these ( and other ) adaptive learning rate methods is still restrictive since it is only guaranteed to converge to a stationary point ( which can be a local minimum or a saddle point ) under strong assumptions . Namely , the stochastic gradient is globally Lipschitz continuous and bounded . Note though that none of these two assumptions hold true in a typical optimization problem involving neural networks . This is particularly evident in complex neural network architectures . 1.2 OUR CONTRIBUTIONS . The proposed algorithm , THεO POULA , tries to combines both advantages : namely , global convergence in Langevin based algorithms and powerful empirical performance in adaptive learning rate methods . To the best of the authors ’ knowledge , our algorithm is the first Langevin based algorithm to outperform popular stochastic optimization methods such as SGD , Adam , AMSGrad , RMSProp , AdaBound and AdaBelief for deep learning tasks . The major strengths of our work over related algorithms are summarized as follows : • ( Global convergence ) We provide a global convergence analysis of THεO POULA for nonconvex optimization where the stochastic gradient of the objective is locally Lipscthiz continuous . Moreover , non-asymptotic estimates for the expected excess risk are derived . • ( Stable and fast training ) THεO POULA achieves a stable and fast training process using the ( element-wise ) taming technique , ( element-wise ) boosting function and averaging , which are theoretically well-designed . Furthermore , we validate the effectiveness of the taming and boosting functions through several empirical experiments . • ( Good generalization ) While THεO POULA behaves like adaptive learning rate methods in the early training phase , it takes an almost global learning rate near an optimal point . That is , THεO POULA is quickly switched from adaptive methods to SGD . As a result , it inherits the good generalization ability of SGD . Our experiments support this fact by showing that THεO POULA outperforms the other optimization methods in generalization measured by test accuracy for various deep learning tasks . 2 MOTIVATING EXAMPLE . The local Lipschitz continuity of gradients and its effect on the performance of optimization methods are relatively under-studied . Most relevant studies assume that the stochastic gradient is global Lipscthiz continuous and bounded ( Kingma & Ba , 2015 ; Xu et al. , 2018 ; Brosse et al. , 2018 ; Duchi et al. , 2011 ; Tieleman & Hinton , 2012 ; Reddi et al. , 2018 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Luo et al. , 2019 ; Zhuang et al. , 2020 ) although it is not true for neural network problems . This section provides a simple , one-dimensional optimization problem that illustrates the convergence issue of popular stochastic gradient methods when the stochastic gradient is locally Lipschitz continuous , i.e. , the gradient can be super-linearly growing 1 . Consider the following optimization problem : min θ u ( θ ) = min θ E [ U ( θ , X ) ] , ( 2 ) where U : R× R→ R is defined as U ( θ , x ) = { θ2 ( 1 + 1x≤1 ) + θ 30 , |θ| ≤ 1 , ( 2|θ| − 1 ) ( 1 + 1x≤1 ) + θ30 , |θ| > 1 , and X is uniformly distributed over ( −2 , 2 ) , that is , fX ( x ) = 141|x|≤2 . Furthermore , the stochastic gradient G : R× R→ R is given by G ( θ , x ) = { 2θ ( 1 + 1x≤1 ) + 30θ 29 , |θ| ≤ 1 , 2 ( 1 + 1x≤1 ) sgn ( θ ) + 30θ 29 , |θ| > 1 , where sgn ( · ) is the sign function . Note that the stochastic gradientG is locally Lipschitz continuous , which satisfies |G ( θ , x ) −G ( θ′ , x ) | ≤ 34 ( 1 + |θ|+ |θ′| ) 28|θ − θ′| 1Lovas et al . ( 2020 ) used a similar example to show the stability of TUSLA with a different taming function . for all x ∈ R and θ , θ′ ∈ R. Also , the optimal value is attained at θ = 0 . See Appendix A for more details . Following Reddi et al . ( 2018 ) , adaptive stochastic gradient methods can be generally written as follows , for n ∈ N , mn = φn ( G1 , · · · , Gn ) , Vn = ψn ( G1 , · · · , Gn ) , θn+1 = θn − λn mn ε+ √ V n ( 3 ) where Gi : = G ( θi , Xi ) is the stochastic gradient evaluated at the i-th iteration , λn is the step size and all operations are applied element-wise . Table 1 provides the details for some of the most popular stochastic optimization methods with corresponding averaging functions φn and ψn . We use SGD , Adam , AMSGrad and RMSprop to solve the optimization problem with initial value θ0 = 5 . For hyperparameters of optimization algorithms , we use their default settings provided in PyTorch . Figure 1 ( a ) shows the trajectories of approximate solutions generated by each optimizer . While SGD , Adam , AMSGrad and RMSProp fail to converge to the optimal solution 0 , the proposed algorithm , THεO POULA , finds the optimal solution with a reasonable step size , say , 0.01 . Intuitively , the undesirable phenomenon occurs because , in the iterating rule ( 3 ) , the denominator√ V n excessively dominates the numerator mn , causing the vanishing gradient problem in the presence of the superlinear gradient . On the contrary , SGD suffers from the exploding gradient problem . Moreover , Figure 1 ( b ) highlights that the problematic behavior can not be simply resolved by adjusting the learning rate within the Adam-type framework , while THεO POULA perform extremely well even in the presence of such violent non-linearities . 3 NEW ALGORITHM : THεO POULA We propose a new stochastic optimization algorithm by combining ideas from taming methods specifically designed to approximate Langevin SDEs with a hybrid approach based on recent advances of polygonal Euler approximations . The latter is achieved by identifying a suitable boosting function ( of order ε 1 ) to efficiently deal with the sparsity of ( stochastic ) gradients of neural networks . In other words , the novelty of our algorithm is to utilize a taming function and a boosting function , rather than designing a new Vn as in Adam-type optimizers . We proceed with the necessary preliminary information , main assumptions and formal introduction of the new algorithm . | The paper presents a new stochastic optimization algorithm inspired by the tamed Euler discretization of the overdamped Langevin diffusion. Convergence guarantees in the Wasserstein metric are established for this algorithm under mild assumptions, primarily local Lipschitz continuity and dissipativity conditions on the (stochastic) gradient of the loss function. In addition to a taming function, the proposed algorithm "Th$\varepsilon$O POULA", employs a boosting function to improve performance in flat regions of the loss landscape. Along with a synthetic example, the authors demonstrate the effectiveness of Th$\varepsilon$O POULA for training deep neural networks for image classification and language modelling. | SP:ab6e769032215b166589f2e9cc1512594a2e5277 |
Polygonal Unadjusted Langevin Algorithms: Creating stable and efficient adaptive algorithms for neural networks | 1 INTRODUCTION . Modern machine learning models including deep neural networks are successfully trained when they are finely tuned via the optimization of their associated loss functions . Two aspects of such optimization tasks pose significant challenges , namely the non-convex nature of loss functions and the highly nonlinear features of many types of neural networks . Moreover , the analysis in Lovas et al . ( 2020 ) shows that the gradients of such non-convex loss functions typically grow faster than linearly and are only locally Lipschitz continuous . Naturally , stability issues are observed , which are known as the ‘ exploding gradient ’ phenomenon ( Bengio et al. , 1994 ; Pascanu et al. , 2013 ) , when vanilla stochastic gradient descent ( SGDs ) or certain types of adaptive algorithms are used for fine tuning . The sparsity of gradients of neural networks is another challenging issue , which is extensively studied in the literature . For example , momentum methods and adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) , Adam ( Kingma & Ba ( 2015 ) ) have been developed to tackle this problem and improve training speed by diagonally scaling the gradient by some function of the past gradients . A family of Langevin based algorithms has been another important stream of literature on the stochastic optimization . They are built on the theoretical fact that the Langevin stochastic differential equation , ( 6 ) , converges to its unique invariant measure , which concentrates on the global minimizers of the objective function as β →∞ , see Hwang ( 1980 ) . Since the convergence property remains true for nonconvex optimization problems , the global convergence of the stochastic gradient Langevin dynamics ( SGLD ) and its variants has been extensively studied in a nonconvex setting ( Raginsky et al. , 2017 ; Xu et al. , 2018 ; Erdogdu et al. , 2018 ; Brosse et al. , 2018 ; Lovas et al. , 2020 ) . Moreover , it is worth noting that Langevin based algorithms have been a key element in statistics and Bayesian learning ( Roberts & Tweedie , 1996 ; Durmus & Moulines , 2017 ; Dalalyan , 2017 ; Brosse et al. , 2019 ; Welling & Teh , 2011 ; Deng et al. , 2020a ; b ) . Motivated by the aforementioned developments in the field , we propose a new class of Langevin algorithms which is based on recent advances of Euler ’ s polygonal approximations for Langevin SDEs . The idea of this new form of Euler ’ s polygonal approximations for SDEs with monotone coefficients originates from the articles Krylov ( 1985 ) and Krylov ( 1990 ) . We name this new class as polygonal unadjusted Langevin algorithms . Moreover , it is versatile enough to incorporate further features to address other known shortcomings of adaptive optimizers . Mathematically , it is described as follows : Given an i.i.d . sequence of random variables { Xn } n≥0 of interest , which typically represent available data , the algorithm follows θλ0 : = θ0 , θ λ n+1 : = θ λ n − λGλ ( θλn , Xn+1 ) + √ 2λβ−1ξn+1 , n ∈ N , ( 1 ) where θ0 is an Rd-valued random variable , λ > 0 denotes the step size of the algorithm , β > 0 is the so-called inverse temperature , ( ξn ) n∈N is an Rd-valued Gaussian process with i.i.d . components and Gλ : Rd × Rm → Rd satisfies the following three properties : 1 . For every λ > 0 , There exist constants Kλ > 0 and ρ1 ≥ 0 such that |Gλ ( θ , x ) | ≤ Kλ ( 1 + |x| ) ρ1 ( 1 + |θ| ) for every θ ∈ Rd and x ∈ Rm . 2 . There exist constants γ ≥ 1/2 , K2 > 0 and ρ2 , ρ3 ≥ 0 such that for all λ > 0 , |Gλ ( θ , x ) −G ( θ , x ) | ≤ λγK2 ( 1 + |x| ) ρ2 ( 1 + |θ| ) ρ3 for every θ ∈ Rd and x ∈ Rm , whereG is the ( unbiased ) stochastic gradient of the objective function of the optimization problem under study . 3 . There exist constants λmax and δ ∈ { 1 , 2 } such that for any λ ≤ λmax , lim inf |θ|→∞ E [ 〈 θ |θ|δ , Gλ ( θ , X0 ) 〉 − 2λ |θ|δ |Gλ ( θ , X0 ) |2 ] > 0 . One obtains our new algorithm THεO POULA by considering the case where Gλ ( θ , x ) is the vector with entries H ( i ) λ , c ( θ , x ) as given by ( 8 ) , for i ∈ { 1 , . . . , d } . Its name is formed from its description , namely Tamed Hybrid ε-Order POlygonal Unadjusted Langevin Algorithm and its full detailed analysis ( including its convergence properties ) are given in Section 3 . We note that THεO POULA and TUSLA ( Lovas et al . ( 2020 ) ) satisfy the above three properties with δ = 2 and γ = 1/2 , whereas TULA ( Brosse et al . ( 2019 ) ) satisfies them with δ = γ = 1 as it assumes only deterministic gradients ( and thus the i.i.d . data sequence reduces to a constant ) . 1.1 RELATED WORK : LANGEVIN BASED ALGORITHMS AND ADAPTIVE LEARNING RATE METHODS . Most research on Langevin based algorithms in the literature has been focused on theoretical aspects . Raginsky et al . ( 2017 ) demonstrated the links between Langevin based algorithms and stochastic optimization in neural networks , stimulating further the development and analysis of such algorithms . Xu et al . ( 2018 ) analyzed the global convergence of GLD , SGLD and SVRG-LD . The incorporation of dependent data streams in the analysis of SGLD algorithms has been achieved in Barkhagen et al . ( 2021 ) and in Chau et al . ( 2019 ) , and local conditions have been studied in Zhang et al . ( 2019 ) . Recently , TUSLA of Lovas et al . ( 2020 ) has been proposed based on a new generation of tamed Euler approximations for stochastic differential equations ( SDEs ) with monotone coefficients in nonconvex optimization problems . See Hutzenthaler et al . ( 2012 ) and Sabanis ( 2013 ) for the rationale of taming techniques . Despite their elegant theoretical results , the use of Langevin based algorithms for training deep learning models has been limited in practice as their empirical performance lacked behind in comparison to other popular adaptive gradient methods . We refer to Appendix F.3 for the reader who is interested in recent progress on sampling and Bayesian neural networks . Adaptive learning rate methods such as AdaGrad ( Duchi et al . ( 2011 ) ) , RMSProp ( Tieleman & Hinton ( 2012 ) ) and Adam ( Kingma & Ba ( 2015 ) ) have been successfully applied to neural network models due to their fast training speed . Since the appearance of Adam , a large number of variants of Adam-type optimizers have been proposed to address the theoretical and practical challenges of Adam . For example , Reddi et al . ( 2018 ) provided a simple example that demonstrates the non-convergence issue of Adam and proposed a simple modification , called AMSGrad , to solve this problem . Chen et al . ( 2019 ) discussed the convergence of Adam-type optimizers in a nonconvex setting . RAdam to rectify the variance of adaptive learning rate has been proposed in Liu et al . ( 2020 ) . Wilson et al . ( 2017 ) revealed that the generalization ability of adaptive learning rate methods is worse than a global learning method like SGD . AdaBound of Luo et al . ( 2019 ) attempts to overcome the drawback by employing dynamic bounds on learning rates . Recently , AdaBelief ( Zhuang et al . ( 2020 ) ) and AdamP ( Heo et al . ( 2021 ) ) demonstrated their fast convergence and good generalization via extensive experiments . Nevertheless , the convergence analysis of these ( and other ) adaptive learning rate methods is still restrictive since it is only guaranteed to converge to a stationary point ( which can be a local minimum or a saddle point ) under strong assumptions . Namely , the stochastic gradient is globally Lipschitz continuous and bounded . Note though that none of these two assumptions hold true in a typical optimization problem involving neural networks . This is particularly evident in complex neural network architectures . 1.2 OUR CONTRIBUTIONS . The proposed algorithm , THεO POULA , tries to combines both advantages : namely , global convergence in Langevin based algorithms and powerful empirical performance in adaptive learning rate methods . To the best of the authors ’ knowledge , our algorithm is the first Langevin based algorithm to outperform popular stochastic optimization methods such as SGD , Adam , AMSGrad , RMSProp , AdaBound and AdaBelief for deep learning tasks . The major strengths of our work over related algorithms are summarized as follows : • ( Global convergence ) We provide a global convergence analysis of THεO POULA for nonconvex optimization where the stochastic gradient of the objective is locally Lipscthiz continuous . Moreover , non-asymptotic estimates for the expected excess risk are derived . • ( Stable and fast training ) THεO POULA achieves a stable and fast training process using the ( element-wise ) taming technique , ( element-wise ) boosting function and averaging , which are theoretically well-designed . Furthermore , we validate the effectiveness of the taming and boosting functions through several empirical experiments . • ( Good generalization ) While THεO POULA behaves like adaptive learning rate methods in the early training phase , it takes an almost global learning rate near an optimal point . That is , THεO POULA is quickly switched from adaptive methods to SGD . As a result , it inherits the good generalization ability of SGD . Our experiments support this fact by showing that THεO POULA outperforms the other optimization methods in generalization measured by test accuracy for various deep learning tasks . 2 MOTIVATING EXAMPLE . The local Lipschitz continuity of gradients and its effect on the performance of optimization methods are relatively under-studied . Most relevant studies assume that the stochastic gradient is global Lipscthiz continuous and bounded ( Kingma & Ba , 2015 ; Xu et al. , 2018 ; Brosse et al. , 2018 ; Duchi et al. , 2011 ; Tieleman & Hinton , 2012 ; Reddi et al. , 2018 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Luo et al. , 2019 ; Zhuang et al. , 2020 ) although it is not true for neural network problems . This section provides a simple , one-dimensional optimization problem that illustrates the convergence issue of popular stochastic gradient methods when the stochastic gradient is locally Lipschitz continuous , i.e. , the gradient can be super-linearly growing 1 . Consider the following optimization problem : min θ u ( θ ) = min θ E [ U ( θ , X ) ] , ( 2 ) where U : R× R→ R is defined as U ( θ , x ) = { θ2 ( 1 + 1x≤1 ) + θ 30 , |θ| ≤ 1 , ( 2|θ| − 1 ) ( 1 + 1x≤1 ) + θ30 , |θ| > 1 , and X is uniformly distributed over ( −2 , 2 ) , that is , fX ( x ) = 141|x|≤2 . Furthermore , the stochastic gradient G : R× R→ R is given by G ( θ , x ) = { 2θ ( 1 + 1x≤1 ) + 30θ 29 , |θ| ≤ 1 , 2 ( 1 + 1x≤1 ) sgn ( θ ) + 30θ 29 , |θ| > 1 , where sgn ( · ) is the sign function . Note that the stochastic gradientG is locally Lipschitz continuous , which satisfies |G ( θ , x ) −G ( θ′ , x ) | ≤ 34 ( 1 + |θ|+ |θ′| ) 28|θ − θ′| 1Lovas et al . ( 2020 ) used a similar example to show the stability of TUSLA with a different taming function . for all x ∈ R and θ , θ′ ∈ R. Also , the optimal value is attained at θ = 0 . See Appendix A for more details . Following Reddi et al . ( 2018 ) , adaptive stochastic gradient methods can be generally written as follows , for n ∈ N , mn = φn ( G1 , · · · , Gn ) , Vn = ψn ( G1 , · · · , Gn ) , θn+1 = θn − λn mn ε+ √ V n ( 3 ) where Gi : = G ( θi , Xi ) is the stochastic gradient evaluated at the i-th iteration , λn is the step size and all operations are applied element-wise . Table 1 provides the details for some of the most popular stochastic optimization methods with corresponding averaging functions φn and ψn . We use SGD , Adam , AMSGrad and RMSprop to solve the optimization problem with initial value θ0 = 5 . For hyperparameters of optimization algorithms , we use their default settings provided in PyTorch . Figure 1 ( a ) shows the trajectories of approximate solutions generated by each optimizer . While SGD , Adam , AMSGrad and RMSProp fail to converge to the optimal solution 0 , the proposed algorithm , THεO POULA , finds the optimal solution with a reasonable step size , say , 0.01 . Intuitively , the undesirable phenomenon occurs because , in the iterating rule ( 3 ) , the denominator√ V n excessively dominates the numerator mn , causing the vanishing gradient problem in the presence of the superlinear gradient . On the contrary , SGD suffers from the exploding gradient problem . Moreover , Figure 1 ( b ) highlights that the problematic behavior can not be simply resolved by adjusting the learning rate within the Adam-type framework , while THεO POULA perform extremely well even in the presence of such violent non-linearities . 3 NEW ALGORITHM : THεO POULA We propose a new stochastic optimization algorithm by combining ideas from taming methods specifically designed to approximate Langevin SDEs with a hybrid approach based on recent advances of polygonal Euler approximations . The latter is achieved by identifying a suitable boosting function ( of order ε 1 ) to efficiently deal with the sparsity of ( stochastic ) gradients of neural networks . In other words , the novelty of our algorithm is to utilize a taming function and a boosting function , rather than designing a new Vn as in Adam-type optimizers . We proceed with the necessary preliminary information , main assumptions and formal introduction of the new algorithm . | The author(s) propose the TheoPouLa algorithm to overcome unstable gradient (exploding / diminishing) problems by utilizing Euler's polygonal approximation. Several experiments are presented on image classification and language modeling to justify the effectiveness of these models. The biggest contribution of this paper is to attempt to tackle stability issues generated by the fast-growing gradients and non-global Lipschitz constants. | SP:ab6e769032215b166589f2e9cc1512594a2e5277 |
BLOOD: Bi-level Learning Framework for Out-of-distribution Generalization | 1 INTRODUCTION . Conventional machine learning algorithms are relying on the empirical risk minimization ( ERM ) method when they should learn from given data , and in many application areas , this approach has shown successful performance with high prediction accuracy . However , if a model learns spurious correlations during training , it can often fail with poor generalization performance , which is known as the out-of-distribution ( OOD ) generalization problem . Furthermore , in recent studies , it has been shown that ERM-based methods more easily learn such unstable correlations in the dataset and result in a poor generalization performance on real-world applications ( Beery et al. , 2018 ; Ilyas et al. , 2019 ; Geirhos et al. , 2018 ; de Haan et al. , 2019 ; Koh et al. , 2021 ) . To address this problem and obtain a robust de-biased model , many approaches have been proposed for the cases where biases are known beforehand or not . When biases are known as a priori , some studies applied adversarial training to remove biases from representations ( Belinkov et al. , 2019a ; b ) or re-weighting training samples ( Schuster et al. , 2019 ) , and assembling predictions of a biased model and the base model for ensemble with a product of experts ( Hinton , 2002 ; He et al. , 2019 ; Clark et al. , 2019 ; Mahabadi et al. , 2020 ) . However , these works are designed for a specific type of bias and thus require extra domain knowledge to generalize to new tasks . Moreover , without such prior knowledge for biases in the data , they are hard to be applied to practical applications . For the case of having no prior knowledge of spurious correlations , the most popular approach is leveraging the prediction result of a shallow model or weak learner while assuming them as a biased classifier . Since predictions of a biased classifier can provide useful clues for the spurious correlation it has learned , to learn from the weak models ’ mistakes , they down-weight the potentially biased examples while training a robust model ( Mahabadi et al. , 2020 ) . Although these works are more general approaches and save a lot of human efforts for finding biases in established datasets , we found that they still can not effectively remove multiple types of biases existing in data groups collected from different environments . Another type of effective OOD generalization approach is group distributionally robust optimization ( group DRO ) algorithm which alleviates model biases by minimizing the worst-case risk over a set of human-defined training groups ( Hu et al. , 2018 ; Sagawa * et al. , 2020 ) . In this method , the choice of how to group the training data allows us to introduce a prior knowledge of spurious correlations into optimization . However , finding multiple types of biases and accordingly constructing data groups are laborious processes . Therefore , a simple grouping algorithm is proposed in a recent study ( Bao et al. , 2021 ) , which splits the training dataset based on the prediction results of biased classifiers . Our approach is also aimed to create data groups that are informative for the multiple underlying biases in the training dataset so that minimizing the worst-case risk over all those data groups can provide a robust classifier . In practical settings where there is little or no prior information about the biases , most de-biasing methods , which automatically identify potential biases in the training data , can not discover all spurious correlations existing in the dataset . Furthermore , splitting training data into several static data groups can not effectively represent the effect of multiple biases existing in the dataset . In this work , first , we propose a novel strategy for discovering bias and splitting training data for a group-based de-biasing algorithm . Based on the prevailing automatic bias identifying approaches ( Utama et al. , 2020b ; Sanh et al. , 2021 ) , we train a shallow model for each group in a batch and dynamically re-group the environments according to the prediction correctness of the shallow model over all other environments in the batch . This batch-wise dynamic data re-grouping strategy allows us gradually uncover multiple unknown biases in the dataset while training a model . A shallow model tends to quickly overfit to surface form information , especially when they are trained with a small training data setting ( Utama et al. , 2020b ) ; therefore , if we re-group the samples in a batch , based on its biased prediction results , we can more effectively account for the various unknown biases in the training dataset . Furthermore , when this approach is combined with the group-based de-biasing method ( group DRO ) , we can train a more robust classifier by minimizing the worst-case risk over all interpolations of those dynamic data partitions . Second , we also propose a unified end-to-end learning framework for a stable classifier . Our framework is a bi-level learning process which extends the min-max objective of group DRO with the unknown bias discovering and grouping method . In the inner level of optimization , it discovers the biases in the environment of each batch by applying the dynamic data re-grouping method , and these re-partitioned data groups are used for the group DRO algorithm , which minimizes the worstcase risk in the outer level of optimization . We coin our novel learning framework as a Bi-level Learning framework for OOD generalization ( BLOOD ) and evaluate its OOD performance in both synthetic and real-world environments . In the empirical evaluation , our framework shows 47 % percent improvement on the Colored MNIST dataset and achieves the best results in real-world datasets ( Camelyon17-wilds , FMoW-wilds ) compared to other OOD methods . The main contributions of our work are the following : ( a ) we show that dynamically re-grouping the subset of environments , based on the predictions of the shallow model , gradually uncovers multiple types of spurious correlations existing in a dataset ; ( b ) we integrate automatic unknown bias identifying and grouping process to the group DRO by formulating a bi-level optimization objective ; ( c ) we propose a unified end-to-end learning framework which does not need prior knowledge of multiple dataset biases to obtain robust models , but automatically removes various unknown biases from out-of-distribution data . 2 METHOD . 2.1 OVERVIEW . Consider a set ofN training environments Etr = { ei } Ni=1 where each environment ei is composed of input-label pairs { ( xek , yek ) } n k=1 . Our main goal is to train a stable classifier from these environments so that it can be generalized to any new test dataset . We do not make any assumption on the biases present ( or not ) in the dataset and rely on letting the shallow model discover them during training . For this type of problem , recent de-biasing methods ( Utama et al. , 2020b ; Sanh et al. , 2021 ; Liu et al. , 2021 ; Bao et al. , 2021 ) apply a two-stage process : ( a ) train a separate biased classifier by learning from spurious correlations in the environments and use the prediction correctness of the biased classifier for identifying a biased sample ( Utama et al. , 2020b ; Liu et al. , 2021 ) or creating new environment partitions for group-based de-biasing methods ( Bao et al. , 2021 ) . ( b ) train a robust classifier by re-weighting biased samples or applying product-of-experts ( Hinton , 2002 ; Sanh et al. , 2021 ) , confidence regularization ( Utama et al. , 2020a ) to the outcome of the first stage . In our approach , we integrate these two stages into a single unified learning framework by leveraging a bi-level optimization structure . With the bi-level setting , we can identify unknown biases in the inner-level and remove the discovered biases with group DRO in the outer-level . In the innerlevel , to automatically discover unknown biases in the environments , we train a shallow model for each environment in a batch and apply an environment-specific classifier to partition all other environments in the batch , based on its prediction correctness . Since a shallow model is more prone to rely on shallow heuristics , we can obtain a biased classifier after few-shot learning in the batch , and this procedure is iteratively performed while training a model . In the outer-level , the dynamically partitioned environments , which are obtained from inner-level optimization , are provided to the group DRO algorithm and used for minimizing the worst-case risk over those partitions . In the next section , we describe each component of our bi-level learning structure with its corresponding contribution . 2.2 BI-LEVEL LEARNING FRAMEWORK FOR DE-BIASING . Our learning framework consists of two training objectives for bi-level optimization , in which the inner objective is nested within the outer objective . The inner training objective learns spurious correlations in the dataset , which are unknown , and uses them for re-grouping other environments . The outer objective learns only stable correlations by minimizing the worst-case risk over these groups . 2.2.1 INNER OBJECTIVE : LEARNING BIAS TO DE-BIAS . The inner-level optimization is aimed to automatically discover unknown spurious correlations , based on the prediction result of a biased classifier ( weak learner ) , and accordingly re-partitions the environments to provide groups to the outer-level process . Therefore , we need to train a biased model which mostly follows spurious correlations in each environment . Most of the other de-biasing methods , exploiting the prediction results of a biased classifier , use a pre-built biased model by training it with the full set or a small subset of training data . In contrast to those works , we do not train a separate biased model ; instead , we dynamically obtain a shallow model for each environment in a batch during inner-level optimization . To obtain biased models while training stable classifier , we get insight from the deep neural network ’ s tendency to exploit simple patterns in the early stage of the training , which is also observed in other researches ( Arpit et al. , 2017 ; Liu et al. , 2020 ) . Since spurious correlations are commonly characterized as simple surface patterns , we expect that models ’ rapid performance gain is attributed to their reliance on simple surface patterns ( Utama et al. , 2020a ) . In the same context , after a model is trained with only a small number of samples from an environment , we expect it to perform as a biased classifier , which achieves high accuracy mostly on the biased examples while still performing poorly on the rest of the samples from other environments . For each batch learning step in the inner optimization , a shallow model is trained and used for re-grouping as follows : Step 1 : For each sampled environment ei in a batch , temporarily train an environment-specific classifier fφi with few-shot learning . Step 2 : For all sampled environments in the batch where j 6= i , use the trained classifier fφi to partition each of them into two parts based on the prediction correctness of the classifier . Training a shallow model At the beginning of a model training , a model fθ is randomly initialized with θ . While training a classifier , we obtain a shallow model for each batch training step by applying a few gradient descent steps to the model ’ s parameters θ , so that the model can quickly overfit to Algorithm 1 BLOOD : Bi-level Learning Framework for OOD Generalization Input : Step sizes α , β , γ ; A set of training environments Etr = { ei } Ni=1 Initialize : θ and q = [ q 1 , q ⊗ 1 , · · · , q N , q ⊗ N ] 1 : while not done do 2 : for all ei ∈ Etr do 3 : φi = θ − α∇θLei ( fθ ) { Inner-loop optimization for a shallow model } 4 : ej ∼ Etr \ ei { Sample training environment ej } 5 : G i→j , G ⊗ i→j = Partition ( fφi , ej ) { Partition ej into G i→j and G ⊗ i→j } 6 : q j ← q j exp ( γLG i→j ( fφi ) ) , q ⊗ i ← q ⊗ i exp ( γLG⊗i→j ( fφi ) ) { Update group weights } 7 : end for 8 : q ← q/ ∑ i ( q i + q ⊗ i ) { Normalize group weights q } 9 : θ ← θ − β ∇θ ∑ i ∑ j q j LG i→j ( fφi|θ ) + q ⊗ j LG⊗i→j ( fφi|θ ) { Outer-loop optimization } 10 : end while surface form information while fθ is still conditioned on the previously learned θ . This temporarily trained shallow model parameter φi , which are optimized for surface patterns of ei , is updated by following stochastic gradient descent ( SGD ) step : φi = θ − α∇θLei ( fθ ) ( 1 ) where α is a step size for the inner optimization , and Lei ( fθ ) is an expected loss of fθ over the data sampled from ei . We show only a single gradient update procedure in Equation 1 for the notational simplicity . Batch-wise dynamic data re-grouping After a biased classifier fφi is trained for the environment ei , we dynamically re-partition all other training environments in the batch . The fφi is applied to all other environments ej in the batch , where j 6= i , and according to its prediction correctness , samples in each environment ej are re-grouped into two parts , a correctly predicted sample group G i→j and a incorrectly predicted sample group G⊗i→j . These dynamically partitioned groups are then used for training a stable classifier by minimizing the worst-case risk over these groups in the outer-level . As a similar group-based de-biasing approach , Predict then Interpolate ( PI ) ( Bao et al. , 2021 ) also uses a biased classifier for re-partitioning other environments . Its main difference compared to our method is that they fully train a separate model with the entire dataset and use it for partitioning all environments into static groups . Once their data groups are statically assigned , it is fixed throughout the optimization process of group DRO . Although PI has shown its theoretical and empirical effectiveness as a de-biasing method , its static grouping strategy , which relies on a fully-trained biased classifier , constrains it from discovering multiple types of spurious correlations in the environments . In contrast , our framework uses a shallow model , which is trained with a small subset of each environment in the batch . Since we are using a different biased classifier per batch , we are continuously learning a bias and producing new data partitions for each batch , representing our dynamic data re-grouping strategy . This dynamic re-grouping strategy provides various group combinations for the outer-level optimization process , so that it can effectively remove various types of biases in the environments . Furthermore , since our shallow model has overfitted to the surface patterns in a small subset of data , it is more likely to capture multiple types of bias in the environments , as shown in other research ( Utama et al. , 2020a ) . This property can be a disadvantage for a de-biasing method , which applies re-weighting to the biased examples , because it reduces the effective training data size for a model . However , in our approach , it enables us to uncover multiple types of biases in the dataset . Because , multiple types of biases can be considered while minimizing the worst-case risk over various types of group configurations . | The paper proposes a new method called BLOOD for the problem of domain generalization. The proposed procedure has two broad steps: (i) Identify groups with different biases (ii) Minimize risk on each of these groups with the group DRO idea. Authors show promising results on colored MNIST and Camelyon17-wilds, FMoW-wilds. | SP:3959ff87954807a09493780c52048d84ef7320f8 |
BLOOD: Bi-level Learning Framework for Out-of-distribution Generalization | 1 INTRODUCTION . Conventional machine learning algorithms are relying on the empirical risk minimization ( ERM ) method when they should learn from given data , and in many application areas , this approach has shown successful performance with high prediction accuracy . However , if a model learns spurious correlations during training , it can often fail with poor generalization performance , which is known as the out-of-distribution ( OOD ) generalization problem . Furthermore , in recent studies , it has been shown that ERM-based methods more easily learn such unstable correlations in the dataset and result in a poor generalization performance on real-world applications ( Beery et al. , 2018 ; Ilyas et al. , 2019 ; Geirhos et al. , 2018 ; de Haan et al. , 2019 ; Koh et al. , 2021 ) . To address this problem and obtain a robust de-biased model , many approaches have been proposed for the cases where biases are known beforehand or not . When biases are known as a priori , some studies applied adversarial training to remove biases from representations ( Belinkov et al. , 2019a ; b ) or re-weighting training samples ( Schuster et al. , 2019 ) , and assembling predictions of a biased model and the base model for ensemble with a product of experts ( Hinton , 2002 ; He et al. , 2019 ; Clark et al. , 2019 ; Mahabadi et al. , 2020 ) . However , these works are designed for a specific type of bias and thus require extra domain knowledge to generalize to new tasks . Moreover , without such prior knowledge for biases in the data , they are hard to be applied to practical applications . For the case of having no prior knowledge of spurious correlations , the most popular approach is leveraging the prediction result of a shallow model or weak learner while assuming them as a biased classifier . Since predictions of a biased classifier can provide useful clues for the spurious correlation it has learned , to learn from the weak models ’ mistakes , they down-weight the potentially biased examples while training a robust model ( Mahabadi et al. , 2020 ) . Although these works are more general approaches and save a lot of human efforts for finding biases in established datasets , we found that they still can not effectively remove multiple types of biases existing in data groups collected from different environments . Another type of effective OOD generalization approach is group distributionally robust optimization ( group DRO ) algorithm which alleviates model biases by minimizing the worst-case risk over a set of human-defined training groups ( Hu et al. , 2018 ; Sagawa * et al. , 2020 ) . In this method , the choice of how to group the training data allows us to introduce a prior knowledge of spurious correlations into optimization . However , finding multiple types of biases and accordingly constructing data groups are laborious processes . Therefore , a simple grouping algorithm is proposed in a recent study ( Bao et al. , 2021 ) , which splits the training dataset based on the prediction results of biased classifiers . Our approach is also aimed to create data groups that are informative for the multiple underlying biases in the training dataset so that minimizing the worst-case risk over all those data groups can provide a robust classifier . In practical settings where there is little or no prior information about the biases , most de-biasing methods , which automatically identify potential biases in the training data , can not discover all spurious correlations existing in the dataset . Furthermore , splitting training data into several static data groups can not effectively represent the effect of multiple biases existing in the dataset . In this work , first , we propose a novel strategy for discovering bias and splitting training data for a group-based de-biasing algorithm . Based on the prevailing automatic bias identifying approaches ( Utama et al. , 2020b ; Sanh et al. , 2021 ) , we train a shallow model for each group in a batch and dynamically re-group the environments according to the prediction correctness of the shallow model over all other environments in the batch . This batch-wise dynamic data re-grouping strategy allows us gradually uncover multiple unknown biases in the dataset while training a model . A shallow model tends to quickly overfit to surface form information , especially when they are trained with a small training data setting ( Utama et al. , 2020b ) ; therefore , if we re-group the samples in a batch , based on its biased prediction results , we can more effectively account for the various unknown biases in the training dataset . Furthermore , when this approach is combined with the group-based de-biasing method ( group DRO ) , we can train a more robust classifier by minimizing the worst-case risk over all interpolations of those dynamic data partitions . Second , we also propose a unified end-to-end learning framework for a stable classifier . Our framework is a bi-level learning process which extends the min-max objective of group DRO with the unknown bias discovering and grouping method . In the inner level of optimization , it discovers the biases in the environment of each batch by applying the dynamic data re-grouping method , and these re-partitioned data groups are used for the group DRO algorithm , which minimizes the worstcase risk in the outer level of optimization . We coin our novel learning framework as a Bi-level Learning framework for OOD generalization ( BLOOD ) and evaluate its OOD performance in both synthetic and real-world environments . In the empirical evaluation , our framework shows 47 % percent improvement on the Colored MNIST dataset and achieves the best results in real-world datasets ( Camelyon17-wilds , FMoW-wilds ) compared to other OOD methods . The main contributions of our work are the following : ( a ) we show that dynamically re-grouping the subset of environments , based on the predictions of the shallow model , gradually uncovers multiple types of spurious correlations existing in a dataset ; ( b ) we integrate automatic unknown bias identifying and grouping process to the group DRO by formulating a bi-level optimization objective ; ( c ) we propose a unified end-to-end learning framework which does not need prior knowledge of multiple dataset biases to obtain robust models , but automatically removes various unknown biases from out-of-distribution data . 2 METHOD . 2.1 OVERVIEW . Consider a set ofN training environments Etr = { ei } Ni=1 where each environment ei is composed of input-label pairs { ( xek , yek ) } n k=1 . Our main goal is to train a stable classifier from these environments so that it can be generalized to any new test dataset . We do not make any assumption on the biases present ( or not ) in the dataset and rely on letting the shallow model discover them during training . For this type of problem , recent de-biasing methods ( Utama et al. , 2020b ; Sanh et al. , 2021 ; Liu et al. , 2021 ; Bao et al. , 2021 ) apply a two-stage process : ( a ) train a separate biased classifier by learning from spurious correlations in the environments and use the prediction correctness of the biased classifier for identifying a biased sample ( Utama et al. , 2020b ; Liu et al. , 2021 ) or creating new environment partitions for group-based de-biasing methods ( Bao et al. , 2021 ) . ( b ) train a robust classifier by re-weighting biased samples or applying product-of-experts ( Hinton , 2002 ; Sanh et al. , 2021 ) , confidence regularization ( Utama et al. , 2020a ) to the outcome of the first stage . In our approach , we integrate these two stages into a single unified learning framework by leveraging a bi-level optimization structure . With the bi-level setting , we can identify unknown biases in the inner-level and remove the discovered biases with group DRO in the outer-level . In the innerlevel , to automatically discover unknown biases in the environments , we train a shallow model for each environment in a batch and apply an environment-specific classifier to partition all other environments in the batch , based on its prediction correctness . Since a shallow model is more prone to rely on shallow heuristics , we can obtain a biased classifier after few-shot learning in the batch , and this procedure is iteratively performed while training a model . In the outer-level , the dynamically partitioned environments , which are obtained from inner-level optimization , are provided to the group DRO algorithm and used for minimizing the worst-case risk over those partitions . In the next section , we describe each component of our bi-level learning structure with its corresponding contribution . 2.2 BI-LEVEL LEARNING FRAMEWORK FOR DE-BIASING . Our learning framework consists of two training objectives for bi-level optimization , in which the inner objective is nested within the outer objective . The inner training objective learns spurious correlations in the dataset , which are unknown , and uses them for re-grouping other environments . The outer objective learns only stable correlations by minimizing the worst-case risk over these groups . 2.2.1 INNER OBJECTIVE : LEARNING BIAS TO DE-BIAS . The inner-level optimization is aimed to automatically discover unknown spurious correlations , based on the prediction result of a biased classifier ( weak learner ) , and accordingly re-partitions the environments to provide groups to the outer-level process . Therefore , we need to train a biased model which mostly follows spurious correlations in each environment . Most of the other de-biasing methods , exploiting the prediction results of a biased classifier , use a pre-built biased model by training it with the full set or a small subset of training data . In contrast to those works , we do not train a separate biased model ; instead , we dynamically obtain a shallow model for each environment in a batch during inner-level optimization . To obtain biased models while training stable classifier , we get insight from the deep neural network ’ s tendency to exploit simple patterns in the early stage of the training , which is also observed in other researches ( Arpit et al. , 2017 ; Liu et al. , 2020 ) . Since spurious correlations are commonly characterized as simple surface patterns , we expect that models ’ rapid performance gain is attributed to their reliance on simple surface patterns ( Utama et al. , 2020a ) . In the same context , after a model is trained with only a small number of samples from an environment , we expect it to perform as a biased classifier , which achieves high accuracy mostly on the biased examples while still performing poorly on the rest of the samples from other environments . For each batch learning step in the inner optimization , a shallow model is trained and used for re-grouping as follows : Step 1 : For each sampled environment ei in a batch , temporarily train an environment-specific classifier fφi with few-shot learning . Step 2 : For all sampled environments in the batch where j 6= i , use the trained classifier fφi to partition each of them into two parts based on the prediction correctness of the classifier . Training a shallow model At the beginning of a model training , a model fθ is randomly initialized with θ . While training a classifier , we obtain a shallow model for each batch training step by applying a few gradient descent steps to the model ’ s parameters θ , so that the model can quickly overfit to Algorithm 1 BLOOD : Bi-level Learning Framework for OOD Generalization Input : Step sizes α , β , γ ; A set of training environments Etr = { ei } Ni=1 Initialize : θ and q = [ q 1 , q ⊗ 1 , · · · , q N , q ⊗ N ] 1 : while not done do 2 : for all ei ∈ Etr do 3 : φi = θ − α∇θLei ( fθ ) { Inner-loop optimization for a shallow model } 4 : ej ∼ Etr \ ei { Sample training environment ej } 5 : G i→j , G ⊗ i→j = Partition ( fφi , ej ) { Partition ej into G i→j and G ⊗ i→j } 6 : q j ← q j exp ( γLG i→j ( fφi ) ) , q ⊗ i ← q ⊗ i exp ( γLG⊗i→j ( fφi ) ) { Update group weights } 7 : end for 8 : q ← q/ ∑ i ( q i + q ⊗ i ) { Normalize group weights q } 9 : θ ← θ − β ∇θ ∑ i ∑ j q j LG i→j ( fφi|θ ) + q ⊗ j LG⊗i→j ( fφi|θ ) { Outer-loop optimization } 10 : end while surface form information while fθ is still conditioned on the previously learned θ . This temporarily trained shallow model parameter φi , which are optimized for surface patterns of ei , is updated by following stochastic gradient descent ( SGD ) step : φi = θ − α∇θLei ( fθ ) ( 1 ) where α is a step size for the inner optimization , and Lei ( fθ ) is an expected loss of fθ over the data sampled from ei . We show only a single gradient update procedure in Equation 1 for the notational simplicity . Batch-wise dynamic data re-grouping After a biased classifier fφi is trained for the environment ei , we dynamically re-partition all other training environments in the batch . The fφi is applied to all other environments ej in the batch , where j 6= i , and according to its prediction correctness , samples in each environment ej are re-grouped into two parts , a correctly predicted sample group G i→j and a incorrectly predicted sample group G⊗i→j . These dynamically partitioned groups are then used for training a stable classifier by minimizing the worst-case risk over these groups in the outer-level . As a similar group-based de-biasing approach , Predict then Interpolate ( PI ) ( Bao et al. , 2021 ) also uses a biased classifier for re-partitioning other environments . Its main difference compared to our method is that they fully train a separate model with the entire dataset and use it for partitioning all environments into static groups . Once their data groups are statically assigned , it is fixed throughout the optimization process of group DRO . Although PI has shown its theoretical and empirical effectiveness as a de-biasing method , its static grouping strategy , which relies on a fully-trained biased classifier , constrains it from discovering multiple types of spurious correlations in the environments . In contrast , our framework uses a shallow model , which is trained with a small subset of each environment in the batch . Since we are using a different biased classifier per batch , we are continuously learning a bias and producing new data partitions for each batch , representing our dynamic data re-grouping strategy . This dynamic re-grouping strategy provides various group combinations for the outer-level optimization process , so that it can effectively remove various types of biases in the environments . Furthermore , since our shallow model has overfitted to the surface patterns in a small subset of data , it is more likely to capture multiple types of bias in the environments , as shown in other research ( Utama et al. , 2020a ) . This property can be a disadvantage for a de-biasing method , which applies re-weighting to the biased examples , because it reduces the effective training data size for a model . However , in our approach , it enables us to uncover multiple types of biases in the dataset . Because , multiple types of biases can be considered while minimizing the worst-case risk over various types of group configurations . | This paper considers the out-of-distribution (OOD) problem. To automatically remove multiple unknown types of biases without prior information, this paper proposes a bi-level learning framework, where in the inner-loop it aims to detect the biases while aiming to remove them in the outer-loop via group Distributionally Robust Optimization (DRO). Experimental results on synthetic and real datasets illustrates the effectiveness of the proposed method over other baselines. | SP:3959ff87954807a09493780c52048d84ef7320f8 |
BLOOD: Bi-level Learning Framework for Out-of-distribution Generalization | 1 INTRODUCTION . Conventional machine learning algorithms are relying on the empirical risk minimization ( ERM ) method when they should learn from given data , and in many application areas , this approach has shown successful performance with high prediction accuracy . However , if a model learns spurious correlations during training , it can often fail with poor generalization performance , which is known as the out-of-distribution ( OOD ) generalization problem . Furthermore , in recent studies , it has been shown that ERM-based methods more easily learn such unstable correlations in the dataset and result in a poor generalization performance on real-world applications ( Beery et al. , 2018 ; Ilyas et al. , 2019 ; Geirhos et al. , 2018 ; de Haan et al. , 2019 ; Koh et al. , 2021 ) . To address this problem and obtain a robust de-biased model , many approaches have been proposed for the cases where biases are known beforehand or not . When biases are known as a priori , some studies applied adversarial training to remove biases from representations ( Belinkov et al. , 2019a ; b ) or re-weighting training samples ( Schuster et al. , 2019 ) , and assembling predictions of a biased model and the base model for ensemble with a product of experts ( Hinton , 2002 ; He et al. , 2019 ; Clark et al. , 2019 ; Mahabadi et al. , 2020 ) . However , these works are designed for a specific type of bias and thus require extra domain knowledge to generalize to new tasks . Moreover , without such prior knowledge for biases in the data , they are hard to be applied to practical applications . For the case of having no prior knowledge of spurious correlations , the most popular approach is leveraging the prediction result of a shallow model or weak learner while assuming them as a biased classifier . Since predictions of a biased classifier can provide useful clues for the spurious correlation it has learned , to learn from the weak models ’ mistakes , they down-weight the potentially biased examples while training a robust model ( Mahabadi et al. , 2020 ) . Although these works are more general approaches and save a lot of human efforts for finding biases in established datasets , we found that they still can not effectively remove multiple types of biases existing in data groups collected from different environments . Another type of effective OOD generalization approach is group distributionally robust optimization ( group DRO ) algorithm which alleviates model biases by minimizing the worst-case risk over a set of human-defined training groups ( Hu et al. , 2018 ; Sagawa * et al. , 2020 ) . In this method , the choice of how to group the training data allows us to introduce a prior knowledge of spurious correlations into optimization . However , finding multiple types of biases and accordingly constructing data groups are laborious processes . Therefore , a simple grouping algorithm is proposed in a recent study ( Bao et al. , 2021 ) , which splits the training dataset based on the prediction results of biased classifiers . Our approach is also aimed to create data groups that are informative for the multiple underlying biases in the training dataset so that minimizing the worst-case risk over all those data groups can provide a robust classifier . In practical settings where there is little or no prior information about the biases , most de-biasing methods , which automatically identify potential biases in the training data , can not discover all spurious correlations existing in the dataset . Furthermore , splitting training data into several static data groups can not effectively represent the effect of multiple biases existing in the dataset . In this work , first , we propose a novel strategy for discovering bias and splitting training data for a group-based de-biasing algorithm . Based on the prevailing automatic bias identifying approaches ( Utama et al. , 2020b ; Sanh et al. , 2021 ) , we train a shallow model for each group in a batch and dynamically re-group the environments according to the prediction correctness of the shallow model over all other environments in the batch . This batch-wise dynamic data re-grouping strategy allows us gradually uncover multiple unknown biases in the dataset while training a model . A shallow model tends to quickly overfit to surface form information , especially when they are trained with a small training data setting ( Utama et al. , 2020b ) ; therefore , if we re-group the samples in a batch , based on its biased prediction results , we can more effectively account for the various unknown biases in the training dataset . Furthermore , when this approach is combined with the group-based de-biasing method ( group DRO ) , we can train a more robust classifier by minimizing the worst-case risk over all interpolations of those dynamic data partitions . Second , we also propose a unified end-to-end learning framework for a stable classifier . Our framework is a bi-level learning process which extends the min-max objective of group DRO with the unknown bias discovering and grouping method . In the inner level of optimization , it discovers the biases in the environment of each batch by applying the dynamic data re-grouping method , and these re-partitioned data groups are used for the group DRO algorithm , which minimizes the worstcase risk in the outer level of optimization . We coin our novel learning framework as a Bi-level Learning framework for OOD generalization ( BLOOD ) and evaluate its OOD performance in both synthetic and real-world environments . In the empirical evaluation , our framework shows 47 % percent improvement on the Colored MNIST dataset and achieves the best results in real-world datasets ( Camelyon17-wilds , FMoW-wilds ) compared to other OOD methods . The main contributions of our work are the following : ( a ) we show that dynamically re-grouping the subset of environments , based on the predictions of the shallow model , gradually uncovers multiple types of spurious correlations existing in a dataset ; ( b ) we integrate automatic unknown bias identifying and grouping process to the group DRO by formulating a bi-level optimization objective ; ( c ) we propose a unified end-to-end learning framework which does not need prior knowledge of multiple dataset biases to obtain robust models , but automatically removes various unknown biases from out-of-distribution data . 2 METHOD . 2.1 OVERVIEW . Consider a set ofN training environments Etr = { ei } Ni=1 where each environment ei is composed of input-label pairs { ( xek , yek ) } n k=1 . Our main goal is to train a stable classifier from these environments so that it can be generalized to any new test dataset . We do not make any assumption on the biases present ( or not ) in the dataset and rely on letting the shallow model discover them during training . For this type of problem , recent de-biasing methods ( Utama et al. , 2020b ; Sanh et al. , 2021 ; Liu et al. , 2021 ; Bao et al. , 2021 ) apply a two-stage process : ( a ) train a separate biased classifier by learning from spurious correlations in the environments and use the prediction correctness of the biased classifier for identifying a biased sample ( Utama et al. , 2020b ; Liu et al. , 2021 ) or creating new environment partitions for group-based de-biasing methods ( Bao et al. , 2021 ) . ( b ) train a robust classifier by re-weighting biased samples or applying product-of-experts ( Hinton , 2002 ; Sanh et al. , 2021 ) , confidence regularization ( Utama et al. , 2020a ) to the outcome of the first stage . In our approach , we integrate these two stages into a single unified learning framework by leveraging a bi-level optimization structure . With the bi-level setting , we can identify unknown biases in the inner-level and remove the discovered biases with group DRO in the outer-level . In the innerlevel , to automatically discover unknown biases in the environments , we train a shallow model for each environment in a batch and apply an environment-specific classifier to partition all other environments in the batch , based on its prediction correctness . Since a shallow model is more prone to rely on shallow heuristics , we can obtain a biased classifier after few-shot learning in the batch , and this procedure is iteratively performed while training a model . In the outer-level , the dynamically partitioned environments , which are obtained from inner-level optimization , are provided to the group DRO algorithm and used for minimizing the worst-case risk over those partitions . In the next section , we describe each component of our bi-level learning structure with its corresponding contribution . 2.2 BI-LEVEL LEARNING FRAMEWORK FOR DE-BIASING . Our learning framework consists of two training objectives for bi-level optimization , in which the inner objective is nested within the outer objective . The inner training objective learns spurious correlations in the dataset , which are unknown , and uses them for re-grouping other environments . The outer objective learns only stable correlations by minimizing the worst-case risk over these groups . 2.2.1 INNER OBJECTIVE : LEARNING BIAS TO DE-BIAS . The inner-level optimization is aimed to automatically discover unknown spurious correlations , based on the prediction result of a biased classifier ( weak learner ) , and accordingly re-partitions the environments to provide groups to the outer-level process . Therefore , we need to train a biased model which mostly follows spurious correlations in each environment . Most of the other de-biasing methods , exploiting the prediction results of a biased classifier , use a pre-built biased model by training it with the full set or a small subset of training data . In contrast to those works , we do not train a separate biased model ; instead , we dynamically obtain a shallow model for each environment in a batch during inner-level optimization . To obtain biased models while training stable classifier , we get insight from the deep neural network ’ s tendency to exploit simple patterns in the early stage of the training , which is also observed in other researches ( Arpit et al. , 2017 ; Liu et al. , 2020 ) . Since spurious correlations are commonly characterized as simple surface patterns , we expect that models ’ rapid performance gain is attributed to their reliance on simple surface patterns ( Utama et al. , 2020a ) . In the same context , after a model is trained with only a small number of samples from an environment , we expect it to perform as a biased classifier , which achieves high accuracy mostly on the biased examples while still performing poorly on the rest of the samples from other environments . For each batch learning step in the inner optimization , a shallow model is trained and used for re-grouping as follows : Step 1 : For each sampled environment ei in a batch , temporarily train an environment-specific classifier fφi with few-shot learning . Step 2 : For all sampled environments in the batch where j 6= i , use the trained classifier fφi to partition each of them into two parts based on the prediction correctness of the classifier . Training a shallow model At the beginning of a model training , a model fθ is randomly initialized with θ . While training a classifier , we obtain a shallow model for each batch training step by applying a few gradient descent steps to the model ’ s parameters θ , so that the model can quickly overfit to Algorithm 1 BLOOD : Bi-level Learning Framework for OOD Generalization Input : Step sizes α , β , γ ; A set of training environments Etr = { ei } Ni=1 Initialize : θ and q = [ q 1 , q ⊗ 1 , · · · , q N , q ⊗ N ] 1 : while not done do 2 : for all ei ∈ Etr do 3 : φi = θ − α∇θLei ( fθ ) { Inner-loop optimization for a shallow model } 4 : ej ∼ Etr \ ei { Sample training environment ej } 5 : G i→j , G ⊗ i→j = Partition ( fφi , ej ) { Partition ej into G i→j and G ⊗ i→j } 6 : q j ← q j exp ( γLG i→j ( fφi ) ) , q ⊗ i ← q ⊗ i exp ( γLG⊗i→j ( fφi ) ) { Update group weights } 7 : end for 8 : q ← q/ ∑ i ( q i + q ⊗ i ) { Normalize group weights q } 9 : θ ← θ − β ∇θ ∑ i ∑ j q j LG i→j ( fφi|θ ) + q ⊗ j LG⊗i→j ( fφi|θ ) { Outer-loop optimization } 10 : end while surface form information while fθ is still conditioned on the previously learned θ . This temporarily trained shallow model parameter φi , which are optimized for surface patterns of ei , is updated by following stochastic gradient descent ( SGD ) step : φi = θ − α∇θLei ( fθ ) ( 1 ) where α is a step size for the inner optimization , and Lei ( fθ ) is an expected loss of fθ over the data sampled from ei . We show only a single gradient update procedure in Equation 1 for the notational simplicity . Batch-wise dynamic data re-grouping After a biased classifier fφi is trained for the environment ei , we dynamically re-partition all other training environments in the batch . The fφi is applied to all other environments ej in the batch , where j 6= i , and according to its prediction correctness , samples in each environment ej are re-grouped into two parts , a correctly predicted sample group G i→j and a incorrectly predicted sample group G⊗i→j . These dynamically partitioned groups are then used for training a stable classifier by minimizing the worst-case risk over these groups in the outer-level . As a similar group-based de-biasing approach , Predict then Interpolate ( PI ) ( Bao et al. , 2021 ) also uses a biased classifier for re-partitioning other environments . Its main difference compared to our method is that they fully train a separate model with the entire dataset and use it for partitioning all environments into static groups . Once their data groups are statically assigned , it is fixed throughout the optimization process of group DRO . Although PI has shown its theoretical and empirical effectiveness as a de-biasing method , its static grouping strategy , which relies on a fully-trained biased classifier , constrains it from discovering multiple types of spurious correlations in the environments . In contrast , our framework uses a shallow model , which is trained with a small subset of each environment in the batch . Since we are using a different biased classifier per batch , we are continuously learning a bias and producing new data partitions for each batch , representing our dynamic data re-grouping strategy . This dynamic re-grouping strategy provides various group combinations for the outer-level optimization process , so that it can effectively remove various types of biases in the environments . Furthermore , since our shallow model has overfitted to the surface patterns in a small subset of data , it is more likely to capture multiple types of bias in the environments , as shown in other research ( Utama et al. , 2020a ) . This property can be a disadvantage for a de-biasing method , which applies re-weighting to the biased examples , because it reduces the effective training data size for a model . However , in our approach , it enables us to uncover multiple types of biases in the dataset . Because , multiple types of biases can be considered while minimizing the worst-case risk over various types of group configurations . | The paper studies the problem of OOD classification: the test data and training data distribution can have different spurious feature-class dependencies. The goal is to have high test accuracy of a model trained in one environment. The paper designs a bi-level optimization problem: the lower-level is to re-group data in an environment (distribution) into two groups (correct and incorrect predictions), and the upper-level is to train a model that has different weights over the two groups to focus on the examples that have the changed spurious feature-class dependencies. Experiments on two real-world datasets and synthetic datasets show significantly improved OOD accuracy. There is no theoretical analysis of the method. | SP:3959ff87954807a09493780c52048d84ef7320f8 |
Context-Aware Sparse Deep Coordination Graphs | Learning sparse coordination graphs adaptive to the coordination dynamics among agents is a long-standing problem in cooperative multi-agent learning . This paper studies this problem and proposes a novel method using the variance of payoff functions to construct context-aware sparse coordination topologies . We theoretically consolidate our method by proving that the smaller the variance of payoff functions is , the less likely action selection will change after removing the corresponding edge . Moreover , we propose to learn action representations to effectively reduce the influence of payoff functions ’ estimation errors on graph construction . To empirically evaluate our method , we present the Multi-Agent COordination ( MACO ) benchmark by collecting classic coordination problems in the literature , increasing their difficulty , and classifying them into different types . We carry out a case study and experiments on the MACO and StarCraft II micromanagement benchmark to demonstrate the dynamics of sparse graph learning , the influence of graph sparseness , and the learning performance of our method . 1 INTRODUCTION . Many real-world problems involve the cooperation of multiple agents , such as unmanned aerial vehicles ( Pham et al. , 2018 ; Xu et al. , 2018 ) and sensor networks ( Stranders et al. , 2009 ) . Like in single-agent settings , learning control policies for multi-agent teams largely relies on the estimation of action-value functions , no matter in value-based ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; 2020 ) or policy-based approaches ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Wang et al. , 2021c ) . However , learning action-value functions for complex multi-agent tasks remains a major challenge . Learning individual action-value functions ( Tan , 1993 ) is scalable but suffers from learning non-stationarity because it treats other learning agents as part of its environment . Joint action-value learning ( Claus & Boutilier , 1998 ) is free from learning non-stationarity but requires access to global information that is often unavailable during execution due to partial observability and communication constraints . Factored Q-learning ( Guestrin et al. , 2002a ) combines the advantages of these two methods . Learning the global action-value function as a combination of local utilities , factored Q functions maintain learning scalability while avoiding non-stationarity . Enjoying these advantages , fully decomposed Q functions significantly contribute to the recent progress of multi-agent reinforcement learning ( Samvelyan et al. , 2019 ; Wang et al. , 2021b ) . However , when fully decomposed , local utility functions only depend on local observations and actions , which may lead to miscoordination problems in partially observable environments with stochastic transition functions ( Wang et al. , 2020 ; 2021a ) and a gametheoretical pathology called relative overgeneralization ( Panait et al. , 2006 ; Böhmer et al. , 2020 ) . Relative overgeneralization renders optimal decentralized policies unlearnable when the employed value function does not have enough representational capacity to distinguish other agents ’ effects on local utility functions . Coordination graphs ( Guestrin et al. , 2002b ) provide a promising approach to solving these problems . Using vertices to represent agents and ( hyper- ) edges to represent payoff functions defined over the joint action-observation space of the connected agents , a coordination graph expresses a higher-order value decomposition among agents . Finding actions with the maximum value in a coordination graph can be achieved by distributed constraint optimization ( DCOP ) algorithms ( Cheng , 2012 ) , which consists of multiple rounds of message passing along the edges . Recently , DCG ( Böhmer et al. , 2020 ) scales coordination graphs to large state-action spaces , shows its ability to solve the problem of relative overgeneralization , and obtains competitive results on StarCraft II micromanagement tasks . However , DCG focuses on predefined static and dense topologies , which largely lack flexibility for dynamic environments and induce intensive and inefficient message passing . The question is how to learn dynamic and sparse coordination graphs sufficient for coordinated action selection . This is a long-standing problem in multi-agent learning . Sparse cooperative Q-learning ( Kok & Vlassis , 2006 ) learns value functions for sparse coordination graphs , but the graph topology is static and predefined by prior knowledge . Zhang & Lesser ( 2013 ) propose to learn minimized dynamic coordination sets for each agent , but the computational complexity grows exponentially with the neighborhood size of an agent . Recently , Castellini et al . ( 2019 ) study the representational capability of several sparse graphs but focus on random topologies and stateless games . In this paper , we push these previous works further by proposing a novel deep method that learns context-aware sparse coordination graphs adaptive to the dynamic coordination requirements . For learning sparse coordination graphs , we propose to use the variance of pairwise payoff functions as an indicator to select edges . Sparse graphs are used when selecting greedy joint actions for execution and the update of Q-function . We provide a theoretical insight into our method by proving that the probability of greedy action selection changing after an edge is removed decreases with the variance of the corresponding payoff function . Despite the advantages of sparse topologies , they raise the concern of learning instability . To solve this problem , we further equip our method with network structures based on action representations for utility and payoff learning to reduce the influence of estimation errors on sparse topologies learning . We call the overall learning framework Context-Aware SparsE Coordination graphs ( CASEC ) . For evaluation , we present the Multi-Agent COordination ( MACO ) benchmark . This benchmark collects classic coordination problems raised in the literature of multi-agent learning , increases their difficulty , and classifies them into 6 classes . Each task in the benchmark represents a type of problem . We carry out a case study on the MACO benchmark to show that CASEC can discover the coordination dependence among agents under different situations and to analyze how the graph sparsity influences action coordination . We further show that CASEC can largely reduce the communication cost ( typically by 50 % ) and perform significantly better than dense , static graphs and several alternative methods for building sparse graphs . We then test CASEC on the StarCraft II micromanagement benchmark ( Samvelyan et al. , 2019 ) to demonstrate its scalability and effectiveness . 2 BACKGROUND . In this paper , we focus on fully cooperative multi-agent tasks that can be modelled as a DecPOMDP ( Oliehoek et al. , 2016 ) consisting of a tuple G=⟨I , S , A , P , R , Ω , O , n , γ⟩ , where I is the finite set of n agents , γ ∈ [ 0 , 1 ) is the discount factor , and s ∈ S is the true state of the environment . At each timestep , each agent i receives an observation oi ∈ Ω drawn according to the observation function O ( s , i ) and selects an action ai ∈ A . Individual actions form a joint action a ∈ An , which leads to a next state s′ according to the transition function P ( s′|s , a ) , a reward r = R ( s , a ) shared by all agents . Each agent has local action-observation history τi ∈ T ≡ ( Ω×A ) ∗ × Ω . Agents learn to collectively maximize the global return Qtot ( s , a ) = Es0 : ∞ , a0 : ∞ [ ∑∞ t=0 γ tR ( st , at ) |s0 = s , a0 = a ] . In a coordination graph ( Guestrin et al. , 2002b ) G = ⟨V , E⟩ , each vertex vi ∈ V represents an agent i , and ( hyper- ) edges in E represent coordination dependencies among agents . In this paper , we consider pairwise edges , and such a coordination graph induces a factorization of the global Q : Qtot ( τ , a ) = 1 |V| ∑ i qi ( τi , ai ) + 1 |E| ∑ { i , j } ∈E qij ( τij , aij ) , ( 1 ) where qi and qij is utility functions for individual agents and pairwise payoff functions , respectively . τij = ⟨τi , τj⟩ and aij = ⟨ai , aj⟩ is the joint action-observation history and action of agent i and j . Within a coordination graph , the greedy action selection required by Q-learning can not be completed by simply computing the maximum of individual utility and payoff functions . Instead , distributed constraint optimization ( DCOP ) ( Cheng , 2012 ) techniques can be used . Max-Sum ( Stranders et al. , 2009 ) is a popular implementation of DCOP , which finds optimal actions on a coordination graph G = ⟨V , E⟩ via multi-round message passing on a bipartite graph Gm = ⟨Va , Vq , Em⟩ . Each node i ∈ Va represents an agent , and each node g ∈ Vq represents a utility ( qi ) or payoff ( qij ) function . Edges in Em connect g with the corresponding agent node ( s ) . Message passing on this bipartite graph starts with sending messages from node i ∈ Va to node g ∈ Vq : mi→g ( ai ) = ∑ h∈Fi\g mh→i ( ai ) + cig , ( 2 ) where Fi is the set of nodes connected to node i in Vq , and cig is a normalizing factor preventing the value of messages from growing arbitrarily large . The message from node g to node i is : mg→i ( ai ) = max ag\ai q ( ag ) + ∑ h∈Vg\i mh→g ( ah ) , ( 3 ) where Vg is the set of nodes connected to node g in Va , ag= { ah|h ∈ Vg } , ag\ai= { ah|h ∈ Vg\ { i } } , and q represents utility or payoff functions conditioned on ag . After several iterations of message passing , each agent i can find its optimal action by calculating a∗i = argmaxai ∑ h∈Fi mh→i ( ai ) . A drawback of Max-Sum or other message passing methods ( e.g. , max-plus ( Pearl , 2014 ) ) is that running them for each action selection through the whole system results in intensive computation and communication among agents , which is impractical for most applications with limited computational resources and communication bandwidth . In the following sections , we discuss how to solve this problem by learning sparse coordination graphs . Previous works ( Naderializadeh et al. , 2020 ; Li et al. , 2021 ) study soft versions of fully-connected coordination graphs based on attention mechanisms . Specifically , Li et al . ( 2021 ) uses graphs whose edge weights are learned by self-attention so that agents attend to observations of other agents differently . The information is used in local actors or a centralized critic . Naderializadeh et al . ( 2020 ) learns soft full graphs in a similar way , but the graph is used to mix local utilities conditioned on local action-observation history . Different from our work , these methods do not learn pairwise payoff functions , and the learned graphs are still fully-connected . 3 LEARNING CONTEXT-AWARE SPARSE GRAPHS . In this section , we introduce our methods for learning context-aware sparse graphs . We first introduce how we construct a sparse graph for effective action selection in Sec . 3.1 . After that , we introduce our learning framework in Sec . 3.2 . Although sparse graphs can reduce communication overhead , they raise the concern of learning instability . We discuss this problem and how to alleviate it in Sec . 3.3 . | The paper introduces a technique called CASEC to train deep coordination graphs with sparse connectivity and a dynamic method to remove a fixed number of edges during inference. The latter removes edges in order of smallest variance of the corresponding payoff functions, which the authors motivate with a theoretical statement on the probability of changing the optimal action after removing an edge. CASEC is evaluated on a novel benchmark suit (MACO) for coordination dilemmas and StarCraft II micromanagement tasks. The proposed methods outperforms the baseline (DCG) in 2 out of 6 MACO tasks and shows in particular a clear advantage of the used action encoding method in StarCraft II. | SP:0536b15b3f25d29ed9976b178e9d13ee43a080c2 |
Context-Aware Sparse Deep Coordination Graphs | Learning sparse coordination graphs adaptive to the coordination dynamics among agents is a long-standing problem in cooperative multi-agent learning . This paper studies this problem and proposes a novel method using the variance of payoff functions to construct context-aware sparse coordination topologies . We theoretically consolidate our method by proving that the smaller the variance of payoff functions is , the less likely action selection will change after removing the corresponding edge . Moreover , we propose to learn action representations to effectively reduce the influence of payoff functions ’ estimation errors on graph construction . To empirically evaluate our method , we present the Multi-Agent COordination ( MACO ) benchmark by collecting classic coordination problems in the literature , increasing their difficulty , and classifying them into different types . We carry out a case study and experiments on the MACO and StarCraft II micromanagement benchmark to demonstrate the dynamics of sparse graph learning , the influence of graph sparseness , and the learning performance of our method . 1 INTRODUCTION . Many real-world problems involve the cooperation of multiple agents , such as unmanned aerial vehicles ( Pham et al. , 2018 ; Xu et al. , 2018 ) and sensor networks ( Stranders et al. , 2009 ) . Like in single-agent settings , learning control policies for multi-agent teams largely relies on the estimation of action-value functions , no matter in value-based ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; 2020 ) or policy-based approaches ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Wang et al. , 2021c ) . However , learning action-value functions for complex multi-agent tasks remains a major challenge . Learning individual action-value functions ( Tan , 1993 ) is scalable but suffers from learning non-stationarity because it treats other learning agents as part of its environment . Joint action-value learning ( Claus & Boutilier , 1998 ) is free from learning non-stationarity but requires access to global information that is often unavailable during execution due to partial observability and communication constraints . Factored Q-learning ( Guestrin et al. , 2002a ) combines the advantages of these two methods . Learning the global action-value function as a combination of local utilities , factored Q functions maintain learning scalability while avoiding non-stationarity . Enjoying these advantages , fully decomposed Q functions significantly contribute to the recent progress of multi-agent reinforcement learning ( Samvelyan et al. , 2019 ; Wang et al. , 2021b ) . However , when fully decomposed , local utility functions only depend on local observations and actions , which may lead to miscoordination problems in partially observable environments with stochastic transition functions ( Wang et al. , 2020 ; 2021a ) and a gametheoretical pathology called relative overgeneralization ( Panait et al. , 2006 ; Böhmer et al. , 2020 ) . Relative overgeneralization renders optimal decentralized policies unlearnable when the employed value function does not have enough representational capacity to distinguish other agents ’ effects on local utility functions . Coordination graphs ( Guestrin et al. , 2002b ) provide a promising approach to solving these problems . Using vertices to represent agents and ( hyper- ) edges to represent payoff functions defined over the joint action-observation space of the connected agents , a coordination graph expresses a higher-order value decomposition among agents . Finding actions with the maximum value in a coordination graph can be achieved by distributed constraint optimization ( DCOP ) algorithms ( Cheng , 2012 ) , which consists of multiple rounds of message passing along the edges . Recently , DCG ( Böhmer et al. , 2020 ) scales coordination graphs to large state-action spaces , shows its ability to solve the problem of relative overgeneralization , and obtains competitive results on StarCraft II micromanagement tasks . However , DCG focuses on predefined static and dense topologies , which largely lack flexibility for dynamic environments and induce intensive and inefficient message passing . The question is how to learn dynamic and sparse coordination graphs sufficient for coordinated action selection . This is a long-standing problem in multi-agent learning . Sparse cooperative Q-learning ( Kok & Vlassis , 2006 ) learns value functions for sparse coordination graphs , but the graph topology is static and predefined by prior knowledge . Zhang & Lesser ( 2013 ) propose to learn minimized dynamic coordination sets for each agent , but the computational complexity grows exponentially with the neighborhood size of an agent . Recently , Castellini et al . ( 2019 ) study the representational capability of several sparse graphs but focus on random topologies and stateless games . In this paper , we push these previous works further by proposing a novel deep method that learns context-aware sparse coordination graphs adaptive to the dynamic coordination requirements . For learning sparse coordination graphs , we propose to use the variance of pairwise payoff functions as an indicator to select edges . Sparse graphs are used when selecting greedy joint actions for execution and the update of Q-function . We provide a theoretical insight into our method by proving that the probability of greedy action selection changing after an edge is removed decreases with the variance of the corresponding payoff function . Despite the advantages of sparse topologies , they raise the concern of learning instability . To solve this problem , we further equip our method with network structures based on action representations for utility and payoff learning to reduce the influence of estimation errors on sparse topologies learning . We call the overall learning framework Context-Aware SparsE Coordination graphs ( CASEC ) . For evaluation , we present the Multi-Agent COordination ( MACO ) benchmark . This benchmark collects classic coordination problems raised in the literature of multi-agent learning , increases their difficulty , and classifies them into 6 classes . Each task in the benchmark represents a type of problem . We carry out a case study on the MACO benchmark to show that CASEC can discover the coordination dependence among agents under different situations and to analyze how the graph sparsity influences action coordination . We further show that CASEC can largely reduce the communication cost ( typically by 50 % ) and perform significantly better than dense , static graphs and several alternative methods for building sparse graphs . We then test CASEC on the StarCraft II micromanagement benchmark ( Samvelyan et al. , 2019 ) to demonstrate its scalability and effectiveness . 2 BACKGROUND . In this paper , we focus on fully cooperative multi-agent tasks that can be modelled as a DecPOMDP ( Oliehoek et al. , 2016 ) consisting of a tuple G=⟨I , S , A , P , R , Ω , O , n , γ⟩ , where I is the finite set of n agents , γ ∈ [ 0 , 1 ) is the discount factor , and s ∈ S is the true state of the environment . At each timestep , each agent i receives an observation oi ∈ Ω drawn according to the observation function O ( s , i ) and selects an action ai ∈ A . Individual actions form a joint action a ∈ An , which leads to a next state s′ according to the transition function P ( s′|s , a ) , a reward r = R ( s , a ) shared by all agents . Each agent has local action-observation history τi ∈ T ≡ ( Ω×A ) ∗ × Ω . Agents learn to collectively maximize the global return Qtot ( s , a ) = Es0 : ∞ , a0 : ∞ [ ∑∞ t=0 γ tR ( st , at ) |s0 = s , a0 = a ] . In a coordination graph ( Guestrin et al. , 2002b ) G = ⟨V , E⟩ , each vertex vi ∈ V represents an agent i , and ( hyper- ) edges in E represent coordination dependencies among agents . In this paper , we consider pairwise edges , and such a coordination graph induces a factorization of the global Q : Qtot ( τ , a ) = 1 |V| ∑ i qi ( τi , ai ) + 1 |E| ∑ { i , j } ∈E qij ( τij , aij ) , ( 1 ) where qi and qij is utility functions for individual agents and pairwise payoff functions , respectively . τij = ⟨τi , τj⟩ and aij = ⟨ai , aj⟩ is the joint action-observation history and action of agent i and j . Within a coordination graph , the greedy action selection required by Q-learning can not be completed by simply computing the maximum of individual utility and payoff functions . Instead , distributed constraint optimization ( DCOP ) ( Cheng , 2012 ) techniques can be used . Max-Sum ( Stranders et al. , 2009 ) is a popular implementation of DCOP , which finds optimal actions on a coordination graph G = ⟨V , E⟩ via multi-round message passing on a bipartite graph Gm = ⟨Va , Vq , Em⟩ . Each node i ∈ Va represents an agent , and each node g ∈ Vq represents a utility ( qi ) or payoff ( qij ) function . Edges in Em connect g with the corresponding agent node ( s ) . Message passing on this bipartite graph starts with sending messages from node i ∈ Va to node g ∈ Vq : mi→g ( ai ) = ∑ h∈Fi\g mh→i ( ai ) + cig , ( 2 ) where Fi is the set of nodes connected to node i in Vq , and cig is a normalizing factor preventing the value of messages from growing arbitrarily large . The message from node g to node i is : mg→i ( ai ) = max ag\ai q ( ag ) + ∑ h∈Vg\i mh→g ( ah ) , ( 3 ) where Vg is the set of nodes connected to node g in Va , ag= { ah|h ∈ Vg } , ag\ai= { ah|h ∈ Vg\ { i } } , and q represents utility or payoff functions conditioned on ag . After several iterations of message passing , each agent i can find its optimal action by calculating a∗i = argmaxai ∑ h∈Fi mh→i ( ai ) . A drawback of Max-Sum or other message passing methods ( e.g. , max-plus ( Pearl , 2014 ) ) is that running them for each action selection through the whole system results in intensive computation and communication among agents , which is impractical for most applications with limited computational resources and communication bandwidth . In the following sections , we discuss how to solve this problem by learning sparse coordination graphs . Previous works ( Naderializadeh et al. , 2020 ; Li et al. , 2021 ) study soft versions of fully-connected coordination graphs based on attention mechanisms . Specifically , Li et al . ( 2021 ) uses graphs whose edge weights are learned by self-attention so that agents attend to observations of other agents differently . The information is used in local actors or a centralized critic . Naderializadeh et al . ( 2020 ) learns soft full graphs in a similar way , but the graph is used to mix local utilities conditioned on local action-observation history . Different from our work , these methods do not learn pairwise payoff functions , and the learned graphs are still fully-connected . 3 LEARNING CONTEXT-AWARE SPARSE GRAPHS . In this section , we introduce our methods for learning context-aware sparse graphs . We first introduce how we construct a sparse graph for effective action selection in Sec . 3.1 . After that , we introduce our learning framework in Sec . 3.2 . Although sparse graphs can reduce communication overhead , they raise the concern of learning instability . We discuss this problem and how to alleviate it in Sec . 3.3 . | The paper proposes to use the variance of the payoffs functions to learn dynamic coordination graphs, i.e. coordination graphs that might change in structure at each time step of the rollout. The empirical evaluation is carried out on a newly proposed MACO benchmark as well as some levels from the Starcraft II SMAC benchmark. | SP:0536b15b3f25d29ed9976b178e9d13ee43a080c2 |
Context-Aware Sparse Deep Coordination Graphs | Learning sparse coordination graphs adaptive to the coordination dynamics among agents is a long-standing problem in cooperative multi-agent learning . This paper studies this problem and proposes a novel method using the variance of payoff functions to construct context-aware sparse coordination topologies . We theoretically consolidate our method by proving that the smaller the variance of payoff functions is , the less likely action selection will change after removing the corresponding edge . Moreover , we propose to learn action representations to effectively reduce the influence of payoff functions ’ estimation errors on graph construction . To empirically evaluate our method , we present the Multi-Agent COordination ( MACO ) benchmark by collecting classic coordination problems in the literature , increasing their difficulty , and classifying them into different types . We carry out a case study and experiments on the MACO and StarCraft II micromanagement benchmark to demonstrate the dynamics of sparse graph learning , the influence of graph sparseness , and the learning performance of our method . 1 INTRODUCTION . Many real-world problems involve the cooperation of multiple agents , such as unmanned aerial vehicles ( Pham et al. , 2018 ; Xu et al. , 2018 ) and sensor networks ( Stranders et al. , 2009 ) . Like in single-agent settings , learning control policies for multi-agent teams largely relies on the estimation of action-value functions , no matter in value-based ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; 2020 ) or policy-based approaches ( Lowe et al. , 2017 ; Foerster et al. , 2018 ; Wang et al. , 2021c ) . However , learning action-value functions for complex multi-agent tasks remains a major challenge . Learning individual action-value functions ( Tan , 1993 ) is scalable but suffers from learning non-stationarity because it treats other learning agents as part of its environment . Joint action-value learning ( Claus & Boutilier , 1998 ) is free from learning non-stationarity but requires access to global information that is often unavailable during execution due to partial observability and communication constraints . Factored Q-learning ( Guestrin et al. , 2002a ) combines the advantages of these two methods . Learning the global action-value function as a combination of local utilities , factored Q functions maintain learning scalability while avoiding non-stationarity . Enjoying these advantages , fully decomposed Q functions significantly contribute to the recent progress of multi-agent reinforcement learning ( Samvelyan et al. , 2019 ; Wang et al. , 2021b ) . However , when fully decomposed , local utility functions only depend on local observations and actions , which may lead to miscoordination problems in partially observable environments with stochastic transition functions ( Wang et al. , 2020 ; 2021a ) and a gametheoretical pathology called relative overgeneralization ( Panait et al. , 2006 ; Böhmer et al. , 2020 ) . Relative overgeneralization renders optimal decentralized policies unlearnable when the employed value function does not have enough representational capacity to distinguish other agents ’ effects on local utility functions . Coordination graphs ( Guestrin et al. , 2002b ) provide a promising approach to solving these problems . Using vertices to represent agents and ( hyper- ) edges to represent payoff functions defined over the joint action-observation space of the connected agents , a coordination graph expresses a higher-order value decomposition among agents . Finding actions with the maximum value in a coordination graph can be achieved by distributed constraint optimization ( DCOP ) algorithms ( Cheng , 2012 ) , which consists of multiple rounds of message passing along the edges . Recently , DCG ( Böhmer et al. , 2020 ) scales coordination graphs to large state-action spaces , shows its ability to solve the problem of relative overgeneralization , and obtains competitive results on StarCraft II micromanagement tasks . However , DCG focuses on predefined static and dense topologies , which largely lack flexibility for dynamic environments and induce intensive and inefficient message passing . The question is how to learn dynamic and sparse coordination graphs sufficient for coordinated action selection . This is a long-standing problem in multi-agent learning . Sparse cooperative Q-learning ( Kok & Vlassis , 2006 ) learns value functions for sparse coordination graphs , but the graph topology is static and predefined by prior knowledge . Zhang & Lesser ( 2013 ) propose to learn minimized dynamic coordination sets for each agent , but the computational complexity grows exponentially with the neighborhood size of an agent . Recently , Castellini et al . ( 2019 ) study the representational capability of several sparse graphs but focus on random topologies and stateless games . In this paper , we push these previous works further by proposing a novel deep method that learns context-aware sparse coordination graphs adaptive to the dynamic coordination requirements . For learning sparse coordination graphs , we propose to use the variance of pairwise payoff functions as an indicator to select edges . Sparse graphs are used when selecting greedy joint actions for execution and the update of Q-function . We provide a theoretical insight into our method by proving that the probability of greedy action selection changing after an edge is removed decreases with the variance of the corresponding payoff function . Despite the advantages of sparse topologies , they raise the concern of learning instability . To solve this problem , we further equip our method with network structures based on action representations for utility and payoff learning to reduce the influence of estimation errors on sparse topologies learning . We call the overall learning framework Context-Aware SparsE Coordination graphs ( CASEC ) . For evaluation , we present the Multi-Agent COordination ( MACO ) benchmark . This benchmark collects classic coordination problems raised in the literature of multi-agent learning , increases their difficulty , and classifies them into 6 classes . Each task in the benchmark represents a type of problem . We carry out a case study on the MACO benchmark to show that CASEC can discover the coordination dependence among agents under different situations and to analyze how the graph sparsity influences action coordination . We further show that CASEC can largely reduce the communication cost ( typically by 50 % ) and perform significantly better than dense , static graphs and several alternative methods for building sparse graphs . We then test CASEC on the StarCraft II micromanagement benchmark ( Samvelyan et al. , 2019 ) to demonstrate its scalability and effectiveness . 2 BACKGROUND . In this paper , we focus on fully cooperative multi-agent tasks that can be modelled as a DecPOMDP ( Oliehoek et al. , 2016 ) consisting of a tuple G=⟨I , S , A , P , R , Ω , O , n , γ⟩ , where I is the finite set of n agents , γ ∈ [ 0 , 1 ) is the discount factor , and s ∈ S is the true state of the environment . At each timestep , each agent i receives an observation oi ∈ Ω drawn according to the observation function O ( s , i ) and selects an action ai ∈ A . Individual actions form a joint action a ∈ An , which leads to a next state s′ according to the transition function P ( s′|s , a ) , a reward r = R ( s , a ) shared by all agents . Each agent has local action-observation history τi ∈ T ≡ ( Ω×A ) ∗ × Ω . Agents learn to collectively maximize the global return Qtot ( s , a ) = Es0 : ∞ , a0 : ∞ [ ∑∞ t=0 γ tR ( st , at ) |s0 = s , a0 = a ] . In a coordination graph ( Guestrin et al. , 2002b ) G = ⟨V , E⟩ , each vertex vi ∈ V represents an agent i , and ( hyper- ) edges in E represent coordination dependencies among agents . In this paper , we consider pairwise edges , and such a coordination graph induces a factorization of the global Q : Qtot ( τ , a ) = 1 |V| ∑ i qi ( τi , ai ) + 1 |E| ∑ { i , j } ∈E qij ( τij , aij ) , ( 1 ) where qi and qij is utility functions for individual agents and pairwise payoff functions , respectively . τij = ⟨τi , τj⟩ and aij = ⟨ai , aj⟩ is the joint action-observation history and action of agent i and j . Within a coordination graph , the greedy action selection required by Q-learning can not be completed by simply computing the maximum of individual utility and payoff functions . Instead , distributed constraint optimization ( DCOP ) ( Cheng , 2012 ) techniques can be used . Max-Sum ( Stranders et al. , 2009 ) is a popular implementation of DCOP , which finds optimal actions on a coordination graph G = ⟨V , E⟩ via multi-round message passing on a bipartite graph Gm = ⟨Va , Vq , Em⟩ . Each node i ∈ Va represents an agent , and each node g ∈ Vq represents a utility ( qi ) or payoff ( qij ) function . Edges in Em connect g with the corresponding agent node ( s ) . Message passing on this bipartite graph starts with sending messages from node i ∈ Va to node g ∈ Vq : mi→g ( ai ) = ∑ h∈Fi\g mh→i ( ai ) + cig , ( 2 ) where Fi is the set of nodes connected to node i in Vq , and cig is a normalizing factor preventing the value of messages from growing arbitrarily large . The message from node g to node i is : mg→i ( ai ) = max ag\ai q ( ag ) + ∑ h∈Vg\i mh→g ( ah ) , ( 3 ) where Vg is the set of nodes connected to node g in Va , ag= { ah|h ∈ Vg } , ag\ai= { ah|h ∈ Vg\ { i } } , and q represents utility or payoff functions conditioned on ag . After several iterations of message passing , each agent i can find its optimal action by calculating a∗i = argmaxai ∑ h∈Fi mh→i ( ai ) . A drawback of Max-Sum or other message passing methods ( e.g. , max-plus ( Pearl , 2014 ) ) is that running them for each action selection through the whole system results in intensive computation and communication among agents , which is impractical for most applications with limited computational resources and communication bandwidth . In the following sections , we discuss how to solve this problem by learning sparse coordination graphs . Previous works ( Naderializadeh et al. , 2020 ; Li et al. , 2021 ) study soft versions of fully-connected coordination graphs based on attention mechanisms . Specifically , Li et al . ( 2021 ) uses graphs whose edge weights are learned by self-attention so that agents attend to observations of other agents differently . The information is used in local actors or a centralized critic . Naderializadeh et al . ( 2020 ) learns soft full graphs in a similar way , but the graph is used to mix local utilities conditioned on local action-observation history . Different from our work , these methods do not learn pairwise payoff functions , and the learned graphs are still fully-connected . 3 LEARNING CONTEXT-AWARE SPARSE GRAPHS . In this section , we introduce our methods for learning context-aware sparse graphs . We first introduce how we construct a sparse graph for effective action selection in Sec . 3.1 . After that , we introduce our learning framework in Sec . 3.2 . Although sparse graphs can reduce communication overhead , they raise the concern of learning instability . We discuss this problem and how to alleviate it in Sec . 3.3 . | The paper focuses on the problem of cooperative multi-agent Reinforcement learning and proposes a novel way to learn the dynamic (state dependent) coordination graph for the joint action selection from factorized joint value representations. The key idea here is to use the variance in payoff function estimates can be a good indicator for whether a coordination graph edge should be present or not. However, given the deep RL goal is learn these payoff functions there is a cyclic dependency between errors from payoff estimation and coordination graph estimation. The paper therefore also proposes an alternative action representation scheme that helps mitigate some of these problems. The paper evaluates the proposed approach on many classic coordination problems as well as subset of SMAC benchmark tasks. | SP:0536b15b3f25d29ed9976b178e9d13ee43a080c2 |
Gradient-based Counterfactual Explanations using Tractable Probabilistic Models | 1 INTRODUCTION . Explaining decisions made by intelligent systems , especially black-box models , is important . First of all , a model that can explain their decisions is more likely to gain human trust , especially if there are significant consequences for incorrect results , or the problem has not been sufficiently studied and validated in real-world applications ( Simpson , 2007 ; Hoffman et al. , 2013 ; Doshi-Velez & Kim , 2017 ) . Secondly , explanations can promote fairness by exposing bias towards protected attributes in the system ( Prates et al. , 2019 ; Buolamwini & Gebru , 2018 ; Obermeyer et al. , 2019 ) . In addition , explanations are a helpful tool for debugging purpose ( Holte , 1993 ; Freitas , 2014 ; Rudin , 2019 ) . Counterfactuals are closely related to classes of explanation , which much of the early work in AI on explaining the decisions made by an expert or rule-based systems focused on ( Wachter et al. , 2017 ) . As the name implies , counterfactual is an alternative example counter to the fact which takes the form “ If X had not occurred , Y would not have occurred ” . Explicitly establishing the connection between counterfactuals and explanations , Wachter et al . ( 2017 ) concluded that counterfactual explanations can bridge the gap between the interests of data subjects and data controllers that otherwise acts as a barrier to a legally binding right to explanation . They further formulate the problem of finding counterfactual explanations as an optimization task that minimizes the loss of a desired outcome w.r.t . an alternative input combined with regularization for distance to the query example . In a similar vein , the dominant majority of recent counterfactual explanation methods are proposed based on their adapted objective functions for optimization . Unfortunately , these deep learning approaches have some downsides : First of all , they are very time-consuming for generating explanations due to the iterative optimization process , because for every optimization iteration the model needs to be evaluated at least once and it may take a lot of iterations until a candidate is found . Secondly , the objective function is usually highly non-convex , which makes it more tricky to find a satisfying solution in practice . Thirdly , the optimizer involves additional hyperparameters that need to be carefully selected , such as learning rate . Furthermore , although these methods optimize for the ” closest possible world ” by constraining the distance of the counterfactual to the query instance , they are still not aware of the underlying density and the data manifold . As a direct consequence , the counterfactuals often appear rather unnatural and unrealistic although they are as close as possible to the query instance . See figure 3 for example . This imposes difficulties for humans to understand the explanations . As Nickerson ( 1998 ) argues , humans exhibit confirmation bias , meaning that we tend to ignore information that is inconsistent with our prior beliefs . In analogy , unrealistic counterfactuals also have very limited effect for communicating explanations to humans . To improve upon these limitations , we propose a novel approach to generate counterfactual explanations . Unlike the overwhelmingly dominant deep learning approach , we decouple the goal of perturbing the prediction and maintaining an additional constraint on the perturbation . Specifically , we view the task as a two-step process , whereby the first step is to perturb a sample towards a desired class and the second step is to constrain the perturbed sample to be close to the data manifold so it is realistic and natural . The first goal aligns with adversarial attacks ( Goodfellow et al. , 2015 ; Brown et al. , 2017 ; Yuan et al. , 2019 ) , where a small perturbation is computed to perturb the prediction . In the literature there are gradient-based methods ( Kurakin et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ) and optimization-based methods ( Szegedy et al. , 2013 ; Carlini & Wagner , 2017 ) . Exploiting the fact that gradient corresponds to the direction of steepest ascent , gradient-based perturbation is not only very easy to implement with current deep learning frameworks , but also much faster to compute compared to optimization-based perturbation . Therefore we adopt a gradient-based approach for the first step . To ensure the quality and effectiveness of the second step , we learn a sum-productnetwork ( SPN ) ( Poon & Domingos , 2011 ) , a tractable density model , on the input , and we perturb the example further based on the gradient that directs to steepest ascent of likelihood , evaluated on the SPN . In summary , we make the following contributions : 1 . We propose the first approach for generating counterfactual examples using probabilistic circuits to ensure density-awareness in a tractable way . 2 . We experiment with complex and high-dimensional real-world dataset , which was not dealt with using domain-agnostic methods in the literature . 3 . We give empirical evidence to demonstrate the advantages and effectiveness of our approach : visually appealing examples with high density , fast computation , and high success rate . We proceed as follows : First , we give an overview of the literature and summarize the shortcomings of the existing approaches . Then we introduce RAT-SPNs , preparing for presenting our approach . Finally , we evaluate our approach via empirical evidence and conclude our work . 2 RELATED WORK ON COUNTERFACTUAL EXPLANATIONS . Research attention on counterfactual explanations has been increasingly raised since Wachter et al . ( 2017 ) presented the concept of unconditional counterfactual explanations as a novel type of explanation of automated decisions . Identifying the resemblance between counterfactual explanations and adversarial perturbations , Wachter et al . ( 2017 ) proposed to generate counterfactual explanations based on the optimisation techniques used in the adversarial perturbation literature . Specifically , a loss function is minimized w.r.t . its input , using standard gradient-based techniques , for a desired output and a regularizer penalizing the distance between the counterfactual and the query . Following Wachter et al . ( 2017 ) , Mothilal et al . ( 2020 ) augmented the loss with diversity constraint to encourage diverse solutions . However , these approaches do not have explicit knowledge of the underlying density or data manifold , which may lead to unrealistic counterfactual explanations . A bunch of methods counteract this issue by learning an auxiliary generative model to impose additional density constraints on the optimization process . As common choice for density approximator , Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) and its variants ( Klys et al. , 2018 ; Ivanov et al. , 2019 ) are used . For instance , Dhurandhar et al . 2018 proposed contrastive explanations method ( CEM ) for neural networks based on optimization . The objective function consists of a hinge-like loss function and the elastic net regularizer as well as an auxiliary VAE to evaluate the proximity to the data manifold . Ustun et al . 2019 defined the term recourse as the ability of a person to change the decision of a model by altering actionable input variables . Recourse is evaluated by solving an optimization problem . Joshi et al . 2019 provided an algorithm , called REVISE , to suggest a recourse , based on samples from the latent space of a VAE characterizing the data distribution . Pawelczyk et al . 2020 developed a framework , called C-CHVAE , to generate faithful counterfactuals . C-CHVAE trains a VAE and returns the closest counterfactual due to a Figure 1 : The SPN structure used to estimate a distribution as a mixture of classconditional densities . Each class-conditional density is in turn represented by a subSPN . Classification is done via Bayes ’ rule . nearest neighbour style search in the latent space . Downs et al . 2020 proposed another algorithmic recourse generation method , CRUDS , that generates multiple recourses satisfying underlying structure of the data as well as end-user specified constraints . Based on a VAE-variant , CRUDS uses a Conditional Subspace Variational Autoencoder ( CSVAE ) model ( Klys et al. , 2018 ) that is capable of extracting latent features that are relevant for prediction . Another method called CLUE Antorán et al . ( 2020 ) is proposed for interpreting uncertainty estimates from differentiable probabilistic models using counterfactual explanations , by searching in the latent space of a VAE with arbitrary conditioning ( VAEAC ) ( Ivanov et al. , 2019 ) . Poyiadzi et al . 2020 proposed FACE , a graph-based algorithm to generate counterfactuals that are coherent with the underlying data distribution by constructing a graph over all the candidate targets . Besides , several domain-specific approaches are also emerging Olson et al . ( 2021 ) ; Goyal et al . ( 2019 ) ; Chang et al . ( 2019 ) . The aforementioned techniques have the following shortcomings : 1 . The deep learning-like approach ( Wachter et al. , 2017 ; Mothilal et al. , 2020 ; Dhurandhar et al. , 2018 ; Ustun et al. , 2019 ; Joshi et al. , 2019 ) is too slow to generate explanations on the fly due to the iterative optimization process , which in turn comes with additional tuning parameters . 2 . Although highly expressive , neural density estimators such as VAEs are highly intractable , which makes explicit density constraint on counterfactual explanations infeasible ( Dhurandhar et al. , 2018 ; Ivanov et al. , 2019 ; Klys et al. , 2018 ; Joshi et al. , 2019 ; Pawelczyk et al. , 2020 ) . In addition , they come with the overhead of latent representation , which is not necessarily in good quality when maximum likelihood training is used to learn them ( Alemi et al. , 2018 ; Dai & Wipf , 2019 ) . We improve upon the aforementioned shortcomings by proposing the first counterfactual method using tractable probabilistic circuits , specifically sum-product networks ( SPNs ) ( Darwiche , 2003 ; Poon & Domingos , 2011 ) . 3 GRADIENT-BASED COUNTERFACTUAL EXPLANATIONS USING TRACTABLE PROBABILISTIC MODELS . Before explaining our idea , we first introduce the tractable probabilistic models we use . An sum-product network ( SPN ) S over X is a tractable probabilistic model for P ( X ) based on a directed acyclic graph ( DAG ) . This graph indicates computation for probabilistic inference and consists of three types of nodes : univariate leaf nodes , sum nodes , and product nodes . Let ch ( · ) denote the children of a node . A sum node S is weighted sum of its children , i.e . S = ∑ N∈ch ( S ) wS , NN where the weights wS , N are non-negative and sum to 1 , i.e . wS , N ≥ 0 , ∑ N wS , N = 1 . Sum nodes can be viewed as mixtures of their child distributions . A product node P is product of its children , i.e . P = ∏ N∈ch ( P ) N . The root node represents P ( X ) . Products are factorized distributions , implying independence assumption among their children . SPNs allow for fast , exact inference on high-treewidth models . Unlike most of the probabilistic deep learning approaches , SPNs permit exact and efficient inference . Specifically , they are able to compute any marginalization and conditioning query in time linear of the model ’ s representation size . By employing SPNs for deep learning , random and tensorized SPNs ( RAT-SPNs ) ( Peharz et al. , 2020 ) are proposed using a simple approach to construct random SPN structure and combine it with GPU-based optimization . It is worth noting that RAT-SPNs are not fooled by certain out-of-domain image detection tests on which VAEs , normalizing flows ( NFs ) , and auto-regressive density estimators ( ARDEs ) consistently fail ( Choi & Jang , 2018 ; Nalisnick et al. , 2018 ) . To learn the parameters ω of a given RAT-SPN structure S in generative setting to approximate a distribution P ∗ ( X ) , we assume i.i.d . samples X = { x1 , . . . , xN } are given . Then maximum likelihood estimation is employed , i.e . ω = argmax 1N ∑N n=1 logS ( xn ) , where S ( x ) is a distribution over X represented by the RAT-SPN S . Apart from the standard use for density estimation , RAT-SPNs can be used as a generative classifier as well . Consider a classification problem f : Rd → { 1 , . . . , C } with C labels , C roots are used to represent class-conditional densities Sc ( X ) = : S ( X|Y = y ) . The overall density distribution is then given by S ( X ) = ∑ y S ( X|y ) P ( y ) . See figure 1 for illustration . Bayes ’ rule is used to classify a sample x : S ( Y |x ) = S ( x|Y ) P ( Y ) S ( x ) . In other words , a RAT-SPN of this special structure has dual use : It is both a density estimator S ( X ) and a classifier S ( Y |X ) . We will use this model to demonstrate our approach because it can be used for classification and yield tractable density evaluation for free at the same time . However , our approach can be easily extended to deep neural classifiers by training an auxiliary RAT-SPN for density estimation . For more details on RAT-SPN , check out appendix . Our approach is defined as two serial perturbations : In the first step , we maximize log S ( y ′|x ) S ( y|x ) to induce desired outcome y′ , which is equivalent to maximizing log S ( x|y ′ ) S ( x|y ) since log S ( y′|x ) S ( y|x ) = log ( S ( x|y′ ) P ( y′ ) S ( x ) S ( x ) S ( x|y ) P ( y ) ) = log S ( x|y′ ) S ( x|y ) , when assuming a uniform class prior . Towards this end , we take a gradient step towards the steepest ascent of the counterfactual outcome . This results in the perturbed example u where u = x+ ∂ ( logS ( x|y′ ) − logS ( x|y ) ) ∂x ∗ 1 . This step is similar to generating an adversarial perturbation in that the sample u is expected to change the prediction to y′ from y with a very slight change . However , without additional constraints , the perturbed sample u is very likely to deviate from the underlying data manifold . In order to generate in-distribution counterfactuals , we maximize the density P ∗ ( u ) of the current sample u , which is approximated via the SPN S ( u ) . In contrast to the density estimators used primarily in the literature , SPNs have the merit that they allow for tractable density evaluation . To maximize the density S ( u ) , we take another gradient step towards its steepest ascent , i.e . x′ = u+ ∂S ( u ) ∂u ∗ 2. x′ is the final counterfactual explanation for x that yields y′ instead of y . See figure 2 for illustration . | This paper consider the counterfactual generation problem; a counterfactual explanation of an input x with label y is a neighborhood point x' which is classified in the target class y'. This paper proposes a two step approach to generate counterfactual: Step 1: take a gradient step to maximize the likelihood of class y' (conditional) Step 2: take a gradient step to maximize the data likelihood (marginal) The paper proposes to use sum-product network (SPN) to model the likelihood. The numerical experiment shows that the counterfactual generated as such: - requires few gradient evaluations, - is visually appealing, - is easy to compute, - is effective. | SP:dd4bf279776e94815cf8778d86fe7666ff3eaa34 |
Gradient-based Counterfactual Explanations using Tractable Probabilistic Models | 1 INTRODUCTION . Explaining decisions made by intelligent systems , especially black-box models , is important . First of all , a model that can explain their decisions is more likely to gain human trust , especially if there are significant consequences for incorrect results , or the problem has not been sufficiently studied and validated in real-world applications ( Simpson , 2007 ; Hoffman et al. , 2013 ; Doshi-Velez & Kim , 2017 ) . Secondly , explanations can promote fairness by exposing bias towards protected attributes in the system ( Prates et al. , 2019 ; Buolamwini & Gebru , 2018 ; Obermeyer et al. , 2019 ) . In addition , explanations are a helpful tool for debugging purpose ( Holte , 1993 ; Freitas , 2014 ; Rudin , 2019 ) . Counterfactuals are closely related to classes of explanation , which much of the early work in AI on explaining the decisions made by an expert or rule-based systems focused on ( Wachter et al. , 2017 ) . As the name implies , counterfactual is an alternative example counter to the fact which takes the form “ If X had not occurred , Y would not have occurred ” . Explicitly establishing the connection between counterfactuals and explanations , Wachter et al . ( 2017 ) concluded that counterfactual explanations can bridge the gap between the interests of data subjects and data controllers that otherwise acts as a barrier to a legally binding right to explanation . They further formulate the problem of finding counterfactual explanations as an optimization task that minimizes the loss of a desired outcome w.r.t . an alternative input combined with regularization for distance to the query example . In a similar vein , the dominant majority of recent counterfactual explanation methods are proposed based on their adapted objective functions for optimization . Unfortunately , these deep learning approaches have some downsides : First of all , they are very time-consuming for generating explanations due to the iterative optimization process , because for every optimization iteration the model needs to be evaluated at least once and it may take a lot of iterations until a candidate is found . Secondly , the objective function is usually highly non-convex , which makes it more tricky to find a satisfying solution in practice . Thirdly , the optimizer involves additional hyperparameters that need to be carefully selected , such as learning rate . Furthermore , although these methods optimize for the ” closest possible world ” by constraining the distance of the counterfactual to the query instance , they are still not aware of the underlying density and the data manifold . As a direct consequence , the counterfactuals often appear rather unnatural and unrealistic although they are as close as possible to the query instance . See figure 3 for example . This imposes difficulties for humans to understand the explanations . As Nickerson ( 1998 ) argues , humans exhibit confirmation bias , meaning that we tend to ignore information that is inconsistent with our prior beliefs . In analogy , unrealistic counterfactuals also have very limited effect for communicating explanations to humans . To improve upon these limitations , we propose a novel approach to generate counterfactual explanations . Unlike the overwhelmingly dominant deep learning approach , we decouple the goal of perturbing the prediction and maintaining an additional constraint on the perturbation . Specifically , we view the task as a two-step process , whereby the first step is to perturb a sample towards a desired class and the second step is to constrain the perturbed sample to be close to the data manifold so it is realistic and natural . The first goal aligns with adversarial attacks ( Goodfellow et al. , 2015 ; Brown et al. , 2017 ; Yuan et al. , 2019 ) , where a small perturbation is computed to perturb the prediction . In the literature there are gradient-based methods ( Kurakin et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ) and optimization-based methods ( Szegedy et al. , 2013 ; Carlini & Wagner , 2017 ) . Exploiting the fact that gradient corresponds to the direction of steepest ascent , gradient-based perturbation is not only very easy to implement with current deep learning frameworks , but also much faster to compute compared to optimization-based perturbation . Therefore we adopt a gradient-based approach for the first step . To ensure the quality and effectiveness of the second step , we learn a sum-productnetwork ( SPN ) ( Poon & Domingos , 2011 ) , a tractable density model , on the input , and we perturb the example further based on the gradient that directs to steepest ascent of likelihood , evaluated on the SPN . In summary , we make the following contributions : 1 . We propose the first approach for generating counterfactual examples using probabilistic circuits to ensure density-awareness in a tractable way . 2 . We experiment with complex and high-dimensional real-world dataset , which was not dealt with using domain-agnostic methods in the literature . 3 . We give empirical evidence to demonstrate the advantages and effectiveness of our approach : visually appealing examples with high density , fast computation , and high success rate . We proceed as follows : First , we give an overview of the literature and summarize the shortcomings of the existing approaches . Then we introduce RAT-SPNs , preparing for presenting our approach . Finally , we evaluate our approach via empirical evidence and conclude our work . 2 RELATED WORK ON COUNTERFACTUAL EXPLANATIONS . Research attention on counterfactual explanations has been increasingly raised since Wachter et al . ( 2017 ) presented the concept of unconditional counterfactual explanations as a novel type of explanation of automated decisions . Identifying the resemblance between counterfactual explanations and adversarial perturbations , Wachter et al . ( 2017 ) proposed to generate counterfactual explanations based on the optimisation techniques used in the adversarial perturbation literature . Specifically , a loss function is minimized w.r.t . its input , using standard gradient-based techniques , for a desired output and a regularizer penalizing the distance between the counterfactual and the query . Following Wachter et al . ( 2017 ) , Mothilal et al . ( 2020 ) augmented the loss with diversity constraint to encourage diverse solutions . However , these approaches do not have explicit knowledge of the underlying density or data manifold , which may lead to unrealistic counterfactual explanations . A bunch of methods counteract this issue by learning an auxiliary generative model to impose additional density constraints on the optimization process . As common choice for density approximator , Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) and its variants ( Klys et al. , 2018 ; Ivanov et al. , 2019 ) are used . For instance , Dhurandhar et al . 2018 proposed contrastive explanations method ( CEM ) for neural networks based on optimization . The objective function consists of a hinge-like loss function and the elastic net regularizer as well as an auxiliary VAE to evaluate the proximity to the data manifold . Ustun et al . 2019 defined the term recourse as the ability of a person to change the decision of a model by altering actionable input variables . Recourse is evaluated by solving an optimization problem . Joshi et al . 2019 provided an algorithm , called REVISE , to suggest a recourse , based on samples from the latent space of a VAE characterizing the data distribution . Pawelczyk et al . 2020 developed a framework , called C-CHVAE , to generate faithful counterfactuals . C-CHVAE trains a VAE and returns the closest counterfactual due to a Figure 1 : The SPN structure used to estimate a distribution as a mixture of classconditional densities . Each class-conditional density is in turn represented by a subSPN . Classification is done via Bayes ’ rule . nearest neighbour style search in the latent space . Downs et al . 2020 proposed another algorithmic recourse generation method , CRUDS , that generates multiple recourses satisfying underlying structure of the data as well as end-user specified constraints . Based on a VAE-variant , CRUDS uses a Conditional Subspace Variational Autoencoder ( CSVAE ) model ( Klys et al. , 2018 ) that is capable of extracting latent features that are relevant for prediction . Another method called CLUE Antorán et al . ( 2020 ) is proposed for interpreting uncertainty estimates from differentiable probabilistic models using counterfactual explanations , by searching in the latent space of a VAE with arbitrary conditioning ( VAEAC ) ( Ivanov et al. , 2019 ) . Poyiadzi et al . 2020 proposed FACE , a graph-based algorithm to generate counterfactuals that are coherent with the underlying data distribution by constructing a graph over all the candidate targets . Besides , several domain-specific approaches are also emerging Olson et al . ( 2021 ) ; Goyal et al . ( 2019 ) ; Chang et al . ( 2019 ) . The aforementioned techniques have the following shortcomings : 1 . The deep learning-like approach ( Wachter et al. , 2017 ; Mothilal et al. , 2020 ; Dhurandhar et al. , 2018 ; Ustun et al. , 2019 ; Joshi et al. , 2019 ) is too slow to generate explanations on the fly due to the iterative optimization process , which in turn comes with additional tuning parameters . 2 . Although highly expressive , neural density estimators such as VAEs are highly intractable , which makes explicit density constraint on counterfactual explanations infeasible ( Dhurandhar et al. , 2018 ; Ivanov et al. , 2019 ; Klys et al. , 2018 ; Joshi et al. , 2019 ; Pawelczyk et al. , 2020 ) . In addition , they come with the overhead of latent representation , which is not necessarily in good quality when maximum likelihood training is used to learn them ( Alemi et al. , 2018 ; Dai & Wipf , 2019 ) . We improve upon the aforementioned shortcomings by proposing the first counterfactual method using tractable probabilistic circuits , specifically sum-product networks ( SPNs ) ( Darwiche , 2003 ; Poon & Domingos , 2011 ) . 3 GRADIENT-BASED COUNTERFACTUAL EXPLANATIONS USING TRACTABLE PROBABILISTIC MODELS . Before explaining our idea , we first introduce the tractable probabilistic models we use . An sum-product network ( SPN ) S over X is a tractable probabilistic model for P ( X ) based on a directed acyclic graph ( DAG ) . This graph indicates computation for probabilistic inference and consists of three types of nodes : univariate leaf nodes , sum nodes , and product nodes . Let ch ( · ) denote the children of a node . A sum node S is weighted sum of its children , i.e . S = ∑ N∈ch ( S ) wS , NN where the weights wS , N are non-negative and sum to 1 , i.e . wS , N ≥ 0 , ∑ N wS , N = 1 . Sum nodes can be viewed as mixtures of their child distributions . A product node P is product of its children , i.e . P = ∏ N∈ch ( P ) N . The root node represents P ( X ) . Products are factorized distributions , implying independence assumption among their children . SPNs allow for fast , exact inference on high-treewidth models . Unlike most of the probabilistic deep learning approaches , SPNs permit exact and efficient inference . Specifically , they are able to compute any marginalization and conditioning query in time linear of the model ’ s representation size . By employing SPNs for deep learning , random and tensorized SPNs ( RAT-SPNs ) ( Peharz et al. , 2020 ) are proposed using a simple approach to construct random SPN structure and combine it with GPU-based optimization . It is worth noting that RAT-SPNs are not fooled by certain out-of-domain image detection tests on which VAEs , normalizing flows ( NFs ) , and auto-regressive density estimators ( ARDEs ) consistently fail ( Choi & Jang , 2018 ; Nalisnick et al. , 2018 ) . To learn the parameters ω of a given RAT-SPN structure S in generative setting to approximate a distribution P ∗ ( X ) , we assume i.i.d . samples X = { x1 , . . . , xN } are given . Then maximum likelihood estimation is employed , i.e . ω = argmax 1N ∑N n=1 logS ( xn ) , where S ( x ) is a distribution over X represented by the RAT-SPN S . Apart from the standard use for density estimation , RAT-SPNs can be used as a generative classifier as well . Consider a classification problem f : Rd → { 1 , . . . , C } with C labels , C roots are used to represent class-conditional densities Sc ( X ) = : S ( X|Y = y ) . The overall density distribution is then given by S ( X ) = ∑ y S ( X|y ) P ( y ) . See figure 1 for illustration . Bayes ’ rule is used to classify a sample x : S ( Y |x ) = S ( x|Y ) P ( Y ) S ( x ) . In other words , a RAT-SPN of this special structure has dual use : It is both a density estimator S ( X ) and a classifier S ( Y |X ) . We will use this model to demonstrate our approach because it can be used for classification and yield tractable density evaluation for free at the same time . However , our approach can be easily extended to deep neural classifiers by training an auxiliary RAT-SPN for density estimation . For more details on RAT-SPN , check out appendix . Our approach is defined as two serial perturbations : In the first step , we maximize log S ( y ′|x ) S ( y|x ) to induce desired outcome y′ , which is equivalent to maximizing log S ( x|y ′ ) S ( x|y ) since log S ( y′|x ) S ( y|x ) = log ( S ( x|y′ ) P ( y′ ) S ( x ) S ( x ) S ( x|y ) P ( y ) ) = log S ( x|y′ ) S ( x|y ) , when assuming a uniform class prior . Towards this end , we take a gradient step towards the steepest ascent of the counterfactual outcome . This results in the perturbed example u where u = x+ ∂ ( logS ( x|y′ ) − logS ( x|y ) ) ∂x ∗ 1 . This step is similar to generating an adversarial perturbation in that the sample u is expected to change the prediction to y′ from y with a very slight change . However , without additional constraints , the perturbed sample u is very likely to deviate from the underlying data manifold . In order to generate in-distribution counterfactuals , we maximize the density P ∗ ( u ) of the current sample u , which is approximated via the SPN S ( u ) . In contrast to the density estimators used primarily in the literature , SPNs have the merit that they allow for tractable density evaluation . To maximize the density S ( u ) , we take another gradient step towards its steepest ascent , i.e . x′ = u+ ∂S ( u ) ∂u ∗ 2. x′ is the final counterfactual explanation for x that yields y′ instead of y . See figure 2 for illustration . | This is a XAI paper presenting a method to find counterfactual examples (i.e., contrastive example leading to a different prediction from the one currently obtained for a given example). The approach is based on tractable generative probabilistic circuits. This makes the procedure considerably faster than the existing SOTA approach. This seems to be very valuable and extensive validations show good performances even in terms of interpretability, smoothness and effectiveness. | SP:dd4bf279776e94815cf8778d86fe7666ff3eaa34 |
Gradient-based Counterfactual Explanations using Tractable Probabilistic Models | 1 INTRODUCTION . Explaining decisions made by intelligent systems , especially black-box models , is important . First of all , a model that can explain their decisions is more likely to gain human trust , especially if there are significant consequences for incorrect results , or the problem has not been sufficiently studied and validated in real-world applications ( Simpson , 2007 ; Hoffman et al. , 2013 ; Doshi-Velez & Kim , 2017 ) . Secondly , explanations can promote fairness by exposing bias towards protected attributes in the system ( Prates et al. , 2019 ; Buolamwini & Gebru , 2018 ; Obermeyer et al. , 2019 ) . In addition , explanations are a helpful tool for debugging purpose ( Holte , 1993 ; Freitas , 2014 ; Rudin , 2019 ) . Counterfactuals are closely related to classes of explanation , which much of the early work in AI on explaining the decisions made by an expert or rule-based systems focused on ( Wachter et al. , 2017 ) . As the name implies , counterfactual is an alternative example counter to the fact which takes the form “ If X had not occurred , Y would not have occurred ” . Explicitly establishing the connection between counterfactuals and explanations , Wachter et al . ( 2017 ) concluded that counterfactual explanations can bridge the gap between the interests of data subjects and data controllers that otherwise acts as a barrier to a legally binding right to explanation . They further formulate the problem of finding counterfactual explanations as an optimization task that minimizes the loss of a desired outcome w.r.t . an alternative input combined with regularization for distance to the query example . In a similar vein , the dominant majority of recent counterfactual explanation methods are proposed based on their adapted objective functions for optimization . Unfortunately , these deep learning approaches have some downsides : First of all , they are very time-consuming for generating explanations due to the iterative optimization process , because for every optimization iteration the model needs to be evaluated at least once and it may take a lot of iterations until a candidate is found . Secondly , the objective function is usually highly non-convex , which makes it more tricky to find a satisfying solution in practice . Thirdly , the optimizer involves additional hyperparameters that need to be carefully selected , such as learning rate . Furthermore , although these methods optimize for the ” closest possible world ” by constraining the distance of the counterfactual to the query instance , they are still not aware of the underlying density and the data manifold . As a direct consequence , the counterfactuals often appear rather unnatural and unrealistic although they are as close as possible to the query instance . See figure 3 for example . This imposes difficulties for humans to understand the explanations . As Nickerson ( 1998 ) argues , humans exhibit confirmation bias , meaning that we tend to ignore information that is inconsistent with our prior beliefs . In analogy , unrealistic counterfactuals also have very limited effect for communicating explanations to humans . To improve upon these limitations , we propose a novel approach to generate counterfactual explanations . Unlike the overwhelmingly dominant deep learning approach , we decouple the goal of perturbing the prediction and maintaining an additional constraint on the perturbation . Specifically , we view the task as a two-step process , whereby the first step is to perturb a sample towards a desired class and the second step is to constrain the perturbed sample to be close to the data manifold so it is realistic and natural . The first goal aligns with adversarial attacks ( Goodfellow et al. , 2015 ; Brown et al. , 2017 ; Yuan et al. , 2019 ) , where a small perturbation is computed to perturb the prediction . In the literature there are gradient-based methods ( Kurakin et al. , 2016 ; Moosavi-Dezfooli et al. , 2016 ) and optimization-based methods ( Szegedy et al. , 2013 ; Carlini & Wagner , 2017 ) . Exploiting the fact that gradient corresponds to the direction of steepest ascent , gradient-based perturbation is not only very easy to implement with current deep learning frameworks , but also much faster to compute compared to optimization-based perturbation . Therefore we adopt a gradient-based approach for the first step . To ensure the quality and effectiveness of the second step , we learn a sum-productnetwork ( SPN ) ( Poon & Domingos , 2011 ) , a tractable density model , on the input , and we perturb the example further based on the gradient that directs to steepest ascent of likelihood , evaluated on the SPN . In summary , we make the following contributions : 1 . We propose the first approach for generating counterfactual examples using probabilistic circuits to ensure density-awareness in a tractable way . 2 . We experiment with complex and high-dimensional real-world dataset , which was not dealt with using domain-agnostic methods in the literature . 3 . We give empirical evidence to demonstrate the advantages and effectiveness of our approach : visually appealing examples with high density , fast computation , and high success rate . We proceed as follows : First , we give an overview of the literature and summarize the shortcomings of the existing approaches . Then we introduce RAT-SPNs , preparing for presenting our approach . Finally , we evaluate our approach via empirical evidence and conclude our work . 2 RELATED WORK ON COUNTERFACTUAL EXPLANATIONS . Research attention on counterfactual explanations has been increasingly raised since Wachter et al . ( 2017 ) presented the concept of unconditional counterfactual explanations as a novel type of explanation of automated decisions . Identifying the resemblance between counterfactual explanations and adversarial perturbations , Wachter et al . ( 2017 ) proposed to generate counterfactual explanations based on the optimisation techniques used in the adversarial perturbation literature . Specifically , a loss function is minimized w.r.t . its input , using standard gradient-based techniques , for a desired output and a regularizer penalizing the distance between the counterfactual and the query . Following Wachter et al . ( 2017 ) , Mothilal et al . ( 2020 ) augmented the loss with diversity constraint to encourage diverse solutions . However , these approaches do not have explicit knowledge of the underlying density or data manifold , which may lead to unrealistic counterfactual explanations . A bunch of methods counteract this issue by learning an auxiliary generative model to impose additional density constraints on the optimization process . As common choice for density approximator , Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) and its variants ( Klys et al. , 2018 ; Ivanov et al. , 2019 ) are used . For instance , Dhurandhar et al . 2018 proposed contrastive explanations method ( CEM ) for neural networks based on optimization . The objective function consists of a hinge-like loss function and the elastic net regularizer as well as an auxiliary VAE to evaluate the proximity to the data manifold . Ustun et al . 2019 defined the term recourse as the ability of a person to change the decision of a model by altering actionable input variables . Recourse is evaluated by solving an optimization problem . Joshi et al . 2019 provided an algorithm , called REVISE , to suggest a recourse , based on samples from the latent space of a VAE characterizing the data distribution . Pawelczyk et al . 2020 developed a framework , called C-CHVAE , to generate faithful counterfactuals . C-CHVAE trains a VAE and returns the closest counterfactual due to a Figure 1 : The SPN structure used to estimate a distribution as a mixture of classconditional densities . Each class-conditional density is in turn represented by a subSPN . Classification is done via Bayes ’ rule . nearest neighbour style search in the latent space . Downs et al . 2020 proposed another algorithmic recourse generation method , CRUDS , that generates multiple recourses satisfying underlying structure of the data as well as end-user specified constraints . Based on a VAE-variant , CRUDS uses a Conditional Subspace Variational Autoencoder ( CSVAE ) model ( Klys et al. , 2018 ) that is capable of extracting latent features that are relevant for prediction . Another method called CLUE Antorán et al . ( 2020 ) is proposed for interpreting uncertainty estimates from differentiable probabilistic models using counterfactual explanations , by searching in the latent space of a VAE with arbitrary conditioning ( VAEAC ) ( Ivanov et al. , 2019 ) . Poyiadzi et al . 2020 proposed FACE , a graph-based algorithm to generate counterfactuals that are coherent with the underlying data distribution by constructing a graph over all the candidate targets . Besides , several domain-specific approaches are also emerging Olson et al . ( 2021 ) ; Goyal et al . ( 2019 ) ; Chang et al . ( 2019 ) . The aforementioned techniques have the following shortcomings : 1 . The deep learning-like approach ( Wachter et al. , 2017 ; Mothilal et al. , 2020 ; Dhurandhar et al. , 2018 ; Ustun et al. , 2019 ; Joshi et al. , 2019 ) is too slow to generate explanations on the fly due to the iterative optimization process , which in turn comes with additional tuning parameters . 2 . Although highly expressive , neural density estimators such as VAEs are highly intractable , which makes explicit density constraint on counterfactual explanations infeasible ( Dhurandhar et al. , 2018 ; Ivanov et al. , 2019 ; Klys et al. , 2018 ; Joshi et al. , 2019 ; Pawelczyk et al. , 2020 ) . In addition , they come with the overhead of latent representation , which is not necessarily in good quality when maximum likelihood training is used to learn them ( Alemi et al. , 2018 ; Dai & Wipf , 2019 ) . We improve upon the aforementioned shortcomings by proposing the first counterfactual method using tractable probabilistic circuits , specifically sum-product networks ( SPNs ) ( Darwiche , 2003 ; Poon & Domingos , 2011 ) . 3 GRADIENT-BASED COUNTERFACTUAL EXPLANATIONS USING TRACTABLE PROBABILISTIC MODELS . Before explaining our idea , we first introduce the tractable probabilistic models we use . An sum-product network ( SPN ) S over X is a tractable probabilistic model for P ( X ) based on a directed acyclic graph ( DAG ) . This graph indicates computation for probabilistic inference and consists of three types of nodes : univariate leaf nodes , sum nodes , and product nodes . Let ch ( · ) denote the children of a node . A sum node S is weighted sum of its children , i.e . S = ∑ N∈ch ( S ) wS , NN where the weights wS , N are non-negative and sum to 1 , i.e . wS , N ≥ 0 , ∑ N wS , N = 1 . Sum nodes can be viewed as mixtures of their child distributions . A product node P is product of its children , i.e . P = ∏ N∈ch ( P ) N . The root node represents P ( X ) . Products are factorized distributions , implying independence assumption among their children . SPNs allow for fast , exact inference on high-treewidth models . Unlike most of the probabilistic deep learning approaches , SPNs permit exact and efficient inference . Specifically , they are able to compute any marginalization and conditioning query in time linear of the model ’ s representation size . By employing SPNs for deep learning , random and tensorized SPNs ( RAT-SPNs ) ( Peharz et al. , 2020 ) are proposed using a simple approach to construct random SPN structure and combine it with GPU-based optimization . It is worth noting that RAT-SPNs are not fooled by certain out-of-domain image detection tests on which VAEs , normalizing flows ( NFs ) , and auto-regressive density estimators ( ARDEs ) consistently fail ( Choi & Jang , 2018 ; Nalisnick et al. , 2018 ) . To learn the parameters ω of a given RAT-SPN structure S in generative setting to approximate a distribution P ∗ ( X ) , we assume i.i.d . samples X = { x1 , . . . , xN } are given . Then maximum likelihood estimation is employed , i.e . ω = argmax 1N ∑N n=1 logS ( xn ) , where S ( x ) is a distribution over X represented by the RAT-SPN S . Apart from the standard use for density estimation , RAT-SPNs can be used as a generative classifier as well . Consider a classification problem f : Rd → { 1 , . . . , C } with C labels , C roots are used to represent class-conditional densities Sc ( X ) = : S ( X|Y = y ) . The overall density distribution is then given by S ( X ) = ∑ y S ( X|y ) P ( y ) . See figure 1 for illustration . Bayes ’ rule is used to classify a sample x : S ( Y |x ) = S ( x|Y ) P ( Y ) S ( x ) . In other words , a RAT-SPN of this special structure has dual use : It is both a density estimator S ( X ) and a classifier S ( Y |X ) . We will use this model to demonstrate our approach because it can be used for classification and yield tractable density evaluation for free at the same time . However , our approach can be easily extended to deep neural classifiers by training an auxiliary RAT-SPN for density estimation . For more details on RAT-SPN , check out appendix . Our approach is defined as two serial perturbations : In the first step , we maximize log S ( y ′|x ) S ( y|x ) to induce desired outcome y′ , which is equivalent to maximizing log S ( x|y ′ ) S ( x|y ) since log S ( y′|x ) S ( y|x ) = log ( S ( x|y′ ) P ( y′ ) S ( x ) S ( x ) S ( x|y ) P ( y ) ) = log S ( x|y′ ) S ( x|y ) , when assuming a uniform class prior . Towards this end , we take a gradient step towards the steepest ascent of the counterfactual outcome . This results in the perturbed example u where u = x+ ∂ ( logS ( x|y′ ) − logS ( x|y ) ) ∂x ∗ 1 . This step is similar to generating an adversarial perturbation in that the sample u is expected to change the prediction to y′ from y with a very slight change . However , without additional constraints , the perturbed sample u is very likely to deviate from the underlying data manifold . In order to generate in-distribution counterfactuals , we maximize the density P ∗ ( u ) of the current sample u , which is approximated via the SPN S ( u ) . In contrast to the density estimators used primarily in the literature , SPNs have the merit that they allow for tractable density evaluation . To maximize the density S ( u ) , we take another gradient step towards its steepest ascent , i.e . x′ = u+ ∂S ( u ) ∂u ∗ 2. x′ is the final counterfactual explanation for x that yields y′ instead of y . See figure 2 for illustration . | Explaining in a human-understandable way the predictions made by machine learning models is an important research topic for the development of trustworthy systems. In this topic, the present paper focuses on counterfactual explanations, a specific class of explanations that provides a link between what could have happened if the input to a model had been changed. The key idea of this paper is to exploit Sum-Product Networks (SPNs), a class of machine learning models capable of providing counterfactual explanations endowed with appealing computational properties. Based on those models, the authors present a conceptually simple two-stage gradient-based algorithm for computing counterfactual explanations. This approach is empirically compared with baseline techniques on several benchmarks. | SP:dd4bf279776e94815cf8778d86fe7666ff3eaa34 |
Efficient Out-of-Distribution Detection via CVAE data Generation | 1 INTRODUCTION . With the development of deep learning , a well-trained neural network model is able to obtain very high accuracy on its testing data . However , when exposed to samples or data instances drawn from a distribution that is far from the training distribution ( called In-distribution ( IND ) ) , the model may make arbitrary predictions under the known framework ( Nguyen et al. , 2015 ; Recht et al. , 2019 ) . This limits the model ’ s application in a broad range of applications , including secure authentication ( Sharif et al. , 2016 ) , autonomous driving ( Nitsch et al. , 2020 ) and medical diagnosis ( Caruana et al. , 2015 ) as in these applications novel or out-of distribution ( OOD ) data instances occur frequently . Therefore , OOD detection ( Hodge & Austin , 2004 ) , which aims to detect abnormal or novel data that are very different from the training data , is an important research task . Many approaches have been proposed to solve this problem , from distance-based methods ( Bendale & Boult , 2015 ; 2016 ; Gunther et al. , 2017 ; Júnior et al. , 2017 ) , to generative models ( Ge et al. , 2017 ; Neal et al. , 2018 ; Oza & Patel , 2019 ; Nalisnick et al. , 2018 ) and self-supervised learning ( Bergman & Hoshen , 2020 ; Golan & El-Yaniv , 2018 ; Hendrycks et al. , 2019 ) . Recently , contrastive learning has been shown highly effective in many applications ( Hjelm et al. , 2018 ; Oord et al. , 2018 ; Chen et al. , 2020b ; a ; Falcon & Cho , 2020 ) . Applying supervised contrastive learning and data augmentation , the recent CSI system has produced state-of-the-art ( SOTA ) OOD detection results ( Tack et al. , 2020 ) . However , data augmentation-based contrastive learning also has some drawbacks . First , designing data augmentation functions and deciding how to use various types of augmented data in contrastive learning involve a great deal of trial and error and manual work . That is , there is a large number of transformations ( or augmentations ) such as cropping , rotation and gray-scaling that can be exerted on images but not all of them may benefit the end tasks . In SimCLR ( Chen et al. , 2020a ) , systematic experiments have been reported to explore the augmentations ’ influence on classification tasks . Based on SimCLR ’ s results , CSI ( Tack et al. , 2020 ) chooses several operations for OOD detection . Second , contrastive learning with data augmentation is very time-consuming to run and resourcehungry due to a large amount of augmented data and quadratic pairwise similarity computation during training . For example , CSI creates 3 shifted instances for each original image sample and the 4 images are then subjected to an additional augmentation operation . Each image is finally expanded to 8 images or samples . Furthermore , every 2 samples in the augmented batch is treated as a pair to calculate contrastive loss . The performance is negatively affected if the batch size is not large enough . Therefore , it is necessary to use a large batch size , which demands a huge amount of memory and takes a very long time to run . It is thus not suitable for applications on hardware devices that do not have the required resources such as edge devices . In this paper , we propose a general and much more efficient solution , called CGA ( CVAE-based Generative data Augmentation for OOD detection ) . CGA consists of two parts . The first part generates pseudo OOD data and the second part makes use of the pseudo OOD data to train an OOD detection model . We discuss the first part first . OOD detection is basically a classification problem but the challenge is that there is no OOD data to use in training . This paper proposes a novel method to generate pseudo OOD data . This method works in the latent space of a Conditional Variational Auto-Encoder ( CVAE ) and uses CVAE ’ s decoder to generate pseudo OOD data . CVAE is able to generate instances from the training distribution on the basis of latent representations consisting of conditional information and variables sampled from a prior distribution of CVAE , normally the Gaussian distribution . If the latent space features or representations are created with some abnormal conditional information , the CVAE will generate “ bad ” instances but such instances can serve as effective pseudo OOD data . The second part of CGA is a fine-tuning framework that can make use of the generated pseudo OOD data to fine-tune any classification model built using only the IND data . Applying the framework to a simple IND classification model , we can already produce comparable results to existing SOTA contrastive learning models but much more efficient . Applying it to the existing SOTA methods , we can improve their results too . Our contributions can be summarized as follows : ( 1 ) We propose to employ a CVAE structure to generate pseudo OOD samples by providing some synthetic conditional information , which , to our knowledge , has not been done before . ( 2 ) We design a two-stage framework to train an OOD detection model by leveraging the generated pseudo OOD data . The first stage simply builds a normal classification model using only the IND data . The second stage fine-tunes the model using the generated OOD data to produce an effective OOD detection model . Extensive experiments show that this approach achieves comparable performance to the state-of-the-art ( SOTA ) contrastive learning methods in OOD detection , while consuming only one-tenth of the execution time . ( 3 ) Equally importantly , the proposed framework can be applied to existing SOTA OOD detection models to improve them to produce new SOTA results . 2 RELATED WORK . Out-of-distribution Detection . It is well-known that the discriminative neural networks can produce overconfident predictions on out-of-distribution ( OOD ) inputs ( Hendrycks & Gimpel , 2016 ; Lakshminarayanan et al. , 2016 ) . The early idea to solve this problem focuses on modifying softmax scores to obtain calibrated confidence for OOD detection ( Bendale & Boult , 2016 ; Guo et al. , 2017 ) . In addition , many other score functions have been proposed , such as likelihood ratio ( Ren et al. , 2019 ) , input complexity ( Serrà et al. , 2019 ) and typicality ( Nalisnick et al. , 2019 ) . A recent work utilizes Gram matrices to characterize activity patterns and identify anomalies in Gram matrix values to do OOD detection ( Sastry & Oore , 2020 ) . Some methods found that auxiliary anomalous data significantly improve detection performance ( Hendrycks et al. , 2018 ; Mohseni et al. , 2020 ) and thus generative models are adopted to anticipate the distribution of novel samples . In some of these methods , generated data are treated as OOD samples to optimize the decision boundary and calibrate the confidence ( Ge et al. , 2017 ; Vernekar et al. , 2019 ) . In some other works , generative models such as auto-encoders ( Zong et al. , 2018 ; Pidhorskyi et al. , 2018 ) and generative adversarial networks ( GAN ) ( Deecke et al. , 2018 ; Perera et al. , 2019 ) are used to reconstruct the training data . During the training of a GAN model , low quality samples acquired by the generator can also work as OOD data directly ( Pourreza et al. , 2021 ) . Owing to the fact that the model can hardly be generalized to unknown data , the reconstruction loss can help detect OOD data . There are also works using auxiliary OOD data to fine-tune the model ( Liu et al. , 2020 ) . Fort et al . ( 2021 ) showed that using pre-trained representations and taking few-shot outlier exposure can improve the results . Recently , self-supervised techniques have been applied to OOD detection . It focuses on acquiring rich representations through training with some pre-defined tasks ( Gidaris et al. , 2018 ; Kolesnikov et al. , 2019 ) . Self-supervised models show outstanding performance on OOD detection tasks ( Kolesnikov et al. , 2019 ; Bergman & Hoshen , 2020 ) . CSI ( Tack et al. , 2020 ) is a representative method ( see more below ) , which uses contrastive learning and data augmentation to improve the features of all labeled IND data and produce state-of-the-art ( SOTA ) results . Some researchers also tried to improve contrastive learning based methods ( Sehwag et al. , 2021 ) and proposed distance-based methods ( Miller et al. , 2021 ) . However , based on our experiments , CSI outperforms them . Our method falls into the generative approach . Unlike existing methods that use perturbations to anticipate OOD data , our method uses synthetic conditions and CVAE to obtain effective and diverse pseudo OOD data . Contrastive Learning . Contrastive learning learns representations by contrasting positive pairs against negative pairs ( Hadsell et al. , 2006 ) . It has been applied to various domains ( Oord et al. , 2018 ) . Recently , a new method called SimCLR ( Chen et al. , 2020a ) was proposed to create sample pairs via data augmentation . It is effective but also very time and resource consuming . SimCLR also shows that contrastive learning benefits more from larger batch sizes and longer training time . CSI ( Tack et al. , 2020 ) proposes that augmentation can not only help construct positive pairs but also negative pairs and makes use of them to detect OOD samples with supervised contrastive learning . It obtains the SOTA OOD detection results with labeled IND data . However , due to contrastive learning , it is extremely slow and memory demanding . Our proposed method generates pseudo OOD using CVAE , avoiding the use of contrastive loss , and is much more efficient than CSI . Auto-Encoder Auto-Encoder ( AE ) is a family of unsupervised neural networks ( Rumelhart et al. , 1986 ; Baldi & Hornik , 1989 ) . A basic AE consists of an encoder and a decoder . The encoder encodes the input data into a low-dimensional hidden representation and the decoder transforms the representation back to the reconstructed input data ( Vincent et al. , 2008 ; Chen et al. , 2012 ; Hinton et al. , 2006 ) . Variational auto-encoder is a special kind of AE ( Kingma & Welling , 2013 ) . It encodes the input as a given probability distribution ( usually Gaussian ) and the decoder reconstructs data instances according to variables sampled from that distribution . CVAE is an extension of VAE ( Kingma et al. , 2014 ) . It encodes the label or conditional information into the latent representation so that a CVAE can generate new samples from specified class labels . CVAE makes it possible to control the generating process , i.e. , to generate samples with features of specified classes . We make use of this property of CVAE to generate high quality pseudo OOD data . 3 PROPOSED CGA METHOD . In tasks related to out-of-distribution ( OOD ) detection , the problem of recognition is commonly formulated as a classification problem . The main challenge is that an important class , OOD data , is not available . Therefore , to effectively train an OOD detection model , an intuitive idea is to generate pseudo OOD data and use them together with the IND data to train the model . As we mentioned earlier , data augmentation and contrastive learning have been shown especially effective for this purpose . However , this approach is extremely inefficient . We propose to use Conditional Variational Auto-Encoder ( CVAE ) to generate pseudo OOD data and present a new fine-tuning framework to leverage the generated pseudo OOD data to train an OOD detection model . | This paper suggests to model outliers using a CVAE. It then suggests simple scoring functions for incorporating these simulated outlier into a classifier and uses a confidence based criterion. A numerical comparison shows this method is able to outperform CSI on a couple of datasets (while it underperforms on most other ones) . It also shows that synthetic anomalies can be combined with existing methods and obtain gains in performance. | SP:1540df04a5892081e63cd38c3ad5a6b098ffaa09 |
Efficient Out-of-Distribution Detection via CVAE data Generation | 1 INTRODUCTION . With the development of deep learning , a well-trained neural network model is able to obtain very high accuracy on its testing data . However , when exposed to samples or data instances drawn from a distribution that is far from the training distribution ( called In-distribution ( IND ) ) , the model may make arbitrary predictions under the known framework ( Nguyen et al. , 2015 ; Recht et al. , 2019 ) . This limits the model ’ s application in a broad range of applications , including secure authentication ( Sharif et al. , 2016 ) , autonomous driving ( Nitsch et al. , 2020 ) and medical diagnosis ( Caruana et al. , 2015 ) as in these applications novel or out-of distribution ( OOD ) data instances occur frequently . Therefore , OOD detection ( Hodge & Austin , 2004 ) , which aims to detect abnormal or novel data that are very different from the training data , is an important research task . Many approaches have been proposed to solve this problem , from distance-based methods ( Bendale & Boult , 2015 ; 2016 ; Gunther et al. , 2017 ; Júnior et al. , 2017 ) , to generative models ( Ge et al. , 2017 ; Neal et al. , 2018 ; Oza & Patel , 2019 ; Nalisnick et al. , 2018 ) and self-supervised learning ( Bergman & Hoshen , 2020 ; Golan & El-Yaniv , 2018 ; Hendrycks et al. , 2019 ) . Recently , contrastive learning has been shown highly effective in many applications ( Hjelm et al. , 2018 ; Oord et al. , 2018 ; Chen et al. , 2020b ; a ; Falcon & Cho , 2020 ) . Applying supervised contrastive learning and data augmentation , the recent CSI system has produced state-of-the-art ( SOTA ) OOD detection results ( Tack et al. , 2020 ) . However , data augmentation-based contrastive learning also has some drawbacks . First , designing data augmentation functions and deciding how to use various types of augmented data in contrastive learning involve a great deal of trial and error and manual work . That is , there is a large number of transformations ( or augmentations ) such as cropping , rotation and gray-scaling that can be exerted on images but not all of them may benefit the end tasks . In SimCLR ( Chen et al. , 2020a ) , systematic experiments have been reported to explore the augmentations ’ influence on classification tasks . Based on SimCLR ’ s results , CSI ( Tack et al. , 2020 ) chooses several operations for OOD detection . Second , contrastive learning with data augmentation is very time-consuming to run and resourcehungry due to a large amount of augmented data and quadratic pairwise similarity computation during training . For example , CSI creates 3 shifted instances for each original image sample and the 4 images are then subjected to an additional augmentation operation . Each image is finally expanded to 8 images or samples . Furthermore , every 2 samples in the augmented batch is treated as a pair to calculate contrastive loss . The performance is negatively affected if the batch size is not large enough . Therefore , it is necessary to use a large batch size , which demands a huge amount of memory and takes a very long time to run . It is thus not suitable for applications on hardware devices that do not have the required resources such as edge devices . In this paper , we propose a general and much more efficient solution , called CGA ( CVAE-based Generative data Augmentation for OOD detection ) . CGA consists of two parts . The first part generates pseudo OOD data and the second part makes use of the pseudo OOD data to train an OOD detection model . We discuss the first part first . OOD detection is basically a classification problem but the challenge is that there is no OOD data to use in training . This paper proposes a novel method to generate pseudo OOD data . This method works in the latent space of a Conditional Variational Auto-Encoder ( CVAE ) and uses CVAE ’ s decoder to generate pseudo OOD data . CVAE is able to generate instances from the training distribution on the basis of latent representations consisting of conditional information and variables sampled from a prior distribution of CVAE , normally the Gaussian distribution . If the latent space features or representations are created with some abnormal conditional information , the CVAE will generate “ bad ” instances but such instances can serve as effective pseudo OOD data . The second part of CGA is a fine-tuning framework that can make use of the generated pseudo OOD data to fine-tune any classification model built using only the IND data . Applying the framework to a simple IND classification model , we can already produce comparable results to existing SOTA contrastive learning models but much more efficient . Applying it to the existing SOTA methods , we can improve their results too . Our contributions can be summarized as follows : ( 1 ) We propose to employ a CVAE structure to generate pseudo OOD samples by providing some synthetic conditional information , which , to our knowledge , has not been done before . ( 2 ) We design a two-stage framework to train an OOD detection model by leveraging the generated pseudo OOD data . The first stage simply builds a normal classification model using only the IND data . The second stage fine-tunes the model using the generated OOD data to produce an effective OOD detection model . Extensive experiments show that this approach achieves comparable performance to the state-of-the-art ( SOTA ) contrastive learning methods in OOD detection , while consuming only one-tenth of the execution time . ( 3 ) Equally importantly , the proposed framework can be applied to existing SOTA OOD detection models to improve them to produce new SOTA results . 2 RELATED WORK . Out-of-distribution Detection . It is well-known that the discriminative neural networks can produce overconfident predictions on out-of-distribution ( OOD ) inputs ( Hendrycks & Gimpel , 2016 ; Lakshminarayanan et al. , 2016 ) . The early idea to solve this problem focuses on modifying softmax scores to obtain calibrated confidence for OOD detection ( Bendale & Boult , 2016 ; Guo et al. , 2017 ) . In addition , many other score functions have been proposed , such as likelihood ratio ( Ren et al. , 2019 ) , input complexity ( Serrà et al. , 2019 ) and typicality ( Nalisnick et al. , 2019 ) . A recent work utilizes Gram matrices to characterize activity patterns and identify anomalies in Gram matrix values to do OOD detection ( Sastry & Oore , 2020 ) . Some methods found that auxiliary anomalous data significantly improve detection performance ( Hendrycks et al. , 2018 ; Mohseni et al. , 2020 ) and thus generative models are adopted to anticipate the distribution of novel samples . In some of these methods , generated data are treated as OOD samples to optimize the decision boundary and calibrate the confidence ( Ge et al. , 2017 ; Vernekar et al. , 2019 ) . In some other works , generative models such as auto-encoders ( Zong et al. , 2018 ; Pidhorskyi et al. , 2018 ) and generative adversarial networks ( GAN ) ( Deecke et al. , 2018 ; Perera et al. , 2019 ) are used to reconstruct the training data . During the training of a GAN model , low quality samples acquired by the generator can also work as OOD data directly ( Pourreza et al. , 2021 ) . Owing to the fact that the model can hardly be generalized to unknown data , the reconstruction loss can help detect OOD data . There are also works using auxiliary OOD data to fine-tune the model ( Liu et al. , 2020 ) . Fort et al . ( 2021 ) showed that using pre-trained representations and taking few-shot outlier exposure can improve the results . Recently , self-supervised techniques have been applied to OOD detection . It focuses on acquiring rich representations through training with some pre-defined tasks ( Gidaris et al. , 2018 ; Kolesnikov et al. , 2019 ) . Self-supervised models show outstanding performance on OOD detection tasks ( Kolesnikov et al. , 2019 ; Bergman & Hoshen , 2020 ) . CSI ( Tack et al. , 2020 ) is a representative method ( see more below ) , which uses contrastive learning and data augmentation to improve the features of all labeled IND data and produce state-of-the-art ( SOTA ) results . Some researchers also tried to improve contrastive learning based methods ( Sehwag et al. , 2021 ) and proposed distance-based methods ( Miller et al. , 2021 ) . However , based on our experiments , CSI outperforms them . Our method falls into the generative approach . Unlike existing methods that use perturbations to anticipate OOD data , our method uses synthetic conditions and CVAE to obtain effective and diverse pseudo OOD data . Contrastive Learning . Contrastive learning learns representations by contrasting positive pairs against negative pairs ( Hadsell et al. , 2006 ) . It has been applied to various domains ( Oord et al. , 2018 ) . Recently , a new method called SimCLR ( Chen et al. , 2020a ) was proposed to create sample pairs via data augmentation . It is effective but also very time and resource consuming . SimCLR also shows that contrastive learning benefits more from larger batch sizes and longer training time . CSI ( Tack et al. , 2020 ) proposes that augmentation can not only help construct positive pairs but also negative pairs and makes use of them to detect OOD samples with supervised contrastive learning . It obtains the SOTA OOD detection results with labeled IND data . However , due to contrastive learning , it is extremely slow and memory demanding . Our proposed method generates pseudo OOD using CVAE , avoiding the use of contrastive loss , and is much more efficient than CSI . Auto-Encoder Auto-Encoder ( AE ) is a family of unsupervised neural networks ( Rumelhart et al. , 1986 ; Baldi & Hornik , 1989 ) . A basic AE consists of an encoder and a decoder . The encoder encodes the input data into a low-dimensional hidden representation and the decoder transforms the representation back to the reconstructed input data ( Vincent et al. , 2008 ; Chen et al. , 2012 ; Hinton et al. , 2006 ) . Variational auto-encoder is a special kind of AE ( Kingma & Welling , 2013 ) . It encodes the input as a given probability distribution ( usually Gaussian ) and the decoder reconstructs data instances according to variables sampled from that distribution . CVAE is an extension of VAE ( Kingma et al. , 2014 ) . It encodes the label or conditional information into the latent representation so that a CVAE can generate new samples from specified class labels . CVAE makes it possible to control the generating process , i.e. , to generate samples with features of specified classes . We make use of this property of CVAE to generate high quality pseudo OOD data . 3 PROPOSED CGA METHOD . In tasks related to out-of-distribution ( OOD ) detection , the problem of recognition is commonly formulated as a classification problem . The main challenge is that an important class , OOD data , is not available . Therefore , to effectively train an OOD detection model , an intuitive idea is to generate pseudo OOD data and use them together with the IND data to train the model . As we mentioned earlier , data augmentation and contrastive learning have been shown especially effective for this purpose . However , this approach is extremely inefficient . We propose to use Conditional Variational Auto-Encoder ( CVAE ) to generate pseudo OOD data and present a new fine-tuning framework to leverage the generated pseudo OOD data to train an OOD detection model . | UPDATE2 I acknowledge that I've read the author responses as well as the other reviews I think the authors gave a good explanation of where their proposed method outperforms the conventional methods. Therefore, I increase the score to 6 weak accept. ========================================================================= UPDATE: I acknowledge that I‘ve read the author responses as well as the other reviews. I initially gave 6 weak accept to the paper. However, after reading the author response and other reviewers' comments, I think the proposed work lose its merit due to several reasons. 1. The proposed model utilizes label information and underperforms against conventional methods that utilize label information. (see the comments). As such methods do not train an extra model, the proposed method's efficiency becomes also vague. 2. As Reviewer BUDw mentioned, I also agree that CVAE possibly becomes inefficient when the image size becomes larger. 3. Furthermore, as the performance and efficiency become vague, I'm not sure about the novelty, or how "surprising" the proposed method can be. The application of the generative models to OOD detection has a long history and better generative models will give better results. Due to the following reasons, I am leaning towards rejection of the paper and downgrading the score to 5. I hope the authors clarify the issues. ================================================================================================ The paper proposes CGA (CVAE-based generative data augmentation for out-of-distribution (OOD) detection) to improve the OOD detection performance when the class information is given. The module consists of a classification module (classifier and feature extractor) and a generation module (encoder and decoder). In the first phase, only in-distribution data are used to train two modules. In the second phase, CGA utilizes the generated pseudo-OOD data to fine-tune the classifier. CGA is compared against SOTA baselines in various setups. In the majority of setups, CGA shows competitive performance against the conventional OOD detection methods with the advantage of reduced computation times. Various ablation supports the design of CGA. | SP:1540df04a5892081e63cd38c3ad5a6b098ffaa09 |
Efficient Out-of-Distribution Detection via CVAE data Generation | 1 INTRODUCTION . With the development of deep learning , a well-trained neural network model is able to obtain very high accuracy on its testing data . However , when exposed to samples or data instances drawn from a distribution that is far from the training distribution ( called In-distribution ( IND ) ) , the model may make arbitrary predictions under the known framework ( Nguyen et al. , 2015 ; Recht et al. , 2019 ) . This limits the model ’ s application in a broad range of applications , including secure authentication ( Sharif et al. , 2016 ) , autonomous driving ( Nitsch et al. , 2020 ) and medical diagnosis ( Caruana et al. , 2015 ) as in these applications novel or out-of distribution ( OOD ) data instances occur frequently . Therefore , OOD detection ( Hodge & Austin , 2004 ) , which aims to detect abnormal or novel data that are very different from the training data , is an important research task . Many approaches have been proposed to solve this problem , from distance-based methods ( Bendale & Boult , 2015 ; 2016 ; Gunther et al. , 2017 ; Júnior et al. , 2017 ) , to generative models ( Ge et al. , 2017 ; Neal et al. , 2018 ; Oza & Patel , 2019 ; Nalisnick et al. , 2018 ) and self-supervised learning ( Bergman & Hoshen , 2020 ; Golan & El-Yaniv , 2018 ; Hendrycks et al. , 2019 ) . Recently , contrastive learning has been shown highly effective in many applications ( Hjelm et al. , 2018 ; Oord et al. , 2018 ; Chen et al. , 2020b ; a ; Falcon & Cho , 2020 ) . Applying supervised contrastive learning and data augmentation , the recent CSI system has produced state-of-the-art ( SOTA ) OOD detection results ( Tack et al. , 2020 ) . However , data augmentation-based contrastive learning also has some drawbacks . First , designing data augmentation functions and deciding how to use various types of augmented data in contrastive learning involve a great deal of trial and error and manual work . That is , there is a large number of transformations ( or augmentations ) such as cropping , rotation and gray-scaling that can be exerted on images but not all of them may benefit the end tasks . In SimCLR ( Chen et al. , 2020a ) , systematic experiments have been reported to explore the augmentations ’ influence on classification tasks . Based on SimCLR ’ s results , CSI ( Tack et al. , 2020 ) chooses several operations for OOD detection . Second , contrastive learning with data augmentation is very time-consuming to run and resourcehungry due to a large amount of augmented data and quadratic pairwise similarity computation during training . For example , CSI creates 3 shifted instances for each original image sample and the 4 images are then subjected to an additional augmentation operation . Each image is finally expanded to 8 images or samples . Furthermore , every 2 samples in the augmented batch is treated as a pair to calculate contrastive loss . The performance is negatively affected if the batch size is not large enough . Therefore , it is necessary to use a large batch size , which demands a huge amount of memory and takes a very long time to run . It is thus not suitable for applications on hardware devices that do not have the required resources such as edge devices . In this paper , we propose a general and much more efficient solution , called CGA ( CVAE-based Generative data Augmentation for OOD detection ) . CGA consists of two parts . The first part generates pseudo OOD data and the second part makes use of the pseudo OOD data to train an OOD detection model . We discuss the first part first . OOD detection is basically a classification problem but the challenge is that there is no OOD data to use in training . This paper proposes a novel method to generate pseudo OOD data . This method works in the latent space of a Conditional Variational Auto-Encoder ( CVAE ) and uses CVAE ’ s decoder to generate pseudo OOD data . CVAE is able to generate instances from the training distribution on the basis of latent representations consisting of conditional information and variables sampled from a prior distribution of CVAE , normally the Gaussian distribution . If the latent space features or representations are created with some abnormal conditional information , the CVAE will generate “ bad ” instances but such instances can serve as effective pseudo OOD data . The second part of CGA is a fine-tuning framework that can make use of the generated pseudo OOD data to fine-tune any classification model built using only the IND data . Applying the framework to a simple IND classification model , we can already produce comparable results to existing SOTA contrastive learning models but much more efficient . Applying it to the existing SOTA methods , we can improve their results too . Our contributions can be summarized as follows : ( 1 ) We propose to employ a CVAE structure to generate pseudo OOD samples by providing some synthetic conditional information , which , to our knowledge , has not been done before . ( 2 ) We design a two-stage framework to train an OOD detection model by leveraging the generated pseudo OOD data . The first stage simply builds a normal classification model using only the IND data . The second stage fine-tunes the model using the generated OOD data to produce an effective OOD detection model . Extensive experiments show that this approach achieves comparable performance to the state-of-the-art ( SOTA ) contrastive learning methods in OOD detection , while consuming only one-tenth of the execution time . ( 3 ) Equally importantly , the proposed framework can be applied to existing SOTA OOD detection models to improve them to produce new SOTA results . 2 RELATED WORK . Out-of-distribution Detection . It is well-known that the discriminative neural networks can produce overconfident predictions on out-of-distribution ( OOD ) inputs ( Hendrycks & Gimpel , 2016 ; Lakshminarayanan et al. , 2016 ) . The early idea to solve this problem focuses on modifying softmax scores to obtain calibrated confidence for OOD detection ( Bendale & Boult , 2016 ; Guo et al. , 2017 ) . In addition , many other score functions have been proposed , such as likelihood ratio ( Ren et al. , 2019 ) , input complexity ( Serrà et al. , 2019 ) and typicality ( Nalisnick et al. , 2019 ) . A recent work utilizes Gram matrices to characterize activity patterns and identify anomalies in Gram matrix values to do OOD detection ( Sastry & Oore , 2020 ) . Some methods found that auxiliary anomalous data significantly improve detection performance ( Hendrycks et al. , 2018 ; Mohseni et al. , 2020 ) and thus generative models are adopted to anticipate the distribution of novel samples . In some of these methods , generated data are treated as OOD samples to optimize the decision boundary and calibrate the confidence ( Ge et al. , 2017 ; Vernekar et al. , 2019 ) . In some other works , generative models such as auto-encoders ( Zong et al. , 2018 ; Pidhorskyi et al. , 2018 ) and generative adversarial networks ( GAN ) ( Deecke et al. , 2018 ; Perera et al. , 2019 ) are used to reconstruct the training data . During the training of a GAN model , low quality samples acquired by the generator can also work as OOD data directly ( Pourreza et al. , 2021 ) . Owing to the fact that the model can hardly be generalized to unknown data , the reconstruction loss can help detect OOD data . There are also works using auxiliary OOD data to fine-tune the model ( Liu et al. , 2020 ) . Fort et al . ( 2021 ) showed that using pre-trained representations and taking few-shot outlier exposure can improve the results . Recently , self-supervised techniques have been applied to OOD detection . It focuses on acquiring rich representations through training with some pre-defined tasks ( Gidaris et al. , 2018 ; Kolesnikov et al. , 2019 ) . Self-supervised models show outstanding performance on OOD detection tasks ( Kolesnikov et al. , 2019 ; Bergman & Hoshen , 2020 ) . CSI ( Tack et al. , 2020 ) is a representative method ( see more below ) , which uses contrastive learning and data augmentation to improve the features of all labeled IND data and produce state-of-the-art ( SOTA ) results . Some researchers also tried to improve contrastive learning based methods ( Sehwag et al. , 2021 ) and proposed distance-based methods ( Miller et al. , 2021 ) . However , based on our experiments , CSI outperforms them . Our method falls into the generative approach . Unlike existing methods that use perturbations to anticipate OOD data , our method uses synthetic conditions and CVAE to obtain effective and diverse pseudo OOD data . Contrastive Learning . Contrastive learning learns representations by contrasting positive pairs against negative pairs ( Hadsell et al. , 2006 ) . It has been applied to various domains ( Oord et al. , 2018 ) . Recently , a new method called SimCLR ( Chen et al. , 2020a ) was proposed to create sample pairs via data augmentation . It is effective but also very time and resource consuming . SimCLR also shows that contrastive learning benefits more from larger batch sizes and longer training time . CSI ( Tack et al. , 2020 ) proposes that augmentation can not only help construct positive pairs but also negative pairs and makes use of them to detect OOD samples with supervised contrastive learning . It obtains the SOTA OOD detection results with labeled IND data . However , due to contrastive learning , it is extremely slow and memory demanding . Our proposed method generates pseudo OOD using CVAE , avoiding the use of contrastive loss , and is much more efficient than CSI . Auto-Encoder Auto-Encoder ( AE ) is a family of unsupervised neural networks ( Rumelhart et al. , 1986 ; Baldi & Hornik , 1989 ) . A basic AE consists of an encoder and a decoder . The encoder encodes the input data into a low-dimensional hidden representation and the decoder transforms the representation back to the reconstructed input data ( Vincent et al. , 2008 ; Chen et al. , 2012 ; Hinton et al. , 2006 ) . Variational auto-encoder is a special kind of AE ( Kingma & Welling , 2013 ) . It encodes the input as a given probability distribution ( usually Gaussian ) and the decoder reconstructs data instances according to variables sampled from that distribution . CVAE is an extension of VAE ( Kingma et al. , 2014 ) . It encodes the label or conditional information into the latent representation so that a CVAE can generate new samples from specified class labels . CVAE makes it possible to control the generating process , i.e. , to generate samples with features of specified classes . We make use of this property of CVAE to generate high quality pseudo OOD data . 3 PROPOSED CGA METHOD . In tasks related to out-of-distribution ( OOD ) detection , the problem of recognition is commonly formulated as a classification problem . The main challenge is that an important class , OOD data , is not available . Therefore , to effectively train an OOD detection model , an intuitive idea is to generate pseudo OOD data and use them together with the IND data to train the model . As we mentioned earlier , data augmentation and contrastive learning have been shown especially effective for this purpose . However , this approach is extremely inefficient . We propose to use Conditional Variational Auto-Encoder ( CVAE ) to generate pseudo OOD data and present a new fine-tuning framework to leverage the generated pseudo OOD data to train an OOD detection model . | This paper proposes to employ a CVAE structure to generate pseudo OOD samples by providing some synthetic conditional information. Besides, they design a two-stage framework to train an OOD detection model by leveraging the generated pseudo OOD data. They show that their approach outperforms other SOTA methods in the task of out-of-distribution detection. | SP:1540df04a5892081e63cd38c3ad5a6b098ffaa09 |
EXPLAINABLE AI-BASED DYNAMIC FILTER PRUNING OF CONVOLUTIONAL NEURAL NETWORKS | 1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved rapid success in many image processing applications , including image classification [ 1 , 2 , 3 ] image segmentation [ 4 , 5 ] , object detection [ 6 ] , etc . The key ingredients in this success of DNN have been the usage of deeper networks and a large amount of training data . However , as the network gets deeper , the model complexity also increases rapidly . The training of DNNs can be carried out on high-performance clusters with Graphics Processing Unit ( GPU ) acceleration ; however , for implementing these networks on hardware , the complexity of the DNNs needs to be reduced . This includes decreasing the memory requirements , energy consumption , latency , or throughput of the implementation of DNNs on the hardware . Pruning is one of the main techniques that are utilized for reducing the complexity of DNNs . DNN Pruning refers to removing the undesired parameters of a DNN that have little influence on the output of the neural network [ 7 , 8 ] . This leads to fewer Multiply-Accumulate Operation ( MAC ) operations and fewer Number of Parameters ( NPs ) . Pruning can be neuron pruning , filter pruning , weight pruning , and layer pruning . In neuron pruning , individual neurons are removed , i.e . , all the incoming and outgoing connections to a neuron are also removed [ 9 ] . In filter pruning , CNN filters are removed [ 10 ] . In layer pruning , some of the layers can also be pruned [ 11 ] . Weight pruning is used synonymously for unstructured pruning , where the redundant weights are set to zero . The two fundamental objectives for pruning the model are : ( 1 ) reducing the memory by lowering the NPs and reducing the latency and energy consumption of the computation by reducing MACs . These two objectives are often conflicting in a DNN because the MACs are concentrated in the lower layers of a typical image classification network and the NPs are concentrated in the higher layers of a typical image classification network . Pruning can be structured or unstructured . In structured pruning , the filters and weights are eliminated by removing all their input and output connections , and this means that no additional compilation techniques or hardware optimization is required to obtain the gain on hardware in terms of reduction in the size of the model or reduction in the inference time of a sample . This is because the whole model structured is changed in unstructured pruning . In unstructured pruning , the unimportant filters or weights are set to zero , a compiler utilizes these zeros to skip some computations , thereby decreasing the inference time . Unstructured pruning has an additional cost in terms of compilation effort or computational effort in order to exploit the irregular sparsity . Typically , unstructured pruning provides a more pruning ratio as compared to structure pruning . Network Pruning can also be classified in terms of static pruning and dynamic pruning . In static pruning , the parameters of a DNN are removed permanently , while in dynamic pruning , the parameters of a DNN are not removed permanently , instead , they are selectively used for computation based on the input to a DNN . A DNN can be pruned using static pruning , thereby reducing MACs and NPs , and then the same DNN can be dynamically pruned as well . In [ 12 ] , the authors surveyed dynamic neural networks . They divided dynamic networks into three main categories : ( 1 ) instance-wise dynamic models that process each input sample or instance with data-dependent architectures or parameters , ( 2 ) spatial-wise dynamic networks that conduct adaptive computation with respect to different spatial locations of image data , and 3 ) temporal-wise dynamic models that perform adaptive inference along the temporal dimension for sequential data such as videos and texts . Our work comes under the category of instance-wise dynamic models . Within this category , the two types of dynamic networks that are relevant to our work are ( 1 ) dynamic depth models and ( 2 ) dynamic width models . In dynamic depth models , the sample could be predicted earlier in a network . Works such as [ 13 ] utilize this strategy . This strategy is based on the principle that an easier sample in a dataset can be predicted earlier within a network than a hard sample . In contrast to dynamic depth models , the dynamic width models change the number of filters or channels of a CNN , based on the input sample . In [ 14 ] , the authors utilized reinforcement learning for training an agent that judges the importance of each convolutional kernel and conducts channel-wise pruning conditioned on different samples such that the network is pruned more when the sample is easier . Their work utilizes hardness of sample for dynamic behavior in a DNN , whereas our work utilizes coarse prediction . Similar to our work is [ 15 ] , in which the authors proposed a Learning Kernel Activation Module ( LKAM ) , which is able to dynamically activate or deactivate a subset of filter kernels depending upon the input image content during the inference phase . Their method requires a bank of 1x1 convolutional kernels followed by average pooling and a sigmoid function in order to choose which filter kernels in a layer will be activated . Our work is unique in this regard that in addition to classifying easy samples earlier , we utilize an intermediate branch to perform a coarse prediction . The lower layers of a CNN output simpler features , while the higher layers output more categorical features that correlate with a specific class . In higher layers , different filters output features specific to various classes . The concept behind our proposed dynamic pruning is to perform a coarse prediction . Then based on this coarse prediction , we select the CNN filters only relevant to specific classes . explainable AI allows us to obtain filter importances relative to specific classes . Our approach allows us to reduce the average latency as well as the longest-path latency of inference while keeping the overhead low and hardware implementation easy . 1.1 CONTRIBUTIONS . Our contribution can be summarized in the following points : • We propose a novel method for dynamic pruning that utilizes early exit along with early coarse prediction and explainable AI . • The early coarse prediction branch is trained using deep top-k loss . If the branch predicts a sample with high confidence , the prediction is made . Otherwise , coarse prediction is obtained , thereby restricting the possible output to be within a subset of classes . • The coarse prediction is used to dynamically select CNN filters relevant for those classes . • The filters relevant for all output classes are obtained in prior using explainable AI . In run-time , only ranking of filters is done . • The dynamically pruned model is trainable and easily deployable on the end hardware . 2 BACKGROUND . In this section , we briefly describe some of the concepts that are utilized in our work . 2.1 RANKING CRITERIA FOR PRUNING . One of the most essential tasks in filter pruning is to rank the filters based on their importances . The importance of a filter can be obtained locally within a layer or it can be obtained globally within a network . Some ranking criteria for pruning are as follows : Magnitude-based metrics These methods utilize ℓ1-norm and ℓ2-norm of the model weights and have been shown to work reasonably well for general cases in works such as [ 16 ] and [ 17 ] . Loss-preservation based metrics These measures determine the effect of removing a set of parameters on model loss , for example , first-order Taylor decomposition has been used for this purpose by [ 18 ] . XAI-based metrics As described in [ 19 ] , explainable AI ( XAI ) seeks to explain why a neural network produces the output that it does for the input it gets . Explanations of DNNs can be of different types such as explaining which neurons are most sensitive ( saliency methods ) , which neurons have the most effect on output , which input excites which neurons ( signal methods ) , etc . For example , explainable AI has been used to guide the quantization and pruning of DNNs [ 20 ] . Saliency methods explain the decision of a neural network by assigning values that reflect the importance of input components in their contribution towards the output . These methods can be used to obtain the importance of both the features and the weights . Some of the methods in this category are for example : DeepLift [ 21 ] , Conductance [ 22 ] , IntegratedGradients [ 23 ] , etc . We choose DeepLIFT as our work is not aimed at comparing different explainable-AI methods specifically , rather it utilizes them in a novel pruning strategy . We choose DeepLIFT due to its robustness and less computational requirement . One of the most attractive aspects of explainable AI based algorithms is that they provide scores of different filters respective to each output class , which makes it possible for these methods to be utilized in our dynamic pruning architecture . DeepLIFT In [ 21 ] , the authors propose a method for decomposing the output prediction of a neural network on a specific input by backpropagating the contributions of all neurons in the network to every feature of the input . DeepLIFT compares the activation of each neuron to its reference activation and assigns contribution scores according to the difference . The choice of reference activation is important for the algorithm ’ s outcome , and it often requires domain-specific knowledge . To specify a reference activation , we must understand the intuition behind the DeepLIFT algorithm . It compares the effect of the features to a baseline of what the model would predict when it can not see the features . Therefore , a good reference activation for MNIST [ 24 ] is an all-black image . Mathematically , the DeepLIFT algorithm works as follows : Let t represent some target output neuron of interest and let x1 , x2 , . . . , xn′ represent some neurons in some intermediate layer or set of layers that are necessary and sufficient to compute t. Let t0 represent the reference activation of t. The quantity ∆t is defined as the difference-from-reference , that is ∆t = t − t0 . DeepLIFT assigns contribution scores C∆xi∆t to ∆xi s.t . : n′ ∑ i=1 C∆xi∆t = ∆t ( 1 ) C∆xi∆t can be thought of as the amount of difference-from-reference t that is attributed to the differencefrom-reference of xi . ∆t is the DeepLIFT score , which can be represented as follows : DL ( t , x ) = n′ ∑ i=1 C∆xi∆t ( 2 ) 2.2 OBTAINING FILTER IMPORTANCES FROM EXPLAINABLE AI ALGORITHMS . The explainable AI methods take a sample of a dataset as input and output sensitivity maps instead of activations/feature maps . These sensitivity maps have the same dimensions as the feature maps . Let Ω be a set of all indices of all feature map elements of all layers of a neural network , I ( m , Ω ) be the importances of all feature map elements from mth sample from the validation set , then we can define total feature map importance as the average of importances obtained from M samples : I ( θ ) = 1 M M−1 ∑ m=0 I ( m , θ ) ( 3 ) where M is the number of samples used by the XAI method for obtaining the importances . M varies depending upon the dataset , its typical value is 1–2 % of validation samples for CIFAR10 . These sensitivity maps are converted into the importances of the filter weights using different methods , which are as follows : ℓ1-norm criteria We can take ℓ1-norm of the sensitivity map . For example , for a d×d convolutional kernel , for each sample m∈M , the explainable AI method outputs a sensitivity map O of height H and width W , the sensitivity of the weights of this convolutional kernel is given by : W−1 ∑ w=0 H−1 ∑ h=0 |Ow , h| / ( H × W ) . Max-Min criteria We can take also get importances by subtracting max from min of a importances , this is useful in DeepLIFT which also outputs negative importances to indicate pixels that negate a class . This will be given by : W−1 ∑ w=0 H−1 ∑ h=0 max ( Ow , h ) −min ( Ow , h ) / ( H ×W ) . | This paper focusses on a dynamic filter pruning technique that reduces the longest path latency of inference while using explainable AI (XAI) to help with determining pruning criterion. The approach uses an early coarse prediction branch that is used to perform a top-k classification. This branch is added to the middle section of the neural network. If this branch either predicts the output class with high prediction, then the rest of the computation is skipped. Else, this branch predicts the top-k classes for this input and executes the rest of the part of the NN. While executing this part, only filters useful for predicting these classes are loaded during execution. To determine the set of filters useful for a certain set of classes, the paper uses XAI to determine importance criterion for these filters for each class. The authors evaluate their work on CIFAR 10 and CIFAR 100 benchmarks on VGG11&16 and ResNet20 architecture while comparing against a dense benchmark and a simple static pruning technique. | SP:a4030043a69cec335dafaea21b0afe6b3f5cf49b |
EXPLAINABLE AI-BASED DYNAMIC FILTER PRUNING OF CONVOLUTIONAL NEURAL NETWORKS | 1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved rapid success in many image processing applications , including image classification [ 1 , 2 , 3 ] image segmentation [ 4 , 5 ] , object detection [ 6 ] , etc . The key ingredients in this success of DNN have been the usage of deeper networks and a large amount of training data . However , as the network gets deeper , the model complexity also increases rapidly . The training of DNNs can be carried out on high-performance clusters with Graphics Processing Unit ( GPU ) acceleration ; however , for implementing these networks on hardware , the complexity of the DNNs needs to be reduced . This includes decreasing the memory requirements , energy consumption , latency , or throughput of the implementation of DNNs on the hardware . Pruning is one of the main techniques that are utilized for reducing the complexity of DNNs . DNN Pruning refers to removing the undesired parameters of a DNN that have little influence on the output of the neural network [ 7 , 8 ] . This leads to fewer Multiply-Accumulate Operation ( MAC ) operations and fewer Number of Parameters ( NPs ) . Pruning can be neuron pruning , filter pruning , weight pruning , and layer pruning . In neuron pruning , individual neurons are removed , i.e . , all the incoming and outgoing connections to a neuron are also removed [ 9 ] . In filter pruning , CNN filters are removed [ 10 ] . In layer pruning , some of the layers can also be pruned [ 11 ] . Weight pruning is used synonymously for unstructured pruning , where the redundant weights are set to zero . The two fundamental objectives for pruning the model are : ( 1 ) reducing the memory by lowering the NPs and reducing the latency and energy consumption of the computation by reducing MACs . These two objectives are often conflicting in a DNN because the MACs are concentrated in the lower layers of a typical image classification network and the NPs are concentrated in the higher layers of a typical image classification network . Pruning can be structured or unstructured . In structured pruning , the filters and weights are eliminated by removing all their input and output connections , and this means that no additional compilation techniques or hardware optimization is required to obtain the gain on hardware in terms of reduction in the size of the model or reduction in the inference time of a sample . This is because the whole model structured is changed in unstructured pruning . In unstructured pruning , the unimportant filters or weights are set to zero , a compiler utilizes these zeros to skip some computations , thereby decreasing the inference time . Unstructured pruning has an additional cost in terms of compilation effort or computational effort in order to exploit the irregular sparsity . Typically , unstructured pruning provides a more pruning ratio as compared to structure pruning . Network Pruning can also be classified in terms of static pruning and dynamic pruning . In static pruning , the parameters of a DNN are removed permanently , while in dynamic pruning , the parameters of a DNN are not removed permanently , instead , they are selectively used for computation based on the input to a DNN . A DNN can be pruned using static pruning , thereby reducing MACs and NPs , and then the same DNN can be dynamically pruned as well . In [ 12 ] , the authors surveyed dynamic neural networks . They divided dynamic networks into three main categories : ( 1 ) instance-wise dynamic models that process each input sample or instance with data-dependent architectures or parameters , ( 2 ) spatial-wise dynamic networks that conduct adaptive computation with respect to different spatial locations of image data , and 3 ) temporal-wise dynamic models that perform adaptive inference along the temporal dimension for sequential data such as videos and texts . Our work comes under the category of instance-wise dynamic models . Within this category , the two types of dynamic networks that are relevant to our work are ( 1 ) dynamic depth models and ( 2 ) dynamic width models . In dynamic depth models , the sample could be predicted earlier in a network . Works such as [ 13 ] utilize this strategy . This strategy is based on the principle that an easier sample in a dataset can be predicted earlier within a network than a hard sample . In contrast to dynamic depth models , the dynamic width models change the number of filters or channels of a CNN , based on the input sample . In [ 14 ] , the authors utilized reinforcement learning for training an agent that judges the importance of each convolutional kernel and conducts channel-wise pruning conditioned on different samples such that the network is pruned more when the sample is easier . Their work utilizes hardness of sample for dynamic behavior in a DNN , whereas our work utilizes coarse prediction . Similar to our work is [ 15 ] , in which the authors proposed a Learning Kernel Activation Module ( LKAM ) , which is able to dynamically activate or deactivate a subset of filter kernels depending upon the input image content during the inference phase . Their method requires a bank of 1x1 convolutional kernels followed by average pooling and a sigmoid function in order to choose which filter kernels in a layer will be activated . Our work is unique in this regard that in addition to classifying easy samples earlier , we utilize an intermediate branch to perform a coarse prediction . The lower layers of a CNN output simpler features , while the higher layers output more categorical features that correlate with a specific class . In higher layers , different filters output features specific to various classes . The concept behind our proposed dynamic pruning is to perform a coarse prediction . Then based on this coarse prediction , we select the CNN filters only relevant to specific classes . explainable AI allows us to obtain filter importances relative to specific classes . Our approach allows us to reduce the average latency as well as the longest-path latency of inference while keeping the overhead low and hardware implementation easy . 1.1 CONTRIBUTIONS . Our contribution can be summarized in the following points : • We propose a novel method for dynamic pruning that utilizes early exit along with early coarse prediction and explainable AI . • The early coarse prediction branch is trained using deep top-k loss . If the branch predicts a sample with high confidence , the prediction is made . Otherwise , coarse prediction is obtained , thereby restricting the possible output to be within a subset of classes . • The coarse prediction is used to dynamically select CNN filters relevant for those classes . • The filters relevant for all output classes are obtained in prior using explainable AI . In run-time , only ranking of filters is done . • The dynamically pruned model is trainable and easily deployable on the end hardware . 2 BACKGROUND . In this section , we briefly describe some of the concepts that are utilized in our work . 2.1 RANKING CRITERIA FOR PRUNING . One of the most essential tasks in filter pruning is to rank the filters based on their importances . The importance of a filter can be obtained locally within a layer or it can be obtained globally within a network . Some ranking criteria for pruning are as follows : Magnitude-based metrics These methods utilize ℓ1-norm and ℓ2-norm of the model weights and have been shown to work reasonably well for general cases in works such as [ 16 ] and [ 17 ] . Loss-preservation based metrics These measures determine the effect of removing a set of parameters on model loss , for example , first-order Taylor decomposition has been used for this purpose by [ 18 ] . XAI-based metrics As described in [ 19 ] , explainable AI ( XAI ) seeks to explain why a neural network produces the output that it does for the input it gets . Explanations of DNNs can be of different types such as explaining which neurons are most sensitive ( saliency methods ) , which neurons have the most effect on output , which input excites which neurons ( signal methods ) , etc . For example , explainable AI has been used to guide the quantization and pruning of DNNs [ 20 ] . Saliency methods explain the decision of a neural network by assigning values that reflect the importance of input components in their contribution towards the output . These methods can be used to obtain the importance of both the features and the weights . Some of the methods in this category are for example : DeepLift [ 21 ] , Conductance [ 22 ] , IntegratedGradients [ 23 ] , etc . We choose DeepLIFT as our work is not aimed at comparing different explainable-AI methods specifically , rather it utilizes them in a novel pruning strategy . We choose DeepLIFT due to its robustness and less computational requirement . One of the most attractive aspects of explainable AI based algorithms is that they provide scores of different filters respective to each output class , which makes it possible for these methods to be utilized in our dynamic pruning architecture . DeepLIFT In [ 21 ] , the authors propose a method for decomposing the output prediction of a neural network on a specific input by backpropagating the contributions of all neurons in the network to every feature of the input . DeepLIFT compares the activation of each neuron to its reference activation and assigns contribution scores according to the difference . The choice of reference activation is important for the algorithm ’ s outcome , and it often requires domain-specific knowledge . To specify a reference activation , we must understand the intuition behind the DeepLIFT algorithm . It compares the effect of the features to a baseline of what the model would predict when it can not see the features . Therefore , a good reference activation for MNIST [ 24 ] is an all-black image . Mathematically , the DeepLIFT algorithm works as follows : Let t represent some target output neuron of interest and let x1 , x2 , . . . , xn′ represent some neurons in some intermediate layer or set of layers that are necessary and sufficient to compute t. Let t0 represent the reference activation of t. The quantity ∆t is defined as the difference-from-reference , that is ∆t = t − t0 . DeepLIFT assigns contribution scores C∆xi∆t to ∆xi s.t . : n′ ∑ i=1 C∆xi∆t = ∆t ( 1 ) C∆xi∆t can be thought of as the amount of difference-from-reference t that is attributed to the differencefrom-reference of xi . ∆t is the DeepLIFT score , which can be represented as follows : DL ( t , x ) = n′ ∑ i=1 C∆xi∆t ( 2 ) 2.2 OBTAINING FILTER IMPORTANCES FROM EXPLAINABLE AI ALGORITHMS . The explainable AI methods take a sample of a dataset as input and output sensitivity maps instead of activations/feature maps . These sensitivity maps have the same dimensions as the feature maps . Let Ω be a set of all indices of all feature map elements of all layers of a neural network , I ( m , Ω ) be the importances of all feature map elements from mth sample from the validation set , then we can define total feature map importance as the average of importances obtained from M samples : I ( θ ) = 1 M M−1 ∑ m=0 I ( m , θ ) ( 3 ) where M is the number of samples used by the XAI method for obtaining the importances . M varies depending upon the dataset , its typical value is 1–2 % of validation samples for CIFAR10 . These sensitivity maps are converted into the importances of the filter weights using different methods , which are as follows : ℓ1-norm criteria We can take ℓ1-norm of the sensitivity map . For example , for a d×d convolutional kernel , for each sample m∈M , the explainable AI method outputs a sensitivity map O of height H and width W , the sensitivity of the weights of this convolutional kernel is given by : W−1 ∑ w=0 H−1 ∑ h=0 |Ow , h| / ( H × W ) . Max-Min criteria We can take also get importances by subtracting max from min of a importances , this is useful in DeepLIFT which also outputs negative importances to indicate pixels that negate a class . This will be given by : W−1 ∑ w=0 H−1 ∑ h=0 max ( Ow , h ) −min ( Ow , h ) / ( H ×W ) . | The authors propose a set of steps in order to reduce the latency and the flops computation effort of neural networks. They add early exit prediction layers, a top-k prediction layer and dynamic pruning based on the set of classes from the top-k prediction layer. The pruning uses statistics precomputed from a validation dataset in order to decide which filters are to be used for which class. The statistics are obtained from deeplift scores. | SP:a4030043a69cec335dafaea21b0afe6b3f5cf49b |
EXPLAINABLE AI-BASED DYNAMIC FILTER PRUNING OF CONVOLUTIONAL NEURAL NETWORKS | 1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved rapid success in many image processing applications , including image classification [ 1 , 2 , 3 ] image segmentation [ 4 , 5 ] , object detection [ 6 ] , etc . The key ingredients in this success of DNN have been the usage of deeper networks and a large amount of training data . However , as the network gets deeper , the model complexity also increases rapidly . The training of DNNs can be carried out on high-performance clusters with Graphics Processing Unit ( GPU ) acceleration ; however , for implementing these networks on hardware , the complexity of the DNNs needs to be reduced . This includes decreasing the memory requirements , energy consumption , latency , or throughput of the implementation of DNNs on the hardware . Pruning is one of the main techniques that are utilized for reducing the complexity of DNNs . DNN Pruning refers to removing the undesired parameters of a DNN that have little influence on the output of the neural network [ 7 , 8 ] . This leads to fewer Multiply-Accumulate Operation ( MAC ) operations and fewer Number of Parameters ( NPs ) . Pruning can be neuron pruning , filter pruning , weight pruning , and layer pruning . In neuron pruning , individual neurons are removed , i.e . , all the incoming and outgoing connections to a neuron are also removed [ 9 ] . In filter pruning , CNN filters are removed [ 10 ] . In layer pruning , some of the layers can also be pruned [ 11 ] . Weight pruning is used synonymously for unstructured pruning , where the redundant weights are set to zero . The two fundamental objectives for pruning the model are : ( 1 ) reducing the memory by lowering the NPs and reducing the latency and energy consumption of the computation by reducing MACs . These two objectives are often conflicting in a DNN because the MACs are concentrated in the lower layers of a typical image classification network and the NPs are concentrated in the higher layers of a typical image classification network . Pruning can be structured or unstructured . In structured pruning , the filters and weights are eliminated by removing all their input and output connections , and this means that no additional compilation techniques or hardware optimization is required to obtain the gain on hardware in terms of reduction in the size of the model or reduction in the inference time of a sample . This is because the whole model structured is changed in unstructured pruning . In unstructured pruning , the unimportant filters or weights are set to zero , a compiler utilizes these zeros to skip some computations , thereby decreasing the inference time . Unstructured pruning has an additional cost in terms of compilation effort or computational effort in order to exploit the irregular sparsity . Typically , unstructured pruning provides a more pruning ratio as compared to structure pruning . Network Pruning can also be classified in terms of static pruning and dynamic pruning . In static pruning , the parameters of a DNN are removed permanently , while in dynamic pruning , the parameters of a DNN are not removed permanently , instead , they are selectively used for computation based on the input to a DNN . A DNN can be pruned using static pruning , thereby reducing MACs and NPs , and then the same DNN can be dynamically pruned as well . In [ 12 ] , the authors surveyed dynamic neural networks . They divided dynamic networks into three main categories : ( 1 ) instance-wise dynamic models that process each input sample or instance with data-dependent architectures or parameters , ( 2 ) spatial-wise dynamic networks that conduct adaptive computation with respect to different spatial locations of image data , and 3 ) temporal-wise dynamic models that perform adaptive inference along the temporal dimension for sequential data such as videos and texts . Our work comes under the category of instance-wise dynamic models . Within this category , the two types of dynamic networks that are relevant to our work are ( 1 ) dynamic depth models and ( 2 ) dynamic width models . In dynamic depth models , the sample could be predicted earlier in a network . Works such as [ 13 ] utilize this strategy . This strategy is based on the principle that an easier sample in a dataset can be predicted earlier within a network than a hard sample . In contrast to dynamic depth models , the dynamic width models change the number of filters or channels of a CNN , based on the input sample . In [ 14 ] , the authors utilized reinforcement learning for training an agent that judges the importance of each convolutional kernel and conducts channel-wise pruning conditioned on different samples such that the network is pruned more when the sample is easier . Their work utilizes hardness of sample for dynamic behavior in a DNN , whereas our work utilizes coarse prediction . Similar to our work is [ 15 ] , in which the authors proposed a Learning Kernel Activation Module ( LKAM ) , which is able to dynamically activate or deactivate a subset of filter kernels depending upon the input image content during the inference phase . Their method requires a bank of 1x1 convolutional kernels followed by average pooling and a sigmoid function in order to choose which filter kernels in a layer will be activated . Our work is unique in this regard that in addition to classifying easy samples earlier , we utilize an intermediate branch to perform a coarse prediction . The lower layers of a CNN output simpler features , while the higher layers output more categorical features that correlate with a specific class . In higher layers , different filters output features specific to various classes . The concept behind our proposed dynamic pruning is to perform a coarse prediction . Then based on this coarse prediction , we select the CNN filters only relevant to specific classes . explainable AI allows us to obtain filter importances relative to specific classes . Our approach allows us to reduce the average latency as well as the longest-path latency of inference while keeping the overhead low and hardware implementation easy . 1.1 CONTRIBUTIONS . Our contribution can be summarized in the following points : • We propose a novel method for dynamic pruning that utilizes early exit along with early coarse prediction and explainable AI . • The early coarse prediction branch is trained using deep top-k loss . If the branch predicts a sample with high confidence , the prediction is made . Otherwise , coarse prediction is obtained , thereby restricting the possible output to be within a subset of classes . • The coarse prediction is used to dynamically select CNN filters relevant for those classes . • The filters relevant for all output classes are obtained in prior using explainable AI . In run-time , only ranking of filters is done . • The dynamically pruned model is trainable and easily deployable on the end hardware . 2 BACKGROUND . In this section , we briefly describe some of the concepts that are utilized in our work . 2.1 RANKING CRITERIA FOR PRUNING . One of the most essential tasks in filter pruning is to rank the filters based on their importances . The importance of a filter can be obtained locally within a layer or it can be obtained globally within a network . Some ranking criteria for pruning are as follows : Magnitude-based metrics These methods utilize ℓ1-norm and ℓ2-norm of the model weights and have been shown to work reasonably well for general cases in works such as [ 16 ] and [ 17 ] . Loss-preservation based metrics These measures determine the effect of removing a set of parameters on model loss , for example , first-order Taylor decomposition has been used for this purpose by [ 18 ] . XAI-based metrics As described in [ 19 ] , explainable AI ( XAI ) seeks to explain why a neural network produces the output that it does for the input it gets . Explanations of DNNs can be of different types such as explaining which neurons are most sensitive ( saliency methods ) , which neurons have the most effect on output , which input excites which neurons ( signal methods ) , etc . For example , explainable AI has been used to guide the quantization and pruning of DNNs [ 20 ] . Saliency methods explain the decision of a neural network by assigning values that reflect the importance of input components in their contribution towards the output . These methods can be used to obtain the importance of both the features and the weights . Some of the methods in this category are for example : DeepLift [ 21 ] , Conductance [ 22 ] , IntegratedGradients [ 23 ] , etc . We choose DeepLIFT as our work is not aimed at comparing different explainable-AI methods specifically , rather it utilizes them in a novel pruning strategy . We choose DeepLIFT due to its robustness and less computational requirement . One of the most attractive aspects of explainable AI based algorithms is that they provide scores of different filters respective to each output class , which makes it possible for these methods to be utilized in our dynamic pruning architecture . DeepLIFT In [ 21 ] , the authors propose a method for decomposing the output prediction of a neural network on a specific input by backpropagating the contributions of all neurons in the network to every feature of the input . DeepLIFT compares the activation of each neuron to its reference activation and assigns contribution scores according to the difference . The choice of reference activation is important for the algorithm ’ s outcome , and it often requires domain-specific knowledge . To specify a reference activation , we must understand the intuition behind the DeepLIFT algorithm . It compares the effect of the features to a baseline of what the model would predict when it can not see the features . Therefore , a good reference activation for MNIST [ 24 ] is an all-black image . Mathematically , the DeepLIFT algorithm works as follows : Let t represent some target output neuron of interest and let x1 , x2 , . . . , xn′ represent some neurons in some intermediate layer or set of layers that are necessary and sufficient to compute t. Let t0 represent the reference activation of t. The quantity ∆t is defined as the difference-from-reference , that is ∆t = t − t0 . DeepLIFT assigns contribution scores C∆xi∆t to ∆xi s.t . : n′ ∑ i=1 C∆xi∆t = ∆t ( 1 ) C∆xi∆t can be thought of as the amount of difference-from-reference t that is attributed to the differencefrom-reference of xi . ∆t is the DeepLIFT score , which can be represented as follows : DL ( t , x ) = n′ ∑ i=1 C∆xi∆t ( 2 ) 2.2 OBTAINING FILTER IMPORTANCES FROM EXPLAINABLE AI ALGORITHMS . The explainable AI methods take a sample of a dataset as input and output sensitivity maps instead of activations/feature maps . These sensitivity maps have the same dimensions as the feature maps . Let Ω be a set of all indices of all feature map elements of all layers of a neural network , I ( m , Ω ) be the importances of all feature map elements from mth sample from the validation set , then we can define total feature map importance as the average of importances obtained from M samples : I ( θ ) = 1 M M−1 ∑ m=0 I ( m , θ ) ( 3 ) where M is the number of samples used by the XAI method for obtaining the importances . M varies depending upon the dataset , its typical value is 1–2 % of validation samples for CIFAR10 . These sensitivity maps are converted into the importances of the filter weights using different methods , which are as follows : ℓ1-norm criteria We can take ℓ1-norm of the sensitivity map . For example , for a d×d convolutional kernel , for each sample m∈M , the explainable AI method outputs a sensitivity map O of height H and width W , the sensitivity of the weights of this convolutional kernel is given by : W−1 ∑ w=0 H−1 ∑ h=0 |Ow , h| / ( H × W ) . Max-Min criteria We can take also get importances by subtracting max from min of a importances , this is useful in DeepLIFT which also outputs negative importances to indicate pixels that negate a class . This will be given by : W−1 ∑ w=0 H−1 ∑ h=0 max ( Ow , h ) −min ( Ow , h ) / ( H ×W ) . | This paper proposed a new dynamic filter pruning method that utilizes explainable AI along with early coarse prediction in the intermediate layers of a CNN. The early coarse prediction branch is trained using deep top-k loss, and the coarse prediction is used to dynamically select CNN filters relevant for those classes. The filters relevant for all output classes are obtained in prior using explainable AI. The dynamically pruned model by the proposed method is trainable and easily deployable on the various end hardware. | SP:a4030043a69cec335dafaea21b0afe6b3f5cf49b |
Convergent and Efficient Deep Q Learning Algorithm | 1 INTRODUCTION . With the development of deep learning , reinforcement learning ( RL ) that utilizes deep neural networks has demonstrated great success recently , finding applications in various fields including robotics , games , and scientific research ( Levine et al. , 2018 ; Berner et al. , 2019 ; Fösel et al. , 2018 ; Wang et al. , 2020 ) . One of the most efficient RL strategy is Q-learning ( Watkins , 1989 ) , and the combination of Q-learning and deep learning leads to the DQN algorithms ( Mnih et al. , 2015 ; Hessel et al. , 2018 ; Riedmiller , 2005 ) , which hold records on many difficult RL tasks ( Badia et al. , 2020 ) . However , unlike supervised learning , Q-learning , or more generally temporal difference ( TD ) learning , does not guarantee convergence when function approximations such as neural networks are used , and as a result , their success is actually empirical , and the performance relies heavily on hyperparameter tuning and technical details involved . This happens because the agent uses its own prediction to construct the learning objective , a.k.a . bootstrapping , and as it generalizes , its predictions over different data interfere with each other , which can make its learning objective unstable in the course of training and potentially lead to instability and divergence . This non-convergence problem was pointed out decades ago by the pioneering works of Baird ( 1995 ) and Tsitsiklis & Van Roy ( 1997 ) , and it has been empirically investigated for DQN by Van Hasselt et al . ( 2018 ) . We have also observed the divergence of DQN in our experiments , as in Fig . 6 . The non-convergence problem often shows up as instability in practice and it places significant obstacles to the application of DQN to complicated tasks . It makes the training with deeper neural networks more difficult , limits the time horizon for planning , and makes the results sometimes unstable and sensitive to hyperparameters . This state of affairs is not satisfactory especially for those scientific applications that require convergence and generality . Although convergent gradient-based methods have also been proposed ( Sutton et al. , 2009 ; Bhatnagar et al. , 2009 ; Feng et al. , 2019 ; Ghiassian et al. , 2020 ) , they can not easily be used with deep non-linear neural networks as they either require linearity or involve computationally heavy operations , and they often show worse empirical performance compared with TD methods . In this work , we show that the above-mentioned gradient-based methods actually have inherent problems in learning dynamics which hamper efficient learning , and we propose a convergent DQN ( C-DQN ) algorithm by modifying the loss of DQN . Because an increase of loss upon updating the target network of DQN is a necessary condition for its divergence , we construct a loss that does not increase upon the update of the target network , and therefore , the proposed algorithm converges in the sense that the loss monotonically decreases . In Sec . 2 we present the background . In Sec . 3 we discuss the inefficiency issues in the previous gradient-based methods and demonstrate using toy problems . In Sec . 4 we propose C-DQN and show its convergence . In Sec . 5 we show the results of C-DQN on the Atari 2600 benchmark ( Bellemare et al. , 2013 ) and in Sec . 6 we present the conclusion and future prospect . To our knowledge , the proposed C-DQN algorithm is the first convergent RL method that is sufficiently efficient and scalable to obtain successful results on the standard Atari 2600 benchmark using deep neural networks , showing its efficacy in dealing with realistic and complicated problems . 2 BACKGROUND . Reinforcement learning involves a Markov decision process ( MDP ) , where the state st of an environment at time step tmakes a transition to the next state st+1 conditioned on the action of the agent at at time t , producing a reward rt depending on the states . The process can terminate at terminal states sT , and the transition of states can be either probabilistic or deterministic . The goal is to find a policy π ( s ) to determine the actions at+i ∼ π ( st+i ) in order to maximizes the return ∑T−t i=0 rt+i , i.e. , the sum of future rewards . In practice , a discounted return ∑T−t i=0 γ irt+i is often used instead , with the discount factor γ < 1 and γ ≈ 1 , so that the expression is convergent for T →∞ and that rewards far into the future can be ignored , giving an effective time horizon 11−γ . The value function is defined as the expected return for a state st following a policy π , and the Q function is defined as the expected return for a state-action pair ( st , at ) : Vπ ( st ) = Eat , { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , Qπ ( st , at ) = E { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , ( 1 ) with at+i ∼ π ( st+i ) in the evaluation of the expectation . When the Q function is maximized by a policy , we say that the policy is optimal and denote the Q function and the policy by Q∗ and π∗ , respectively . The optimality implies that Q∗ satisfies the Bellman equation ( Sutton & Barto , 2018 ) Q∗ ( st , at ) = rt + γEst+1 [ max a′ Q∗ ( st+1 , a ′ ) ] . ( 2 ) The policy π∗ is greedy with respect to Q∗ , i.e . π∗ ( s ) = arg maxa′ Q ∗ ( s , a′ ) . Q-learning uses this recursive relation to learn Q∗ . In this work we only consider the deterministic case and drop the notation Est+1 [ · ] where appropriate . When the space of state-action pairs is small and finite , we can write down the values of an arbitrarily initialized Q function for all state-action pairs into a table , and iterate over the values using ∆Q ( st , at ) = α ( rt + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 3 ) where α is the learning rate . This is called Q-table learning and it guarantees convergence to Q∗ . If the space of ( s , a ) is large and Q-table learning is impossible , a function approximation is used instead , representing the Q function as Qθ with learnable parameter θ . The learning rule is ∆θ = α∇θQθ ( st , at ) ( rt + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) , ( 4 ) which can be interpreted as modifying the value of Qθ ( st , at ) following the gradient so that Qθ ( st , at ) approaches the target value rt + γmaxa′ Qθ ( st+1 , a′ ) . However , this iteration may not converge , because the term maxa′ Qθ ( st+1 , a′ ) is also θ-dependent and may change together with Qθ ( st , at ) . Specifically , an exponential divergence occurs if γ∇θQθ ( st , at ) · ∇θ maxa′ Qθ ( st+1 , a′ ) > ||∇θQθ ( st , at ) ||2 is always satisfied and the value of maxa′ Qθ ( st+1 , a′ ) is not constrained by other means.1 This can be a serious issue for realistic tasks , because the adjacent states st and st+1 often have similar representations and∇θQθ ( st , · ) is close to∇θQθ ( st+1 , · ) . The DQN algorithm uses a deep neural network with parameters θ as Qθ ( Mnih et al. , 2015 ) , and to stabilize learning , it introduces a target network with parameters θ̃ , and replace the term maxa′ Qθ ( st+1 , a ′ ) by maxa′ Qθ̃ ( st+1 , a ′ ) , so that the target value rt + γmaxa′ Qθ̃ ( st+1 , a ′ ) does 1This can be shown by checking the Bellman error δt : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) , for which we have ∆δt = αδt ( γ∇θQθ ( st , at ) ·maxa′ Qθ ( st+1 , a′ ) − ||∇θQθ ( st , at ) ||2 ) up to the first order of ∆θ following Eq . ( 4 ) . As ∆δt is proportional to δt with the same sign , it can increase exponentially . not change simultaneously with Qθ . The target network θ̃ is then updated by copying from θ for every few thousand iterations of θ . This technique reduces fluctuations in the target value and dramatically improves the stability of learning , and with the use of offline sampling and adaptive optimizers , it can learn various tasks such as video games and simulated robotic control ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ) . Nevertheless , the introduction of the target network θ̃ is not well-principled , and it does not really preclude the possibility of divergence . As a result , DQN sometimes requires a significant amount of hyperparameter tuning in order to work well for a new task , and in some cases , the instability in learning can be hard to diagnose or remove , and usually one can not use a discount factor γ that is very close to 1 . In an attempt to solve this problem , Durugkar & Stone ( 2017 ) considered only updating θ in a direction that is perpendicular to ∇θ maxa′ Qθ ( st+1 , a′ ) ; however , this strategy is not satisfactory in general and can lead to poor performance , as shown in Pohlen et al . ( 2018 ) . One way of approaching this problem is to consider the mean squared Bellman error ( MSBE ) , which is originally proposed by Baird ( 1995 ) and called the residual gradient ( RG ) algorithm . The Bellman error , or Bellman residual , TD error , is given by δt ( θ ) : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) . Given a dataset S of state-action data , δt is a function of θ , and we can minimize the MSBE loss LMSBE ( θ ) : = E [ |δ ( θ ) |2 ] = 1 |S| ∑ ( st , at , rt , st+1 ) ∈S ∣∣∣Qθ ( st , at ) − rt − γmax a′ Qθ ( st+1 , a ′ ) ∣∣∣2 , ( 5 ) and in practice the loss is minimized via gradient descent . If LMSBE becomes zero , we have δt ≡ 0 and the Bellman equation is satisfied , implying Qθ = Q∗ . Given a fixed dataset S , the convergence of the learning process simply follows the convergence of the optimization of the loss . This strategy can be used with neural networks straightforwardly . There have also been many improvements on this strategy including Sutton et al . ( 2008 ; 2009 ) ; Bhatnagar et al . ( 2009 ) ; Dai et al . ( 2018 ) ; Feng et al . ( 2019 ) ; Ghiassian et al . ( 2020 ) ; Touati et al . ( 2018 ) , and they are often referred to as gradientTD methods . Many of them have focused on how to evaluate the expectation term in Eq . ( 2 ) and make it converge to the same solution found by TD , or Q-learning . However , most of these methods often do not work well for difficult problems , and few of them have been successfully demonstrated on standard RL benchmarks , especially the Atari 2600 benchmark . In the following we refer to the strategy of simply minimizing LMSBE as the RG algorithm , or RG learning . | The paper argues that the DQN and its algorithm and its variants do not guarantee convergence and that they can diverge in realistic settings. The authors develop a new technique that guarantees convergence of DQN. The authors show that in the case of very large discount factors (such as 0.9998) this algorithm outperforms baseline algorithms on certain Atari games. | SP:c5056fb9a101fcea018a8615f848cc2464cfca1c |
Convergent and Efficient Deep Q Learning Algorithm | 1 INTRODUCTION . With the development of deep learning , reinforcement learning ( RL ) that utilizes deep neural networks has demonstrated great success recently , finding applications in various fields including robotics , games , and scientific research ( Levine et al. , 2018 ; Berner et al. , 2019 ; Fösel et al. , 2018 ; Wang et al. , 2020 ) . One of the most efficient RL strategy is Q-learning ( Watkins , 1989 ) , and the combination of Q-learning and deep learning leads to the DQN algorithms ( Mnih et al. , 2015 ; Hessel et al. , 2018 ; Riedmiller , 2005 ) , which hold records on many difficult RL tasks ( Badia et al. , 2020 ) . However , unlike supervised learning , Q-learning , or more generally temporal difference ( TD ) learning , does not guarantee convergence when function approximations such as neural networks are used , and as a result , their success is actually empirical , and the performance relies heavily on hyperparameter tuning and technical details involved . This happens because the agent uses its own prediction to construct the learning objective , a.k.a . bootstrapping , and as it generalizes , its predictions over different data interfere with each other , which can make its learning objective unstable in the course of training and potentially lead to instability and divergence . This non-convergence problem was pointed out decades ago by the pioneering works of Baird ( 1995 ) and Tsitsiklis & Van Roy ( 1997 ) , and it has been empirically investigated for DQN by Van Hasselt et al . ( 2018 ) . We have also observed the divergence of DQN in our experiments , as in Fig . 6 . The non-convergence problem often shows up as instability in practice and it places significant obstacles to the application of DQN to complicated tasks . It makes the training with deeper neural networks more difficult , limits the time horizon for planning , and makes the results sometimes unstable and sensitive to hyperparameters . This state of affairs is not satisfactory especially for those scientific applications that require convergence and generality . Although convergent gradient-based methods have also been proposed ( Sutton et al. , 2009 ; Bhatnagar et al. , 2009 ; Feng et al. , 2019 ; Ghiassian et al. , 2020 ) , they can not easily be used with deep non-linear neural networks as they either require linearity or involve computationally heavy operations , and they often show worse empirical performance compared with TD methods . In this work , we show that the above-mentioned gradient-based methods actually have inherent problems in learning dynamics which hamper efficient learning , and we propose a convergent DQN ( C-DQN ) algorithm by modifying the loss of DQN . Because an increase of loss upon updating the target network of DQN is a necessary condition for its divergence , we construct a loss that does not increase upon the update of the target network , and therefore , the proposed algorithm converges in the sense that the loss monotonically decreases . In Sec . 2 we present the background . In Sec . 3 we discuss the inefficiency issues in the previous gradient-based methods and demonstrate using toy problems . In Sec . 4 we propose C-DQN and show its convergence . In Sec . 5 we show the results of C-DQN on the Atari 2600 benchmark ( Bellemare et al. , 2013 ) and in Sec . 6 we present the conclusion and future prospect . To our knowledge , the proposed C-DQN algorithm is the first convergent RL method that is sufficiently efficient and scalable to obtain successful results on the standard Atari 2600 benchmark using deep neural networks , showing its efficacy in dealing with realistic and complicated problems . 2 BACKGROUND . Reinforcement learning involves a Markov decision process ( MDP ) , where the state st of an environment at time step tmakes a transition to the next state st+1 conditioned on the action of the agent at at time t , producing a reward rt depending on the states . The process can terminate at terminal states sT , and the transition of states can be either probabilistic or deterministic . The goal is to find a policy π ( s ) to determine the actions at+i ∼ π ( st+i ) in order to maximizes the return ∑T−t i=0 rt+i , i.e. , the sum of future rewards . In practice , a discounted return ∑T−t i=0 γ irt+i is often used instead , with the discount factor γ < 1 and γ ≈ 1 , so that the expression is convergent for T →∞ and that rewards far into the future can be ignored , giving an effective time horizon 11−γ . The value function is defined as the expected return for a state st following a policy π , and the Q function is defined as the expected return for a state-action pair ( st , at ) : Vπ ( st ) = Eat , { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , Qπ ( st , at ) = E { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , ( 1 ) with at+i ∼ π ( st+i ) in the evaluation of the expectation . When the Q function is maximized by a policy , we say that the policy is optimal and denote the Q function and the policy by Q∗ and π∗ , respectively . The optimality implies that Q∗ satisfies the Bellman equation ( Sutton & Barto , 2018 ) Q∗ ( st , at ) = rt + γEst+1 [ max a′ Q∗ ( st+1 , a ′ ) ] . ( 2 ) The policy π∗ is greedy with respect to Q∗ , i.e . π∗ ( s ) = arg maxa′ Q ∗ ( s , a′ ) . Q-learning uses this recursive relation to learn Q∗ . In this work we only consider the deterministic case and drop the notation Est+1 [ · ] where appropriate . When the space of state-action pairs is small and finite , we can write down the values of an arbitrarily initialized Q function for all state-action pairs into a table , and iterate over the values using ∆Q ( st , at ) = α ( rt + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 3 ) where α is the learning rate . This is called Q-table learning and it guarantees convergence to Q∗ . If the space of ( s , a ) is large and Q-table learning is impossible , a function approximation is used instead , representing the Q function as Qθ with learnable parameter θ . The learning rule is ∆θ = α∇θQθ ( st , at ) ( rt + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) , ( 4 ) which can be interpreted as modifying the value of Qθ ( st , at ) following the gradient so that Qθ ( st , at ) approaches the target value rt + γmaxa′ Qθ ( st+1 , a′ ) . However , this iteration may not converge , because the term maxa′ Qθ ( st+1 , a′ ) is also θ-dependent and may change together with Qθ ( st , at ) . Specifically , an exponential divergence occurs if γ∇θQθ ( st , at ) · ∇θ maxa′ Qθ ( st+1 , a′ ) > ||∇θQθ ( st , at ) ||2 is always satisfied and the value of maxa′ Qθ ( st+1 , a′ ) is not constrained by other means.1 This can be a serious issue for realistic tasks , because the adjacent states st and st+1 often have similar representations and∇θQθ ( st , · ) is close to∇θQθ ( st+1 , · ) . The DQN algorithm uses a deep neural network with parameters θ as Qθ ( Mnih et al. , 2015 ) , and to stabilize learning , it introduces a target network with parameters θ̃ , and replace the term maxa′ Qθ ( st+1 , a ′ ) by maxa′ Qθ̃ ( st+1 , a ′ ) , so that the target value rt + γmaxa′ Qθ̃ ( st+1 , a ′ ) does 1This can be shown by checking the Bellman error δt : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) , for which we have ∆δt = αδt ( γ∇θQθ ( st , at ) ·maxa′ Qθ ( st+1 , a′ ) − ||∇θQθ ( st , at ) ||2 ) up to the first order of ∆θ following Eq . ( 4 ) . As ∆δt is proportional to δt with the same sign , it can increase exponentially . not change simultaneously with Qθ . The target network θ̃ is then updated by copying from θ for every few thousand iterations of θ . This technique reduces fluctuations in the target value and dramatically improves the stability of learning , and with the use of offline sampling and adaptive optimizers , it can learn various tasks such as video games and simulated robotic control ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ) . Nevertheless , the introduction of the target network θ̃ is not well-principled , and it does not really preclude the possibility of divergence . As a result , DQN sometimes requires a significant amount of hyperparameter tuning in order to work well for a new task , and in some cases , the instability in learning can be hard to diagnose or remove , and usually one can not use a discount factor γ that is very close to 1 . In an attempt to solve this problem , Durugkar & Stone ( 2017 ) considered only updating θ in a direction that is perpendicular to ∇θ maxa′ Qθ ( st+1 , a′ ) ; however , this strategy is not satisfactory in general and can lead to poor performance , as shown in Pohlen et al . ( 2018 ) . One way of approaching this problem is to consider the mean squared Bellman error ( MSBE ) , which is originally proposed by Baird ( 1995 ) and called the residual gradient ( RG ) algorithm . The Bellman error , or Bellman residual , TD error , is given by δt ( θ ) : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) . Given a dataset S of state-action data , δt is a function of θ , and we can minimize the MSBE loss LMSBE ( θ ) : = E [ |δ ( θ ) |2 ] = 1 |S| ∑ ( st , at , rt , st+1 ) ∈S ∣∣∣Qθ ( st , at ) − rt − γmax a′ Qθ ( st+1 , a ′ ) ∣∣∣2 , ( 5 ) and in practice the loss is minimized via gradient descent . If LMSBE becomes zero , we have δt ≡ 0 and the Bellman equation is satisfied , implying Qθ = Q∗ . Given a fixed dataset S , the convergence of the learning process simply follows the convergence of the optimization of the loss . This strategy can be used with neural networks straightforwardly . There have also been many improvements on this strategy including Sutton et al . ( 2008 ; 2009 ) ; Bhatnagar et al . ( 2009 ) ; Dai et al . ( 2018 ) ; Feng et al . ( 2019 ) ; Ghiassian et al . ( 2020 ) ; Touati et al . ( 2018 ) , and they are often referred to as gradientTD methods . Many of them have focused on how to evaluate the expectation term in Eq . ( 2 ) and make it converge to the same solution found by TD , or Q-learning . However , most of these methods often do not work well for difficult problems , and few of them have been successfully demonstrated on standard RL benchmarks , especially the Atari 2600 benchmark . In the following we refer to the strategy of simply minimizing LMSBE as the RG algorithm , or RG learning . | This paper studies several issues of DQN (basically FQI, a version of fixed-point iteration) and empirical Bellman error minimization (has a clear loss function). Several issues of MSBE are pointed out. The authors propose a new approach by replacing the DQN loss by the maximum of DQN loss and MSBE loss. Several experiments on Atari games support the argument. | SP:c5056fb9a101fcea018a8615f848cc2464cfca1c |
Convergent and Efficient Deep Q Learning Algorithm | 1 INTRODUCTION . With the development of deep learning , reinforcement learning ( RL ) that utilizes deep neural networks has demonstrated great success recently , finding applications in various fields including robotics , games , and scientific research ( Levine et al. , 2018 ; Berner et al. , 2019 ; Fösel et al. , 2018 ; Wang et al. , 2020 ) . One of the most efficient RL strategy is Q-learning ( Watkins , 1989 ) , and the combination of Q-learning and deep learning leads to the DQN algorithms ( Mnih et al. , 2015 ; Hessel et al. , 2018 ; Riedmiller , 2005 ) , which hold records on many difficult RL tasks ( Badia et al. , 2020 ) . However , unlike supervised learning , Q-learning , or more generally temporal difference ( TD ) learning , does not guarantee convergence when function approximations such as neural networks are used , and as a result , their success is actually empirical , and the performance relies heavily on hyperparameter tuning and technical details involved . This happens because the agent uses its own prediction to construct the learning objective , a.k.a . bootstrapping , and as it generalizes , its predictions over different data interfere with each other , which can make its learning objective unstable in the course of training and potentially lead to instability and divergence . This non-convergence problem was pointed out decades ago by the pioneering works of Baird ( 1995 ) and Tsitsiklis & Van Roy ( 1997 ) , and it has been empirically investigated for DQN by Van Hasselt et al . ( 2018 ) . We have also observed the divergence of DQN in our experiments , as in Fig . 6 . The non-convergence problem often shows up as instability in practice and it places significant obstacles to the application of DQN to complicated tasks . It makes the training with deeper neural networks more difficult , limits the time horizon for planning , and makes the results sometimes unstable and sensitive to hyperparameters . This state of affairs is not satisfactory especially for those scientific applications that require convergence and generality . Although convergent gradient-based methods have also been proposed ( Sutton et al. , 2009 ; Bhatnagar et al. , 2009 ; Feng et al. , 2019 ; Ghiassian et al. , 2020 ) , they can not easily be used with deep non-linear neural networks as they either require linearity or involve computationally heavy operations , and they often show worse empirical performance compared with TD methods . In this work , we show that the above-mentioned gradient-based methods actually have inherent problems in learning dynamics which hamper efficient learning , and we propose a convergent DQN ( C-DQN ) algorithm by modifying the loss of DQN . Because an increase of loss upon updating the target network of DQN is a necessary condition for its divergence , we construct a loss that does not increase upon the update of the target network , and therefore , the proposed algorithm converges in the sense that the loss monotonically decreases . In Sec . 2 we present the background . In Sec . 3 we discuss the inefficiency issues in the previous gradient-based methods and demonstrate using toy problems . In Sec . 4 we propose C-DQN and show its convergence . In Sec . 5 we show the results of C-DQN on the Atari 2600 benchmark ( Bellemare et al. , 2013 ) and in Sec . 6 we present the conclusion and future prospect . To our knowledge , the proposed C-DQN algorithm is the first convergent RL method that is sufficiently efficient and scalable to obtain successful results on the standard Atari 2600 benchmark using deep neural networks , showing its efficacy in dealing with realistic and complicated problems . 2 BACKGROUND . Reinforcement learning involves a Markov decision process ( MDP ) , where the state st of an environment at time step tmakes a transition to the next state st+1 conditioned on the action of the agent at at time t , producing a reward rt depending on the states . The process can terminate at terminal states sT , and the transition of states can be either probabilistic or deterministic . The goal is to find a policy π ( s ) to determine the actions at+i ∼ π ( st+i ) in order to maximizes the return ∑T−t i=0 rt+i , i.e. , the sum of future rewards . In practice , a discounted return ∑T−t i=0 γ irt+i is often used instead , with the discount factor γ < 1 and γ ≈ 1 , so that the expression is convergent for T →∞ and that rewards far into the future can be ignored , giving an effective time horizon 11−γ . The value function is defined as the expected return for a state st following a policy π , and the Q function is defined as the expected return for a state-action pair ( st , at ) : Vπ ( st ) = Eat , { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , Qπ ( st , at ) = E { ( st+i , at+i ) } T−ti=1 [ T−t∑ i=0 γirt+i ] , ( 1 ) with at+i ∼ π ( st+i ) in the evaluation of the expectation . When the Q function is maximized by a policy , we say that the policy is optimal and denote the Q function and the policy by Q∗ and π∗ , respectively . The optimality implies that Q∗ satisfies the Bellman equation ( Sutton & Barto , 2018 ) Q∗ ( st , at ) = rt + γEst+1 [ max a′ Q∗ ( st+1 , a ′ ) ] . ( 2 ) The policy π∗ is greedy with respect to Q∗ , i.e . π∗ ( s ) = arg maxa′ Q ∗ ( s , a′ ) . Q-learning uses this recursive relation to learn Q∗ . In this work we only consider the deterministic case and drop the notation Est+1 [ · ] where appropriate . When the space of state-action pairs is small and finite , we can write down the values of an arbitrarily initialized Q function for all state-action pairs into a table , and iterate over the values using ∆Q ( st , at ) = α ( rt + γmax a′ Q ( st+1 , a ′ ) −Q ( st , at ) ) , ( 3 ) where α is the learning rate . This is called Q-table learning and it guarantees convergence to Q∗ . If the space of ( s , a ) is large and Q-table learning is impossible , a function approximation is used instead , representing the Q function as Qθ with learnable parameter θ . The learning rule is ∆θ = α∇θQθ ( st , at ) ( rt + γmax a′ Qθ ( st+1 , a ′ ) −Qθ ( st , at ) ) , ( 4 ) which can be interpreted as modifying the value of Qθ ( st , at ) following the gradient so that Qθ ( st , at ) approaches the target value rt + γmaxa′ Qθ ( st+1 , a′ ) . However , this iteration may not converge , because the term maxa′ Qθ ( st+1 , a′ ) is also θ-dependent and may change together with Qθ ( st , at ) . Specifically , an exponential divergence occurs if γ∇θQθ ( st , at ) · ∇θ maxa′ Qθ ( st+1 , a′ ) > ||∇θQθ ( st , at ) ||2 is always satisfied and the value of maxa′ Qθ ( st+1 , a′ ) is not constrained by other means.1 This can be a serious issue for realistic tasks , because the adjacent states st and st+1 often have similar representations and∇θQθ ( st , · ) is close to∇θQθ ( st+1 , · ) . The DQN algorithm uses a deep neural network with parameters θ as Qθ ( Mnih et al. , 2015 ) , and to stabilize learning , it introduces a target network with parameters θ̃ , and replace the term maxa′ Qθ ( st+1 , a ′ ) by maxa′ Qθ̃ ( st+1 , a ′ ) , so that the target value rt + γmaxa′ Qθ̃ ( st+1 , a ′ ) does 1This can be shown by checking the Bellman error δt : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) , for which we have ∆δt = αδt ( γ∇θQθ ( st , at ) ·maxa′ Qθ ( st+1 , a′ ) − ||∇θQθ ( st , at ) ||2 ) up to the first order of ∆θ following Eq . ( 4 ) . As ∆δt is proportional to δt with the same sign , it can increase exponentially . not change simultaneously with Qθ . The target network θ̃ is then updated by copying from θ for every few thousand iterations of θ . This technique reduces fluctuations in the target value and dramatically improves the stability of learning , and with the use of offline sampling and adaptive optimizers , it can learn various tasks such as video games and simulated robotic control ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ) . Nevertheless , the introduction of the target network θ̃ is not well-principled , and it does not really preclude the possibility of divergence . As a result , DQN sometimes requires a significant amount of hyperparameter tuning in order to work well for a new task , and in some cases , the instability in learning can be hard to diagnose or remove , and usually one can not use a discount factor γ that is very close to 1 . In an attempt to solve this problem , Durugkar & Stone ( 2017 ) considered only updating θ in a direction that is perpendicular to ∇θ maxa′ Qθ ( st+1 , a′ ) ; however , this strategy is not satisfactory in general and can lead to poor performance , as shown in Pohlen et al . ( 2018 ) . One way of approaching this problem is to consider the mean squared Bellman error ( MSBE ) , which is originally proposed by Baird ( 1995 ) and called the residual gradient ( RG ) algorithm . The Bellman error , or Bellman residual , TD error , is given by δt ( θ ) : = rt + γmaxa′ Qθ ( st+1 , a′ ) − Qθ ( st , at ) . Given a dataset S of state-action data , δt is a function of θ , and we can minimize the MSBE loss LMSBE ( θ ) : = E [ |δ ( θ ) |2 ] = 1 |S| ∑ ( st , at , rt , st+1 ) ∈S ∣∣∣Qθ ( st , at ) − rt − γmax a′ Qθ ( st+1 , a ′ ) ∣∣∣2 , ( 5 ) and in practice the loss is minimized via gradient descent . If LMSBE becomes zero , we have δt ≡ 0 and the Bellman equation is satisfied , implying Qθ = Q∗ . Given a fixed dataset S , the convergence of the learning process simply follows the convergence of the optimization of the loss . This strategy can be used with neural networks straightforwardly . There have also been many improvements on this strategy including Sutton et al . ( 2008 ; 2009 ) ; Bhatnagar et al . ( 2009 ) ; Dai et al . ( 2018 ) ; Feng et al . ( 2019 ) ; Ghiassian et al . ( 2020 ) ; Touati et al . ( 2018 ) , and they are often referred to as gradientTD methods . Many of them have focused on how to evaluate the expectation term in Eq . ( 2 ) and make it converge to the same solution found by TD , or Q-learning . However , most of these methods often do not work well for difficult problems , and few of them have been successfully demonstrated on standard RL benchmarks , especially the Atari 2600 benchmark . In the following we refer to the strategy of simply minimizing LMSBE as the RG algorithm , or RG learning . | The paper addresses the problem of unstable learning that arises in NFQ type RL methods. It is assumed that the problem can be overcome by a provably convergent NFQ-like method. Such a provably convergent method is presented and tested on a selection of benchmarks and compared to DQN. | SP:c5056fb9a101fcea018a8615f848cc2464cfca1c |
Pre-training Molecular Graph Representation with 3D Geometry | 1 INTRODUCTION . In recent years , drug discovery has drawn increasing interest in the machine learning community . Among many challenges therein , how to discriminatively represent a molecule with a vectorized embedding remains a fundamental yet open challenge . The underlying problem can be decomposed into two components : how to design a common latent space for molecule graphs ( i.e. , designing a suitable encoder ) and how to construct an objective function to supervise the training ( i.e. , defining a learning target ) . Falling broadly into the second category , our paper studies self-supervised molecular representation learning by leveraging the consistency between 3D geometry and 2D topology . Motivated by the prominent success of the pretraining-finetuning pipeline [ 16 ] , unsupervisedly pretrained graph neural networks for molecules yields promising performance on downstream tasks and becomes increasingly popular [ 39 , 48 , 72 , 80 , 91 , 92 ] . The key to pre-training lies in finding an effective proxy task ( i.e. , training objective ) to leverage the power of large unlabeled datasets . Inspired by [ 50 , 69 ] that molecular properties [ 27 , 48 ] can be better predicted by 3D geometry due to its encoded energy knowledge , we aim to make use of the 3D geometry of molecules in pre-training . However , the stereochemical structures are often very expensive to obtain , making such 3D geometric information scarce in downstream tasks . To address this problem , we propose the GraphMulti-View Pre-training ( GraphMVP ) framework , where a 2D molecule encoder is pre-trained with the knowledge of 3D geometry and then fine-tuned on downstream tasks without 3D information . Our learning paradigm , during pre-training , injects the knowledge of 3D molecular geometry to a 2D molecular graph encoder such that the downstream tasks can benefit from the implicit 3D geometry even if there is no 3D information available . We attain the aforementioned goal by leveraging two pretext tasks on the 3D and 2D molecular graphs : one contrastive and one generative SSL . Contrastive SSL creates the supervised signal at an inter-molecule level : the 3D and 2D graph pairs are positive if they are from the same molecule , and negative otherwise ; Then contrastive SSL [ 83 ] will align the positive pairs and contrast the negative pairs simultaneously . Generative SSL [ 36 , 45 , 81 ] , on the other hand , obtains the supervised signal in an intra-molecule way : it learns a 2D/3D representation that can reconstruct its 3D/2D counterpart view for each molecule itself . To cope with the challenge of measuring the quality of reconstruction on molecule 3D and 2D space , we further propose a novel surrogate objective function called variation representation reconstruction ( VRR ) for the generative SSL task , which can effectively compute such quality in the continuous representation space . The knowledge acquired by these two SSL tasks is complementary , so our GraphMVP framework integrates them to form more discriminative 2D molecular graph representation . Consistent performance improvements empirically validate the effectiveness of GraphMVP . We give additional insights to justify the effectiveness of GraphMVP . First , GraphMVP is a selfsupervised learning approach based on maximizing mutual information ( MI ) between 3D and 2D views , enabling the learnt representation to capture high-level factors [ 5 , 6 , 76 ] in molecule data . Second , we find that 3D molecular geometry is a form of privileged information [ 78 , 79 ] . It has been proven that using privileged information in training can accelerate the speed of learning . We are aware that privileged information is only used in training , while it is not available in testing . This perfectly matches our intuition of pre-training molecular representation with 3D geometry . Our major contributions include ( 1 ) To our best knowledge , we are the first to incorporate the 3D geometric information into graph SSL ; ( 2 ) We propose one contrastive and one generative SSL tasks for pre-training . Then we elaborate their differences and empirically validate that combining both can lead to a better representation ; ( 3 ) We provide theoretical insights and case studies justify why adding 3D geometry is beneficial ; ( 4 ) We achieve the SOTA performance among all the SSL baselines . Related work . We briefly review the most related works here and include a more detailed summarization in Appendix A. Self-supervised learning ( SSL ) methods have attracted massive attention to graph applications [ 49 , 51 , 85 , 87 ] . In general , there are roughly two categories of graph SSL : contrastive and generative , where they differ on the design of the supervised signals . Contrastive graph SSL [ 39 , 72 , 80 , 91 , 92 ] constructs the supervised signals at the inter-graph level and learns the representation by contrasting with other graphs , while generative graph SSL [ 32 , 39 , 40 , 48 ] focuses on reconstructing the original graph at the intra-graph level . One of the most significant differences that separate our work from existing methods is that all previous methods merely focus on 2D molecular topology . However , for scientific tasks such as molecular property prediction , 3D geometry should be incorporated as it provides complementary and comprehensive information [ 50 , 69 ] . To fill this gap , we propose GraphMVP to leverage the 3D geometry in graph self-supervised pre-training . 2 PRELIMINARIES . We first outline the key concepts and notations used in this work . Self-supervised learning ( SSL ) is based on the view design , where each view provides a specific aspect and modality of the data . Each molecule has two natural views : the 2D graph incorporates the topological structure defined by the adjacency , while the 3D graph can better reflect the geometry and spatial relation . From a chemical perspective , 3D geometric graphs focus on the energy while 2D graphs emphasize the topological information ; thus they can be composed for learning more informative representation in GraphMVP . Transformation is an atomic operation in SSL that can extract specific information from each view . Next , we will briefly introduce how to represent these two views of molecular graphs . 2D Molecular Graph represents molecules as 2D graphs , with atoms as nodes and bonds as edges . We denote it as g2D = ( X , E ) , where X is the atom attribute matrix and E is the bond attribute matrix . Notice that hereE also includes the bond connectivity . Then we will apply one transformation function T2D on the topological graph . Given a 2D molecular graph g2D , its representation h2D can be obtained from a 2D graph neural network ( GNN ) model : h2D = GNN-2D ( T2D ( g2D ) ) = GNN-2D ( T2D ( X , E ) ) . ( 1 ) 3D Molecular Graph additionally includes spatial positions of the atoms , which needless to be static since atoms are in continual motion on a potential energy surface [ 3 ] . 1 The 3D structures at the local minima on this surface are named conformer . As the molecular properties are conformers ensembled [ 34 ] , GraphMVP provides a novel perspective on adopting 3D conformers for learning better representation . Given a conformer g3D = ( X , R ) , its representation via a 3D GNN model is : h3D = GNN-3D ( T3D ( g3D ) ) = GNN-3D ( T3D ( X , R ) ) , ( 2 ) 1A more rigorous way of defining conformer is in [ 56 ] : a conformer is an isomer of a molecule that differs from another isomer by the rotation of a single bond in the molecule . where R is the 3D-coordinate matrix and T3D is the 3D transformation . In what follows , for notation simplicity , we use x and y for the 2D and 3D graphs , i.e. , x , g2D and y , g3D . Then the latent representations are denoted as hx and hy . 3 GRAPHMVP : GRAPH MULTI-VIEW PRE-TRAINING . Our model , termed as Graph Multi-View Pre-training ( GraphMVP ) , conducts self-supervised learning ( SSL ) pre-training with 3D information . The 3D conformers encode rich information about the molecule energy and spatial structure , which are complementary to the 2D topology . Thus , applying SSL between the 3D and 2D views will provide a better 2D representation , which implicitly embeds the ensembles of energies and geometric information for molecules . In the following , we first present an overview of proposed GraphMVP , and then introduce two pretext tasks specialized concerning 3D conformation structures . Finally , we summarize a broader graph SSL family that prevails the 2D molecular graph representation learning with 3D geometry . 3.1 OVERVIEW OF GRAPHMVP 3 As aforementioned , GraphMVP exerts 2D topology and 3D geometry as two complementary views for each molecule . By proceeding SSL between these views , it is expected to learn a 2D representation enhanced with 3D conformation , which can better reflect certain molecular properties . As generic SSL pre-training pipelines , GraphMVP has two stages : pre-training then fine-tuning . In the pre-training , we conduct SSL via auxiliary tasks on data collections providing both 3D and 2D molecular structures . During fine-tuning , the pre-trained 2D GNN models are subsequently fine tuned on specific downstream tasks , where usually only 2D structures are available . At the SSL pre-training stage , we design two pretext tasks : one contrastive and one generative . We conjecture then empirically prove that these two tasks are focusing on different learning aspects , which are concluded into following two points . ( 1 ) From the perspective of representation learning , contrastive SSL is learning from inter-data and generative SSL is learning by intra-data . For contrastive SSL , one key step is to obtain the negative view pairs from inter-data for contrasting ; while generative SSL focuses on each data point itself , by reconstructing the key features at the intra-data level . ( 2 ) From the perspective of distribution learning , contrastive SSL and generative SSL are learning the data distribution from local and global manner , respectively . Contrastive SSL learns the distribution locally by contrasting the pairwise distance at the inter-data level . Thus , with sufficient number of data , the local contrastive operation can iteratively recover the data distribution . Generative SSL , on the other hand , learns the global data density function directly . Therefore , contrastive and generative SSL are essentially conducting representation and distribution learning with different intuitions and disciplines , and we expect that combining these two can lead to better representation . We later carry out an ablation study ( Section 4.4 ) to verify this empirically . In addition , to make the pretext tasks more challenging , we take views for each molecule by randomly masking M nodes ( and corresponding edges ) as the transformation function , i.e. , T2D = T3D = mask . This smart trick has been widely used in graph SSL [ 39 , 91 , 92 ] and has shown robust improvements . 3.2 CONTRASTIVE SELF-SUPERVISED LEARNING BETWEEN 3D AND 2D VIEWS . The main idea of contrastive self-supervised learning ( SSL ) [ 9 , 60 ] is first to define positive and negative pairs of views from the inter-data level , and then to align the positive pairs and contrast the negative pairs simultaneously [ 83 ] . For each molecule , we first extract representations from 2D and 3D views , i.e. , hx and hy . Then we create positive and negative pairs for contrastive learning : the 2D-3D pairs ( x , y ) for the same molecule are treated as positive , and negative otherwise . Finally , we align the positive pairs and contrast the negative ones . The pipeline is shown in Figure 1 . In the following , we discuss two common objective functions on contrastive graph SSL . InfoNCE is first proposed in [ 60 ] , and its effectiveness has been validated both empirically [ 9 , 35 ] and theoretically [ 2 ] . Its formulation is given as follows : LInfoNCE = − 1 2 Ep ( x , y ) [ log exp ( fx ( x , y ) ) exp ( fx ( x , y ) ) + ∑ j exp ( fx ( xj , y ) ) + log exp ( fy ( y , x ) ) exp ( fy ( y , x ) ) + ∑ j exp ( fy ( yj , x ) ) ] , ( 3 ) where x ( j ) , y ( j ) are randomly sampled 2D and 3D views regarding to the anchored pair ( x , y ) . fx ( x , y ) and fy ( y , x ) are scoring functions for the two corresponding views , whose formulation can be flexible . Here we use fx ( x , y ) = fy ( y , x ) = 〈hx , hy〉 . More details are in Appendix D. Energy-Based Model with Noise Contrastive Estimation ( EBM-NCE ) is an alternative that has been widely used in the research line of graph contrastive SSL [ 39 , 72 , 91 , 92 ] . Its intention is essentially the same as InfoNCE , to align positive pairs and contrast negative pairs , while the main difference is the usage of binary cross-entropy and extra noise distribution for negative sampling : LEBM-NCE = − 1 2 Ep ( y ) [ Epn ( x|y ) log ( 1− σ ( fx ( x , y ) ) ) + Ep ( x|y ) log σ ( fx ( x , y ) ) ] − 1 2 Ep ( x ) [ Epn ( y|x ) log ( 1− σ ( fy ( y , x ) ) ) + Ep ( y , x ) log σ ( fy ( y , x ) ) ] , ( 4 ) where pn is the noise distribution and σ is the sigmoid function . We also notice that the final formulation of EBM-NCE shares certain similarities with Jensen-Shannon estimation ( JSE ) [ 59 ] . However , the derivation process and underlying intuition are different : EBM-NCE models the conditional distribution in MI lower bound ( Equation ( 9 ) ) with EBM , while JSE is a special case of variational estimation of f-divergence . Since this is not the main focus of GraphMVP , we expand the a more comprehensive comparison in Appendix D , plus some potential benefits with EBM-NCE . Few works [ 33 ] have witnessed the effect on the choice of objectives in graph contrastive SSL , therefore in GraphMVP , we treat it as a hyper-parameter and further run ablations on them , i.e. , to solely use either InfoNCE ( LC = LInfoNCE ) or EMB-NCE ( LC = LEBM-NCE ) . | This paper presents a pre-training method of GNNs for molecular graphs by self-supervised learning (SSL) on not only 2D topologies of graphs but also 3D geometries of molecules. In particular, the paper develops two SSL pretext tasks learning inter-molecule and intra-molecule associations in 2D and 3D. The "inter-molecule" task is a graph classification on whether a 2D, 3D graph pairs come from the same molecule or not, while the "intra-molecule" task is a generative task to generate 2D from 3D as well as 3D from 2D information. Empirical evaluations over several datasets demonstrate that jointly learning these two SSL tasks brings nice improvement in prediction accuracies. | SP:fa3b7ee53ba4c3970e1c110984cbd15fd80fec98 |
Pre-training Molecular Graph Representation with 3D Geometry | 1 INTRODUCTION . In recent years , drug discovery has drawn increasing interest in the machine learning community . Among many challenges therein , how to discriminatively represent a molecule with a vectorized embedding remains a fundamental yet open challenge . The underlying problem can be decomposed into two components : how to design a common latent space for molecule graphs ( i.e. , designing a suitable encoder ) and how to construct an objective function to supervise the training ( i.e. , defining a learning target ) . Falling broadly into the second category , our paper studies self-supervised molecular representation learning by leveraging the consistency between 3D geometry and 2D topology . Motivated by the prominent success of the pretraining-finetuning pipeline [ 16 ] , unsupervisedly pretrained graph neural networks for molecules yields promising performance on downstream tasks and becomes increasingly popular [ 39 , 48 , 72 , 80 , 91 , 92 ] . The key to pre-training lies in finding an effective proxy task ( i.e. , training objective ) to leverage the power of large unlabeled datasets . Inspired by [ 50 , 69 ] that molecular properties [ 27 , 48 ] can be better predicted by 3D geometry due to its encoded energy knowledge , we aim to make use of the 3D geometry of molecules in pre-training . However , the stereochemical structures are often very expensive to obtain , making such 3D geometric information scarce in downstream tasks . To address this problem , we propose the GraphMulti-View Pre-training ( GraphMVP ) framework , where a 2D molecule encoder is pre-trained with the knowledge of 3D geometry and then fine-tuned on downstream tasks without 3D information . Our learning paradigm , during pre-training , injects the knowledge of 3D molecular geometry to a 2D molecular graph encoder such that the downstream tasks can benefit from the implicit 3D geometry even if there is no 3D information available . We attain the aforementioned goal by leveraging two pretext tasks on the 3D and 2D molecular graphs : one contrastive and one generative SSL . Contrastive SSL creates the supervised signal at an inter-molecule level : the 3D and 2D graph pairs are positive if they are from the same molecule , and negative otherwise ; Then contrastive SSL [ 83 ] will align the positive pairs and contrast the negative pairs simultaneously . Generative SSL [ 36 , 45 , 81 ] , on the other hand , obtains the supervised signal in an intra-molecule way : it learns a 2D/3D representation that can reconstruct its 3D/2D counterpart view for each molecule itself . To cope with the challenge of measuring the quality of reconstruction on molecule 3D and 2D space , we further propose a novel surrogate objective function called variation representation reconstruction ( VRR ) for the generative SSL task , which can effectively compute such quality in the continuous representation space . The knowledge acquired by these two SSL tasks is complementary , so our GraphMVP framework integrates them to form more discriminative 2D molecular graph representation . Consistent performance improvements empirically validate the effectiveness of GraphMVP . We give additional insights to justify the effectiveness of GraphMVP . First , GraphMVP is a selfsupervised learning approach based on maximizing mutual information ( MI ) between 3D and 2D views , enabling the learnt representation to capture high-level factors [ 5 , 6 , 76 ] in molecule data . Second , we find that 3D molecular geometry is a form of privileged information [ 78 , 79 ] . It has been proven that using privileged information in training can accelerate the speed of learning . We are aware that privileged information is only used in training , while it is not available in testing . This perfectly matches our intuition of pre-training molecular representation with 3D geometry . Our major contributions include ( 1 ) To our best knowledge , we are the first to incorporate the 3D geometric information into graph SSL ; ( 2 ) We propose one contrastive and one generative SSL tasks for pre-training . Then we elaborate their differences and empirically validate that combining both can lead to a better representation ; ( 3 ) We provide theoretical insights and case studies justify why adding 3D geometry is beneficial ; ( 4 ) We achieve the SOTA performance among all the SSL baselines . Related work . We briefly review the most related works here and include a more detailed summarization in Appendix A. Self-supervised learning ( SSL ) methods have attracted massive attention to graph applications [ 49 , 51 , 85 , 87 ] . In general , there are roughly two categories of graph SSL : contrastive and generative , where they differ on the design of the supervised signals . Contrastive graph SSL [ 39 , 72 , 80 , 91 , 92 ] constructs the supervised signals at the inter-graph level and learns the representation by contrasting with other graphs , while generative graph SSL [ 32 , 39 , 40 , 48 ] focuses on reconstructing the original graph at the intra-graph level . One of the most significant differences that separate our work from existing methods is that all previous methods merely focus on 2D molecular topology . However , for scientific tasks such as molecular property prediction , 3D geometry should be incorporated as it provides complementary and comprehensive information [ 50 , 69 ] . To fill this gap , we propose GraphMVP to leverage the 3D geometry in graph self-supervised pre-training . 2 PRELIMINARIES . We first outline the key concepts and notations used in this work . Self-supervised learning ( SSL ) is based on the view design , where each view provides a specific aspect and modality of the data . Each molecule has two natural views : the 2D graph incorporates the topological structure defined by the adjacency , while the 3D graph can better reflect the geometry and spatial relation . From a chemical perspective , 3D geometric graphs focus on the energy while 2D graphs emphasize the topological information ; thus they can be composed for learning more informative representation in GraphMVP . Transformation is an atomic operation in SSL that can extract specific information from each view . Next , we will briefly introduce how to represent these two views of molecular graphs . 2D Molecular Graph represents molecules as 2D graphs , with atoms as nodes and bonds as edges . We denote it as g2D = ( X , E ) , where X is the atom attribute matrix and E is the bond attribute matrix . Notice that hereE also includes the bond connectivity . Then we will apply one transformation function T2D on the topological graph . Given a 2D molecular graph g2D , its representation h2D can be obtained from a 2D graph neural network ( GNN ) model : h2D = GNN-2D ( T2D ( g2D ) ) = GNN-2D ( T2D ( X , E ) ) . ( 1 ) 3D Molecular Graph additionally includes spatial positions of the atoms , which needless to be static since atoms are in continual motion on a potential energy surface [ 3 ] . 1 The 3D structures at the local minima on this surface are named conformer . As the molecular properties are conformers ensembled [ 34 ] , GraphMVP provides a novel perspective on adopting 3D conformers for learning better representation . Given a conformer g3D = ( X , R ) , its representation via a 3D GNN model is : h3D = GNN-3D ( T3D ( g3D ) ) = GNN-3D ( T3D ( X , R ) ) , ( 2 ) 1A more rigorous way of defining conformer is in [ 56 ] : a conformer is an isomer of a molecule that differs from another isomer by the rotation of a single bond in the molecule . where R is the 3D-coordinate matrix and T3D is the 3D transformation . In what follows , for notation simplicity , we use x and y for the 2D and 3D graphs , i.e. , x , g2D and y , g3D . Then the latent representations are denoted as hx and hy . 3 GRAPHMVP : GRAPH MULTI-VIEW PRE-TRAINING . Our model , termed as Graph Multi-View Pre-training ( GraphMVP ) , conducts self-supervised learning ( SSL ) pre-training with 3D information . The 3D conformers encode rich information about the molecule energy and spatial structure , which are complementary to the 2D topology . Thus , applying SSL between the 3D and 2D views will provide a better 2D representation , which implicitly embeds the ensembles of energies and geometric information for molecules . In the following , we first present an overview of proposed GraphMVP , and then introduce two pretext tasks specialized concerning 3D conformation structures . Finally , we summarize a broader graph SSL family that prevails the 2D molecular graph representation learning with 3D geometry . 3.1 OVERVIEW OF GRAPHMVP 3 As aforementioned , GraphMVP exerts 2D topology and 3D geometry as two complementary views for each molecule . By proceeding SSL between these views , it is expected to learn a 2D representation enhanced with 3D conformation , which can better reflect certain molecular properties . As generic SSL pre-training pipelines , GraphMVP has two stages : pre-training then fine-tuning . In the pre-training , we conduct SSL via auxiliary tasks on data collections providing both 3D and 2D molecular structures . During fine-tuning , the pre-trained 2D GNN models are subsequently fine tuned on specific downstream tasks , where usually only 2D structures are available . At the SSL pre-training stage , we design two pretext tasks : one contrastive and one generative . We conjecture then empirically prove that these two tasks are focusing on different learning aspects , which are concluded into following two points . ( 1 ) From the perspective of representation learning , contrastive SSL is learning from inter-data and generative SSL is learning by intra-data . For contrastive SSL , one key step is to obtain the negative view pairs from inter-data for contrasting ; while generative SSL focuses on each data point itself , by reconstructing the key features at the intra-data level . ( 2 ) From the perspective of distribution learning , contrastive SSL and generative SSL are learning the data distribution from local and global manner , respectively . Contrastive SSL learns the distribution locally by contrasting the pairwise distance at the inter-data level . Thus , with sufficient number of data , the local contrastive operation can iteratively recover the data distribution . Generative SSL , on the other hand , learns the global data density function directly . Therefore , contrastive and generative SSL are essentially conducting representation and distribution learning with different intuitions and disciplines , and we expect that combining these two can lead to better representation . We later carry out an ablation study ( Section 4.4 ) to verify this empirically . In addition , to make the pretext tasks more challenging , we take views for each molecule by randomly masking M nodes ( and corresponding edges ) as the transformation function , i.e. , T2D = T3D = mask . This smart trick has been widely used in graph SSL [ 39 , 91 , 92 ] and has shown robust improvements . 3.2 CONTRASTIVE SELF-SUPERVISED LEARNING BETWEEN 3D AND 2D VIEWS . The main idea of contrastive self-supervised learning ( SSL ) [ 9 , 60 ] is first to define positive and negative pairs of views from the inter-data level , and then to align the positive pairs and contrast the negative pairs simultaneously [ 83 ] . For each molecule , we first extract representations from 2D and 3D views , i.e. , hx and hy . Then we create positive and negative pairs for contrastive learning : the 2D-3D pairs ( x , y ) for the same molecule are treated as positive , and negative otherwise . Finally , we align the positive pairs and contrast the negative ones . The pipeline is shown in Figure 1 . In the following , we discuss two common objective functions on contrastive graph SSL . InfoNCE is first proposed in [ 60 ] , and its effectiveness has been validated both empirically [ 9 , 35 ] and theoretically [ 2 ] . Its formulation is given as follows : LInfoNCE = − 1 2 Ep ( x , y ) [ log exp ( fx ( x , y ) ) exp ( fx ( x , y ) ) + ∑ j exp ( fx ( xj , y ) ) + log exp ( fy ( y , x ) ) exp ( fy ( y , x ) ) + ∑ j exp ( fy ( yj , x ) ) ] , ( 3 ) where x ( j ) , y ( j ) are randomly sampled 2D and 3D views regarding to the anchored pair ( x , y ) . fx ( x , y ) and fy ( y , x ) are scoring functions for the two corresponding views , whose formulation can be flexible . Here we use fx ( x , y ) = fy ( y , x ) = 〈hx , hy〉 . More details are in Appendix D. Energy-Based Model with Noise Contrastive Estimation ( EBM-NCE ) is an alternative that has been widely used in the research line of graph contrastive SSL [ 39 , 72 , 91 , 92 ] . Its intention is essentially the same as InfoNCE , to align positive pairs and contrast negative pairs , while the main difference is the usage of binary cross-entropy and extra noise distribution for negative sampling : LEBM-NCE = − 1 2 Ep ( y ) [ Epn ( x|y ) log ( 1− σ ( fx ( x , y ) ) ) + Ep ( x|y ) log σ ( fx ( x , y ) ) ] − 1 2 Ep ( x ) [ Epn ( y|x ) log ( 1− σ ( fy ( y , x ) ) ) + Ep ( y , x ) log σ ( fy ( y , x ) ) ] , ( 4 ) where pn is the noise distribution and σ is the sigmoid function . We also notice that the final formulation of EBM-NCE shares certain similarities with Jensen-Shannon estimation ( JSE ) [ 59 ] . However , the derivation process and underlying intuition are different : EBM-NCE models the conditional distribution in MI lower bound ( Equation ( 9 ) ) with EBM , while JSE is a special case of variational estimation of f-divergence . Since this is not the main focus of GraphMVP , we expand the a more comprehensive comparison in Appendix D , plus some potential benefits with EBM-NCE . Few works [ 33 ] have witnessed the effect on the choice of objectives in graph contrastive SSL , therefore in GraphMVP , we treat it as a hyper-parameter and further run ablations on them , i.e. , to solely use either InfoNCE ( LC = LInfoNCE ) or EMB-NCE ( LC = LEBM-NCE ) . | This work aims to leverage additional 3D geometric information for molecular graph representation learning and proposes a multi-view pre-training framework, GraphMVP. Specifically, in GraphMVP, both 2D and 3D information are used, and a combined loss function (i.e., the combination of contrastive self-supervised learning loss and generative self-supervised learning loss ) is adopted to enhance the quality of representations. To verify the model's effectiveness, they conducted experiments and comparisons on a number of datasets. Ablation studies are also carried out to inspect the inner workings of GraphMVP. | SP:fa3b7ee53ba4c3970e1c110984cbd15fd80fec98 |
Pre-training Molecular Graph Representation with 3D Geometry | 1 INTRODUCTION . In recent years , drug discovery has drawn increasing interest in the machine learning community . Among many challenges therein , how to discriminatively represent a molecule with a vectorized embedding remains a fundamental yet open challenge . The underlying problem can be decomposed into two components : how to design a common latent space for molecule graphs ( i.e. , designing a suitable encoder ) and how to construct an objective function to supervise the training ( i.e. , defining a learning target ) . Falling broadly into the second category , our paper studies self-supervised molecular representation learning by leveraging the consistency between 3D geometry and 2D topology . Motivated by the prominent success of the pretraining-finetuning pipeline [ 16 ] , unsupervisedly pretrained graph neural networks for molecules yields promising performance on downstream tasks and becomes increasingly popular [ 39 , 48 , 72 , 80 , 91 , 92 ] . The key to pre-training lies in finding an effective proxy task ( i.e. , training objective ) to leverage the power of large unlabeled datasets . Inspired by [ 50 , 69 ] that molecular properties [ 27 , 48 ] can be better predicted by 3D geometry due to its encoded energy knowledge , we aim to make use of the 3D geometry of molecules in pre-training . However , the stereochemical structures are often very expensive to obtain , making such 3D geometric information scarce in downstream tasks . To address this problem , we propose the GraphMulti-View Pre-training ( GraphMVP ) framework , where a 2D molecule encoder is pre-trained with the knowledge of 3D geometry and then fine-tuned on downstream tasks without 3D information . Our learning paradigm , during pre-training , injects the knowledge of 3D molecular geometry to a 2D molecular graph encoder such that the downstream tasks can benefit from the implicit 3D geometry even if there is no 3D information available . We attain the aforementioned goal by leveraging two pretext tasks on the 3D and 2D molecular graphs : one contrastive and one generative SSL . Contrastive SSL creates the supervised signal at an inter-molecule level : the 3D and 2D graph pairs are positive if they are from the same molecule , and negative otherwise ; Then contrastive SSL [ 83 ] will align the positive pairs and contrast the negative pairs simultaneously . Generative SSL [ 36 , 45 , 81 ] , on the other hand , obtains the supervised signal in an intra-molecule way : it learns a 2D/3D representation that can reconstruct its 3D/2D counterpart view for each molecule itself . To cope with the challenge of measuring the quality of reconstruction on molecule 3D and 2D space , we further propose a novel surrogate objective function called variation representation reconstruction ( VRR ) for the generative SSL task , which can effectively compute such quality in the continuous representation space . The knowledge acquired by these two SSL tasks is complementary , so our GraphMVP framework integrates them to form more discriminative 2D molecular graph representation . Consistent performance improvements empirically validate the effectiveness of GraphMVP . We give additional insights to justify the effectiveness of GraphMVP . First , GraphMVP is a selfsupervised learning approach based on maximizing mutual information ( MI ) between 3D and 2D views , enabling the learnt representation to capture high-level factors [ 5 , 6 , 76 ] in molecule data . Second , we find that 3D molecular geometry is a form of privileged information [ 78 , 79 ] . It has been proven that using privileged information in training can accelerate the speed of learning . We are aware that privileged information is only used in training , while it is not available in testing . This perfectly matches our intuition of pre-training molecular representation with 3D geometry . Our major contributions include ( 1 ) To our best knowledge , we are the first to incorporate the 3D geometric information into graph SSL ; ( 2 ) We propose one contrastive and one generative SSL tasks for pre-training . Then we elaborate their differences and empirically validate that combining both can lead to a better representation ; ( 3 ) We provide theoretical insights and case studies justify why adding 3D geometry is beneficial ; ( 4 ) We achieve the SOTA performance among all the SSL baselines . Related work . We briefly review the most related works here and include a more detailed summarization in Appendix A. Self-supervised learning ( SSL ) methods have attracted massive attention to graph applications [ 49 , 51 , 85 , 87 ] . In general , there are roughly two categories of graph SSL : contrastive and generative , where they differ on the design of the supervised signals . Contrastive graph SSL [ 39 , 72 , 80 , 91 , 92 ] constructs the supervised signals at the inter-graph level and learns the representation by contrasting with other graphs , while generative graph SSL [ 32 , 39 , 40 , 48 ] focuses on reconstructing the original graph at the intra-graph level . One of the most significant differences that separate our work from existing methods is that all previous methods merely focus on 2D molecular topology . However , for scientific tasks such as molecular property prediction , 3D geometry should be incorporated as it provides complementary and comprehensive information [ 50 , 69 ] . To fill this gap , we propose GraphMVP to leverage the 3D geometry in graph self-supervised pre-training . 2 PRELIMINARIES . We first outline the key concepts and notations used in this work . Self-supervised learning ( SSL ) is based on the view design , where each view provides a specific aspect and modality of the data . Each molecule has two natural views : the 2D graph incorporates the topological structure defined by the adjacency , while the 3D graph can better reflect the geometry and spatial relation . From a chemical perspective , 3D geometric graphs focus on the energy while 2D graphs emphasize the topological information ; thus they can be composed for learning more informative representation in GraphMVP . Transformation is an atomic operation in SSL that can extract specific information from each view . Next , we will briefly introduce how to represent these two views of molecular graphs . 2D Molecular Graph represents molecules as 2D graphs , with atoms as nodes and bonds as edges . We denote it as g2D = ( X , E ) , where X is the atom attribute matrix and E is the bond attribute matrix . Notice that hereE also includes the bond connectivity . Then we will apply one transformation function T2D on the topological graph . Given a 2D molecular graph g2D , its representation h2D can be obtained from a 2D graph neural network ( GNN ) model : h2D = GNN-2D ( T2D ( g2D ) ) = GNN-2D ( T2D ( X , E ) ) . ( 1 ) 3D Molecular Graph additionally includes spatial positions of the atoms , which needless to be static since atoms are in continual motion on a potential energy surface [ 3 ] . 1 The 3D structures at the local minima on this surface are named conformer . As the molecular properties are conformers ensembled [ 34 ] , GraphMVP provides a novel perspective on adopting 3D conformers for learning better representation . Given a conformer g3D = ( X , R ) , its representation via a 3D GNN model is : h3D = GNN-3D ( T3D ( g3D ) ) = GNN-3D ( T3D ( X , R ) ) , ( 2 ) 1A more rigorous way of defining conformer is in [ 56 ] : a conformer is an isomer of a molecule that differs from another isomer by the rotation of a single bond in the molecule . where R is the 3D-coordinate matrix and T3D is the 3D transformation . In what follows , for notation simplicity , we use x and y for the 2D and 3D graphs , i.e. , x , g2D and y , g3D . Then the latent representations are denoted as hx and hy . 3 GRAPHMVP : GRAPH MULTI-VIEW PRE-TRAINING . Our model , termed as Graph Multi-View Pre-training ( GraphMVP ) , conducts self-supervised learning ( SSL ) pre-training with 3D information . The 3D conformers encode rich information about the molecule energy and spatial structure , which are complementary to the 2D topology . Thus , applying SSL between the 3D and 2D views will provide a better 2D representation , which implicitly embeds the ensembles of energies and geometric information for molecules . In the following , we first present an overview of proposed GraphMVP , and then introduce two pretext tasks specialized concerning 3D conformation structures . Finally , we summarize a broader graph SSL family that prevails the 2D molecular graph representation learning with 3D geometry . 3.1 OVERVIEW OF GRAPHMVP 3 As aforementioned , GraphMVP exerts 2D topology and 3D geometry as two complementary views for each molecule . By proceeding SSL between these views , it is expected to learn a 2D representation enhanced with 3D conformation , which can better reflect certain molecular properties . As generic SSL pre-training pipelines , GraphMVP has two stages : pre-training then fine-tuning . In the pre-training , we conduct SSL via auxiliary tasks on data collections providing both 3D and 2D molecular structures . During fine-tuning , the pre-trained 2D GNN models are subsequently fine tuned on specific downstream tasks , where usually only 2D structures are available . At the SSL pre-training stage , we design two pretext tasks : one contrastive and one generative . We conjecture then empirically prove that these two tasks are focusing on different learning aspects , which are concluded into following two points . ( 1 ) From the perspective of representation learning , contrastive SSL is learning from inter-data and generative SSL is learning by intra-data . For contrastive SSL , one key step is to obtain the negative view pairs from inter-data for contrasting ; while generative SSL focuses on each data point itself , by reconstructing the key features at the intra-data level . ( 2 ) From the perspective of distribution learning , contrastive SSL and generative SSL are learning the data distribution from local and global manner , respectively . Contrastive SSL learns the distribution locally by contrasting the pairwise distance at the inter-data level . Thus , with sufficient number of data , the local contrastive operation can iteratively recover the data distribution . Generative SSL , on the other hand , learns the global data density function directly . Therefore , contrastive and generative SSL are essentially conducting representation and distribution learning with different intuitions and disciplines , and we expect that combining these two can lead to better representation . We later carry out an ablation study ( Section 4.4 ) to verify this empirically . In addition , to make the pretext tasks more challenging , we take views for each molecule by randomly masking M nodes ( and corresponding edges ) as the transformation function , i.e. , T2D = T3D = mask . This smart trick has been widely used in graph SSL [ 39 , 91 , 92 ] and has shown robust improvements . 3.2 CONTRASTIVE SELF-SUPERVISED LEARNING BETWEEN 3D AND 2D VIEWS . The main idea of contrastive self-supervised learning ( SSL ) [ 9 , 60 ] is first to define positive and negative pairs of views from the inter-data level , and then to align the positive pairs and contrast the negative pairs simultaneously [ 83 ] . For each molecule , we first extract representations from 2D and 3D views , i.e. , hx and hy . Then we create positive and negative pairs for contrastive learning : the 2D-3D pairs ( x , y ) for the same molecule are treated as positive , and negative otherwise . Finally , we align the positive pairs and contrast the negative ones . The pipeline is shown in Figure 1 . In the following , we discuss two common objective functions on contrastive graph SSL . InfoNCE is first proposed in [ 60 ] , and its effectiveness has been validated both empirically [ 9 , 35 ] and theoretically [ 2 ] . Its formulation is given as follows : LInfoNCE = − 1 2 Ep ( x , y ) [ log exp ( fx ( x , y ) ) exp ( fx ( x , y ) ) + ∑ j exp ( fx ( xj , y ) ) + log exp ( fy ( y , x ) ) exp ( fy ( y , x ) ) + ∑ j exp ( fy ( yj , x ) ) ] , ( 3 ) where x ( j ) , y ( j ) are randomly sampled 2D and 3D views regarding to the anchored pair ( x , y ) . fx ( x , y ) and fy ( y , x ) are scoring functions for the two corresponding views , whose formulation can be flexible . Here we use fx ( x , y ) = fy ( y , x ) = 〈hx , hy〉 . More details are in Appendix D. Energy-Based Model with Noise Contrastive Estimation ( EBM-NCE ) is an alternative that has been widely used in the research line of graph contrastive SSL [ 39 , 72 , 91 , 92 ] . Its intention is essentially the same as InfoNCE , to align positive pairs and contrast negative pairs , while the main difference is the usage of binary cross-entropy and extra noise distribution for negative sampling : LEBM-NCE = − 1 2 Ep ( y ) [ Epn ( x|y ) log ( 1− σ ( fx ( x , y ) ) ) + Ep ( x|y ) log σ ( fx ( x , y ) ) ] − 1 2 Ep ( x ) [ Epn ( y|x ) log ( 1− σ ( fy ( y , x ) ) ) + Ep ( y , x ) log σ ( fy ( y , x ) ) ] , ( 4 ) where pn is the noise distribution and σ is the sigmoid function . We also notice that the final formulation of EBM-NCE shares certain similarities with Jensen-Shannon estimation ( JSE ) [ 59 ] . However , the derivation process and underlying intuition are different : EBM-NCE models the conditional distribution in MI lower bound ( Equation ( 9 ) ) with EBM , while JSE is a special case of variational estimation of f-divergence . Since this is not the main focus of GraphMVP , we expand the a more comprehensive comparison in Appendix D , plus some potential benefits with EBM-NCE . Few works [ 33 ] have witnessed the effect on the choice of objectives in graph contrastive SSL , therefore in GraphMVP , we treat it as a hyper-parameter and further run ablations on them , i.e. , to solely use either InfoNCE ( LC = LInfoNCE ) or EMB-NCE ( LC = LEBM-NCE ) . | This paper proposes to leverage 3D information to pretrain graph neural networks for learning molecular representations. To achieve this, contrastive and generative SSL strategies are developed accordingly. The empirical results on several datasets show that the improvements of this method over previous 2D graph pretraining methods are consistent and obvious. | SP:fa3b7ee53ba4c3970e1c110984cbd15fd80fec98 |
Learning-Augmented Sketches for Hessians | 1 INTRODUCTION . Large-scale optimization problems are abundant and solving them efficiently requires powerful tools to make the computation practical . This is especially true of second order methods which often are less practical than first order ones . Although second order methods may have many fewer iterations , each iteration could involve inverting a large Hessian , which is cubic time ; in contrast , first order methods such as stochastic gradient descent are linear time per iteration . In order to make second order methods faster in each iteration , a large body of work has looked at dimensionality reduction techniques , such as sampling , sketching , or approximating the Hessian by a low rank matrix . See , for example , ( Gower et al. , 2016 ; Xu et al. , 2016 ; Pilanci & Wainwright , 2016 ; 2017 ; Doikov & Richtárik , 2018 ; Gower et al. , 2018 ; Roosta-Khorasani & Mahoney , 2019 ; Gower et al. , 2019 ; Kylasa et al. , 2019 ; Xu et al. , 2020 ; Li et al. , 2020 ) . Our focus is on sketching techniques , which often consist of multiplying the Hessian by a random matrix chosen independently of the Hessian . Sketching has a long history in theoretical computer science ( see , e.g. , ( Woodruff , 2014 ) for a survey ) , and we describe such methods more below . A special case of sketching is sampling , which in practice is often uniform sampling , and hence oblivious to properties of the actual matrix . Other times the sampling is non-uniform , and based on squared norms of submatrices of the Hessian or on the leverage scores of the Hessian . Our focus is on sketching techniques , and in particular , we consider the framework of ( Pilanci & Wainwright , 2016 ; 2017 ) which introduces the iterative Hessian sketch and the Newton sketch , as well as the high accuracy refinement given in ( van den Brand et al. , 2020 ) . If one were to run Newton ’ s method to find a point where the gradient is zero , in each iteration one needs to solve an equation involving the current Hessian and gradient to find the update direction . When the Hessian can be decomposed as A > A for an n × d matrix A with n d , then sketching is particularly suitable . The iterative Hessian sketch was proposed in Pilanci & Wainwright ( 2016 ) , where A is replaced with S · A , for a random matrix S which could be i.i.d . Gaussian or drawn from a more structured family of random matrices such as the Subsampled Randomized Hadamard Transforms or COUNT-SKETCH matrices ; the latter was done in ( Cormode & Dickens , 2019 ) . The Newton sketch was proposed by Pilanci & Wainwright ( 2017 ) , which extended sketching methods beyond constrained least-squares problems to any twice differentiable function subject to a closed convex constraint set . Using this sketch inside of interior point updates has led to much faster algorithms for an extensive body of convex optimization problems ( Pilanci & Wainwright , 2017 ) . By instead using sketching as a preconditioner , an application of the work of ( van den Brand et al. , 2020 ) ( see Appendix E ) was able to improve the dependence on the accuracy parameter to logarithmic . In general , the idea behind sketching is the following . One chooses a random matrix S , drawn from a certain family of random matrices , and computes SA . IfA is tall-and-thin , then S is short-and-fat , and thus SA is a small , roughly square matrix . Moreover , SA preserves important properties of A . One typically desired property is that S is a subspace embedding , meaning that ‖SAx‖2 = ( 1± ) ‖Ax‖2 for all x simultaneously . An observation exploited in Cormode & Dickens ( 2019 ) , building off of the COUNT-SKETCH random matrices S introduced in randomized linear algebra in Clarkson & Woodruff ( 2017 ) , is that if S contains a single non-zero entry per column , then SA can be computed in O ( nnz ( A ) ) time , where nnz ( A ) denotes the number of nonzeros in A . This is also referred to as input-sparsity running time . Each iteration of a second order method often involves solving an equation of the formA > Ax = A > b , where A > A is the Hessian and b is the gradient . For a number of problems , one has access to a matrix A ∈ Rn×d with n d , which is also an assumption made in Pilanci & Wainwright ( 2017 ) . Therefore , the solution x is the minimizer to a constrained least squares regression problem : min x∈C 1 2 ‖Ax− b‖22 , ( 1 ) where C is a convex constraint set in Rd . For the unconstrained case ( C = Rd ) , various classical sketches that attain the subspace embedding property can provably yield high-accuracy approximate solutions ( see , e.g. , ( Sarlos , 2006 ; Nelson & Nguyên , 2013 ; Cohen , 2016 ; Clarkson & Woodruff , 2017 ) ) ; for the general constrained case , the Iterative Hessian Sketch ( IHS ) was proposed by Pilanci & Wainwright ( 2016 ) as an effective approach and Cormode & Dickens ( 2019 ) employed sparse sketches to achieve input-sparsity running time for IHS . All sketches used in these results are data-oblivious random sketches . Learned Sketching . In the last few years , an exciting new notion of learned sketching has emerged . Here the idea is that one often sees independent samples of matrices A from a distribution D , and can train a model to learn the entries in a sketching matrix S on these samples . When given a future sample B , also drawn from D , the learned sketching matrix S will be such that S · B is a much more accurate compression of B than if S had the same number of rows and were instead drawn without knowledge of D. Moreover , the learned sketch S is often sparse , therefore allowing S ·B to be applied very quickly . For large datasets B this is particularly important , and distinguishes this approach from other transfer learning approaches , e.g. , ( Andrychowicz et al. , 2016 ) , which can be considerably slower in this context . Learned sketches were first used in the data stream context for finding frequent items ( Hsu et al. , 2019 ) and have subsequently been applied to a number of other problems on large data . For example , Indyk et al . ( 2019 ) showed that learned sketches yield significantly smaller errors for low rank approximation . Dong et al . ( 2020 ) made significant improvements to nearest neighbor search using learned sketches . More recently , Liu et al . ( 2020 ) extended learned sketches to several problems in numerical linear algebra , including least-squares regression , as well as k-means clustering . Despite the number of problems that learned sketches have been applied to , they have not been applied to convex optimization in general . Given that such methods often require solving a large overdetermined least squares problem in each iteration , it is hopeful that one can improve each iteration using learned sketches . However , a number of natural questions arise : ( 1 ) how should we learn the sketch ? ( 2 ) should we apply the same learned sketch in each iteration , or learn it in the next iteration by training on a data set involving previously learned sketches from prior iterations ? Our Contributions . In this work we answer the above questions and develop the first framework of learned sketching that applies to a wide number of problems in convex optimization . Namely , we apply learned sketches to constrained least-squares problems , including LASSO and matrix regression with nuclear norm constraints . We show empirically that learned sketches demonstrate superior accuracy over classical oblivious random sketches for each of these problems . All of our learned sketches S are extremely sparse , meaning that they contain a single non-zero entry per column and that they can be applied in input-sparsity time . For such sketches , there are two things to learn : the position of the non-zero entry in each column and the value of the non-zero entry . Following the previous work of Indyk et al . ( 2019 ) , we choose the position of the nonzero entry in each column to be uniformly random , while the value of the nonzero entry is learned ( the value is no longer limited to −1 and 1 ) . Here we consider a new learning objective , that is , we optimize the subspace embedding property of the sketching matrix instead of optimizing the error in the objective function of the optimization problem we are trying to solve . This demonstrates a significant advantage over non-learned sketches , and has a fast training time . Our experiments show that the convergence rate is reduced by 44 % over the nonlearned COUNT-SKETCH ( a classical extremely sparse sketch ) for the LASSO problem on a real-world dataset . Recall that a smaller convergence rate means a faster convergence . We prove theoretically that S can take fewer rows , with optimized positions of nonzero entries , when the input matrix A has a small number of rows of heavy leverage score . More specifically , COUNT-SKETCH takes O ( d2/ ( δ 2 ) ) rows with failure probability δ , while our S requires only O ( ( dpolylog ( 1/ ) + log ( 1/δ ) ) / 2 ) rows if A has at most dpolylog ( 1/ ) / 2 rows of leverage score at least /d . This is a quadratic improvement in d and an exponential improvement in δ . Applying S to A runs in input-sparsity time and the resulting SA may remain sparse if A is sparse . In practice , it is not necessary to calculate the leverage scores . Instead , we show in our experiments that the indices of the rows of heavy leverage score can be learned and the induced S achieves a comparable accuracy for the abovementioned LASSO problem to classical dense sketches such as Gaussian matrices . Combining both aspects , the value of the nonzero entry and the indices of the rows of heavy leverage score , we obtain even better learned sketches . For the same LASSO problem , we show empirically that such learned sketches reduce the convergence rate by a larger 79.9 % to 84.6 % over non-learned sketches . Therefore , the learned sketches attain a smaller error within the same number of iterations , and in fact , within the same limit on the maximum runtime , since our sketches are extremely sparse . We also study the general framework of convex optimization in van den Brand et al . ( 2020 ) , and show that also for sketching-based preconditioning , learned sketches demonstrate considerable advantages . More precisely , by using a learned sketch with the same number of rows as an oblivious sketch , we are able to obtain a much better preconditioner with the same overall running time . 2 PRELIMINARIES Algorithm 1 LEARN-SKETCH : Gradient descent algorithm for learning the sketch values Require : Atrain = { Ai } Ni=1 ( Ai ∈ Rn×d ) , learn- ing rate α 1 : Randomly initialize p , v for a COUNT- SKETCH-type sketch as described in the text 2 : for t = 0 to step do 3 : Form S using p , v 4 : Sample batch Abatch from Atrain 5 : v ← v − α∂L ( S , Abatch ) ∂v Notation . We denote by Sn−1 the unit sphere in the n-dimensional Euclidean space Rn . For a matrix A ∈ Rm×n we denote by ‖A‖op its operator norm , which is defined as ‖A‖op = supx∈Sn−1 ‖Ax‖2 . We also denote by σmax ( A ) and σmin ( A ) the largest and smallest singular values of A , respectively , and by colsp ( A ) the column space of A . The condition number of A is defined to be κ ( A ) = σmax ( A ) /σmin ( A ) . Leverage Scores . We only consider matrices of full column rank1 . Suppose thatA ∈ Rm×n ( m ≥ n ) has full column rank . It has m leverage scores , denoted by τ1 ( A ) , . . . , τm ( A ) , which are defined as τi ( A ) = ‖e > i A ( A > A ) −1A > ‖22 , where { e1 , . . . , em } is the canonical basis of Rm . Equivalently , letting A = UΣV > be the singular value decomposition of A , where U ∈ Rm×n , Σ , V ∈ Rn×n , we can also write τi ( A ) = ‖e > i UU > ‖22 = ‖e > i U‖22 , which is the squared ` 2 norm of the i-th row of U . Classical Sketches . Below we review several classical sketches that have been used for solving optimization problems . • Gaussian sketch : S = 1√ m G , where G ∈ Rm×n with i.i.d . N ( 0 , 1 ) entries . • COUNT-SKETCH : Each column of S has only a single non-zero entry . The position of the non-zero entry is chosen uniformly over the m entries in the column and the value of the entry is either +1 or −1 , each with probability 1/2 . Further , the columns are chosen independently . • Sparse Johnson-Lindenstrauss Transform ( SJLT ) : S is the vertical concatenation of s independent COUNT-SKETCH matrices , each of dimension m/s× n. 1This can be assumed w.l.o.g . by adding artbirarily small random noise to the input , or one can first quickly use sketching to find a subset of columns of maximum rank , and replace the inut with that subset of columns . COUNT-SKETCH-type Sketch . A COUNT-SKETCH-type sketch is characterized by a tuple ( m , n , p , v ) , where m , n are positive integers and p , v are n-dimensional real vectors , defined as follows . The sketching matrix S has dimensions m × n and Spi , i = vi for all 1 ≤ i ≤ n , while all the other entries of S are 0 . When m and n are clear from context , we may characterize such a sketching matrix by ( p , v ) only . Subspace Embeddings . For a matrix A ∈ Rn×d , we say a matrix S ∈ Rm×n is a ( 1± ) -subspace embedding for the column span of A if ( 1− ) ‖Ax‖2 ≤ ‖SAx‖2 ≤ ( 1 + ) ‖Ax‖2 for all x ∈ Rd . The classical sketches above , with appropriate parameters , are all subspace embedding matrices with probability at least 1− δ ; our focus is on COUNT-SKETCH which can be applied in input sparsity running time . We summarize the parameters needed for a subspace embedding below : • Gaussian sketch : m = O ( ( d + log ( 1/δ ) ) / 2 ) . It is a dense matrix and computing SA costs O ( m · nnz ( A ) ) = O ( nnz ( A ) ( d+ log ( 1/δ ) ) / 2 ) time . • COUNT-SKETCH : m = O ( d2/ ( δ 2 ) ) ( Clarkson & Woodruff , 2017 ) . Though the number of rows is quadratic in d/ , the matrix S is sparse and computing SA takes only O ( nnz ( A ) ) time . • SJLT : m = O ( d log ( dδ ) / 2 ) and has s = O ( log ( dδ ) / ) non-zeros per column ( Nelson & Nguyên , 2013 ; Cohen , 2016 ) . Computing SA takes O ( snnz ( A ) ) = O ( nnz ( A ) log ( dδ ) / ) time . Iterative Hessian Sketch . The Iterative Hessian Sketching ( IHS ) method ( Pilanci & Wainwright , 2016 ) solves the constrained least-squares problem ( 1 ) by iteratively performing the update xt+1 = arg min x∈C { 1 2 ‖St+1A ( x− xt ) ‖22 − 〈A > ( b−Axt ) , x− xt〉 } , ( 2 ) where St+1 is a sketching matrix . It is not difficult to see that for the unsketched version ( St+1 is the identity matrix ) of the minimization above , the optimal solution xt+1 coincides with the optimal solution to the constrained least squares problem ( 1 ) . The IHS approximates the Hessian A > A by a sketched version ( St+1A ) > ( St+1A ) to improve runtime , as St+1A typically has very few rows . Unconstrained Convex Optimization . Consider an unconstrained convex optimization problem minx f ( x ) , where f is smooth and strongly convex , and its Hessian ∇2f is Lipschitz continuous . This problem can be solved by Newton ’ s method , which iteratively performs the update xt+1 = xt − arg min z ∥∥∥ ( ∇2f ( xt ) 1/2 ) > ( ∇2f ( xt ) 1/2 ) z −∇f ( xt ) ∥∥∥ 2 , ( 3 ) provided it is given a good initial point x0 . In each step , it requires solving a regression problem of the form minz ∥∥A > Az − y∥∥ 2 , which , with access to A , can be solved with a fast regression solver in ( van den Brand et al. , 2020 ) . The regression solver first computes a preconditioner R via a QR decomposition such that SAR has orthonormal columns , where S is a sketching matrix , then solves ẑ = arg minz′ ∥∥ ( AR ) > ( AR ) z′ − y∥∥ 2 by gradient descent and returns Rẑ in the end . Here , the point of sketching is that the QR decomposition of SA can be computed much more efficiently than the QR decomposition of A , since S has only a small number of rows . Learning a Sketch . We use the same learning algorithm in ( Liu et al. , 2020 ) , given in Algorithm 1 . The algorithm aims to minimize the mean loss function L ( S , A ) = 1N ∑N i=1 L ( S , Ai ) , where S is the learned sketch , L ( S , A ) is the loss function of S applied to a data matrix A , and A = { A1 , . . . , AN } is a ( random ) subset of training data . | In this paper, the authors extend a line of work focused on sketching the Hessian for convex problems to help accelerate second order optimization methods. In particular, they present an algorithm for learning weights of a sketching matrix (with one non-zero entry per columns chosen uniformly) by using gradient descent; the Hessians used for training are treated as draws from a distribution of Hessians. They also discuss how leverage scores can be used to improve convergence rates by ensuring that "heavy" rows are sampled with probability 1. The authors show empirically that the learned sketches improve convergence rates and reduce the number of iterations for several problems. They also provide theoretical results stating a reduction in rows required in the sketch when heavy leverage scores rows are known and error/time complexity bounds for the Hessian sketch/regression problems. | SP:8bfa5d83945adf0acb08e86ea8dd530bfbf20f29 |
Learning-Augmented Sketches for Hessians | 1 INTRODUCTION . Large-scale optimization problems are abundant and solving them efficiently requires powerful tools to make the computation practical . This is especially true of second order methods which often are less practical than first order ones . Although second order methods may have many fewer iterations , each iteration could involve inverting a large Hessian , which is cubic time ; in contrast , first order methods such as stochastic gradient descent are linear time per iteration . In order to make second order methods faster in each iteration , a large body of work has looked at dimensionality reduction techniques , such as sampling , sketching , or approximating the Hessian by a low rank matrix . See , for example , ( Gower et al. , 2016 ; Xu et al. , 2016 ; Pilanci & Wainwright , 2016 ; 2017 ; Doikov & Richtárik , 2018 ; Gower et al. , 2018 ; Roosta-Khorasani & Mahoney , 2019 ; Gower et al. , 2019 ; Kylasa et al. , 2019 ; Xu et al. , 2020 ; Li et al. , 2020 ) . Our focus is on sketching techniques , which often consist of multiplying the Hessian by a random matrix chosen independently of the Hessian . Sketching has a long history in theoretical computer science ( see , e.g. , ( Woodruff , 2014 ) for a survey ) , and we describe such methods more below . A special case of sketching is sampling , which in practice is often uniform sampling , and hence oblivious to properties of the actual matrix . Other times the sampling is non-uniform , and based on squared norms of submatrices of the Hessian or on the leverage scores of the Hessian . Our focus is on sketching techniques , and in particular , we consider the framework of ( Pilanci & Wainwright , 2016 ; 2017 ) which introduces the iterative Hessian sketch and the Newton sketch , as well as the high accuracy refinement given in ( van den Brand et al. , 2020 ) . If one were to run Newton ’ s method to find a point where the gradient is zero , in each iteration one needs to solve an equation involving the current Hessian and gradient to find the update direction . When the Hessian can be decomposed as A > A for an n × d matrix A with n d , then sketching is particularly suitable . The iterative Hessian sketch was proposed in Pilanci & Wainwright ( 2016 ) , where A is replaced with S · A , for a random matrix S which could be i.i.d . Gaussian or drawn from a more structured family of random matrices such as the Subsampled Randomized Hadamard Transforms or COUNT-SKETCH matrices ; the latter was done in ( Cormode & Dickens , 2019 ) . The Newton sketch was proposed by Pilanci & Wainwright ( 2017 ) , which extended sketching methods beyond constrained least-squares problems to any twice differentiable function subject to a closed convex constraint set . Using this sketch inside of interior point updates has led to much faster algorithms for an extensive body of convex optimization problems ( Pilanci & Wainwright , 2017 ) . By instead using sketching as a preconditioner , an application of the work of ( van den Brand et al. , 2020 ) ( see Appendix E ) was able to improve the dependence on the accuracy parameter to logarithmic . In general , the idea behind sketching is the following . One chooses a random matrix S , drawn from a certain family of random matrices , and computes SA . IfA is tall-and-thin , then S is short-and-fat , and thus SA is a small , roughly square matrix . Moreover , SA preserves important properties of A . One typically desired property is that S is a subspace embedding , meaning that ‖SAx‖2 = ( 1± ) ‖Ax‖2 for all x simultaneously . An observation exploited in Cormode & Dickens ( 2019 ) , building off of the COUNT-SKETCH random matrices S introduced in randomized linear algebra in Clarkson & Woodruff ( 2017 ) , is that if S contains a single non-zero entry per column , then SA can be computed in O ( nnz ( A ) ) time , where nnz ( A ) denotes the number of nonzeros in A . This is also referred to as input-sparsity running time . Each iteration of a second order method often involves solving an equation of the formA > Ax = A > b , where A > A is the Hessian and b is the gradient . For a number of problems , one has access to a matrix A ∈ Rn×d with n d , which is also an assumption made in Pilanci & Wainwright ( 2017 ) . Therefore , the solution x is the minimizer to a constrained least squares regression problem : min x∈C 1 2 ‖Ax− b‖22 , ( 1 ) where C is a convex constraint set in Rd . For the unconstrained case ( C = Rd ) , various classical sketches that attain the subspace embedding property can provably yield high-accuracy approximate solutions ( see , e.g. , ( Sarlos , 2006 ; Nelson & Nguyên , 2013 ; Cohen , 2016 ; Clarkson & Woodruff , 2017 ) ) ; for the general constrained case , the Iterative Hessian Sketch ( IHS ) was proposed by Pilanci & Wainwright ( 2016 ) as an effective approach and Cormode & Dickens ( 2019 ) employed sparse sketches to achieve input-sparsity running time for IHS . All sketches used in these results are data-oblivious random sketches . Learned Sketching . In the last few years , an exciting new notion of learned sketching has emerged . Here the idea is that one often sees independent samples of matrices A from a distribution D , and can train a model to learn the entries in a sketching matrix S on these samples . When given a future sample B , also drawn from D , the learned sketching matrix S will be such that S · B is a much more accurate compression of B than if S had the same number of rows and were instead drawn without knowledge of D. Moreover , the learned sketch S is often sparse , therefore allowing S ·B to be applied very quickly . For large datasets B this is particularly important , and distinguishes this approach from other transfer learning approaches , e.g. , ( Andrychowicz et al. , 2016 ) , which can be considerably slower in this context . Learned sketches were first used in the data stream context for finding frequent items ( Hsu et al. , 2019 ) and have subsequently been applied to a number of other problems on large data . For example , Indyk et al . ( 2019 ) showed that learned sketches yield significantly smaller errors for low rank approximation . Dong et al . ( 2020 ) made significant improvements to nearest neighbor search using learned sketches . More recently , Liu et al . ( 2020 ) extended learned sketches to several problems in numerical linear algebra , including least-squares regression , as well as k-means clustering . Despite the number of problems that learned sketches have been applied to , they have not been applied to convex optimization in general . Given that such methods often require solving a large overdetermined least squares problem in each iteration , it is hopeful that one can improve each iteration using learned sketches . However , a number of natural questions arise : ( 1 ) how should we learn the sketch ? ( 2 ) should we apply the same learned sketch in each iteration , or learn it in the next iteration by training on a data set involving previously learned sketches from prior iterations ? Our Contributions . In this work we answer the above questions and develop the first framework of learned sketching that applies to a wide number of problems in convex optimization . Namely , we apply learned sketches to constrained least-squares problems , including LASSO and matrix regression with nuclear norm constraints . We show empirically that learned sketches demonstrate superior accuracy over classical oblivious random sketches for each of these problems . All of our learned sketches S are extremely sparse , meaning that they contain a single non-zero entry per column and that they can be applied in input-sparsity time . For such sketches , there are two things to learn : the position of the non-zero entry in each column and the value of the non-zero entry . Following the previous work of Indyk et al . ( 2019 ) , we choose the position of the nonzero entry in each column to be uniformly random , while the value of the nonzero entry is learned ( the value is no longer limited to −1 and 1 ) . Here we consider a new learning objective , that is , we optimize the subspace embedding property of the sketching matrix instead of optimizing the error in the objective function of the optimization problem we are trying to solve . This demonstrates a significant advantage over non-learned sketches , and has a fast training time . Our experiments show that the convergence rate is reduced by 44 % over the nonlearned COUNT-SKETCH ( a classical extremely sparse sketch ) for the LASSO problem on a real-world dataset . Recall that a smaller convergence rate means a faster convergence . We prove theoretically that S can take fewer rows , with optimized positions of nonzero entries , when the input matrix A has a small number of rows of heavy leverage score . More specifically , COUNT-SKETCH takes O ( d2/ ( δ 2 ) ) rows with failure probability δ , while our S requires only O ( ( dpolylog ( 1/ ) + log ( 1/δ ) ) / 2 ) rows if A has at most dpolylog ( 1/ ) / 2 rows of leverage score at least /d . This is a quadratic improvement in d and an exponential improvement in δ . Applying S to A runs in input-sparsity time and the resulting SA may remain sparse if A is sparse . In practice , it is not necessary to calculate the leverage scores . Instead , we show in our experiments that the indices of the rows of heavy leverage score can be learned and the induced S achieves a comparable accuracy for the abovementioned LASSO problem to classical dense sketches such as Gaussian matrices . Combining both aspects , the value of the nonzero entry and the indices of the rows of heavy leverage score , we obtain even better learned sketches . For the same LASSO problem , we show empirically that such learned sketches reduce the convergence rate by a larger 79.9 % to 84.6 % over non-learned sketches . Therefore , the learned sketches attain a smaller error within the same number of iterations , and in fact , within the same limit on the maximum runtime , since our sketches are extremely sparse . We also study the general framework of convex optimization in van den Brand et al . ( 2020 ) , and show that also for sketching-based preconditioning , learned sketches demonstrate considerable advantages . More precisely , by using a learned sketch with the same number of rows as an oblivious sketch , we are able to obtain a much better preconditioner with the same overall running time . 2 PRELIMINARIES Algorithm 1 LEARN-SKETCH : Gradient descent algorithm for learning the sketch values Require : Atrain = { Ai } Ni=1 ( Ai ∈ Rn×d ) , learn- ing rate α 1 : Randomly initialize p , v for a COUNT- SKETCH-type sketch as described in the text 2 : for t = 0 to step do 3 : Form S using p , v 4 : Sample batch Abatch from Atrain 5 : v ← v − α∂L ( S , Abatch ) ∂v Notation . We denote by Sn−1 the unit sphere in the n-dimensional Euclidean space Rn . For a matrix A ∈ Rm×n we denote by ‖A‖op its operator norm , which is defined as ‖A‖op = supx∈Sn−1 ‖Ax‖2 . We also denote by σmax ( A ) and σmin ( A ) the largest and smallest singular values of A , respectively , and by colsp ( A ) the column space of A . The condition number of A is defined to be κ ( A ) = σmax ( A ) /σmin ( A ) . Leverage Scores . We only consider matrices of full column rank1 . Suppose thatA ∈ Rm×n ( m ≥ n ) has full column rank . It has m leverage scores , denoted by τ1 ( A ) , . . . , τm ( A ) , which are defined as τi ( A ) = ‖e > i A ( A > A ) −1A > ‖22 , where { e1 , . . . , em } is the canonical basis of Rm . Equivalently , letting A = UΣV > be the singular value decomposition of A , where U ∈ Rm×n , Σ , V ∈ Rn×n , we can also write τi ( A ) = ‖e > i UU > ‖22 = ‖e > i U‖22 , which is the squared ` 2 norm of the i-th row of U . Classical Sketches . Below we review several classical sketches that have been used for solving optimization problems . • Gaussian sketch : S = 1√ m G , where G ∈ Rm×n with i.i.d . N ( 0 , 1 ) entries . • COUNT-SKETCH : Each column of S has only a single non-zero entry . The position of the non-zero entry is chosen uniformly over the m entries in the column and the value of the entry is either +1 or −1 , each with probability 1/2 . Further , the columns are chosen independently . • Sparse Johnson-Lindenstrauss Transform ( SJLT ) : S is the vertical concatenation of s independent COUNT-SKETCH matrices , each of dimension m/s× n. 1This can be assumed w.l.o.g . by adding artbirarily small random noise to the input , or one can first quickly use sketching to find a subset of columns of maximum rank , and replace the inut with that subset of columns . COUNT-SKETCH-type Sketch . A COUNT-SKETCH-type sketch is characterized by a tuple ( m , n , p , v ) , where m , n are positive integers and p , v are n-dimensional real vectors , defined as follows . The sketching matrix S has dimensions m × n and Spi , i = vi for all 1 ≤ i ≤ n , while all the other entries of S are 0 . When m and n are clear from context , we may characterize such a sketching matrix by ( p , v ) only . Subspace Embeddings . For a matrix A ∈ Rn×d , we say a matrix S ∈ Rm×n is a ( 1± ) -subspace embedding for the column span of A if ( 1− ) ‖Ax‖2 ≤ ‖SAx‖2 ≤ ( 1 + ) ‖Ax‖2 for all x ∈ Rd . The classical sketches above , with appropriate parameters , are all subspace embedding matrices with probability at least 1− δ ; our focus is on COUNT-SKETCH which can be applied in input sparsity running time . We summarize the parameters needed for a subspace embedding below : • Gaussian sketch : m = O ( ( d + log ( 1/δ ) ) / 2 ) . It is a dense matrix and computing SA costs O ( m · nnz ( A ) ) = O ( nnz ( A ) ( d+ log ( 1/δ ) ) / 2 ) time . • COUNT-SKETCH : m = O ( d2/ ( δ 2 ) ) ( Clarkson & Woodruff , 2017 ) . Though the number of rows is quadratic in d/ , the matrix S is sparse and computing SA takes only O ( nnz ( A ) ) time . • SJLT : m = O ( d log ( dδ ) / 2 ) and has s = O ( log ( dδ ) / ) non-zeros per column ( Nelson & Nguyên , 2013 ; Cohen , 2016 ) . Computing SA takes O ( snnz ( A ) ) = O ( nnz ( A ) log ( dδ ) / ) time . Iterative Hessian Sketch . The Iterative Hessian Sketching ( IHS ) method ( Pilanci & Wainwright , 2016 ) solves the constrained least-squares problem ( 1 ) by iteratively performing the update xt+1 = arg min x∈C { 1 2 ‖St+1A ( x− xt ) ‖22 − 〈A > ( b−Axt ) , x− xt〉 } , ( 2 ) where St+1 is a sketching matrix . It is not difficult to see that for the unsketched version ( St+1 is the identity matrix ) of the minimization above , the optimal solution xt+1 coincides with the optimal solution to the constrained least squares problem ( 1 ) . The IHS approximates the Hessian A > A by a sketched version ( St+1A ) > ( St+1A ) to improve runtime , as St+1A typically has very few rows . Unconstrained Convex Optimization . Consider an unconstrained convex optimization problem minx f ( x ) , where f is smooth and strongly convex , and its Hessian ∇2f is Lipschitz continuous . This problem can be solved by Newton ’ s method , which iteratively performs the update xt+1 = xt − arg min z ∥∥∥ ( ∇2f ( xt ) 1/2 ) > ( ∇2f ( xt ) 1/2 ) z −∇f ( xt ) ∥∥∥ 2 , ( 3 ) provided it is given a good initial point x0 . In each step , it requires solving a regression problem of the form minz ∥∥A > Az − y∥∥ 2 , which , with access to A , can be solved with a fast regression solver in ( van den Brand et al. , 2020 ) . The regression solver first computes a preconditioner R via a QR decomposition such that SAR has orthonormal columns , where S is a sketching matrix , then solves ẑ = arg minz′ ∥∥ ( AR ) > ( AR ) z′ − y∥∥ 2 by gradient descent and returns Rẑ in the end . Here , the point of sketching is that the QR decomposition of SA can be computed much more efficiently than the QR decomposition of A , since S has only a small number of rows . Learning a Sketch . We use the same learning algorithm in ( Liu et al. , 2020 ) , given in Algorithm 1 . The algorithm aims to minimize the mean loss function L ( S , A ) = 1N ∑N i=1 L ( S , Ai ) , where S is the learned sketch , L ( S , A ) is the loss function of S applied to a data matrix A , and A = { A1 , . . . , AN } is a ( random ) subset of training data . | This paper considers how learned CountSketches can be used in a variety of optimization tasks. The authors propose a method for predicting rows with high leverage score based on the training data. These rows are then sampled deterministically alongside either a standard CountSketch, or the learned CountSketch introduced by Indyk et al. (2019). Some novel theory is presented for this new sketch. | SP:8bfa5d83945adf0acb08e86ea8dd530bfbf20f29 |
Learning-Augmented Sketches for Hessians | 1 INTRODUCTION . Large-scale optimization problems are abundant and solving them efficiently requires powerful tools to make the computation practical . This is especially true of second order methods which often are less practical than first order ones . Although second order methods may have many fewer iterations , each iteration could involve inverting a large Hessian , which is cubic time ; in contrast , first order methods such as stochastic gradient descent are linear time per iteration . In order to make second order methods faster in each iteration , a large body of work has looked at dimensionality reduction techniques , such as sampling , sketching , or approximating the Hessian by a low rank matrix . See , for example , ( Gower et al. , 2016 ; Xu et al. , 2016 ; Pilanci & Wainwright , 2016 ; 2017 ; Doikov & Richtárik , 2018 ; Gower et al. , 2018 ; Roosta-Khorasani & Mahoney , 2019 ; Gower et al. , 2019 ; Kylasa et al. , 2019 ; Xu et al. , 2020 ; Li et al. , 2020 ) . Our focus is on sketching techniques , which often consist of multiplying the Hessian by a random matrix chosen independently of the Hessian . Sketching has a long history in theoretical computer science ( see , e.g. , ( Woodruff , 2014 ) for a survey ) , and we describe such methods more below . A special case of sketching is sampling , which in practice is often uniform sampling , and hence oblivious to properties of the actual matrix . Other times the sampling is non-uniform , and based on squared norms of submatrices of the Hessian or on the leverage scores of the Hessian . Our focus is on sketching techniques , and in particular , we consider the framework of ( Pilanci & Wainwright , 2016 ; 2017 ) which introduces the iterative Hessian sketch and the Newton sketch , as well as the high accuracy refinement given in ( van den Brand et al. , 2020 ) . If one were to run Newton ’ s method to find a point where the gradient is zero , in each iteration one needs to solve an equation involving the current Hessian and gradient to find the update direction . When the Hessian can be decomposed as A > A for an n × d matrix A with n d , then sketching is particularly suitable . The iterative Hessian sketch was proposed in Pilanci & Wainwright ( 2016 ) , where A is replaced with S · A , for a random matrix S which could be i.i.d . Gaussian or drawn from a more structured family of random matrices such as the Subsampled Randomized Hadamard Transforms or COUNT-SKETCH matrices ; the latter was done in ( Cormode & Dickens , 2019 ) . The Newton sketch was proposed by Pilanci & Wainwright ( 2017 ) , which extended sketching methods beyond constrained least-squares problems to any twice differentiable function subject to a closed convex constraint set . Using this sketch inside of interior point updates has led to much faster algorithms for an extensive body of convex optimization problems ( Pilanci & Wainwright , 2017 ) . By instead using sketching as a preconditioner , an application of the work of ( van den Brand et al. , 2020 ) ( see Appendix E ) was able to improve the dependence on the accuracy parameter to logarithmic . In general , the idea behind sketching is the following . One chooses a random matrix S , drawn from a certain family of random matrices , and computes SA . IfA is tall-and-thin , then S is short-and-fat , and thus SA is a small , roughly square matrix . Moreover , SA preserves important properties of A . One typically desired property is that S is a subspace embedding , meaning that ‖SAx‖2 = ( 1± ) ‖Ax‖2 for all x simultaneously . An observation exploited in Cormode & Dickens ( 2019 ) , building off of the COUNT-SKETCH random matrices S introduced in randomized linear algebra in Clarkson & Woodruff ( 2017 ) , is that if S contains a single non-zero entry per column , then SA can be computed in O ( nnz ( A ) ) time , where nnz ( A ) denotes the number of nonzeros in A . This is also referred to as input-sparsity running time . Each iteration of a second order method often involves solving an equation of the formA > Ax = A > b , where A > A is the Hessian and b is the gradient . For a number of problems , one has access to a matrix A ∈ Rn×d with n d , which is also an assumption made in Pilanci & Wainwright ( 2017 ) . Therefore , the solution x is the minimizer to a constrained least squares regression problem : min x∈C 1 2 ‖Ax− b‖22 , ( 1 ) where C is a convex constraint set in Rd . For the unconstrained case ( C = Rd ) , various classical sketches that attain the subspace embedding property can provably yield high-accuracy approximate solutions ( see , e.g. , ( Sarlos , 2006 ; Nelson & Nguyên , 2013 ; Cohen , 2016 ; Clarkson & Woodruff , 2017 ) ) ; for the general constrained case , the Iterative Hessian Sketch ( IHS ) was proposed by Pilanci & Wainwright ( 2016 ) as an effective approach and Cormode & Dickens ( 2019 ) employed sparse sketches to achieve input-sparsity running time for IHS . All sketches used in these results are data-oblivious random sketches . Learned Sketching . In the last few years , an exciting new notion of learned sketching has emerged . Here the idea is that one often sees independent samples of matrices A from a distribution D , and can train a model to learn the entries in a sketching matrix S on these samples . When given a future sample B , also drawn from D , the learned sketching matrix S will be such that S · B is a much more accurate compression of B than if S had the same number of rows and were instead drawn without knowledge of D. Moreover , the learned sketch S is often sparse , therefore allowing S ·B to be applied very quickly . For large datasets B this is particularly important , and distinguishes this approach from other transfer learning approaches , e.g. , ( Andrychowicz et al. , 2016 ) , which can be considerably slower in this context . Learned sketches were first used in the data stream context for finding frequent items ( Hsu et al. , 2019 ) and have subsequently been applied to a number of other problems on large data . For example , Indyk et al . ( 2019 ) showed that learned sketches yield significantly smaller errors for low rank approximation . Dong et al . ( 2020 ) made significant improvements to nearest neighbor search using learned sketches . More recently , Liu et al . ( 2020 ) extended learned sketches to several problems in numerical linear algebra , including least-squares regression , as well as k-means clustering . Despite the number of problems that learned sketches have been applied to , they have not been applied to convex optimization in general . Given that such methods often require solving a large overdetermined least squares problem in each iteration , it is hopeful that one can improve each iteration using learned sketches . However , a number of natural questions arise : ( 1 ) how should we learn the sketch ? ( 2 ) should we apply the same learned sketch in each iteration , or learn it in the next iteration by training on a data set involving previously learned sketches from prior iterations ? Our Contributions . In this work we answer the above questions and develop the first framework of learned sketching that applies to a wide number of problems in convex optimization . Namely , we apply learned sketches to constrained least-squares problems , including LASSO and matrix regression with nuclear norm constraints . We show empirically that learned sketches demonstrate superior accuracy over classical oblivious random sketches for each of these problems . All of our learned sketches S are extremely sparse , meaning that they contain a single non-zero entry per column and that they can be applied in input-sparsity time . For such sketches , there are two things to learn : the position of the non-zero entry in each column and the value of the non-zero entry . Following the previous work of Indyk et al . ( 2019 ) , we choose the position of the nonzero entry in each column to be uniformly random , while the value of the nonzero entry is learned ( the value is no longer limited to −1 and 1 ) . Here we consider a new learning objective , that is , we optimize the subspace embedding property of the sketching matrix instead of optimizing the error in the objective function of the optimization problem we are trying to solve . This demonstrates a significant advantage over non-learned sketches , and has a fast training time . Our experiments show that the convergence rate is reduced by 44 % over the nonlearned COUNT-SKETCH ( a classical extremely sparse sketch ) for the LASSO problem on a real-world dataset . Recall that a smaller convergence rate means a faster convergence . We prove theoretically that S can take fewer rows , with optimized positions of nonzero entries , when the input matrix A has a small number of rows of heavy leverage score . More specifically , COUNT-SKETCH takes O ( d2/ ( δ 2 ) ) rows with failure probability δ , while our S requires only O ( ( dpolylog ( 1/ ) + log ( 1/δ ) ) / 2 ) rows if A has at most dpolylog ( 1/ ) / 2 rows of leverage score at least /d . This is a quadratic improvement in d and an exponential improvement in δ . Applying S to A runs in input-sparsity time and the resulting SA may remain sparse if A is sparse . In practice , it is not necessary to calculate the leverage scores . Instead , we show in our experiments that the indices of the rows of heavy leverage score can be learned and the induced S achieves a comparable accuracy for the abovementioned LASSO problem to classical dense sketches such as Gaussian matrices . Combining both aspects , the value of the nonzero entry and the indices of the rows of heavy leverage score , we obtain even better learned sketches . For the same LASSO problem , we show empirically that such learned sketches reduce the convergence rate by a larger 79.9 % to 84.6 % over non-learned sketches . Therefore , the learned sketches attain a smaller error within the same number of iterations , and in fact , within the same limit on the maximum runtime , since our sketches are extremely sparse . We also study the general framework of convex optimization in van den Brand et al . ( 2020 ) , and show that also for sketching-based preconditioning , learned sketches demonstrate considerable advantages . More precisely , by using a learned sketch with the same number of rows as an oblivious sketch , we are able to obtain a much better preconditioner with the same overall running time . 2 PRELIMINARIES Algorithm 1 LEARN-SKETCH : Gradient descent algorithm for learning the sketch values Require : Atrain = { Ai } Ni=1 ( Ai ∈ Rn×d ) , learn- ing rate α 1 : Randomly initialize p , v for a COUNT- SKETCH-type sketch as described in the text 2 : for t = 0 to step do 3 : Form S using p , v 4 : Sample batch Abatch from Atrain 5 : v ← v − α∂L ( S , Abatch ) ∂v Notation . We denote by Sn−1 the unit sphere in the n-dimensional Euclidean space Rn . For a matrix A ∈ Rm×n we denote by ‖A‖op its operator norm , which is defined as ‖A‖op = supx∈Sn−1 ‖Ax‖2 . We also denote by σmax ( A ) and σmin ( A ) the largest and smallest singular values of A , respectively , and by colsp ( A ) the column space of A . The condition number of A is defined to be κ ( A ) = σmax ( A ) /σmin ( A ) . Leverage Scores . We only consider matrices of full column rank1 . Suppose thatA ∈ Rm×n ( m ≥ n ) has full column rank . It has m leverage scores , denoted by τ1 ( A ) , . . . , τm ( A ) , which are defined as τi ( A ) = ‖e > i A ( A > A ) −1A > ‖22 , where { e1 , . . . , em } is the canonical basis of Rm . Equivalently , letting A = UΣV > be the singular value decomposition of A , where U ∈ Rm×n , Σ , V ∈ Rn×n , we can also write τi ( A ) = ‖e > i UU > ‖22 = ‖e > i U‖22 , which is the squared ` 2 norm of the i-th row of U . Classical Sketches . Below we review several classical sketches that have been used for solving optimization problems . • Gaussian sketch : S = 1√ m G , where G ∈ Rm×n with i.i.d . N ( 0 , 1 ) entries . • COUNT-SKETCH : Each column of S has only a single non-zero entry . The position of the non-zero entry is chosen uniformly over the m entries in the column and the value of the entry is either +1 or −1 , each with probability 1/2 . Further , the columns are chosen independently . • Sparse Johnson-Lindenstrauss Transform ( SJLT ) : S is the vertical concatenation of s independent COUNT-SKETCH matrices , each of dimension m/s× n. 1This can be assumed w.l.o.g . by adding artbirarily small random noise to the input , or one can first quickly use sketching to find a subset of columns of maximum rank , and replace the inut with that subset of columns . COUNT-SKETCH-type Sketch . A COUNT-SKETCH-type sketch is characterized by a tuple ( m , n , p , v ) , where m , n are positive integers and p , v are n-dimensional real vectors , defined as follows . The sketching matrix S has dimensions m × n and Spi , i = vi for all 1 ≤ i ≤ n , while all the other entries of S are 0 . When m and n are clear from context , we may characterize such a sketching matrix by ( p , v ) only . Subspace Embeddings . For a matrix A ∈ Rn×d , we say a matrix S ∈ Rm×n is a ( 1± ) -subspace embedding for the column span of A if ( 1− ) ‖Ax‖2 ≤ ‖SAx‖2 ≤ ( 1 + ) ‖Ax‖2 for all x ∈ Rd . The classical sketches above , with appropriate parameters , are all subspace embedding matrices with probability at least 1− δ ; our focus is on COUNT-SKETCH which can be applied in input sparsity running time . We summarize the parameters needed for a subspace embedding below : • Gaussian sketch : m = O ( ( d + log ( 1/δ ) ) / 2 ) . It is a dense matrix and computing SA costs O ( m · nnz ( A ) ) = O ( nnz ( A ) ( d+ log ( 1/δ ) ) / 2 ) time . • COUNT-SKETCH : m = O ( d2/ ( δ 2 ) ) ( Clarkson & Woodruff , 2017 ) . Though the number of rows is quadratic in d/ , the matrix S is sparse and computing SA takes only O ( nnz ( A ) ) time . • SJLT : m = O ( d log ( dδ ) / 2 ) and has s = O ( log ( dδ ) / ) non-zeros per column ( Nelson & Nguyên , 2013 ; Cohen , 2016 ) . Computing SA takes O ( snnz ( A ) ) = O ( nnz ( A ) log ( dδ ) / ) time . Iterative Hessian Sketch . The Iterative Hessian Sketching ( IHS ) method ( Pilanci & Wainwright , 2016 ) solves the constrained least-squares problem ( 1 ) by iteratively performing the update xt+1 = arg min x∈C { 1 2 ‖St+1A ( x− xt ) ‖22 − 〈A > ( b−Axt ) , x− xt〉 } , ( 2 ) where St+1 is a sketching matrix . It is not difficult to see that for the unsketched version ( St+1 is the identity matrix ) of the minimization above , the optimal solution xt+1 coincides with the optimal solution to the constrained least squares problem ( 1 ) . The IHS approximates the Hessian A > A by a sketched version ( St+1A ) > ( St+1A ) to improve runtime , as St+1A typically has very few rows . Unconstrained Convex Optimization . Consider an unconstrained convex optimization problem minx f ( x ) , where f is smooth and strongly convex , and its Hessian ∇2f is Lipschitz continuous . This problem can be solved by Newton ’ s method , which iteratively performs the update xt+1 = xt − arg min z ∥∥∥ ( ∇2f ( xt ) 1/2 ) > ( ∇2f ( xt ) 1/2 ) z −∇f ( xt ) ∥∥∥ 2 , ( 3 ) provided it is given a good initial point x0 . In each step , it requires solving a regression problem of the form minz ∥∥A > Az − y∥∥ 2 , which , with access to A , can be solved with a fast regression solver in ( van den Brand et al. , 2020 ) . The regression solver first computes a preconditioner R via a QR decomposition such that SAR has orthonormal columns , where S is a sketching matrix , then solves ẑ = arg minz′ ∥∥ ( AR ) > ( AR ) z′ − y∥∥ 2 by gradient descent and returns Rẑ in the end . Here , the point of sketching is that the QR decomposition of SA can be computed much more efficiently than the QR decomposition of A , since S has only a small number of rows . Learning a Sketch . We use the same learning algorithm in ( Liu et al. , 2020 ) , given in Algorithm 1 . The algorithm aims to minimize the mean loss function L ( S , A ) = 1N ∑N i=1 L ( S , Ai ) , where S is the learned sketch , L ( S , A ) is the loss function of S applied to a data matrix A , and A = { A1 , . . . , AN } is a ( random ) subset of training data . | This paper studies matrix sketching algorithms where the sketching matrix is `learned', or generated adaptively. Theoretically, this is done by favoring more the rows of A with high leverage scores, while practically this is done by associating that set with rows of large norms. It evaluates this algorithm on both L_1 and L_2 regression, and observes improved test errors. | SP:8bfa5d83945adf0acb08e86ea8dd530bfbf20f29 |
Coordination Among Neural Modules Through a Shared Global Workspace | 1 INTRODUCTION 1 . Parallel , competing specialists 2 . Write to shared workspace 3 . Broadcast workspace contents Figure 1 : Step 1 : an ensemble of specialist modules doing their own default processing ; at a particular computational stage , depending upon the input , a subset of the specialists becomes active . Step 2 : the active specialists get to write information in a shared global workspace . Step 3 : the contents of the workspace are broadcast to all specialists . Deep Learning has seen a movement towards more structured models with cleaner separation between different pieces of information often handled by different components . The induced structure , and separation of knowledge has improved generalization , model-size scaling , and long-range dependencies ( Berner et al. , 2019 ; Vinyals et al. , 2019 ; Brown et al. , 2020 ) . This opens up questions about how to achieve coherence and coordination between different components in such architectures . Looking back to the 1980s , the focus in AI was much less on learning and more on constructing articulated , multi-component architectures and examining how intelligence might emerge from interactions among this collection of simple , functionally specialized components ( Fodor , 1983 ; Braitenberg , 1986 ; Minsky , 1988 ; Brooks , 1991 ) . Each of these specialist modules is on the scale of a typical component of a computer program , like a subroutine that implements a narrow , prespecified function from certain input contents to certain output contents.1 Through appropriate communication and coordination , a set of specialists can achieve complex , dynamic , and flexible behavior patterns . 1In the literature , specialists are sometimes referred to as processes or agents . As a concrete illustration , consider the task of driving a car in terms of specialists . One specialist might monitor the position of the car with respect to lines on the road , and another specialist might adjust the steering direction based on the perceptual data . In addition , there might be specialists which provide alerts when certain events occur , such as loud sounds , reaching a critical intersection on a route , or coming into close proximity to the car in front . To execute the task of driving the car properly , all these specialists need to interact coherently and broadcast their individual information to each other . Arguably , modern ML and AI has yet to develop broad architectural frameworks for learning both the specialist modules and how they should interact , while the classical view lacks an articulate story about how learning could take place successfully in such frameworks . In this article , we revisit this classical view with modern machine learning tools based on end-to-end learning and differentiable memory and attention mechanisms . Inspired by the Global Workspace Theory ( Baars , 1993 ; Dehaene et al. , 1998 ; Shanahan and Baars , 2005 ; Shanahan , 2006 ; 2010 ; 2012 ; Dehaene et al. , 2017 ) from cognitive neuroscience , we argue that more flexibility and generalization emerge through an architecture of specialists if their training encourages them to communicate effectively with one another via the bottleneck of a shared workspace ( Figure . 1 ) . Distributed specialist modules . From a computational perspective , articulated multi-component architectures composed of sparsely interacting specialist modules show desirable scaling properties ( e.g. , more specialists can seamlessly be added ) , increased robustness ( the system can tolerate the removal of or changes in individual specialists ) , and efficiency ( information is processed predominantly locally , reducing the cost of communication between specialists ) . However , modularization also requires mechanisms to establish sharing of compatible representations across specialists , a form of shared internal language . While portions of a task might be solved by independent specialists , synchronization is critical particularly when there are statistical , functional , or causal dependencies among the specialists . Coherence through a shared workspace . In cognitive neuroscience , the Global Workspace Theory ( GWT ) ( Baars , 1993 ; Dehaene et al. , 2017 ) suggests an architecture allowing specialist modules to interact . The key claim of GWT is the existence of a shared representation—sometimes called a blackboard , sometimes a workspace—that can be modified by any specialist and that is broadcast to all specialists , along with the notion that write access is limited to maintain coherence . Our interpretation of this restriction on write access is that it stems from an assumption on the form of the joint distribution between high-level concepts . In this paper , we explore a communication and coordination scheme similar to the one proposed by GWT for modern neural network architectures like Transformers ( Vaswani et al. , 2017 ; Dehghani et al. , 2018 ; Parmar et al. , 2018 ; Radford et al. , 2019 ; Brown et al. , 2020 ) and attention-based modular architectures ( Goyal et al. , 2019 ; Rahaman et al. , 2020 ; Mittal et al. , 2020a ; Goyal et al. , 2020 ; Madan et al. , 2021 ) . In terms of our driving example , the workspace could be used to override default behaviors by giving high priority to specialist modules which provide alerts of various sorts ( loud sounds , presence of a child on the street ) , allowing specialists which respond to such alerts to take control of behavior over default driving routines . This scenario implies that prioritization of signals in a shared workspace is critical . A shared communication channel necessitates common representations . For a multitude of specialist modules to cooperate , a common language is necessary ( Baars , 1997 ) . For example , in the driving scenario , alerts may come from auditory or visual processing specialists , but regardless of the source , a signal for danger must be placed in the workspace to override default behavior , whether that behavior is controlled by a radio-tuning specialist or a steering specialist . Although specialist modules can be pre-wired to have compatible communication interfaces , we will model an architecture in which an ensemble of specialist modules is trained in coordination , which should lead to a shared language ( Colagrosso and Mozer , 2005 ) . Internally , individual specialists can use whatever form of representations that serves them , but their inputs and outputs require alignment with other specialists in order to synchronize . For example , an unusual event such as a rough thud under the wheels might not have been previously experienced , but the mere signalling of novelty could override default specialists . Without a global communication channel , specialists would have to learn to communicate through pairwise interactions , which might limit coordination of behavior in novel situations : global communication ensures exchangeability of knowledge to achieve systematic generalization . 2 SYNCHRONIZING NEURAL MODULES THROUGH A SHARED WORKSPACE . We investigate a neural architecture reminiscent of the GW model , where a number of sparsely communicating specialist modules interact via a shared working memory . In particular , we extend the Transformer ( Vaswani et al. , 2017 ) , attention and slot-based modular architectures ( Goyal et al. , 2019 ) by adding a shared workspace and allowing modules ( each representing an entity ) to compete for write access in each computational stage . Key-value attention . Key-value attention defines the backbone of updates to the hidden states in the proposed model . This form of attention is widely used in self-attention models and performs well on a wide array of tasks ( Bahdanau et al. , 2014 ; Vaswani et al. , 2017 ; Santoro et al. , 2018 ) . Key-value attention selects an input value based on the match of a query vector to a key vector associated with each value . To allow differentiability and thus easier learnability , selection is soft and computes a convex combination of all the values . Such a mechanism makes it possible to change on-the-fly both the source of input and how the shared workspace is updated . It also makes the outputs of the specialists and the elements of the memory permutation invariant : they should be considered as an unordered set of elements to be selected by an attention mechanism from the contents of specialists . More precisely , soft attention uses the product of a query ( represented as a matrix Q of dimensionality Nr × d , with Nr queries , and d the dimension of each query ) with a set of No objects each associated with a key as a row in matrix KT ( No × d ) . After normalization with a softmax the resulting convex weights are used to combine the values Vi ( row i of matrix V ) : where the softmax is applied to each row of its argument matrix , yielding a set of convex weights . For our experiments , we use multihead dot product attention . Neural modules with pairwise interactions . Our approach to synchronizing neural modules is highly general and mostly agnostic to the task , domain , or specific choice of architecture , with the only requirement being that the model consists of multiple specialist modules which either operate independently or have sparse interactions requiring to only match pairs of modules at a time . Our goal is to explore how introducing a shared workspace can help these modules to become better synchronized and coordinated . We show the utility of the shared workspace for synchronization in ( a ) Transformers ( Vaswani et al. , 2017 ) , in which all interactions between positions are performed via attention , and ( b ) slot-based architectures like Recurrent Independent Mechanisms or RIMs ( Goyal et al. , 2019 ) in which all pairwise interactions between modules are performed via attention . In the context of slot-based architectures , each slot ’ s content is associated with a specialist module , whereas in Transformers different entities each associated with a different position acts as a specialist module ( Figure 2 ) . Both Transformers and RIMs utilize a self-attention mechanism for sharing information between modules , typically implemented in a pairwise manner , i.e. , each specialist attends to every other specialist . Instead , we facilitate information sharing among specialist modules through a limited capacity shared workspace . In this framework at each computational stage , different specialists compete for write access to the common workspace . The contents of the workspace , in turn , are broadcast to all specialist modules simultaneously . Notation . The input is processed through a sequence of computational stages indexed by t , and at each stage , ns entities are operated on ( i.e. , ns different modules in slot-based architectures like RIMs or ns different positions in the case of Transformers ) . Each of these ns specialist modules has a distinct internal nh-dimensional state hkt , for k ∈ { 1 , ... , ns } . The specialist modules communicate with each other via a shared workspace divided into nm memory slots , each consisting of a vector of nl elements , denoted M = [ m1 ; . . .mj ; . . .mnm ] . The shared workspace is updated across different computational stages i.e. , different time-steps in recurrent architecture and different layers in the case of Transformers . At each computational stage t , different specialists compete for writing in the shared workspace , but all specialists can read from the current state of the workspace . In the case of an autoregressive task , we can restrict the information sharing to previous positions and keep a separate version of the workspace for each position . | This paper presents a method of using external memory called "shared workspace" for communication among different neural modules or "specialists". The key idea is that there are limits on the communication bandwidth and the specialist modules must compete for access. The communication limit encourages specialization and compositionally and facilitate better synchronization. Experiments over a variety of tasks indicate the proposed Shared Workspace model improves performance over baselines. | SP:8b0bca0b528c2e633a275e0148d64ed892a451fa |
Coordination Among Neural Modules Through a Shared Global Workspace | 1 INTRODUCTION 1 . Parallel , competing specialists 2 . Write to shared workspace 3 . Broadcast workspace contents Figure 1 : Step 1 : an ensemble of specialist modules doing their own default processing ; at a particular computational stage , depending upon the input , a subset of the specialists becomes active . Step 2 : the active specialists get to write information in a shared global workspace . Step 3 : the contents of the workspace are broadcast to all specialists . Deep Learning has seen a movement towards more structured models with cleaner separation between different pieces of information often handled by different components . The induced structure , and separation of knowledge has improved generalization , model-size scaling , and long-range dependencies ( Berner et al. , 2019 ; Vinyals et al. , 2019 ; Brown et al. , 2020 ) . This opens up questions about how to achieve coherence and coordination between different components in such architectures . Looking back to the 1980s , the focus in AI was much less on learning and more on constructing articulated , multi-component architectures and examining how intelligence might emerge from interactions among this collection of simple , functionally specialized components ( Fodor , 1983 ; Braitenberg , 1986 ; Minsky , 1988 ; Brooks , 1991 ) . Each of these specialist modules is on the scale of a typical component of a computer program , like a subroutine that implements a narrow , prespecified function from certain input contents to certain output contents.1 Through appropriate communication and coordination , a set of specialists can achieve complex , dynamic , and flexible behavior patterns . 1In the literature , specialists are sometimes referred to as processes or agents . As a concrete illustration , consider the task of driving a car in terms of specialists . One specialist might monitor the position of the car with respect to lines on the road , and another specialist might adjust the steering direction based on the perceptual data . In addition , there might be specialists which provide alerts when certain events occur , such as loud sounds , reaching a critical intersection on a route , or coming into close proximity to the car in front . To execute the task of driving the car properly , all these specialists need to interact coherently and broadcast their individual information to each other . Arguably , modern ML and AI has yet to develop broad architectural frameworks for learning both the specialist modules and how they should interact , while the classical view lacks an articulate story about how learning could take place successfully in such frameworks . In this article , we revisit this classical view with modern machine learning tools based on end-to-end learning and differentiable memory and attention mechanisms . Inspired by the Global Workspace Theory ( Baars , 1993 ; Dehaene et al. , 1998 ; Shanahan and Baars , 2005 ; Shanahan , 2006 ; 2010 ; 2012 ; Dehaene et al. , 2017 ) from cognitive neuroscience , we argue that more flexibility and generalization emerge through an architecture of specialists if their training encourages them to communicate effectively with one another via the bottleneck of a shared workspace ( Figure . 1 ) . Distributed specialist modules . From a computational perspective , articulated multi-component architectures composed of sparsely interacting specialist modules show desirable scaling properties ( e.g. , more specialists can seamlessly be added ) , increased robustness ( the system can tolerate the removal of or changes in individual specialists ) , and efficiency ( information is processed predominantly locally , reducing the cost of communication between specialists ) . However , modularization also requires mechanisms to establish sharing of compatible representations across specialists , a form of shared internal language . While portions of a task might be solved by independent specialists , synchronization is critical particularly when there are statistical , functional , or causal dependencies among the specialists . Coherence through a shared workspace . In cognitive neuroscience , the Global Workspace Theory ( GWT ) ( Baars , 1993 ; Dehaene et al. , 2017 ) suggests an architecture allowing specialist modules to interact . The key claim of GWT is the existence of a shared representation—sometimes called a blackboard , sometimes a workspace—that can be modified by any specialist and that is broadcast to all specialists , along with the notion that write access is limited to maintain coherence . Our interpretation of this restriction on write access is that it stems from an assumption on the form of the joint distribution between high-level concepts . In this paper , we explore a communication and coordination scheme similar to the one proposed by GWT for modern neural network architectures like Transformers ( Vaswani et al. , 2017 ; Dehghani et al. , 2018 ; Parmar et al. , 2018 ; Radford et al. , 2019 ; Brown et al. , 2020 ) and attention-based modular architectures ( Goyal et al. , 2019 ; Rahaman et al. , 2020 ; Mittal et al. , 2020a ; Goyal et al. , 2020 ; Madan et al. , 2021 ) . In terms of our driving example , the workspace could be used to override default behaviors by giving high priority to specialist modules which provide alerts of various sorts ( loud sounds , presence of a child on the street ) , allowing specialists which respond to such alerts to take control of behavior over default driving routines . This scenario implies that prioritization of signals in a shared workspace is critical . A shared communication channel necessitates common representations . For a multitude of specialist modules to cooperate , a common language is necessary ( Baars , 1997 ) . For example , in the driving scenario , alerts may come from auditory or visual processing specialists , but regardless of the source , a signal for danger must be placed in the workspace to override default behavior , whether that behavior is controlled by a radio-tuning specialist or a steering specialist . Although specialist modules can be pre-wired to have compatible communication interfaces , we will model an architecture in which an ensemble of specialist modules is trained in coordination , which should lead to a shared language ( Colagrosso and Mozer , 2005 ) . Internally , individual specialists can use whatever form of representations that serves them , but their inputs and outputs require alignment with other specialists in order to synchronize . For example , an unusual event such as a rough thud under the wheels might not have been previously experienced , but the mere signalling of novelty could override default specialists . Without a global communication channel , specialists would have to learn to communicate through pairwise interactions , which might limit coordination of behavior in novel situations : global communication ensures exchangeability of knowledge to achieve systematic generalization . 2 SYNCHRONIZING NEURAL MODULES THROUGH A SHARED WORKSPACE . We investigate a neural architecture reminiscent of the GW model , where a number of sparsely communicating specialist modules interact via a shared working memory . In particular , we extend the Transformer ( Vaswani et al. , 2017 ) , attention and slot-based modular architectures ( Goyal et al. , 2019 ) by adding a shared workspace and allowing modules ( each representing an entity ) to compete for write access in each computational stage . Key-value attention . Key-value attention defines the backbone of updates to the hidden states in the proposed model . This form of attention is widely used in self-attention models and performs well on a wide array of tasks ( Bahdanau et al. , 2014 ; Vaswani et al. , 2017 ; Santoro et al. , 2018 ) . Key-value attention selects an input value based on the match of a query vector to a key vector associated with each value . To allow differentiability and thus easier learnability , selection is soft and computes a convex combination of all the values . Such a mechanism makes it possible to change on-the-fly both the source of input and how the shared workspace is updated . It also makes the outputs of the specialists and the elements of the memory permutation invariant : they should be considered as an unordered set of elements to be selected by an attention mechanism from the contents of specialists . More precisely , soft attention uses the product of a query ( represented as a matrix Q of dimensionality Nr × d , with Nr queries , and d the dimension of each query ) with a set of No objects each associated with a key as a row in matrix KT ( No × d ) . After normalization with a softmax the resulting convex weights are used to combine the values Vi ( row i of matrix V ) : where the softmax is applied to each row of its argument matrix , yielding a set of convex weights . For our experiments , we use multihead dot product attention . Neural modules with pairwise interactions . Our approach to synchronizing neural modules is highly general and mostly agnostic to the task , domain , or specific choice of architecture , with the only requirement being that the model consists of multiple specialist modules which either operate independently or have sparse interactions requiring to only match pairs of modules at a time . Our goal is to explore how introducing a shared workspace can help these modules to become better synchronized and coordinated . We show the utility of the shared workspace for synchronization in ( a ) Transformers ( Vaswani et al. , 2017 ) , in which all interactions between positions are performed via attention , and ( b ) slot-based architectures like Recurrent Independent Mechanisms or RIMs ( Goyal et al. , 2019 ) in which all pairwise interactions between modules are performed via attention . In the context of slot-based architectures , each slot ’ s content is associated with a specialist module , whereas in Transformers different entities each associated with a different position acts as a specialist module ( Figure 2 ) . Both Transformers and RIMs utilize a self-attention mechanism for sharing information between modules , typically implemented in a pairwise manner , i.e. , each specialist attends to every other specialist . Instead , we facilitate information sharing among specialist modules through a limited capacity shared workspace . In this framework at each computational stage , different specialists compete for write access to the common workspace . The contents of the workspace , in turn , are broadcast to all specialist modules simultaneously . Notation . The input is processed through a sequence of computational stages indexed by t , and at each stage , ns entities are operated on ( i.e. , ns different modules in slot-based architectures like RIMs or ns different positions in the case of Transformers ) . Each of these ns specialist modules has a distinct internal nh-dimensional state hkt , for k ∈ { 1 , ... , ns } . The specialist modules communicate with each other via a shared workspace divided into nm memory slots , each consisting of a vector of nl elements , denoted M = [ m1 ; . . .mj ; . . .mnm ] . The shared workspace is updated across different computational stages i.e. , different time-steps in recurrent architecture and different layers in the case of Transformers . At each computational stage t , different specialists compete for writing in the shared workspace , but all specialists can read from the current state of the workspace . In the case of an autoregressive task , we can restrict the information sharing to previous positions and keep a separate version of the workspace for each position . | This paper proposes a communication framework to have multiple modules communicate and switch precedence efficiently, taking inspiration from Global Workspace Theory in cognitive science. The primary contribution is a scheme to replace complete pairwise communications in modularized architectures with a single, limited-capacity workspace that persists and changes over stages of computation. This workspace is implemented with a read/write scheme that iterates through stages of computation (layers in a Transformer or steps in a recurrent architecture): in the write phase, the shared memory is updated according to the current states of the modules that are most informative to the shared memory's current state as determined by a key-value attention scheme, with the modules competing via softmax. In the read phase, the internal states of all modules are updated via another key-value attention scheme. The advantages are claimed to be 1) higher order interaction among modules because every module learns from every other one (at least, more than pairwise), dynamic filtering because the memory persists and updates stage to stage; and linear computational complexity because the number of memory slots doesn't change much (and it's typically small, 1-10). The related work motivates this paper by the classical AI principle that intelligent systems should have multiple specialized modules rather than one general entity. It distinguishes from prior slot-based memory work in that memory writes here are sparse and competitive, and prior work on reducing computational complexity of Transformer dot product attention through its persistent memory. It aptly assesses itself as a unification of existing ideas. The experimentation section tests different parts of the proposed scheme. The triangles experiment tests the comparative speed to convergence (and accuracy) of the HO communications here compared to pairwise in baseline Transformer. The MNIST generation experiment with TIMs shows that the shared workspace gives an advantage on domains where input dimensions are mostly independent. The CATER experiment shows a similar result to the triangles experiment (quickly picking out only relevant information) but in a time series, and the Sort-of-CLEVR experiment again reinforces the power of the shared workspace on sparse tasks. The physical reasoning shows general improvement, and the Atari performance shows considerable improvement due to modularization. | SP:8b0bca0b528c2e633a275e0148d64ed892a451fa |
Coordination Among Neural Modules Through a Shared Global Workspace | 1 INTRODUCTION 1 . Parallel , competing specialists 2 . Write to shared workspace 3 . Broadcast workspace contents Figure 1 : Step 1 : an ensemble of specialist modules doing their own default processing ; at a particular computational stage , depending upon the input , a subset of the specialists becomes active . Step 2 : the active specialists get to write information in a shared global workspace . Step 3 : the contents of the workspace are broadcast to all specialists . Deep Learning has seen a movement towards more structured models with cleaner separation between different pieces of information often handled by different components . The induced structure , and separation of knowledge has improved generalization , model-size scaling , and long-range dependencies ( Berner et al. , 2019 ; Vinyals et al. , 2019 ; Brown et al. , 2020 ) . This opens up questions about how to achieve coherence and coordination between different components in such architectures . Looking back to the 1980s , the focus in AI was much less on learning and more on constructing articulated , multi-component architectures and examining how intelligence might emerge from interactions among this collection of simple , functionally specialized components ( Fodor , 1983 ; Braitenberg , 1986 ; Minsky , 1988 ; Brooks , 1991 ) . Each of these specialist modules is on the scale of a typical component of a computer program , like a subroutine that implements a narrow , prespecified function from certain input contents to certain output contents.1 Through appropriate communication and coordination , a set of specialists can achieve complex , dynamic , and flexible behavior patterns . 1In the literature , specialists are sometimes referred to as processes or agents . As a concrete illustration , consider the task of driving a car in terms of specialists . One specialist might monitor the position of the car with respect to lines on the road , and another specialist might adjust the steering direction based on the perceptual data . In addition , there might be specialists which provide alerts when certain events occur , such as loud sounds , reaching a critical intersection on a route , or coming into close proximity to the car in front . To execute the task of driving the car properly , all these specialists need to interact coherently and broadcast their individual information to each other . Arguably , modern ML and AI has yet to develop broad architectural frameworks for learning both the specialist modules and how they should interact , while the classical view lacks an articulate story about how learning could take place successfully in such frameworks . In this article , we revisit this classical view with modern machine learning tools based on end-to-end learning and differentiable memory and attention mechanisms . Inspired by the Global Workspace Theory ( Baars , 1993 ; Dehaene et al. , 1998 ; Shanahan and Baars , 2005 ; Shanahan , 2006 ; 2010 ; 2012 ; Dehaene et al. , 2017 ) from cognitive neuroscience , we argue that more flexibility and generalization emerge through an architecture of specialists if their training encourages them to communicate effectively with one another via the bottleneck of a shared workspace ( Figure . 1 ) . Distributed specialist modules . From a computational perspective , articulated multi-component architectures composed of sparsely interacting specialist modules show desirable scaling properties ( e.g. , more specialists can seamlessly be added ) , increased robustness ( the system can tolerate the removal of or changes in individual specialists ) , and efficiency ( information is processed predominantly locally , reducing the cost of communication between specialists ) . However , modularization also requires mechanisms to establish sharing of compatible representations across specialists , a form of shared internal language . While portions of a task might be solved by independent specialists , synchronization is critical particularly when there are statistical , functional , or causal dependencies among the specialists . Coherence through a shared workspace . In cognitive neuroscience , the Global Workspace Theory ( GWT ) ( Baars , 1993 ; Dehaene et al. , 2017 ) suggests an architecture allowing specialist modules to interact . The key claim of GWT is the existence of a shared representation—sometimes called a blackboard , sometimes a workspace—that can be modified by any specialist and that is broadcast to all specialists , along with the notion that write access is limited to maintain coherence . Our interpretation of this restriction on write access is that it stems from an assumption on the form of the joint distribution between high-level concepts . In this paper , we explore a communication and coordination scheme similar to the one proposed by GWT for modern neural network architectures like Transformers ( Vaswani et al. , 2017 ; Dehghani et al. , 2018 ; Parmar et al. , 2018 ; Radford et al. , 2019 ; Brown et al. , 2020 ) and attention-based modular architectures ( Goyal et al. , 2019 ; Rahaman et al. , 2020 ; Mittal et al. , 2020a ; Goyal et al. , 2020 ; Madan et al. , 2021 ) . In terms of our driving example , the workspace could be used to override default behaviors by giving high priority to specialist modules which provide alerts of various sorts ( loud sounds , presence of a child on the street ) , allowing specialists which respond to such alerts to take control of behavior over default driving routines . This scenario implies that prioritization of signals in a shared workspace is critical . A shared communication channel necessitates common representations . For a multitude of specialist modules to cooperate , a common language is necessary ( Baars , 1997 ) . For example , in the driving scenario , alerts may come from auditory or visual processing specialists , but regardless of the source , a signal for danger must be placed in the workspace to override default behavior , whether that behavior is controlled by a radio-tuning specialist or a steering specialist . Although specialist modules can be pre-wired to have compatible communication interfaces , we will model an architecture in which an ensemble of specialist modules is trained in coordination , which should lead to a shared language ( Colagrosso and Mozer , 2005 ) . Internally , individual specialists can use whatever form of representations that serves them , but their inputs and outputs require alignment with other specialists in order to synchronize . For example , an unusual event such as a rough thud under the wheels might not have been previously experienced , but the mere signalling of novelty could override default specialists . Without a global communication channel , specialists would have to learn to communicate through pairwise interactions , which might limit coordination of behavior in novel situations : global communication ensures exchangeability of knowledge to achieve systematic generalization . 2 SYNCHRONIZING NEURAL MODULES THROUGH A SHARED WORKSPACE . We investigate a neural architecture reminiscent of the GW model , where a number of sparsely communicating specialist modules interact via a shared working memory . In particular , we extend the Transformer ( Vaswani et al. , 2017 ) , attention and slot-based modular architectures ( Goyal et al. , 2019 ) by adding a shared workspace and allowing modules ( each representing an entity ) to compete for write access in each computational stage . Key-value attention . Key-value attention defines the backbone of updates to the hidden states in the proposed model . This form of attention is widely used in self-attention models and performs well on a wide array of tasks ( Bahdanau et al. , 2014 ; Vaswani et al. , 2017 ; Santoro et al. , 2018 ) . Key-value attention selects an input value based on the match of a query vector to a key vector associated with each value . To allow differentiability and thus easier learnability , selection is soft and computes a convex combination of all the values . Such a mechanism makes it possible to change on-the-fly both the source of input and how the shared workspace is updated . It also makes the outputs of the specialists and the elements of the memory permutation invariant : they should be considered as an unordered set of elements to be selected by an attention mechanism from the contents of specialists . More precisely , soft attention uses the product of a query ( represented as a matrix Q of dimensionality Nr × d , with Nr queries , and d the dimension of each query ) with a set of No objects each associated with a key as a row in matrix KT ( No × d ) . After normalization with a softmax the resulting convex weights are used to combine the values Vi ( row i of matrix V ) : where the softmax is applied to each row of its argument matrix , yielding a set of convex weights . For our experiments , we use multihead dot product attention . Neural modules with pairwise interactions . Our approach to synchronizing neural modules is highly general and mostly agnostic to the task , domain , or specific choice of architecture , with the only requirement being that the model consists of multiple specialist modules which either operate independently or have sparse interactions requiring to only match pairs of modules at a time . Our goal is to explore how introducing a shared workspace can help these modules to become better synchronized and coordinated . We show the utility of the shared workspace for synchronization in ( a ) Transformers ( Vaswani et al. , 2017 ) , in which all interactions between positions are performed via attention , and ( b ) slot-based architectures like Recurrent Independent Mechanisms or RIMs ( Goyal et al. , 2019 ) in which all pairwise interactions between modules are performed via attention . In the context of slot-based architectures , each slot ’ s content is associated with a specialist module , whereas in Transformers different entities each associated with a different position acts as a specialist module ( Figure 2 ) . Both Transformers and RIMs utilize a self-attention mechanism for sharing information between modules , typically implemented in a pairwise manner , i.e. , each specialist attends to every other specialist . Instead , we facilitate information sharing among specialist modules through a limited capacity shared workspace . In this framework at each computational stage , different specialists compete for write access to the common workspace . The contents of the workspace , in turn , are broadcast to all specialist modules simultaneously . Notation . The input is processed through a sequence of computational stages indexed by t , and at each stage , ns entities are operated on ( i.e. , ns different modules in slot-based architectures like RIMs or ns different positions in the case of Transformers ) . Each of these ns specialist modules has a distinct internal nh-dimensional state hkt , for k ∈ { 1 , ... , ns } . The specialist modules communicate with each other via a shared workspace divided into nm memory slots , each consisting of a vector of nl elements , denoted M = [ m1 ; . . .mj ; . . .mnm ] . The shared workspace is updated across different computational stages i.e. , different time-steps in recurrent architecture and different layers in the case of Transformers . At each computational stage t , different specialists compete for writing in the shared workspace , but all specialists can read from the current state of the workspace . In the case of an autoregressive task , we can restrict the information sharing to previous positions and keep a separate version of the workspace for each position . | Paper proposes a novel mechanism for information exchange between different neural subnets. It replaces the pairwise interactions with a share memory space. The memory is updated by a competitive scheme which the top-k updates are selected via the key-query-value attention mechanism. The shared memory/workspace then broadcast the updated state to all other upstream specialist subnets. Each specialist subnet then update its representation/weights accordingly. Paper claims 3 advantages of this approach: 1. Higher-order (HO) interaction among neural modules 2. Dynamic filtering due to persistence of memory. 3. Lower computational complexity of using shared workspace for synchronizing different specialists Experimental results are very promising across a wide variety of tasks, namely DETECTING EQUILATERAL TRIANGLES; SORT-OF-CLEVR; CATER: OBJECT TRACKING; for transformer architectures. Also, experiments on RIM for the BOUNCING BALL task and TIMS for the MULTIMNIST GENERATION and Language Modeling Task were also done. Finally, the approach was also experimented on model free RL on ATARI game task. | SP:8b0bca0b528c2e633a275e0148d64ed892a451fa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.