paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Adaptive Extra-Gradient Methods for Min-Max Optimization and Games
1 Introduction The surge of recent breakthroughs in generative adversarial networks ( GANs ) [ 20 ] , robust reinforcement learning [ 41 ] , and other adversarial learning models [ 27 ] has sparked renewed interest in the theory of min-max optimization problems and games . In this broad setting , it has become empirically clear that , ceteris paribus , the simultaneous training of two ( or more ) antagonistic models faces drastically new challenges relative to the training of a single one . Perhaps the most prominent of these challenges is the appearance of cycles and recurrent ( or even chaotic ) behavior in min-max games . This has been studied extensively in the context of learning in bilinear games , in both continuous [ 16 , 31 , 40 ] and discrete time [ 12 , 18 , 19 , 32 ] , and the methods proposed to overcome recurrence typically focus on mitigating the rotational component of min-max games . The method with the richest history in this context is the extra-gradient ( EG ) algorithm of Korpelevich [ 25 ] and its variants . The EG algorithm exploits the Lipschitz smoothness of the problem and , if coupled with a Polyak–Ruppert averaging scheme , it achieves an O ( 1/T ) rate of convergence in smooth , convex-concave min-max problems [ 35 ] . This rate is known to be tight [ 34 , 39 ] but , in order to achieve it , the original method requires the problem ’ s Lipschitz constant to be known in advance . If the problem is not Lipschitz smooth ( or the algorithm is run with a vanishing step-size schedule ) , the method ’ s rate of convergence drops to O ( 1/ √ T ) . Our contributions . Our aim in this paper is to provide an algorithm that automatically adapts to smooth / non-smooth min-max problems and games , and achieves order-optimal rates in both classes without requiring any prior tuning by the optimizer . In this regard , we propose a flexible algorithmic scheme , which we call AdaProx , and which exploits gradient data observed at earlier iterations to perform more informative extra-gradient steps in later ones . Thanks to this mechanism , and to the best of our knowledge , AdaProx is the first algorithm that simultaneously achieves the following : 1 . An O ( 1/ √ T ) convergence rate in non-smooth problems and O ( 1/T ) in smooth ones . 2 . Applicability to min-max problems and games where the standard boundedness / Lipschitz continuity conditions required in the literature do not hold . 3 . Convergence without prior knowledge of the problem ’ s parameters ( e.g. , whether the problem ’ s defining vector field is smooth or not , its smoothness modulus if it is , etc. ) . Our proposed method achieves the above by fusing the following ingredients : a ) a family of local norms – a Finsler metric – capturing any singularities in the problem at hand ; b ) a suitable mirror-prox template ; and c ) an adaptive step-size policy in the spirit of Rakhlin & Sridharan [ 43 ] . We also show that , under a suitable coherence assumption , the sequence of iterates generated by the algorithm converges , thus providing an appealing alternative to iterate averaging in cases where the method ’ s “ last iterate ” is more appropriate ( for instance , if using AdaProx to solve non-monotone problems ) . Related works . There have been several works improving on the guarantees of the original extragradient/mirror-prox template . We review the most relevant of these works below ; for convenience , we also tabulate these contributions in Table 1 above . Because many of these works appear in the literature on variational inequalities [ 15 ] , we also use this language in the sequel . In unconstrained problems with an operator that is locally Lipschitz continuous ( but not necessarily globally so ) , the golden ratio algorithm ( GRAAL ) [ 29 ] achieves convergence without requiring prior knowledge of the problem ’ s Lipschitz parameter . However , GRAAL provides no rate guarantees for non-smooth problems – and hence , a fortiori , no interpolation guarantees either . By contrast , such guarantees are provided in problems with a bounded domain by the generalized mirror-prox ( GMP ) algorithm of [ 47 ] under the umbrella of Hölder continuity . Still , nothing is known about the convergence of GRAAL / GMP in problems with singularities ( i.e. , when the problem ’ s defining vector field blows up at a boundary point of the problem ’ s domain ) . Singularities of this type were treated in a recent series of papers [ 1 , 17 , 48 ] by means of a “ Bregman continuity ” or “ Lipschitz-like ” condition . These methods are order-optimal in the smooth case , without requiring any knowledge of the problem ’ s smoothness modulus . On the other hand , like GRAAL ( but unlike GMP ) , they do not provide any rate interpolation guarantees between smooth and non-smooth problems . Another method that simultaneously achieves an O ( 1/ √ T ) rate in non-smooth problems and an O ( 1/T ) rate in smooth ones is the recent algorithm of Bach & Levy [ 2 ] . The BL algorithm employs an adaptive , AdaGradlike step-size policy which allows the method to interpolate between the two regimes – and this , even with noisy gradient feedback . On the negative side , the BL algorithm requires a bounded domain with a ( Bregman ) diameter that is known in advance ; as a result , its theoretical guarantees do not apply to unbounded problems . In addition , the BL algorithm makes crucial use of boundedness and Lipschitz continuity ; extending the BL method beyond this standard framework is a highly non-trivial endeavor which formed a big part of this paper ’ s motivation . 2 Problem Setup and Blanket Assumptions We begin in this section by reviewing some basics for min-max problems and games . 2.1 . Min-max / Saddle-point problems . A min-max game is a saddle-point problem of the form min θ∈Θ max φ∈Φ L ( θ , φ ) ( SP ) where Θ , Φ are convex subsets of some ambient real space and L : Θ × Φ→ is the problem ’ s loss function . In the game-theoretic interpretation of ( SP ) , the player controlling θ seeks to minimize L ( θ , φ ) for any value of the maximization variable φ , while the player controlling φ seeks to maximize L ( θ , φ ) for any value of the minimization variable θ . Accordingly , solving ( SP ) consists of finding a Nash equilibrium ( NE ) , i.e. , an action profile ( θ∗ , φ∗ ) ∈ Θ × Φ such that L ( θ∗ , φ ) ≤ L ( θ∗ , φ∗ ) ≤ L ( θ , φ∗ ) for all θ ∈ Θ , φ ∈ Φ . ( 1 ) By the minimax theorem of von Neumann [ 49 ] , Nash equilibria are guaranteed to exist when Θ , Φ are compact and L is convex-concave ( i.e. , convex in θ and concave in φ ) . Much of our paper is motivated by the question of calculating a Nash equilibrium ( θ∗ , φ∗ ) of ( SP ) in the context of von Neumann ’ s theorem ; we expand on this below . 2.2 . Games . Going beyond the min-max setting , a continuous game in normal form is defined as follows : First , consider a finite set of players N = { 1 , . . . , N } , each with their own action space Ki ∈ di ( assumed convex but possibly not closed ) . During play , each player selects an action xi from Ki with the aim of minimizing a loss determined by the ensemble x B ( xi ; x−i ) B ( x1 , . . . , xN ) of all players ’ actions . In more detail , writing K B ∏ i Ki for the game ’ s total action space , we assume that the loss incurred by the i-th player is ` i ( xi ; x−i ) , where ` i : K → is the player ’ s loss function . In this context , a Nash equilibrium is any action profile x∗ ∈ K that is unilaterally stable , i.e. , ` i ( x∗i ; x ∗ −i ) ≤ ` i ( xi ; x∗−i ) for all xi ∈ Ki and all i ∈ N . ( NE ) If each Ki is compact and ` i is convex in xi , existence of Nash equilibria is guaranteed by the theorem of Debreu [ 13 ] . Given that a min-max problem can be seen as a two-player zero-sum game with ` 1 = L , ` 2 = −L , von Neumann ’ s theorem may in turn be seen as a special case of Debreu ’ s ; in the sequel , we describe a first-order characterization of Nash equilibria that encapsulates both . In most cases of interest , the players ’ loss functions are individually subdifferentiable on a subset X of K with riK ⊆ X ⊆ K [ 21 , 44 ] . This means that there exists a ( possibly discontinuous ) vector field Vi : X → di such that ` i ( x′i ; x−i ) ≥ ` i ( xi ; x−i ) + 〈Vi ( x ) , x′i − xi〉 ( 2 ) for all x ∈ X , x′ ∈ K and all i ∈ N [ 21 ] . In the simplest case , if ` i is differentiable at x , then Vi ( x ) can be interpreted as the gradient of ` i with respect to xi . The raison d ’ être of the more general definition ( 2 ) is that it allows us to treat non-smooth loss functions that are common in machine learning ( such as L1-regularized losses ) . We make this distinction precise below : 1 . If there is no continuous vector field Vi ( x ) satisfying ( 2 ) , the game is called non-smooth . 2 . If there is a continuous vector field Vi ( x ) satisfying ( 2 ) , the game is called smooth . Remark . We stress here that the adjective “ smooth ” refers to the game itself : for instance , if ` ( x ) = |x| for x ∈ , the game is not smooth and any V satisfying ( 2 ) is discontinuous at 0 . In this regard , the above boils down to whether the ( individual ) subdifferential of each ` i admits a continuous selection . 2.3 . Resource allocation and equilibrium problems . The notion of a Nash equilibrium captures the unilateral minimization of the players ’ individual loss functions . In many pratical cases of interest , a notion of equilibrium is still relevant , even though it is not necessarily attached to the minimization of individual loss functions . Such problems are known as “ equilibrium problems ” [ 15 , 26 ] ; to avoid unnecessary generalities , we focus here on a relevant problem that arises in distributed computing architectures ( such as GPU clusters and the like ) . To state the problem , consider a distributed computing grid consisting of N parallel processors that serve demands arriving at a rate of ρ per unit of time ( measured e.g. , in flop/s ) . If the maximum processing rate of the i-th node is µi ( without overclocking ) , and jobs are buffered and served on a first-come , first-served ( FCFS ) basis , the mean time required to process a unit demand at the i-th node is given by the Kleinrock M/M/1 response function τi ( xi ) = 1/ ( µi − xi ) , where xi denotes the node ’ s load [ 5 ] . Accordingly , the set of feasible loads that can be processed by the grid is X B { ( x1 , . . . , xN ) : 0 ≤ xi < µi , x1 + · · · + xN = ρ } . In this context , a load profile x∗ ∈ X is said to be balanced if no infinitesimal process can be better served by buffering it at a different node [ 38 ] ; formally , this amounts to the so-called Wardrop equilibrium condition τi ( x∗i ) ≤ τ j ( x∗j ) for all i , j ∈ N with x∗i > 0 . ( WE ) We note here a crucial difference between ( WE ) and ( NE ) : if we view the grid ’ s computing nodes as “ players ” , the constraint ∑ i xi = ρ means that there is no allowable unilateral deviation ( x∗i ; x ∗ −i ) 7→ ( xi ; x∗−i ) with xi , x ∗ i . As a result , ( NE ) is meaningless as a requirement for this equilibrium problem . As we discuss below , this resource allocation problem will require the full capacity of our framework . 2.4 . Variational inequalities . Importantly , all of the above problems can be restated as a variational inequality of the form Find x∗ ∈ X such that 〈V ( x∗ ) , x − x∗〉 ≥ 0 for all x ∈ X . ( VI ) In the above , X is a convex subset of d ( not necessarily closed ) that represents the problem ’ s domain . The problem ’ s defining vector field V : X → d is then given as follows : In min-max problems and games , V is any field satisfying ( 2 ) ; otherwise , in equilibrium problems of the form ( WE ) , the components of V are Vi = τi ( we leave the details of this verification to the reader ) . This equivalent formulation is quite common in the literature on min-max / equilibrium problems [ 14 , 15 , 26 , 30 ] , and it is often referred to as the “ vector field formulation ” [ 3 , 8 , 23 ] . Its usefulness lies in that it allows us to abstract away from the underlying game-theoretic complications ( multiple indices , individual subdifferentials , etc . ) and provides a unifying framework for a wide range of problems in machine learning , signal processing , operations research , and many other fields [ 15 , 45 ] . For this reason , our analysis will focus almost exclusively on solving ( VI ) , and we will treat V and X ⊆ d , d = ∑i di , as the problem ’ s primitive data . 2.5 . Merit functions and monotonicity . A widely used assumption in the literature on equilibrium problems and variational inequalities is the monotonicity condition 〈V ( x ) − V ( x′ ) , x − x′〉 ≥ 0 for all x , x′ ∈ X . ( Mon ) In single-player games , monotonicity is equivalent to convexity of the optimizer ’ s loss function ; in min-max games , it is equivalent to L being convex-concave [ 26 ] ; etc . In the absence of monotonicity , approximating an equilibrium is PPAD-hard [ 11 ] , so we will state most of our results under ( Mon ) . Now , to assess the quality of a candidate solution x̂ ∈ X , we will employ the restricted merit function GapC ( x̂ ) = supx∈C〈V ( x ) , x̂ − x〉 , ( 3 ) where the “ test domain ” C is a nonempty convex subset of X [ 15 , 24 , 37 ] . The motivation for this is provided by the following proposition : Proposition 1 . Let C be a nonempty convex subset of X . Then : a ) GapC ( x̂ ) ≥ 0 whenever x̂ ∈ C ; and b ) if GapC ( x̂ ) = 0 and C contains a neighborhood of x̂ , then x̂ is a solution of ( VI ) . Proposition 1 generalizes an earlier characterization by Nesterov [ 37 ] and justifies the use of GapC ( x ) as a merit function for ( VI ) ; to streamline our presentation , we defer the proof to the paper ’ s supplement . Moreover , to avoid trivialities , we will also assume that the solution set X ∗ of ( VI ) is nonempty and we will reserve the notation x∗ for solutions of ( VI ) . Together with monotonicity , this will be our only blanket assumption . 3 The Extra-Gradient Algorithm and its Limits Perhaps the most widely used solution method for games and variational inequalities ( VIs ) is the extra-gradient ( EG ) algorithm of Korpelevich [ 25 ] and its variants [ 28 , 42 , 43 ] . This algorithm has a rich history in optimization , and it has recently attracted considerable interest in the fields of machine learning and AI , see e.g. , [ 8 , 12 , 18 , 22 , 23 , 32 , 33 ] and references therein . In its simplest form , for problems with closed domains , the algorithm proceeds recursively as Xt+1/2 = Π ( Xt − γtVt ) , Xt+1 = Π ( Xt − γtVt+1/2 ) , ( EG ) where Π ( x ) = arg minx′∈X ‖x′ − x‖ is the Euclidean projection on X , Vt B V ( Xt ) for t = 1 , 3/2 , . . . , and γt > 0 , is the method ’ s step-size . Then , running ( EG ) for T iterations , the algorithm returns the “ ergodic average ” X̄T = ∑T t=1 γtXt+1/2∑T t=1 γt . ( 4 ) In this setting , the main guarantees for ( EG ) date back to [ 35 ] and can be summarized as follows : 1 . For non-smooth problems ( discontinuous V ) : Assume V is bounded , i.e. , there exists some M > 0 such that ‖V ( x ) ‖ ≤ M for all x ∈ X . ( BD ) Then , if ( EG ) is run with a step-size of the form γt ∝ 1/ √ t , we have GapC ( X̄T ) = O ( 1/ √ T ) . ( 5 ) 2 . For smooth problems ( continuous V ) : Assume V is L-Lipschitz continuous , i.e. , ‖V ( x ) − V ( x′ ) ‖ ≤ L‖x − x′‖ for all x , x′ ∈ X . ( LC ) Then , if ( EG ) is run with a constant step-size γ < 1/L , we have GapC ( X̄T ) = O ( 1/T ) . ( 6 ) Remark . In the above , ‖·‖ is tacitly assumed to be the standard Euclidean norm . Non-Euclidean considerations will play a crucial role in the sequel , but they are not necessary for the moment . Importantly , the distinction between smooth and non-smooth problems can not be lifted : the bounds ( 5 ) and ( 6 ) are tight in their respective problem classes and they can not be improved without further assumptions [ 34 , 39 ] . Moreover , we should also note the following : 1 . The algorithm changes drastically from the non-smooth to the smooth case : non-smoothness requires γt ∝ 1/ √ t , but such a step-size can not achieve a fast O ( 1/T ) rate . 2 . If ( EG ) is run with a constant step-size , L must be known in advance ; otherwise , running ( EG ) with an ill-adapted step-size ( γ > 1/L ) could lead to non-convergence . We illustrate this failure of ( EG ) in Fig . 1 . As we discussed in the introduction , our aim in the sequel will be to provide a single , adaptive algorithm that simultaneously achieves the following : a ) an order-optimal O ( 1/ √ T ) convergence rate in non-smooth problems and O ( 1/T ) in smooth ones ; b ) convergence in problems where the boundedness / Lipschitz continuity conditions ( BD ) / ( LC ) no longer hold ; and c ) achieves all this without prior knowledge of the problem ’ s parameters . 4 Rate Interpolation : the Euclidean Case As a prelude to our main result , we provide in this section an adaptive version of ( EG ) that achieves the “ best of both worlds ” in the Euclidean setting of Section 3 , i.e. , an O ( 1/ √ T ) convergence rate in problems satisfying ( BD ) , and an O ( 1/T ) rate in problems satisfying ( LC ) . Our starting point is the observation that , if the sequence Xt produced by ( EG ) converges to a solution of ( VI ) , the difference δt B ‖Vt+1/2 − Vt‖ = ‖V ( Xt+1/2 ) − V ( Xt ) ‖ ( 7 ) must itself become vanishingly small if V is ( Lipschitz ) continuous . On the contrary , if V is discontinuous , this difference may remain bounded away from zero ( consider for example the L1 loss ` ( x ) = |x| near 0 ) . Based on this observation , we consider the adaptive step-size policy : γt+1 = 1 /√ 1 + ∑t s=1 δ 2 s . ( 8 ) The intuition behind ( 8 ) is as follows : If V is not smooth and lim inft→∞ δt > 0 , then γt will vanish at a Θ ( 1/ √ t ) rate , which is the optimal step-size schedule for problems satisfying ( BD ) but not ( LC ) . Instead , if V satisfies ( LC ) and Xt converges to a solution x∗ of ( VI ) , it is plausible to expect that the infinite series ∑ t δ 2 t is summable , in which case the step-size γt will not vanish as t → ∞ . Furthermore , since δt is defined in terms of successive gradient differences , it automatically exploits the variation of the gradient data observed up to time t , so it can be expected to adjust to the “ local ” Lipschitz constant of V around a solution x∗ of ( VI ) . Our step-size policy and motivation are similar in spirit to the “ predictable sequence ” approach of [ 43 ] . For now , we only state ( without proof ) our main result for problems satisfying ( BD ) or ( LC ) . Theorem 1 . Suppose V satisfies ( Mon ) , let C be a compact neighborhood of a solution of ( VI ) , and let H = supx∈C‖X1 − x‖2 . If ( EG ) is run with the adaptive step-size policy ( 8 ) , we have : a ) If V satisfies ( BD ) : GapC ( X̄T ) = O ( H + 4M3 + log ( 1 + 4M2T ) √ T ) . ( 9a ) b ) If V satisfies ( LC ) : GapC ( X̄T ) = O ( H / T ) . ( 9b ) Theorem 1 ( which is proved in the sequel as a special case of Theorem 2 ) should be compared to the corresponding results of Bach & Levy [ 2 ] . In the non-smooth case , [ 2 ] provides a bound of the form Õ ( αMD/ √ T ) with D2 = 12 maxx∈X ‖x‖2 − 1 2 minx∈X ‖x‖2 ( recall that [ 2 ] only treats problems with a bounded domain ) , and α = max { M/M0 , M0/M } where M0 is an initial estimate of M. The worst-case value of α is O ( M ) when good estimates are not readily available ; in this regard , ( 9a ) essentially replaces the O ( D ) constant of Bach & Levy [ 2 ] by O ( M ) . Since D = ∞ in problems with an unbounded domain , Theorem 1 provides a significant improvement in this regard . In terms of L , the smooth guarantee of [ 2 ] is Õ ( α2LD2/T ) , so the multiplicative constant in the bound also becomes infinite in problems with an unbounded domain . In our case , D2 is replaced by H ( which is also finite ) times an additional multiplicative constant which is increasing in M and L ( but is otherwise asymptotic , so it is not included in the statement of Theorem 1 ) . This removes an additional limitation in the results of [ 2 ] ; in the next sections we drop even the Euclidean regularity requirements ( BD ) / ( LC ) , and we provide a rate interpolation result that does not require either condition . 5 Finsler Regularity To motivate our analysis outside the setting of ( BD ) / ( LC ) , consider the vector field Vi ( x ) = ( µi − xi ) −1 + λ1 { xi > 0 } , i = 1 , . . . , N , ( 10 ) which corresponds to the distributed computing problem of Section 2.3 plus a regularization term designed to limit the activation of computing nodes at low loads . Clearly , we have ‖V ( x ) ‖ → ∞ whenever xi → 0+ , so ( BD ) and ( LC ) both fail ( the latter even if λ = 0 ) . On the other hand , if we consider the “ local ” norm ‖v‖x , ∗ = ∑d i=1 ( µi − xi ) |vi| , we have ‖V ( x ) ‖x , ∗ ≤ d + λ ∑d i=1 µi , so V is bounded relative to ‖·‖x , ∗ . This observation motivates the use of a local – as opposed to global – norm , which we define formally as follows : Definition 1 . A Finsler metric on a convex subset X of d is a continuous function F : X × d → + which satisfies the following properties for all x ∈ X and all z , z′ ∈ d : 1 . Subadditivity : F ( x ; z + z′ ) ≤ F ( x ; z ) + F ( x ; z′ ) . 2 . Absolute homogeneity : F ( x ; λz ) = |λ|F ( x ; z ) for all λ ∈ . 3 . Positive-definiteness : F ( x ; z ) ≥ 0 with equality if and only if z = 0 . Given a Finsler metric on X , the induced primal / dual local norms on X are respectively defined as ‖z‖x = F ( x ; z ) and ‖v‖x , ∗ = max { 〈v , z〉 : F ( x ; z ) = 1 } ( 11 ) for all x ∈ X and all z , v ∈ d. We will also say that a Finsler metric on X is regular when ‖v‖x′ , ∗/‖v‖x , ∗ = 1 + O ( ‖x′ − x‖x ) for all x , x′ ∈ X , v ∈ d. Finally , for simplicity , we will also assume in the sequel that ‖·‖x ≥ ν‖·‖ for some ν > 0 and all x ∈ X ( this last assumption is for convenience only , as the norm could be redefined to ‖·‖x ← ‖·‖x + ν‖·‖ without affecting our theoretical analysis ) . When X is equipped with a regular Finsler metric as above , we will say that it is a Finsler space . Example 5.1 . Let F ( x ; z ) = ‖z‖ where ‖·‖ denotes the reference norm of X = d. Then the properties of Definition 1 are satisfied trivially . J Example 5.2 . For a more interesting example of a Finsler structure , consider the set X = ( 0 , 1 ] d and the metric ‖z‖x = maxi|zi|/xi , z ∈ d , x ∈ X . In this case ‖v‖x , ∗ = ∑d i=1 xi|vi| for all v ∈ d , and the only property of Definition 1 that remains to be proved is that of regularity . To that end , we have ‖v‖x′ , ∗ − ‖v‖x , ∗ ≤ ∑d i=1|vi| · |x′i − xi| = ∑d i=1 xi|vi| · |x′i − xi|/xi ≤ ‖v‖x , ∗ · ‖x′ − x‖x . ( 12 ) Hence , by dividing by ‖v‖x , ∗ , we readily get ‖v‖x′ , ∗/‖v‖x , ∗ ≤ 1 + ‖x − x′‖x i.e. , ‖·‖x is regular in the sense of Definition 1 . As we discuss in the sequel , this metric plays an important role for distributed computing problems of the form presented in Section 2.3 . J With all this in hand , we will say that a vector field V : X → d is 1 . Metrically bounded if there exists some M > 0 such that ‖V ( x ) ‖x , ∗ ≤ M for all x ∈ X . ( MB ) 2 . Metrically smooth if there exists some L > 0 such that ‖V ( x′ ) − V ( x ) ‖x , ∗ ≤ L‖x′ − x‖x′ for all x′ , x ∈ X . ( MS ) The notion of metric boundedness/smoothness extends that of ordinary boundedness/Lipschitz continuity to a Finsler context ; note also that , even though neither side of ( MS ) is unilaterally symmetric under the change x↔ x′ , the condition ( MS ) as a whole is . Our next example shows that this extension is proper , i.e. , ( BD ) / ( LC ) may both fail while ( MB ) / ( MS ) both hold : Example 5.3 . Consider the change of variables xi 1 − xi/µi in the resource allocation problem of Section 2.3 . Then , writing Vi ( x ) = − ( 1/xi ) − λ1 { xi < 1 } for the transformed field ( 10 ) under this change of variables , we readily get Vi ( x ) → −∞ as xi → 0+ ; as a result , both ( BD ) and ( LC ) fail to hold for any global norm on d. Instead , under the local norm ‖z‖x = maxi|z|i/xi , we have : 1 . For all λ ≥ 0 , V satisfies ( MB ) with M = d ( 1 + λ ) : ‖V ( x ) ‖x , ∗ ≤ ∑d i=1 xi · ( 1/xi + λ ) = d ( 1 + λ ) . 2 . For λ = 0 , V satisfies ( MS ) with L = d : indeed , for all x , x′ ∈ X , we have ‖V ( x′ ) − V ( x ) ‖x , ∗ = ∑d i=1 xi ∣∣∣∣∣∣ 1x′i − 1xi ∣∣∣∣∣∣ = ∑di=1 |x′i − xi|x′i ≤ d maxi |x ′ i − xi| x′i = d‖x′ − x‖x′ . ( 13 ) 6 The AdaProx Algorithm and its Guarantees The method . We are now in a position to define a family of algorithms that is capable of interpolating between the optimal smooth/non-smooth convergence rates for solving ( VI ) without requiring either ( BD ) or ( LC ) .To do so , the key steps in our approach will be to ( i ) equip X with a suitable Finsler structure ( as in Section 5 ) ; and ( ii ) replace the Euclidean projection in ( EG ) with a suitable “ Bregman proximal ” step that is compatible with the chosen Finsler structure on X . We begin with the latter ( assuming that X is equipped with an arbitrary Finsler structure ) : Definition 2 . We say that h : d → ∪ { ∞ } is a Bregman-Finsler function on X if : 1. h is convex , lower semi-continuous ( l.s.c . ) , cl ( dom h ) = cl ( X ) , and dom ∂h = X . 2 . The subdifferential of h admits a continuous selection ∇h ( x ) ∈ ∂h ( x ) for all x ∈ X . 3. h is strongly convex , i.e. , there exists some K > 0 such that h ( x′ ) ≥ h ( x ) + 〈∇h ( x ) , x′ − x〉 + K2 ‖x ′ − x‖2x ( 14 ) for all x ∈ X and all x′ ∈ dom h. The Bregman divergence induced by h is defined for all x ∈ X , x′ ∈ dom h as D ( x′ , x ) = h ( x′ ) − h ( x ) − 〈∇h ( x ) , x′ − x〉 ( 15 ) and the associated prox-mapping is defined for all x ∈ X and y ∈ d as Px ( y ) = arg minx′∈X { 〈y , x − x′〉 + D ( x′ , x ) } . ( 16 ) Definition 2 is fairly technical , so some clarifications are in order . First , to connect this definition with the Euclidean setup of Section 4 , the prox-mapping ( 16 ) should be seen as the Bregman equivalent of a Euclidean projection step , i.e. , Π ( x+y ) ! Px ( y ) . Second , a key difference between Definition 2 and other definitions of Bregman functions in the literature [ 4 , 6 , 7 , 9 , 24 , 36 , 37 , 46 ] is that h is assumed strongly convex relative to a local norm – not a global norm . This “ locality ” will play a crucial role in allowing the proposed methods to adapt to the geometry of the problem . For concreteness , we provide below an example that expands further on Examples 5.2 and 5.3 : Example 6.1 . Consider the local norm ‖z‖x = maxi|zi|/xi on X = ( 0 , 1 ] d and let h ( x ) = ∑d i=1 1/xi on ( 0 , 1 ] d. We then have D ( x′ , x ) = d∑ i=1 [ 1 x′i − 1 xi + x′i − xi x2i ] = d∑ i=1 ( x′i − xi ) 2 x2i x ′ i ≥ d∑ i=1 ( 1 − x′i/xi ) 2 ≥ ‖x′ − x‖2x ( 17 ) i.e. , h is 1-strongly convex relative to ‖·‖x on X . J With all this is in place , the extra-gradient method can be adapted to our current setting as follows : Xt+1/2 = PXt ( −γtVt ) δt = ‖Vt+1/2 − Vt‖Xt+1/2 , ∗ Xt+1 = PXt ( −γtVt+1/2 ) γt+1 = 1 /√ 1 + ∑t s=1 δ 2 s ( AdaProx ) with Vt = V ( Xt ) , t = 1 , 3/2 , . . . , as in Section 3 . In words , this method builds on the template of ( EG ) by ( i ) replacing the Euclidean projection with a mirror step ; ( ii ) replacing the global norm in ( 8 ) with a dual Finsler norm evaluated at the algorithm ’ s leading state Xt+1/2 . Convergence speed . With all this in hand , our main result for AdaProx can be stated as follows : Theorem 2 . Suppose V satisfies ( Mon ) , let C be a compact neighborhood of a solution of ( VI ) , and set H = supx∈C D ( x , X1 ) Then , the AdaProx algorithm enjoys the guarantees : a ) If V satisfies ( MB ) : GapC ( X̄T ) = O ( H + M3 ( 1 + 1/K ) 2 + log ( 1 + 4M2 ( 1 + 2/K ) 2T ) √ T ) . ( 18a ) b ) If V satisfies ( MS ) : GapC ( X̄T ) = O ( H / T ) . ( 18b ) For the constants that appear in Eq . ( 18 ) , we refer the reader to the discussion following Theorem 1 . Moreover , we defer the proof of Theorem 2 to the paper ’ s supplement . We only mention here that its key element is the determination of the asymptotic behavior of the adaptive step-size policy γt in the non-smooth and smooth regimes , i.e. , under ( MB ) and ( MS ) respectively . At a very high level , ( MB ) guarantees that the difference sequence δt is bounded , which implies in turn that ∑T t=1 γt = Ω ( √ T ) and eventually yields the bound ( 18a ) for the algorithm ’ s ergodic average X̄T . On the other hand , if ( MS ) kicks in , we have the following finer result : Lemma 1 . Assume V satisfies ( MS ) . Then , a ) γt decreases monotonically to a strictly positive limit γ∞ = limt→∞ γt > 0 ; and b ) the sequence δt is square summable : in particular , ∑∞ t=1 δ 2 t = 1/γ 2 ∞ − 1 . By means of this lemma ( which we prove in the paper ’ s supplement ) , it follows that ∑T t=1 γt ≥ γ∞T = Ω ( T ) ; hence it ultimately follows that AdaProx enjoys an O ( 1/T ) rate of convergence under ( MS ) . Trajectory convergence . In complement to Theorem 2 , we also provide a trajectory convergence result that governs the actual iterates of the AdaProx algorithm : Theorem 3 . Suppose that 〈V ( x ) , x − x∗〉 < 0 whenever x∗ is a solution of ( VI ) and x is not . If , in addition , V satisfies ( MB ) or ( MS ) , the iterates Xt of AdaProx converge to a solution of ( VI ) . The importance of this result is that , in many practical applications ( especially in non-monotone problems ) , it is more common to harvest the “ last iterate ” of the method ( Xt ) rather than its ergodic average ( X̄T ) ; as such , Theorem 3 provides a certain justification for this design choice . The proof of Theorem 3 relies on non-standard arguments , so we relegate it to the supplement . Structurally , the first step is to show that Xt visits any neighborhood of a solution point x∗ ∈ X ∗ infinitely often ( this is where the coherence assumption 〈V ( x ) , x − x∗〉 is used ) . The second is to use this trapping property in conjunction with a suitable “ energy inequality ” to establish convergence via the use of a quasi-Fejér technique as in [ 10 ] ; this part is detailed in a separate appendix . 7 Numerical Experiments We conclude in this section with a numerical illustration of the convergence properties of AdaProx in two different settings : a ) bilinear min-max games ; and b ) a simple Wasserstein GAN in the spirit of Daskalakis et al . [ 12 ] with the aim of learning an unknown covariance matrix . Bilinear min-max games . For our first set of experiments , we consider a min-max game of the form of the form L ( θ , φ ) = ( θ − θ∗ ) > A ( φ − φ∗ ) with θ , φ ∈ 100 and A ∈ 100 × 100 ( drawn i.i.d . component-wise from a standard Gaussian ) . To test the convergence of AdaProx beyond the “ full gradient ” framework , we ran the algorithm with stochastic gradient signals of the form Vt = V ( Xt ) +Ut where Ut is drawn i.i.d . from a centered Gaussian distribution with unit covariance matrix . We then plotted in Fig . 2 the squared gradient norm ‖V ( X̄T ) ‖2 of the method ’ s ergodic average X̄T after T iterations ( so values closer to zero are better ) . For benchmarking purposes , we also ran the extragradient ( EG ) and Bach–Levy ( BL ) algorithms [ 2 ] with the same random seed for the simulated gradient noise . The step-size parameter of the EG algorithm was chosen as γt = 0.025/ √ t , whereas the BL algorithm was run with diameter and gradient bound estimation parameters D0 = .5 and M0 = 2.5 respectively ( both determined after a hyper-parameter search since the only theoretically allowable values are D0 = M0 = ∞ ; interestingly , very large values for D0 and M0 did not yield good results ) . The experiment was repeated S = 100 times , and AdaProx gave consistently faster rates . Covariance matrix learning . Going a step further , consider the covariance learning game L ( θ , φ ) = x∼N ( 0 , Σ ) [ x > θx ] − z∼N ( 0 , I ) [ z > θ > φθz ] , θ , φ ∈ d × d. ( 19 ) The goal here is to generate data drawn from a centered Gaussian distribution with unknown covariance Σ ; in particular , this model follows the Wasserstein GAN formulation of Daskalakis et al . [ 12 ] with generator and discriminator respectively given by G ( z ) = θz and D ( x ) = x > φx ( no clipping ) . For the experiments , we took d = 100 , a mini-batch of m = 128 samples per update , and we ran the EG , BL and AdaProx algorithms as above , tracing the square norm of V as a measure of convergence . Since the problem is non-monotone , there are several disjoint equilibrium components so the algorithms ’ behavior is considerably more erratic ; however , after this initial warm-up phase , AdaProx again gave the faster convergence rates . Acknowledgments This research was partially supported by the COST Action CA16228 “ European Network for Game Theory ” ( GAMENET ) and the French National Research Agency ( ANR ) in the framework of the grants ORACLESS ( ANR–16–CE33–0004–01 ) and ELIOT ( ANR-18-CE40-0030 and FAPESP 2018/12579-7 ) , the “ Investissements d ’ avenir ” program ( ANR-15-IDEX-02 ) , the LabEx PERSYVAL ( ANR-11-LABX-0025-01 ) , and MIAI @ Grenoble Alpes ( ANR-19-P3IA-0003 ) . References [ 1 ] Kimon Antonakopoulos , E. Veronica Belmega , and Panayotis Mertikopoulos . An adaptive mirror-prox algorithm for variational inequalities with singular operators . In NeurIPS ’ 19 : Proceedings of the 33rd International Conference on Neural Information Processing Systems , 2019 . [ 2 ] Francis Bach and Kfir Yehuda Levy . A universal algorithm for variational inequalities adaptive to smoothness and noise . In COLT ’ 19 : Proceedings of the 32nd Annual Conference on Learning Theory , 2019 . [ 3 ] David Balduzzi , Sebastien Racaniere , James Martens , Jakob Foerster , Karl Tuyls , and Thore Graepel . The mechanics of n-player differentiable games . In ICML ’ 18 : Proceedings of the 35th International Conference on Machine Learning , 2018 . [ 4 ] Amir Beck and Marc Teboulle . Mirror descent and nonlinear projected subgradient methods for convex optimization . Operations Research Letters , 31 ( 3 ) :167–175 , 2003 . [ 5 ] Dimitri P. Bertsekas and Robert Gallager . Data Networks . Prentice Hall , Englewood Cliffs , NJ , 2 edition , 1992 . [ 6 ] Lev M. Bregman . The relaxation method of finding the common point of convex sets and its application to the solution of problems in convex programming . USSR Computational Mathematics and Mathematical Physics , 7 ( 3 ) :200–217 , 1967 . [ 7 ] Sébastien Bubeck . Convex optimization : Algorithms and complexity . Foundations and Trends in Machine Learning , 8 ( 3-4 ) :231–358 , 2015 . [ 8 ] Tatjana Chavdarova , Gauthier Gidel , François Fleuret , and Simon Lacoste-Julien . Reducing noise in GAN training with variance reduced extragradient . In NeurIPS ’ 19 : Proceedings of the 33rd International Conference on Neural Information Processing Systems , 2019 . [ 9 ] Gong Chen and Marc Teboulle . Convergence analysis of a proximal-like minimization algorithm using Bregman functions . SIAM Journal on Optimization , 3 ( 3 ) :538–543 , August 1993 . [ 10 ] Patrick L. Combettes . Quasi-Fejérian analysis of some optimization algorithms . In Dan Butnariu , Yair Censor , and Simeon Reich ( eds . ) , Inherently Parallel Algorithms in Feasibility and Optimization and Their Applications , pp . 115–152 . Elsevier , New York , NY , USA , 2001 . [ 11 ] Constantinos Daskalakis , Paul W. Goldberg , and Christos H. Papadimitriou . The complexity of computing a Nash equilibrium . SIAM Journal on Computing , 39 ( 1 ) :195–259 , 2009 . [ 12 ] Constantinos Daskalakis , Andrew Ilyas , Vasilis Syrgkanis , and Haoyang Zeng . Training GANs with optimism . In ICLR ’ 18 : Proceedings of the 2018 International Conference on Learning Representations , 2018 . [ 13 ] Gérard Debreu . A social equilibrium existence theorem . Proceedings of the National Academy of Sciences of the USA , 38 ( 10 ) :886–893 , October 1952 . [ 14 ] Francisco Facchinei and Christian Kanzow . Generalized Nash equilibrium problems . 4OR , 5 ( 3 ) :173–210 , September 2007 . [ 15 ] Francisco Facchinei and Jong-Shi Pang . Finite-Dimensional Variational Inequalities and Complementarity Problems . Springer Series in Operations Research . Springer , 2003 . [ 16 ] Lampros Flokas , Emmanouil Vasileios Vlatakis-Gkaragkounis , and Georgios Piliouras . Poincaré recurrence , cycles and spurious equilibria in gradient-descent-ascent for non-convex non-concave zero-sum games . In NeurIPS ’ 19 : Proceedings of the 33rd International Conference on Neural Information Processing Systems , 2019 . [ 17 ] A.V . Gasnikov , P.E . Dvurechensky , F.S . Stonyakin , and A.A. Titov . An adaptive proximal method for variational inequalities . Computational Mathematics and Mathematical Physics , 59:836–841 , 2019 . [ 18 ] Gauthier Gidel , Hugo Berard , Gaëtan Vignoud , Pascal Vincent , and Simon Lacoste-Julien . A variational inequality perspective on generative adversarial networks . In ICLR ’ 19 : Proceedings of the 2019 International Conference on Learning Representations , 2019 . [ 19 ] Gauthier Gidel , Reyhane Askari Hemmat , Mohammad Pezehski , Rémi Le Priol , Gabriel Huang , Simon Lacoste-Julien , and Ioannis Mitliagkas . Negative momentum for improved game dynamics . In AISTATS ’ 19 : Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics , 2019 . [ 20 ] Ian J. Goodfellow , Jean Pouget-Abadie , Mehdi Mirza , Bing Xu , David Warde-Farley , Sherjil Ozair , Aaron Courville , and Yoshua Bengio . Generative adversarial nets . In NIPS ’ 14 : Proceedings of the 28th International Conference on Neural Information Processing Systems , 2014 . [ 21 ] Jean-Baptiste Hiriart-Urruty and Claude Lemaréchal . Fundamentals of Convex Analysis . Springer , Berlin , 2001 . [ 22 ] Yu-Guan Hsieh , Franck Iutzeler , Jérôme Malick , and Panayotis Mertikopoulos . On the convergence of single-call stochastic extra-gradient methods . In NeurIPS ’ 19 : Proceedings of the 33rd International Conference on Neural Information Processing Systems , pp . 6936–6946 , 2019 . [ 23 ] Yu-Guan Hsieh , Franck Iutzeler , Jérôme Malick , and Panayotis Mertikopoulos . Explore aggressively , update conservatively : Stochastic extragradient methods with variable stepsize scaling . https : //arxiv.org/abs/2003.10162 , 2020 . [ 24 ] Anatoli Juditsky , Arkadi Semen Nemirovski , and Claire Tauvel . Solving variational inequalities with stochastic mirror-prox algorithm . Stochastic Systems , 1 ( 1 ) :17–58 , 2011 . [ 25 ] G. M. Korpelevich . The extragradient method for finding saddle points and other problems . Èkonom . i Mat . Metody , 12 : 747–756 , 1976 . [ 26 ] Rida Laraki , Jérôme Renault , and Sylvain Sorin . Mathematical Foundations of Game Theory . Universitext . Springer , 2019 . [ 27 ] Aleksander Madry , Aleksandar Makelov , Ludwig Schmidt , Dimitris Tsipras , and Adrian Vladu . Towards deep learning models resistant to adversarial attacks . In ICLR ’ 18 : Proceedings of the 2018 International Conference on Learning Representations , 2018 . [ 28 ] Yura Malitsky . Projected reflected gradient methods for monotone variational inequalities . SIAM Journal on Optimization , 25 ( 1 ) :502–520 , 2015 . [ 29 ] Yura Malitsky . Golden ratio algorithms for variational inequalities . Mathematical Programming , 2019 . [ 30 ] Panayotis Mertikopoulos and Zhengyuan Zhou . Learning in games with continuous action sets and unknown payoff functions . Mathematical Programming , 173 ( 1-2 ) :465–507 , January 2019 . [ 31 ] Panayotis Mertikopoulos , Christos H. Papadimitriou , and Georgios Piliouras . Cycles in adversarial regularized learning . In SODA ’ 18 : Proceedings of the 29th annual ACM-SIAM Symposium on Discrete Algorithms , 2018 . [ 32 ] Panayotis Mertikopoulos , Bruno Lecouat , Houssam Zenati , Chuan-Sheng Foo , Vijay Chandrasekhar , and Georgios Piliouras . Optimistic mirror descent in saddle-point problems : Going the extra ( gradient ) mile . In ICLR ’ 19 : Proceedings of the 2019 International Conference on Learning Representations , 2019 . [ 33 ] Aryan Mokhtari , Asuman Ozdaglar , and Sarath Pattathil . Convergence rate of O ( 1/k ) for optimistic gradient and extra-gradient methods in smooth convex-concave saddle point problems . https : //arxiv.org/pdf/1906.01115.pdf , 2019 . [ 34 ] Arkadi Semen Nemirovski . Information-based complexity of linear operator equations . Journal of Complexity , 8 ( 2 ) : 153–175 , 1992 . [ 35 ] Arkadi Semen Nemirovski . Prox-method with rate of convergence O ( 1/t ) for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems . SIAM Journal on Optimization , 15 ( 1 ) :229–251 , 2004 . [ 36 ] Arkadi Semen Nemirovski , Anatoli Juditsky , Guanghui Lan , and Alexander Shapiro . Robust stochastic approximation approach to stochastic programming . SIAM Journal on Optimization , 19 ( 4 ) :1574–1609 , 2009 . [ 37 ] Yurii Nesterov . Dual extrapolation and its applications to solving variational inequalities and related problems . Mathematical Programming , 109 ( 2 ) :319–344 , 2007 . [ 38 ] Noam Nisan , Tim Roughgarden , Éva Tardos , and V. V. Vazirani ( eds. ) . Algorithmic Game Theory . Cambridge University Press , 2007 . [ 39 ] Yuyuan Ouyang and Yangyang Xu . Lower complexity bounds of first-order methods for convex-concave bilinear saddle-point problems . Mathematical Programming , 2019 . URL https : //doi.org/10.1007/s10107-019-01420-0 . [ 40 ] Georgios Piliouras and Jeff S. Shamma . Optimization despite chaos : Convex relaxations to complex limit sets via Poincaré recurrence . In SODA ’ 14 : Proceedings of the 25th annual ACM-SIAM Symposium on Discrete Algorithms , 2014 . [ 41 ] Lerrel Pinto , James Davidson , Rahul Sukthankar , and Abhinav Gupta . Robust adversarial reinforcement learning . In ICML ’ 17 : Proceedings of the 34th International Conference on Machine Learning , 2017 . [ 42 ] Leonid Denisovich Popov . A modification of the Arrow–Hurwicz method for search of saddle points . Mathematical Notes of the Academy of Sciences of the USSR , 28 ( 5 ) :845–848 , 1980 . [ 43 ] Alexander Rakhlin and Karthik Sridharan . Optimization , learning , and games with predictable sequences . In NIPS ’ 13 : Proceedings of the 27th International Conference on Neural Information Processing Systems , 2013 . [ 44 ] Ralph Tyrrell Rockafellar . Convex Analysis . Princeton University Press , Princeton , NJ , 1970 . [ 45 ] Gesualdo Scutari , Francisco Facchinei , Daniel Pérez Palomar , and Jong-Shi Pang . Convex optimization , game theory , and variational inequality theory in multiuser communication systems . IEEE Signal Process . Mag. , 27 ( 3 ) :35–49 , May 2010 . [ 46 ] Shai Shalev-Shwartz . Online learning and online convex optimization . Foundations and Trends in Machine Learning , 4 ( 2 ) :107–194 , 2011 . [ 47 ] Fedor Stonyakin , Alexander Gasnikov , Pavel Dvurechensky , Mohammad Alkousa , and Alexander Titov . Generalized mirror prox for monotone variational inequalities : Universality and inexact oracle . https : //arxiv.org/abs/1806 . 05140 , 2018 . [ 48 ] Fedor Stonyakin , Alexander Gasnikov , Alexander Tyurin , Dmitry Pasechnyuk , Artem Agafonov , Pavel Dvurechensky , Darina Dvinskikh , Alexey Kroshnin , and Victorya Piskunova . Inexact model : A framework for optimization and variational inequalities . https : //arxiv.org/abs/1902.00990 , 2019 . [ 49 ] John von Neumann . Zur Theorie der Gesellschaftsspiele . Mathematische Annalen , 100:295–320 , 1928 . Translated by S. Bargmann as “ On the Theory of Games of Strategy ” in A. Tucker and R. D. Luce , editors , Contributions to the Theory of Games IV , volume 40 of Annals of Mathematics Studies , pages 13-42 , 1957 , Princeton University Press , Princeton .
This work proposed a stepsize for the extragradient/mirror-prox method that works both in smooth and non-smooth settings. The stepsize is based on the empirical values of gradient/operator differences, and mirror maps are used to allow for non-euclidian geometry such as KL divergence. The paper offers us three convergence results: 1 bound for the extragradient update (no mirror map) and 2 bounds for the mirror-prox update (convergence of iterates without a rate and convergence of the restricted gap with rates). The theory is followed by simple randomly-generated problems, which is ok for justifying the theory but can't serve a significant contribution on its own.
SP:c5d1720922dfde389abbce3110a7f049e972192a
Transfer among Agents: An Efficient Multiagent Transfer Learning Framework
1 INTRODUCTION . Transfer Learning has shown great potential to accelerate single-agent RL via leveraging prior knowledge from past learned policies of relevant tasks ( Yin & Pan , 2017 ; Yang et al. , 2020 ) . Inspired by this , transfer learning in multiagent reinforcement learning ( MARL ) ( Claus & Boutilier , 1998 ; Hu & Wellman , 1998 ; Bu et al. , 2008 ; Hernandez-Leal et al. , 2019 ; da Silva & Costa , 2019 ) is also studied with two major directions : 1 ) transferring knowledge across different but similar MARL tasks and 2 ) transferring knowledge among multiple agents in the same MARL task . For the former , several works explicitly compute similarities between states or temporal abstractions ( Hu et al. , 2015 ; Boutsioukis et al. , 2011 ; Didi & Nitschke , 2016 ) to transfer across similar tasks with the same number of agents , or design new network structures to transfer across tasks with different numbers of agents ( Agarwal et al. , 2019 ; Wang et al. , 2020 ) . In this paper , we focus on the latter direction due to the following intuition : in a multiagent system ( MAS ) , each agent ’ s experience is different , so the states each agent encounters ( the degree of familiarity to the different regions of the whole environment ) are also different ; if we figure out some principled ways to transfer knowledge across different agents , all agents could form a big picture about the MAS even without exploring the whole space of the environment , and this will definitely facilitate more efficient MARL ( da Silva et al. , 2020 ) . Transferring knowledge among multiple agents is still investigated at an initial stage , and the assumptions and designs of some recent methods are usually simple . For example , LeCTR ( Omidshafiei et al. , 2019 ) and HMAT ( Kim et al. , 2020 ) adopted the teacher-student framework to learn to teach by assigning each agent two roles ( i.e. , the teacher and the student ) , so the agent could learn when and what to advise other agents or receive advice from other agents . However , both LeCTR and HMAT only consider two-agent scenarios . Liang & Li ( 2020 ) proposed a method under the teacher-student framework where each agent asks for advice from other agents through learning an attentional teacher selector . However , they simply used the difference of two unbounded value functions as the reward signal which may cause instability . DVM ( Wadhwania et al. , 2019 ) and LTCR Xue et al . ( 2020 ) are two proposed multiagent policy distillation methods to transfer knowledge among more than two agents . However , both methods decompose the solution into several stages in a coarse-grained manner . Moreover , they consider the distillation equally throughout the whole training process , which is counter-intuitive . A good transfer should be adaptive rather than being equally treated , e.g. , the transfer should be more frequent at the beginning of the training since agents are less knowledgeable about the environment , while decay as the training process continues because agents are familiar with the environment gradually and should focus more on their own knowledge . In this paper , we propose a novel MultiAgent Option-based Policy Transfer ( MAOPT ) framework which models the policy transfer among multiple agents as an option learning problem . In contrast to the previous teacher-student framework and policy distillation framework , MAOPT is adaptive and applicable to scenarios consisting of more than two agents . Specifically , MAOPT adaptively selects a suitable policy for each agent as the advised policy , which is used as a complementary optimization objective of each agent . MAOPT also uses the termination probability as a performance indicator to determine whether the advice should be terminated to avoid negative transfer . Furthermore , to facilitate the scalability and robustness , MAOPT contains two types : one type is MAOPT with the global option advisor ( MAOPT-GOA ) , the other type consists of MAOPT with the local option advisor ( MAOPT-LOA ) and MAOPT with the successor representation option advisor ( MAOPTSRO ) . Ideally , we can obtain the global information to estimate the option-value function , where MAOPT-GOA is used to select a joint policy set , in which each policy is advised to each agent . However , in many realistic scenarios , we can only obtain each agents ’ local experience , where we adopt MAOPT-LOA and MAOPT-SRO . Each agent ’ s experience may be inconsistent due to partial observations , which may cause the inaccuracy in option-value ’ s estimation . MAOPT-SRO is used to overcome the inconsistency in multiple agents ’ experience by decoupling the dynamics of the environment from the rewards to learn the option-value function under each agent ’ s preference . MAOPT can be easily incorporated into existing DRL approaches and experimental results show that it significantly boosts the performance of existing DRL approaches both in discrete and continuous state spaces . 2 PRELIMINARIES . Stochastic Games ( Littman , 1994 ) are a natural multiagent extension of Markov Decision Processes ( MDPs ) , which model the dynamic interactions among multiple agents . Considering the fact agents may not have access to the complete environmental information , we follow previous work ’ s settings and model the multiagent learning problems as partially observable stochastic games ( Hansen et al. , 2004 ) . A Partially Observable Stochastic Game ( POSG ) is defined as a tuple 〈N , S , A1 , · · · , An , T , R1 , · · · , Rn , O1 , · · · , On〉 , where N is the set of agents ; S is the set of states ; Ai is the set of actions available to agent i ( the joint action spaceA = A1×A2×· · ·×An ) ; T is the transition function that defines transition probabilities between global states : S×A×S → [ 0 , 1 ] ; Ri is the reward function for agent i : S × A → R and Oi is the set of observations for agent i . A policy πi : Oi × Ai → [ 0 , 1 ] specifies the probability distribution over the action space of agent i . The goal of agent i is to learn a policy πi that maximizes the expected return with a discount factor γ : J = Eπi [ ∑∞ t=0 γ trit ] . The Options Framework . Sutton et al . ( 1999 ) firstly formalized the idea of temporally extended action as an option . An option ω ∈ Ω is defined as a triple { Iω , πω , βω } in which Iω ⊂ S is an initiation state set , πω is an intra-option policy and βω : Iω → [ 0 , 1 ] is a termination function that specifies the probability an option ω terminates at state s ∈ Iω . An MDP endowed with a set of options becomes a Semi-Markov Decision Process ( Semi-MDP ) , which has a corresponding optimal option-value function over options learned using intra-option learning . The options framework considers the call-and-return option execution model , in which an agent picks an option o according to its option-value function Qω ( s , ω ) , and follows the intra-option policy πω until termination , then selects a next option and repeats the procedure . Deep Successor Representation ( DSR ) . The successor representation ( SR ) ( Dayan , 1993 ) is a basic scheme that describes the state value function by a prediction about the future occurrence of all states under a fixed policy . SR decouples the dynamics of the environment from the rewards . Given a transition ( s , a , s′ , r ) , SR is defined as the expected discounted future state occupancy : M ( s , s′ , a ) = E [ ∞∑ t=0 γt1 [ st = s ′ ] |s0 = s , a0 = a ] , ( 1 ) where 1 [ . ] is an indicator function with value of one when the argument is true and zero otherwise . Given the SR , the Q-value for selecting action a at state s can be formulated as the inner product of the SR and the immediate reward : Qπ ( s , a ) = ∑ s′∈SM ( s , s ′ , a ) R ( s′ ) . DSR ( Kulkarni et al. , 2016 ) extends SR by approximating it using neural networks . Specifically , each state s is represented by a D-dimensional feature vector φs , which is the output of the network parameterized by θ . Given φs , SR is represented as msr ( φs , a|τ ) parameterized by τ , a decoder gθ̄ ( φs ) parameterized by θ̄ outputs the input reconstruction ŝ , and the immediate reward at state s is approximated as a linear function of φs : R ( s ) ≈ φs · w , where w ∈ RD is the weight vector . In this way , the Q-value function can be approximated by putting these two parts together as : Qπ ( s , a ) ≈ msr ( φs , a|τ ) · w. The stochastic gradient descent is used to update parameters ( θ , τ , w , θ̄ ) . Specifically , the loss function of τ is : L ( τ , θ ) = E [ ( φs + γm ′ sr ( φs′ , a ′|τ ′ ) −msr ( φs , a|τ ) ) 2 ] , ( 2 ) where a′ = arg maxamsr ( φ ′ s , a ) ·w , and m′sr is the target SR network parameterized by τ ′ which follows DQN ( Mnih et al. , 2015 ) for stable training . The reward weight w is updated by minimizing the loss function : L ( w , θ ) = ( R ( s ) − φs ·w ) 2 . The parameter θ̄ is updated using an L2 loss : L ( θ̄ , θ ) = ( ŝ− s ) 2 . Thus , the loss function of DSR is the composition of the three loss functions : L ( θ , τ , w , θ̄ ) = L ( τ , θ ) + L ( w , θ ) + L ( θ̄ , θ ) . 3 MULTIAGENT OPTION-BASED POLICY TRANSFER ( MAOPT ) 3.1 FRAMEWORK OVERVIEW In this section , we describe our MAOPT framework in detail . Figure 1 illustrates the MAOPT framework which contains n agents interacting with the environment and corresponding option advisors . At each step , each agent i obtains its own observation oi , selects an action ai following its policy πi , and receives its reward ri . Each option advisor initializes the option set , and selects an option for each agent . During the training phase , the option advisor uses samples from all agents to update the option-value function and corresponding termination probabilities . Each agent is advised by an option advisor , and the advice is to exploit this advised policy through imitation , which serves as a complementary optimization objective ( each agent does not know which policy it imitates and how the extra loss function is calculated ) ∗ . The exploitation of this advised policy is terminated as the selected option terminates and then another option is selected . In this way , each agent efficiently exploits useful information from other agents and as a result , the learning process of the whole system is accelerated and improved . Note that in the following section we assume the agents using the option advisor are homogeneous , i.e. , agents share the same option set . While our MAOPT can also support the situation where each agent is initialized with different numbers of options , e.g. , each agent only needs to imitate its neighbours . To achieve this , instead of input states into the option-value network , we just input the pair of states and options to the network and output a single option-value . Our proposed MAOPT can be classified into two types in terms of the experience used during training . One type is MAOPT with the global option advisor ( MAOPT-GOA ) which has the access to the ∗We provide the theoretical analysis to show this objective ensures to converge to an improved policy and will not affect the convergence of the original RL algorithm . global information ( i.e. , ( s , ~a , r , s′ ) , where r = ∑n i=1 r i ) of the environment . Thus , MAOPT-GOA selects a joint option as the advice set given the global observation of the environment and then evaluates the performance of the selected joint option . Selecting a joint option means that each advice given to each agent begins and ends simultaneously . However , in many realistic scenarios , we can only obtain each agent ’ s local information due to the partial observation . Moreover , the degree of familiarity to the environment of each agent is different , then some agents may need to imitate their teachers for a longer time . Therefore , a more flexible way to control each advice when to terminate individually is necessary . The other type contains MAOPT with the local option advisor ( MAOPTLOA ) , and MAOPT with the successor representation option advisor ( MAOPT-SRO ) which collects each agent ’ s local experience for the update . In many cases , each agent ’ s experience is inconsistent with each other , e.g. , each agent has an individual goal to achieve or has different roles , and the rewards assigned to each agent are different . If we simply use all experiences for the update , the option-value estimation would oscillate and become inaccurate . MAOPT-SRO is used to handle the experience inconsistency by decoupling the dynamics of the environment from the rewards to learn the option-value function under each agent ’ s preference .
This paper proposed an option-based framework for multiple agents to share knowledge with each other in the same MARL task. For scalability and robustness, two variants of the framework are designed, including 1) a global option advisor, which has the access to the global information of the environment; 2) local option advisor combined with successor representation option to enable more accurate option-value estimation. Experimental results demonstrate the proposed method is able to improve the performance of existing deep RL approaches for multiagent domains.
SP:6bf54a72a9f670d7c47a134440b73b2c3e07ee91
Transfer among Agents: An Efficient Multiagent Transfer Learning Framework
1 INTRODUCTION . Transfer Learning has shown great potential to accelerate single-agent RL via leveraging prior knowledge from past learned policies of relevant tasks ( Yin & Pan , 2017 ; Yang et al. , 2020 ) . Inspired by this , transfer learning in multiagent reinforcement learning ( MARL ) ( Claus & Boutilier , 1998 ; Hu & Wellman , 1998 ; Bu et al. , 2008 ; Hernandez-Leal et al. , 2019 ; da Silva & Costa , 2019 ) is also studied with two major directions : 1 ) transferring knowledge across different but similar MARL tasks and 2 ) transferring knowledge among multiple agents in the same MARL task . For the former , several works explicitly compute similarities between states or temporal abstractions ( Hu et al. , 2015 ; Boutsioukis et al. , 2011 ; Didi & Nitschke , 2016 ) to transfer across similar tasks with the same number of agents , or design new network structures to transfer across tasks with different numbers of agents ( Agarwal et al. , 2019 ; Wang et al. , 2020 ) . In this paper , we focus on the latter direction due to the following intuition : in a multiagent system ( MAS ) , each agent ’ s experience is different , so the states each agent encounters ( the degree of familiarity to the different regions of the whole environment ) are also different ; if we figure out some principled ways to transfer knowledge across different agents , all agents could form a big picture about the MAS even without exploring the whole space of the environment , and this will definitely facilitate more efficient MARL ( da Silva et al. , 2020 ) . Transferring knowledge among multiple agents is still investigated at an initial stage , and the assumptions and designs of some recent methods are usually simple . For example , LeCTR ( Omidshafiei et al. , 2019 ) and HMAT ( Kim et al. , 2020 ) adopted the teacher-student framework to learn to teach by assigning each agent two roles ( i.e. , the teacher and the student ) , so the agent could learn when and what to advise other agents or receive advice from other agents . However , both LeCTR and HMAT only consider two-agent scenarios . Liang & Li ( 2020 ) proposed a method under the teacher-student framework where each agent asks for advice from other agents through learning an attentional teacher selector . However , they simply used the difference of two unbounded value functions as the reward signal which may cause instability . DVM ( Wadhwania et al. , 2019 ) and LTCR Xue et al . ( 2020 ) are two proposed multiagent policy distillation methods to transfer knowledge among more than two agents . However , both methods decompose the solution into several stages in a coarse-grained manner . Moreover , they consider the distillation equally throughout the whole training process , which is counter-intuitive . A good transfer should be adaptive rather than being equally treated , e.g. , the transfer should be more frequent at the beginning of the training since agents are less knowledgeable about the environment , while decay as the training process continues because agents are familiar with the environment gradually and should focus more on their own knowledge . In this paper , we propose a novel MultiAgent Option-based Policy Transfer ( MAOPT ) framework which models the policy transfer among multiple agents as an option learning problem . In contrast to the previous teacher-student framework and policy distillation framework , MAOPT is adaptive and applicable to scenarios consisting of more than two agents . Specifically , MAOPT adaptively selects a suitable policy for each agent as the advised policy , which is used as a complementary optimization objective of each agent . MAOPT also uses the termination probability as a performance indicator to determine whether the advice should be terminated to avoid negative transfer . Furthermore , to facilitate the scalability and robustness , MAOPT contains two types : one type is MAOPT with the global option advisor ( MAOPT-GOA ) , the other type consists of MAOPT with the local option advisor ( MAOPT-LOA ) and MAOPT with the successor representation option advisor ( MAOPTSRO ) . Ideally , we can obtain the global information to estimate the option-value function , where MAOPT-GOA is used to select a joint policy set , in which each policy is advised to each agent . However , in many realistic scenarios , we can only obtain each agents ’ local experience , where we adopt MAOPT-LOA and MAOPT-SRO . Each agent ’ s experience may be inconsistent due to partial observations , which may cause the inaccuracy in option-value ’ s estimation . MAOPT-SRO is used to overcome the inconsistency in multiple agents ’ experience by decoupling the dynamics of the environment from the rewards to learn the option-value function under each agent ’ s preference . MAOPT can be easily incorporated into existing DRL approaches and experimental results show that it significantly boosts the performance of existing DRL approaches both in discrete and continuous state spaces . 2 PRELIMINARIES . Stochastic Games ( Littman , 1994 ) are a natural multiagent extension of Markov Decision Processes ( MDPs ) , which model the dynamic interactions among multiple agents . Considering the fact agents may not have access to the complete environmental information , we follow previous work ’ s settings and model the multiagent learning problems as partially observable stochastic games ( Hansen et al. , 2004 ) . A Partially Observable Stochastic Game ( POSG ) is defined as a tuple 〈N , S , A1 , · · · , An , T , R1 , · · · , Rn , O1 , · · · , On〉 , where N is the set of agents ; S is the set of states ; Ai is the set of actions available to agent i ( the joint action spaceA = A1×A2×· · ·×An ) ; T is the transition function that defines transition probabilities between global states : S×A×S → [ 0 , 1 ] ; Ri is the reward function for agent i : S × A → R and Oi is the set of observations for agent i . A policy πi : Oi × Ai → [ 0 , 1 ] specifies the probability distribution over the action space of agent i . The goal of agent i is to learn a policy πi that maximizes the expected return with a discount factor γ : J = Eπi [ ∑∞ t=0 γ trit ] . The Options Framework . Sutton et al . ( 1999 ) firstly formalized the idea of temporally extended action as an option . An option ω ∈ Ω is defined as a triple { Iω , πω , βω } in which Iω ⊂ S is an initiation state set , πω is an intra-option policy and βω : Iω → [ 0 , 1 ] is a termination function that specifies the probability an option ω terminates at state s ∈ Iω . An MDP endowed with a set of options becomes a Semi-Markov Decision Process ( Semi-MDP ) , which has a corresponding optimal option-value function over options learned using intra-option learning . The options framework considers the call-and-return option execution model , in which an agent picks an option o according to its option-value function Qω ( s , ω ) , and follows the intra-option policy πω until termination , then selects a next option and repeats the procedure . Deep Successor Representation ( DSR ) . The successor representation ( SR ) ( Dayan , 1993 ) is a basic scheme that describes the state value function by a prediction about the future occurrence of all states under a fixed policy . SR decouples the dynamics of the environment from the rewards . Given a transition ( s , a , s′ , r ) , SR is defined as the expected discounted future state occupancy : M ( s , s′ , a ) = E [ ∞∑ t=0 γt1 [ st = s ′ ] |s0 = s , a0 = a ] , ( 1 ) where 1 [ . ] is an indicator function with value of one when the argument is true and zero otherwise . Given the SR , the Q-value for selecting action a at state s can be formulated as the inner product of the SR and the immediate reward : Qπ ( s , a ) = ∑ s′∈SM ( s , s ′ , a ) R ( s′ ) . DSR ( Kulkarni et al. , 2016 ) extends SR by approximating it using neural networks . Specifically , each state s is represented by a D-dimensional feature vector φs , which is the output of the network parameterized by θ . Given φs , SR is represented as msr ( φs , a|τ ) parameterized by τ , a decoder gθ̄ ( φs ) parameterized by θ̄ outputs the input reconstruction ŝ , and the immediate reward at state s is approximated as a linear function of φs : R ( s ) ≈ φs · w , where w ∈ RD is the weight vector . In this way , the Q-value function can be approximated by putting these two parts together as : Qπ ( s , a ) ≈ msr ( φs , a|τ ) · w. The stochastic gradient descent is used to update parameters ( θ , τ , w , θ̄ ) . Specifically , the loss function of τ is : L ( τ , θ ) = E [ ( φs + γm ′ sr ( φs′ , a ′|τ ′ ) −msr ( φs , a|τ ) ) 2 ] , ( 2 ) where a′ = arg maxamsr ( φ ′ s , a ) ·w , and m′sr is the target SR network parameterized by τ ′ which follows DQN ( Mnih et al. , 2015 ) for stable training . The reward weight w is updated by minimizing the loss function : L ( w , θ ) = ( R ( s ) − φs ·w ) 2 . The parameter θ̄ is updated using an L2 loss : L ( θ̄ , θ ) = ( ŝ− s ) 2 . Thus , the loss function of DSR is the composition of the three loss functions : L ( θ , τ , w , θ̄ ) = L ( τ , θ ) + L ( w , θ ) + L ( θ̄ , θ ) . 3 MULTIAGENT OPTION-BASED POLICY TRANSFER ( MAOPT ) 3.1 FRAMEWORK OVERVIEW In this section , we describe our MAOPT framework in detail . Figure 1 illustrates the MAOPT framework which contains n agents interacting with the environment and corresponding option advisors . At each step , each agent i obtains its own observation oi , selects an action ai following its policy πi , and receives its reward ri . Each option advisor initializes the option set , and selects an option for each agent . During the training phase , the option advisor uses samples from all agents to update the option-value function and corresponding termination probabilities . Each agent is advised by an option advisor , and the advice is to exploit this advised policy through imitation , which serves as a complementary optimization objective ( each agent does not know which policy it imitates and how the extra loss function is calculated ) ∗ . The exploitation of this advised policy is terminated as the selected option terminates and then another option is selected . In this way , each agent efficiently exploits useful information from other agents and as a result , the learning process of the whole system is accelerated and improved . Note that in the following section we assume the agents using the option advisor are homogeneous , i.e. , agents share the same option set . While our MAOPT can also support the situation where each agent is initialized with different numbers of options , e.g. , each agent only needs to imitate its neighbours . To achieve this , instead of input states into the option-value network , we just input the pair of states and options to the network and output a single option-value . Our proposed MAOPT can be classified into two types in terms of the experience used during training . One type is MAOPT with the global option advisor ( MAOPT-GOA ) which has the access to the ∗We provide the theoretical analysis to show this objective ensures to converge to an improved policy and will not affect the convergence of the original RL algorithm . global information ( i.e. , ( s , ~a , r , s′ ) , where r = ∑n i=1 r i ) of the environment . Thus , MAOPT-GOA selects a joint option as the advice set given the global observation of the environment and then evaluates the performance of the selected joint option . Selecting a joint option means that each advice given to each agent begins and ends simultaneously . However , in many realistic scenarios , we can only obtain each agent ’ s local information due to the partial observation . Moreover , the degree of familiarity to the environment of each agent is different , then some agents may need to imitate their teachers for a longer time . Therefore , a more flexible way to control each advice when to terminate individually is necessary . The other type contains MAOPT with the local option advisor ( MAOPTLOA ) , and MAOPT with the successor representation option advisor ( MAOPT-SRO ) which collects each agent ’ s local experience for the update . In many cases , each agent ’ s experience is inconsistent with each other , e.g. , each agent has an individual goal to achieve or has different roles , and the rewards assigned to each agent are different . If we simply use all experiences for the update , the option-value estimation would oscillate and become inaccurate . MAOPT-SRO is used to handle the experience inconsistency by decoupling the dynamics of the environment from the rewards to learn the option-value function under each agent ’ s preference .
The paper proposes a new option-based policy transfer framework for multi-agent reinforcement learning (MARL) called MAOPT. By framing multi-agent transfer as an option learning problem, MAOPT methods are able to learn when to give advice to agents and when to stop it. Authors provide a version of MOAPT for fully cooperative setting based on global state and reward, as well as two versions for mixed settings based on local states and per-agent rewards. The paper presents experimental results on two environments that show performance gains over existing RL methods.
SP:6bf54a72a9f670d7c47a134440b73b2c3e07ee91
C-Learning: Horizon-Aware Cumulative Accessibility Estimation
1 INTRODUCTION . Multi-goal reinforcement learning tackles the challenging problem of reaching multiple goals , and as a result , is an ideal framework for real-world agents that solve a diverse set of tasks . Despite progress in this field ( Kaelbling , 1993 ; Schaul et al. , 2015 ; Andrychowicz et al. , 2017 ; Ghosh et al. , 2019 ) , current algorithms suffer from a set of limitations : an inability to find multiple paths to a goal , high sample complexity , and poor results in complex motion planning tasks . In this paper we propose C-learning , a method which addresses all of these shortcomings . Many multi-goal reinforcement learning algorithms are limited by learning only a single policy π ( a|s , g ) over actions a to reach goal g from state s. There is an unexplored trade-off between reaching the goal reliably and reaching it quickly . We illustrate this shortcoming in Figure 1a , which represents an environment where an agent must reach a goal on the opposite side of some predator . Shorter paths can reach the goal faster at the cost of a higher probability of being eaten . Existing algorithms do not allow a dynamic choice of whether to act safely or quickly at test time . The second limitation is sample complexity . Despite significant improvements ( Andrychowicz et al. , 2017 ; Ghosh et al. , 2019 ) , multi-goal reaching still requires a very large amount of environment interactions for effective learning . We argue that the optimal Q-function must be learned to high accuracy for the agent to achieve reasonable performance , and this leads to sample inefficiency . The same drawback of optimal Q-functions often causes agents to learn sub-optimal ways of reaching the intended goal . This issue is particularly true for motion planning tasks ( Qureshi et al. , 2020 ) , where current algorithms struggle . We propose to address these limitations by learning horizon-aware policies π ( a|s , g , h ) , which should be followed to reach goal g from state s in at most h steps . The introduction of a time horizon h naturally allows us to tune the speed/reliability trade-off , as an agent wishing to reach the goal faster should select a policy with a suitably small h value . To learn these policies , we introduce the optimal cumulative accessibility function C∗ ( s , a , g , h ) . This is a generalization of the state-action value function and corresponds to the probability of reaching goal g from state s after at most h steps if action a is taken , and the agent acts optimally thereafter . Intuitively it is similar to the optimal Q-function , but Q-functions rarely correspond to probabilities , whereas the C∗-function does so by construction . We derive Bellman backup update rules for C∗ , which allow it to be learned via minimization of unbiased estimates of the cross-entropy loss – this is in contrast to Q-learning , which optimizes biased estimates of the squared error . Policies π ( a|s , g , h ) can then be recovered from the C∗ function . We call our method cumulative accessibility estimation , or Clearning . Pong et al . ( 2018 ) proposed TDMs , a method involving horizon-aware policies . We point out that their method is roughly related to a non-cumulative version of ours with a different loss that does not enable the speed/reliability trade-off and is ill-suited for sparse rewards . We include a detailed discussion of TDMs in section 4 . One might expect that adding an extra dimension to the learning task , namely h , would increase the difficulty - as C∗ effectively contains the information of several optimal Q-functions for different discount factors . However , we argue that C∗ does not need to be learned to the same degree of accuracy as the optimal Q-function for the agent to solve the task . As a result , learning C∗ is more efficient , and converges in fewer environmental interactions . This property , combined with our proposed goal sampling technique and replay buffer used during training , provides empirical improvements over Q-function based methods . In addition to these advantages , learning C∗ is itself useful , containing information that the horizonaware policies do not . It estimates whether a goal g is reachable from the current state s within h steps . In contrast , π ( a|s , g , h ) simply returns some action , even for unreachable goals . We show that C∗ can be used to determine reachability with examples in a nonholonomic environment . Summary of contributions : ( i ) introducing C-functions and cumulative accessibility estimation for both discrete and continuous action spaces ; ( ii ) highlighting the importance of the speed vs reliability trade-off in finite horizon reinforcement learning ; ( iii ) introducing a novel replay buffer specially tailored for learning C∗ which builds on HER ( Andrychowicz et al. , 2017 ) ; and ( iv ) empirically showing the effectiveness of our method for goal-reaching as compared to existing alternatives , particularly in the context of complex motion planning tasks . 2 BACKGROUND AND RELATED WORK . Let us extend the Markov Decision Process ( MDP ) formalism ( Sutton et al. , 1998 ) for goal-reaching . We consider a set of actionsA , a state space S , and a goal set G. We assume access to a goal checking function G : S × G → { 0 , 1 } such that G ( s , g ) = 1 if and only if state s achieves goal g. For example , achieving the goal could mean exactly reaching a certain state , in which case G = S and a a1 a2 a3 s h s1 h− 1 s2 h− 2 s3 h− 3 g . . . . . . Figure 2 : Graphical model depicting trajectories from Pπ ( ·|· , g , h ) ( ·|s0 = s , a0 = a ) . Gray nodes denote fixed values , and white nodes stochastic ones . Nodes a , g and s are non-stochastic simply because they are conditioned on , not because they are always fixed within the environment . Note that the values of h decrease deterministically . Nodes corresponding to horizons could be separated from states , but are not for a more concise graph . G ( s , g ) = 1 ( s = g ) . For many continuous state-spaces , hitting a state exactly has zero probability . Here we can still take G = S , but letG ( s , g ) = 1 ( d ( s , g ) ≤ ) for some radius and metric d. More general choices are possible . For example , in the Dubins ’ Car environment which we describe in more detail later , the state consists of both the location and orientation of the car : S = R2 × S1 . We take G = R2 , and G ( s , g ) checks that the location of the car is within some small radius of g , ignoring the direction entirely . For a fixed g , G ( s , g ) can be thought of as a sparse reward function . In the goal-reaching setting , a policy π : S×G → P ( A ) , whereP ( A ) denotes the set of distributions over A , maps state-goal pairs to an action distribution . The environment dynamics are given by a starting distribution p ( s0 , g ) , usually taken as p ( s0 ) p ( g ) , and transition probabilities p ( st+1|st , at ) . States for which G ( s , g ) = 1 are considered terminal . Q-Learning : AQ-function ( Watkins & Dayan , 1992 ) for multi-goal reaching , Qπ : S×G×A → R , is defined by Qπ ( st , g , at ) = Eπ [ ∑∞ i=t γ i−tG ( st , g ) |st , at ] , where γ ∈ [ 0 , 1 ] is a discount factor and the expectation is with respect to state-action trajectories obtained by using π ( a|si , g ) . If π∗ is an optimal policy in the sense thatQπ ∗ ( s , g , a ) ≥ Qπ ( s , g , a ) for every π and ( s , g , a ) ∈ S×G×A , then Qπ ∗ matches the optimal Q-function , Q∗ , which obeys the Bellman equation : Q∗ ( s , g , a ) = Es′∼p ( ·|s , a ) [ G ( s , g ) + γmax a′∈A Q∗ ( s′ , g , a′ ) ] . ( 1 ) In deep Q-learning ( Mnih et al. , 2015 ) , Q∗ is parameterized with a neural network and learning is achieved by enforcing the relationship from equation 1 . This is done by minimizing∑ i L ( Q∗ ( si , gi , ai ) , yi ) , where yi corresponds to the expectation in equation 1 and is estimated using a replay buffer of stored tuples ( si , ai , gi , s′i ) . Note that s ′ i is the state the environment transitioned to after taking action ai from state si , and determines the value of yi . Typically L is chosen as a squared error loss , and the dependency of yi on Q∗ is ignored for backpropagation in order to stabilize training . Once Q∗ is learned , the optimal policy is recovered by π∗ ( a|s , g ) = 1 ( a = argmaxa′ Q∗ ( s , g , a′ ) ) . There is ample work extending and improving upon deep Q-learning ( Haarnoja et al. , 2018 ) . For example , Lillicrap et al . ( 2015 ) extend it to the continuous action space setting , and Fujimoto et al . ( 2018 ) further stabilize training . These improvements are fully compatible with goal-reaching ( Pong et al. , 2019 ; Bharadhwaj et al. , 2020a ; Ghosh et al. , 2019 ) . Andrychowicz et al . ( 2017 ) proposed Hindsight Experience Replay ( HER ) , which relabels past experience as achieved goals , and allows sample efficient learning from sparse rewards ( Nachum et al. , 2018 ) . 3 CUMULATIVE ACCESSIBILITY FUNCTIONS . We now consider horizon-aware policies π : S × G × N → P ( A ) , and define the cumulative accessibility function Cπ ( s , a , g , h ) , or C-function , as the probability of reaching goal g from state s in at most h steps by taking action a and following the policy π thereafter . By “ following the policy π thereafter ” we mean that after a , the next action a1 is sampled from π ( ·|s1 , g , h− 1 ) , a2 is sampled from π ( ·|s2 , g , h− 2 ) and so on . See Figure 2 for a graphical model depiction of how these trajectories are obtained . Importantly , an agent need not always act the same way at a particular state in order to reach a particular goal , thanks to horizon-awareness . We use Pπ ( ·|· , g , h ) ( ·|s0 = s , a0 = a ) to denote probabilities in which actions are drawn in this manner and transitions are drawn according to the environment p ( st+1|st , a ) . More formally , Cπ is given by : Cπ ( s , a , g , h ) = Pπ ( ·|· , g , h ) ( max t=0 , ... , h G ( st , g ) = 1 ∣∣∣∣s0 = s , a0 = a ) . ( 2 ) Proposition 1 : Cπ can be framed as a Q-function within the MDP formalism , and if π∗ is optimal in the sense that Cπ ∗ ( s , a , g , h ) ≥ Cπ ( s , a , g , h ) for every π and ( s , a , g , h ) ∈ S ×A×G ×N , then Cπ ∗ matches the optimal C-function , C∗ , which obeys the following equation : C∗ ( s , a , g , h ) = Es′∼p ( ·|s , a ) [ max a′∈A C∗ ( s′ , a′ , g , h− 1 ) ] if G ( s , g ) = 0 and h ≥ 1 , G ( s , g ) otherwise . ( 3 ) See appendix A for a detailed mathematical proof of this proposition . The proof proceeds by first deriving a recurrence relationship that holds for any Cπ . In an analogous manner to the Bellman equation in Q-learning , this recurrence involves an expectation over π ( ·|s′ , g , h − 1 ) , which , when replaced by a max returns the recursion for C∗ . Proposition 1 is relevant as it allows us to learn C∗ , enabling goal-reaching policies to be recovered : π∗ ( a|s , g , h ) = 1 ( a = argmax a′ C∗ ( s , a′ , g , h ) ) . ( 4 ) C∗ itself is useful for determining reachability . After maximizing over actions , it estimates whether a given goal is reachable from a state within some horizon . Comparing these probabilities for different horizons allows us to make a speed / reliability trade-off for reaching goals . We observe that an optimal C∗-function is non-decreasing in h , but this does not necessarily hold for non-optimal C-functions . For example , a horizon-aware policy could actively try to avoid the goal for high values of h , and the Cπ-function constructed from it would show lower probabilities of success for larger h. See appendix A for a concrete example of this counter-intuitive behavior . Proposition 2 : C∗ is non-decreasing in h. See appendix A for a detailed mathematical proof . Intuitively , the proof consists of showing that an optimal policy can not exhibit the pathology mentioned above . Given an optimal policy π∗ ( a|s , g , h ) for a fixed horizon h we construct a policy π̃ for h + 1 which always performs better , and lower bounds the performance of π∗ ( a|s , g , h+ 1 ) . In addition to being an elegant theoretical property , proposition 2 suggests that there is additional structure in a C∗ function which mitigates the added complexity from using horizon-aware policies . Indeed , in our preliminary experiments we used a non-cumulative version of C-functions ( see section 3.3 ) and obtained significantly improved performance upon changing to C-functions . Moreover , monotonicity in h could be encoded in the architecture of C∗ ( Sill , 1998 ; Wehenkel & Louppe , 2019 ) . However , we found that actively doing so hurt empirical performance ( appendix F ) . 3.1 SHORTCOMINGS OF Q-LEARNING Before describing our method for learningC∗ , we highlight a shortcoming ofQ-learning . Consider a 2D navigation environment where an agent can move deterministically in the cardinal directions , and fix s and g. For an optimal action a∗ , the optimalQ function will achieve some valueQ∗ ( s , g , a∗ ) ∈ [ 0 , 1 ] in the sparse reward setting . Taking a sub-optimal action a− initially results in the agent taking two extra steps to reach the intended goal , given that the agent acts optimally after the first action , so that Q∗ ( s , g , a− ) = γ2Q∗ ( s , g , a∗ ) . The value of γ is typically chosen close to 1 , for example 0.99 , to ensure that future rewards are not too heavily discounted . As a consequence γ2 ≈ 1 and thus the value of Q∗ at the optimal action is very close to its value at a sub-optimal action . We illustrate this issue in Figure 1b . In this scenario , recovering an optimal policy requires that the error between the learned Q-function and Q∗ should be at most ( 1−γ2 ) /2 ; this is reflected empirically by Q-learning having high sample complexity and learning sub-optimal paths . This shortcoming surfaces in any environment where taking a sub-optimal action results in a slightly longer path than an optimal one , as in e.g . motion planning tasks . The C∗ function does not have this shortcoming . Consider the same 2D navigation example , and let h∗ be the smallest horizon for which g can be reached from s. h∗ can be easily obtained from C∗ as the smallest h such that maxa C∗ ( s , a , g , h ) = 1 . Again , denoting a∗ as an optimal action and a− as a sub-optimal one , we have that C∗ ( s , a∗ , g , h∗ ) = 1 whereas C∗ ( s , a− , g , h∗ ) = 0 , which is illustrated in Figure 1b . Therefore , the threshold for error is much higher when learning the C∗ function . This property results in fewer interactions with the environment needed to learn C∗ and more efficient solutions .
The paper proposes C-learning, which is an essentially a horizon aware Q-learning. In a nutshell, the authors proposes changing the Q function from Q(s, a) to C(s, a, h) where s is the state, a is the action and h is allowed time horizon i.e. the agent should get to the goal state using less than h states. Since C can be framed as a modified Q, the authors demonstrate that familiar Q-learning properties such as Bellman property and backprop can be used for C-learning.
SP:f32600d6223672363a45f0797dd6be29e6fd491d
C-Learning: Horizon-Aware Cumulative Accessibility Estimation
1 INTRODUCTION . Multi-goal reinforcement learning tackles the challenging problem of reaching multiple goals , and as a result , is an ideal framework for real-world agents that solve a diverse set of tasks . Despite progress in this field ( Kaelbling , 1993 ; Schaul et al. , 2015 ; Andrychowicz et al. , 2017 ; Ghosh et al. , 2019 ) , current algorithms suffer from a set of limitations : an inability to find multiple paths to a goal , high sample complexity , and poor results in complex motion planning tasks . In this paper we propose C-learning , a method which addresses all of these shortcomings . Many multi-goal reinforcement learning algorithms are limited by learning only a single policy π ( a|s , g ) over actions a to reach goal g from state s. There is an unexplored trade-off between reaching the goal reliably and reaching it quickly . We illustrate this shortcoming in Figure 1a , which represents an environment where an agent must reach a goal on the opposite side of some predator . Shorter paths can reach the goal faster at the cost of a higher probability of being eaten . Existing algorithms do not allow a dynamic choice of whether to act safely or quickly at test time . The second limitation is sample complexity . Despite significant improvements ( Andrychowicz et al. , 2017 ; Ghosh et al. , 2019 ) , multi-goal reaching still requires a very large amount of environment interactions for effective learning . We argue that the optimal Q-function must be learned to high accuracy for the agent to achieve reasonable performance , and this leads to sample inefficiency . The same drawback of optimal Q-functions often causes agents to learn sub-optimal ways of reaching the intended goal . This issue is particularly true for motion planning tasks ( Qureshi et al. , 2020 ) , where current algorithms struggle . We propose to address these limitations by learning horizon-aware policies π ( a|s , g , h ) , which should be followed to reach goal g from state s in at most h steps . The introduction of a time horizon h naturally allows us to tune the speed/reliability trade-off , as an agent wishing to reach the goal faster should select a policy with a suitably small h value . To learn these policies , we introduce the optimal cumulative accessibility function C∗ ( s , a , g , h ) . This is a generalization of the state-action value function and corresponds to the probability of reaching goal g from state s after at most h steps if action a is taken , and the agent acts optimally thereafter . Intuitively it is similar to the optimal Q-function , but Q-functions rarely correspond to probabilities , whereas the C∗-function does so by construction . We derive Bellman backup update rules for C∗ , which allow it to be learned via minimization of unbiased estimates of the cross-entropy loss – this is in contrast to Q-learning , which optimizes biased estimates of the squared error . Policies π ( a|s , g , h ) can then be recovered from the C∗ function . We call our method cumulative accessibility estimation , or Clearning . Pong et al . ( 2018 ) proposed TDMs , a method involving horizon-aware policies . We point out that their method is roughly related to a non-cumulative version of ours with a different loss that does not enable the speed/reliability trade-off and is ill-suited for sparse rewards . We include a detailed discussion of TDMs in section 4 . One might expect that adding an extra dimension to the learning task , namely h , would increase the difficulty - as C∗ effectively contains the information of several optimal Q-functions for different discount factors . However , we argue that C∗ does not need to be learned to the same degree of accuracy as the optimal Q-function for the agent to solve the task . As a result , learning C∗ is more efficient , and converges in fewer environmental interactions . This property , combined with our proposed goal sampling technique and replay buffer used during training , provides empirical improvements over Q-function based methods . In addition to these advantages , learning C∗ is itself useful , containing information that the horizonaware policies do not . It estimates whether a goal g is reachable from the current state s within h steps . In contrast , π ( a|s , g , h ) simply returns some action , even for unreachable goals . We show that C∗ can be used to determine reachability with examples in a nonholonomic environment . Summary of contributions : ( i ) introducing C-functions and cumulative accessibility estimation for both discrete and continuous action spaces ; ( ii ) highlighting the importance of the speed vs reliability trade-off in finite horizon reinforcement learning ; ( iii ) introducing a novel replay buffer specially tailored for learning C∗ which builds on HER ( Andrychowicz et al. , 2017 ) ; and ( iv ) empirically showing the effectiveness of our method for goal-reaching as compared to existing alternatives , particularly in the context of complex motion planning tasks . 2 BACKGROUND AND RELATED WORK . Let us extend the Markov Decision Process ( MDP ) formalism ( Sutton et al. , 1998 ) for goal-reaching . We consider a set of actionsA , a state space S , and a goal set G. We assume access to a goal checking function G : S × G → { 0 , 1 } such that G ( s , g ) = 1 if and only if state s achieves goal g. For example , achieving the goal could mean exactly reaching a certain state , in which case G = S and a a1 a2 a3 s h s1 h− 1 s2 h− 2 s3 h− 3 g . . . . . . Figure 2 : Graphical model depicting trajectories from Pπ ( ·|· , g , h ) ( ·|s0 = s , a0 = a ) . Gray nodes denote fixed values , and white nodes stochastic ones . Nodes a , g and s are non-stochastic simply because they are conditioned on , not because they are always fixed within the environment . Note that the values of h decrease deterministically . Nodes corresponding to horizons could be separated from states , but are not for a more concise graph . G ( s , g ) = 1 ( s = g ) . For many continuous state-spaces , hitting a state exactly has zero probability . Here we can still take G = S , but letG ( s , g ) = 1 ( d ( s , g ) ≤ ) for some radius and metric d. More general choices are possible . For example , in the Dubins ’ Car environment which we describe in more detail later , the state consists of both the location and orientation of the car : S = R2 × S1 . We take G = R2 , and G ( s , g ) checks that the location of the car is within some small radius of g , ignoring the direction entirely . For a fixed g , G ( s , g ) can be thought of as a sparse reward function . In the goal-reaching setting , a policy π : S×G → P ( A ) , whereP ( A ) denotes the set of distributions over A , maps state-goal pairs to an action distribution . The environment dynamics are given by a starting distribution p ( s0 , g ) , usually taken as p ( s0 ) p ( g ) , and transition probabilities p ( st+1|st , at ) . States for which G ( s , g ) = 1 are considered terminal . Q-Learning : AQ-function ( Watkins & Dayan , 1992 ) for multi-goal reaching , Qπ : S×G×A → R , is defined by Qπ ( st , g , at ) = Eπ [ ∑∞ i=t γ i−tG ( st , g ) |st , at ] , where γ ∈ [ 0 , 1 ] is a discount factor and the expectation is with respect to state-action trajectories obtained by using π ( a|si , g ) . If π∗ is an optimal policy in the sense thatQπ ∗ ( s , g , a ) ≥ Qπ ( s , g , a ) for every π and ( s , g , a ) ∈ S×G×A , then Qπ ∗ matches the optimal Q-function , Q∗ , which obeys the Bellman equation : Q∗ ( s , g , a ) = Es′∼p ( ·|s , a ) [ G ( s , g ) + γmax a′∈A Q∗ ( s′ , g , a′ ) ] . ( 1 ) In deep Q-learning ( Mnih et al. , 2015 ) , Q∗ is parameterized with a neural network and learning is achieved by enforcing the relationship from equation 1 . This is done by minimizing∑ i L ( Q∗ ( si , gi , ai ) , yi ) , where yi corresponds to the expectation in equation 1 and is estimated using a replay buffer of stored tuples ( si , ai , gi , s′i ) . Note that s ′ i is the state the environment transitioned to after taking action ai from state si , and determines the value of yi . Typically L is chosen as a squared error loss , and the dependency of yi on Q∗ is ignored for backpropagation in order to stabilize training . Once Q∗ is learned , the optimal policy is recovered by π∗ ( a|s , g ) = 1 ( a = argmaxa′ Q∗ ( s , g , a′ ) ) . There is ample work extending and improving upon deep Q-learning ( Haarnoja et al. , 2018 ) . For example , Lillicrap et al . ( 2015 ) extend it to the continuous action space setting , and Fujimoto et al . ( 2018 ) further stabilize training . These improvements are fully compatible with goal-reaching ( Pong et al. , 2019 ; Bharadhwaj et al. , 2020a ; Ghosh et al. , 2019 ) . Andrychowicz et al . ( 2017 ) proposed Hindsight Experience Replay ( HER ) , which relabels past experience as achieved goals , and allows sample efficient learning from sparse rewards ( Nachum et al. , 2018 ) . 3 CUMULATIVE ACCESSIBILITY FUNCTIONS . We now consider horizon-aware policies π : S × G × N → P ( A ) , and define the cumulative accessibility function Cπ ( s , a , g , h ) , or C-function , as the probability of reaching goal g from state s in at most h steps by taking action a and following the policy π thereafter . By “ following the policy π thereafter ” we mean that after a , the next action a1 is sampled from π ( ·|s1 , g , h− 1 ) , a2 is sampled from π ( ·|s2 , g , h− 2 ) and so on . See Figure 2 for a graphical model depiction of how these trajectories are obtained . Importantly , an agent need not always act the same way at a particular state in order to reach a particular goal , thanks to horizon-awareness . We use Pπ ( ·|· , g , h ) ( ·|s0 = s , a0 = a ) to denote probabilities in which actions are drawn in this manner and transitions are drawn according to the environment p ( st+1|st , a ) . More formally , Cπ is given by : Cπ ( s , a , g , h ) = Pπ ( ·|· , g , h ) ( max t=0 , ... , h G ( st , g ) = 1 ∣∣∣∣s0 = s , a0 = a ) . ( 2 ) Proposition 1 : Cπ can be framed as a Q-function within the MDP formalism , and if π∗ is optimal in the sense that Cπ ∗ ( s , a , g , h ) ≥ Cπ ( s , a , g , h ) for every π and ( s , a , g , h ) ∈ S ×A×G ×N , then Cπ ∗ matches the optimal C-function , C∗ , which obeys the following equation : C∗ ( s , a , g , h ) = Es′∼p ( ·|s , a ) [ max a′∈A C∗ ( s′ , a′ , g , h− 1 ) ] if G ( s , g ) = 0 and h ≥ 1 , G ( s , g ) otherwise . ( 3 ) See appendix A for a detailed mathematical proof of this proposition . The proof proceeds by first deriving a recurrence relationship that holds for any Cπ . In an analogous manner to the Bellman equation in Q-learning , this recurrence involves an expectation over π ( ·|s′ , g , h − 1 ) , which , when replaced by a max returns the recursion for C∗ . Proposition 1 is relevant as it allows us to learn C∗ , enabling goal-reaching policies to be recovered : π∗ ( a|s , g , h ) = 1 ( a = argmax a′ C∗ ( s , a′ , g , h ) ) . ( 4 ) C∗ itself is useful for determining reachability . After maximizing over actions , it estimates whether a given goal is reachable from a state within some horizon . Comparing these probabilities for different horizons allows us to make a speed / reliability trade-off for reaching goals . We observe that an optimal C∗-function is non-decreasing in h , but this does not necessarily hold for non-optimal C-functions . For example , a horizon-aware policy could actively try to avoid the goal for high values of h , and the Cπ-function constructed from it would show lower probabilities of success for larger h. See appendix A for a concrete example of this counter-intuitive behavior . Proposition 2 : C∗ is non-decreasing in h. See appendix A for a detailed mathematical proof . Intuitively , the proof consists of showing that an optimal policy can not exhibit the pathology mentioned above . Given an optimal policy π∗ ( a|s , g , h ) for a fixed horizon h we construct a policy π̃ for h + 1 which always performs better , and lower bounds the performance of π∗ ( a|s , g , h+ 1 ) . In addition to being an elegant theoretical property , proposition 2 suggests that there is additional structure in a C∗ function which mitigates the added complexity from using horizon-aware policies . Indeed , in our preliminary experiments we used a non-cumulative version of C-functions ( see section 3.3 ) and obtained significantly improved performance upon changing to C-functions . Moreover , monotonicity in h could be encoded in the architecture of C∗ ( Sill , 1998 ; Wehenkel & Louppe , 2019 ) . However , we found that actively doing so hurt empirical performance ( appendix F ) . 3.1 SHORTCOMINGS OF Q-LEARNING Before describing our method for learningC∗ , we highlight a shortcoming ofQ-learning . Consider a 2D navigation environment where an agent can move deterministically in the cardinal directions , and fix s and g. For an optimal action a∗ , the optimalQ function will achieve some valueQ∗ ( s , g , a∗ ) ∈ [ 0 , 1 ] in the sparse reward setting . Taking a sub-optimal action a− initially results in the agent taking two extra steps to reach the intended goal , given that the agent acts optimally after the first action , so that Q∗ ( s , g , a− ) = γ2Q∗ ( s , g , a∗ ) . The value of γ is typically chosen close to 1 , for example 0.99 , to ensure that future rewards are not too heavily discounted . As a consequence γ2 ≈ 1 and thus the value of Q∗ at the optimal action is very close to its value at a sub-optimal action . We illustrate this issue in Figure 1b . In this scenario , recovering an optimal policy requires that the error between the learned Q-function and Q∗ should be at most ( 1−γ2 ) /2 ; this is reflected empirically by Q-learning having high sample complexity and learning sub-optimal paths . This shortcoming surfaces in any environment where taking a sub-optimal action results in a slightly longer path than an optimal one , as in e.g . motion planning tasks . The C∗ function does not have this shortcoming . Consider the same 2D navigation example , and let h∗ be the smallest horizon for which g can be reached from s. h∗ can be easily obtained from C∗ as the smallest h such that maxa C∗ ( s , a , g , h ) = 1 . Again , denoting a∗ as an optimal action and a− as a sub-optimal one , we have that C∗ ( s , a∗ , g , h∗ ) = 1 whereas C∗ ( s , a− , g , h∗ ) = 0 , which is illustrated in Figure 1b . Therefore , the threshold for error is much higher when learning the C∗ function . This property results in fewer interactions with the environment needed to learn C∗ and more efficient solutions .
The paper highlights a problem in existing goal-reaching RL agents, in that they do not explicitly allow for trading off speed (how fast you reach the goal) and reliability (how often you reach the goal). While this tradeoff is implicitly determined by the discount factor in training, the paper asserts that in practice the ability to more flexibly determine this during inference is more desirable. Given this shortcoming of existing work, the paper then proposes "C-Learning" which learns a policy conditioned on both a goal and a desired horizon (h) -- i.e., a time limit on the policy. The paper presents favorable results of C-Learning on a few simulated domains compared to existing goal-reaching RL agents.
SP:f32600d6223672363a45f0797dd6be29e6fd491d
A Sharp Analysis of Model-based Reinforcement Learning with Self-Play
1 INTRODUCTION . This paper is concerned with the problem of multi-agent reinforcement learning ( multi-agent RL ) , in which multiple agents learn to make decisions in an unknown environment in order to maximize their ( own ) cumulative rewards . Multi-agent RL has achieved significant recent success in traditionally hard AI challenges including large-scale strategy games ( such as GO ) ( Silver et al. , 2016 ; 2017 ) , real-time video games involving team play such as Starcraft and Dota2 ( OpenAI , 2018 ; Vinyals et al. , 2019 ) , as well as behavior learning in complex social scenarios ( Baker et al. , 2020 ) . Achieving human-like ( or super-human ) performance in these games using multi-agent RL typically requires a large number of samples ( steps of game playing ) due to the necessity of exploration , and how to improve the sample complexity of multi-agent RL has been an important research question . One prevalent approach towards solving multi-agent RL is model-based methods , that is , to use the existing visitation data to build an estimate of the model ( i.e . transition dynamics and rewards ) , run an offline planning algorithm on the estimated model to obtain the policy , and play the policy in the environment . Such a principle underlies some of the earliest single-agent online RL algorithms such as E3 ( Kearns & Singh , 2002 ) and RMax ( Brafman & Tennenholtz , 2002 ) , and is conceptually appealing for multi-agent RL too since the multi-agent structure does not add complexity onto the model estimation part and only requires an appropriate multi-agent planning algorithm ( such as value iteration for games ( Shapley , 1953 ) ) in a black-box fashion . On the other hand , modelfree methods do not directly build estimates of the model , but instead directly estimate the value functions or action-value ( Q ) functions of the problem at the optimal/equilibrium policies , and play the greedy policies with respect to the estimated value functions . Model-free algorithms have also been well developed for multi-agent RL such as friend-or-foe Q-Learning ( Littman , 2001 ) and Nash Q-Learning ( Hu & Wellman , 2003 ) . While both model-based and model-free algorithms have been shown to be provably efficient in multi-agent RL in a recent line of work ( Bai & Jin , 2020 ; Xie et al. , 2020 ; Bai et al. , 2020 ) , a more precise understanding of the optimal sample complexities within these two types of algorithms ( respectively ) is still lacking . In the specific setting of two-player zero-sum Markov games , the current best sample complexity for model-based algorithms is achieved by the VI-ULCB ( Value Iteration with Upper/Lower Confidence Bounds ) algorithm ( Bai & Jin , 2020 ; Xie et al. , 2020 ) : In a tabular Markov game with S states , { A , B } actions for the two players , and horizon length H , VI-ULCB is able to find an -approximate Nash equilibrium policy in Õ ( H4S2AB/ 2 ) episodes of game playing . However , compared with the information-theoretic lower bound Ω ( H3S ( A+B ) / 2 ) , this rate has suboptimal dependencies on all of H , S , and A , B . In contrast , the current best sample complexity for model-free algorithms is achieved by Nash V-Learning ( Bai et al. , 2020 ) , which finds an -approximate Nash policy in Õ ( H6S ( A + B ) / 2 ) episodes . Compared with the lower bound , this is tight except for a poly ( H ) factor , which may seemingly suggest that model-free algorithms could be superior to model-based ones in multi-agent RL . However , such a conclusion would be in stark contrast to the single-agent MDP setting , where it is known that model-based algorithms are able to achieve minimax optimal sample complexities ( Jaksch et al. , 2010 ; Azar et al. , 2017 ) . It naturally arises whether model-free algorithms are indeed superior in multi-agent settings , or whether the existing analyses of model-based algorithms are not tight . This motivates us to ask the following research question : Question : How sample-efficient are model-based algorithms in multi-agent RL ? In this paper , we advance the theoretical understandings of multi-agent RL by presenting a sharp analysis of model-based algorithms on Markov games . Our core contribution is the design of a new model-based algorithm Optimistic Nash Value Iteration ( Nash-VI ) that achieves an almost optimal sample complexity for zero-sum Markov games and improves significantly over existing modelbased approaches . We summarize our main contributions as follows . A comparison between our and prior results can be found in Table 1 . • We design a new model-based algorithm Optimistic Nash Value Iteration ( Nash-VI ) that provably finds -approximate Nash equilibria for Markov games in Õ ( H3SAB/ 2 ) episodes of game playing ( Section 3 ) . This improves over the best existing model-based algorithm by O ( HS ) and is the first algorithm that matches the sample complexity lower bound except for a Õ ( min { A , B } ) factor , showing that model-based algorithms can indeed achieve an almost optimal sample complexity . Further , unlike state-of-the-art model-free algorithms such as Nash V-Learning ( Bai et al. , 2020 ) , this algorithm achieves in addition a Õ ( √ T ) regret bound , and outputs a simple Markov policy ( instead of a nested mixture of Markov policies as returned by Nash V-Learning ) . • We design an alternative algorithm Optimistic Value Iteration with Zero Reward ( VI-Zero ) that is able to perform task-agnostic ( reward-free ) learning for multiple Markov games sharing the same transition ( Section 4 ) . For N > 1 games with the same transition and different ( known ) rewards , VI-Zero can find -approximate Nash policy for all games simultaneously in Õ ( H4SAB logN/ 2 ) episodes of game playing , which scales logarithmically in the number of games . • We design the first line of sample-efficient algorithms for multi-player general-sum Markov games . In a multi-player game with M players and Ai actions per player , we show that an nearoptimal policy can be found in Õ ( H4S2 ∏ i∈ [ M ] Ai/ 2 ) episodes , where the desired optimality can be either one of Nash equilibrium , correlated equilibrium ( CE ) , or coarse correlated equilibrium ( CCE ) . We achieve this guarantee by either a multi-player version of Nash-VI or a multi-player version of reward-free value iteration ( Section 5 & Appendix C ) . Due to space limit , we defer a detailed survey of related works to Appendix A . 2 PRELIMINARIES . In this paper , we consider Markov Games ( MGs , Shapley , 1953 ; Littman , 1994 ) , which are also known as stochastic games in the literature . Markov games are the generalization of standard Markov Decision Processes ( MDPs ) into the multi-player setting , where each player seeks to maximize her own utility . For simplicity , in this section we describe the important special case of twoplayer zero-sum games , and return to the general formulation in Appendix C. Formally , we consider the tabular episodic version of two-player zero-sum Markov game , which we denote as MG ( H , S , A , B , P , r ) . HereH is the number of steps in each episode , S is the set of states with |S| ≤ S , ( A , B ) are the sets of actions of the max-player and the min-player respectively with |A| ≤ A and |B| ≤ B , P = { Ph } h∈ [ H ] is a collection of transition matrices , so that Ph ( ·|s , a , b ) gives the distribution of the next state if action pair ( a , b ) is taken at state s at step h , and r = { rh } h∈ [ H ] is a collection of reward functions , where rh : S × A × B → [ 0 , 1 ] is the deterministic reward function at step h.1 This reward represents both the gain of the max-player and the loss of the min-player , making the problem a zero-sum Markov game . In each episode of this MG , we start with a fixed initial state s1 . At each step h ∈ [ H ] , both players observe state sh ∈ S , and pick their own actions ah ∈ A and bh ∈ B simultaneously . Then , both players observe the actions of their opponent , receive reward rh ( sh , ah , bh ) , and then the environment transitions to the next state sh+1 ∼ Ph ( ·|sh , ah , bh ) . The episode ends when sH+1 is reached . Policy , value function . A ( Markov ) policy µ of the max-player is a collection of H functions { µh : S → ∆A } h∈ [ H ] , each mapping from a state to a distribution over actions . ( Here ∆A is the probability simplex over action set A . ) Similarly , a policy ν of the min-player is a collection of H functions { νh : S → ∆B } h∈ [ H ] . We use the notation µh ( a|s ) and νh ( b|s ) to represent the probability of taking action a or b for state s at step h under Markov policy µ or ν respectively . We use V µ , νh : S → R to denote the value function at step h under policy µ and ν , so that V µ , ν h ( s ) gives the expected cumulative rewards received under policy µ and ν , starting from s at step h : V µ , νh ( s ) : = Eµ , ν [ ∑H h′=h rh′ ( sh′ , ah′ , bh′ ) ∣∣∣ sh = s ] . ( 1 ) We also define Qµ , νh : S × A × B → R to be the Q-value function at step h so that Q µ , ν h ( s , a , b ) gives the cumulative rewards received under policy µ and ν , starting from ( s , a , b ) at step h : Qµ , νh ( s , a , b ) : = Eµ , ν [ ∑H h′=h rh′ ( sh′ , ah′ , bh′ ) ∣∣∣ sh = s , ah = a , bh = b ] . ( 2 ) For simplicity , we define operator Ph as [ PhV ] ( s , a , b ) : = Es′∼Ph ( ·|s , a , b ) V ( s′ ) for any value function V . We also use notation [ DπQ ] ( s ) : = E ( a , b ) ∼π ( · , ·|s ) Q ( s , a , b ) for any action-value function Q . By definition of value functions , we have the Bellman equation Qµ , νh ( s , a , b ) = ( rh + PhV µ , ν h+1 ) ( s , a , b ) , V µ , ν h ( s ) = ( Dµh×νhQ µ , ν h ) ( s ) 1We assume the rewards in [ 0 , 1 ] for normalization . Our results directly generalize to randomized reward functions , since learning the transition is more difficult than learning the reward . for all ( s , a , b , h ) ∈ S ×A×B× [ H ] , and at the ( H + 1 ) th step we have V µ , νH+1 ( s ) = 0 for all s ∈ S. Best response and Nash equilibrium . For any policy of the max-player µ , there exists a best response of the min-player , which is a policy ν† ( µ ) satisfying V µ , ν † ( µ ) h ( s ) = infν V µ , ν h ( s ) for any ( s , h ) ∈ S× [ H ] . We denote V µ , †h : = V µ , ν† ( µ ) h . By symmetry , we can also define µ † ( ν ) and V † , νh . It is further known ( cf . ( Filar & Vrieze , 2012 ) ) that there exist policies µ ? , ν ? that are optimal against the best responses of the opponents , in the sense that V µ ? , † h ( s ) = supµ V µ , † h ( s ) , V † , ν ? h ( s ) = infν V † , ν h ( s ) , for all ( s , h ) . We call these optimal strategies ( µ ? , ν ? ) the Nash equilibrium of the Markov game , which satisfies the following minimax equation 2 : supµ infν V µ , ν h ( s ) = V µ ? , ν ? h ( s ) = infν supµ V µ , ν h ( s ) . Intuitively , a Nash equilibrium gives a solution in which no player has anything to gain by changing only her own policy . We further abbreviate the values of Nash equilibrium V µ ? , ν ? h andQ µ ? , ν ? h as V ? h and Q ? h . We refer readers to Appendix D for Bellman optimality equations for ( the value functions of ) the best responses and the Nash equilibrium . Learning Objective . We measure the suboptimality of any pair of general policies ( µ̂ , ν̂ ) using the gap between their performance and the performance of the optimal strategy ( i.e. , Nash equilibrium ) when playing against the best responses respectively : V † , ν̂1 ( s1 ) − V µ̂ , † 1 ( s1 ) = [ V † , ν̂1 ( s1 ) − V ? 1 ( s1 ) ] + [ V ? 1 ( s1 ) − V µ̂ , † 1 ( s1 ) ] Definition 1 ( -approximate Nash equilibrium ) . A pair of general policies ( µ̂ , ν̂ ) is an - approximate Nash equilibrium , if V † , ν̂1 ( s1 ) − V µ̂ , † 1 ( s1 ) ≤ . Definition 2 ( Regret ) . Let ( µk , νk ) denote the policies deployed by the algorithm in the kth episode . After a total of K episodes , the regret is defined as Regret ( K ) = K∑ k=1 ( V † , ν k 1 − V µk , † 1 ) ( s1 ) . One goal of reinforcement learning is to design algorithms for Markov games that can find an -approximate Nash equilibrium using a number of episodes that is small in its dependency on S , A , B , H as well as 1/ ( PAC sample complexity bound ) . An alternative goal is to design algorithms for Markov games that achieves regret that is sublinear in K , and polynomial in S , A , B , H ( regret bound ) . We remark that any sublinear regret algorithm can be directly converted to a polynomial-sample PAC algorithm via the standard online-to-batch conversion ( see e.g. , Jin et al . ( 2018 ) ) .
This paper studies learning in stochastic games, which are extensions of Markov decision processes (MDPs) from the single-agent setup to the multi-agent one. Here the objective of each learner is to optimize her own reward function. Similarly to the case of MDPs, here one can devise learning algorithms with controlled sample complexity or regret (or both simultaneously) even when reward and transition functions are unknown.
SP:e4db134ad2f3217ae370cb58399efc86047166f7
A Sharp Analysis of Model-based Reinforcement Learning with Self-Play
1 INTRODUCTION . This paper is concerned with the problem of multi-agent reinforcement learning ( multi-agent RL ) , in which multiple agents learn to make decisions in an unknown environment in order to maximize their ( own ) cumulative rewards . Multi-agent RL has achieved significant recent success in traditionally hard AI challenges including large-scale strategy games ( such as GO ) ( Silver et al. , 2016 ; 2017 ) , real-time video games involving team play such as Starcraft and Dota2 ( OpenAI , 2018 ; Vinyals et al. , 2019 ) , as well as behavior learning in complex social scenarios ( Baker et al. , 2020 ) . Achieving human-like ( or super-human ) performance in these games using multi-agent RL typically requires a large number of samples ( steps of game playing ) due to the necessity of exploration , and how to improve the sample complexity of multi-agent RL has been an important research question . One prevalent approach towards solving multi-agent RL is model-based methods , that is , to use the existing visitation data to build an estimate of the model ( i.e . transition dynamics and rewards ) , run an offline planning algorithm on the estimated model to obtain the policy , and play the policy in the environment . Such a principle underlies some of the earliest single-agent online RL algorithms such as E3 ( Kearns & Singh , 2002 ) and RMax ( Brafman & Tennenholtz , 2002 ) , and is conceptually appealing for multi-agent RL too since the multi-agent structure does not add complexity onto the model estimation part and only requires an appropriate multi-agent planning algorithm ( such as value iteration for games ( Shapley , 1953 ) ) in a black-box fashion . On the other hand , modelfree methods do not directly build estimates of the model , but instead directly estimate the value functions or action-value ( Q ) functions of the problem at the optimal/equilibrium policies , and play the greedy policies with respect to the estimated value functions . Model-free algorithms have also been well developed for multi-agent RL such as friend-or-foe Q-Learning ( Littman , 2001 ) and Nash Q-Learning ( Hu & Wellman , 2003 ) . While both model-based and model-free algorithms have been shown to be provably efficient in multi-agent RL in a recent line of work ( Bai & Jin , 2020 ; Xie et al. , 2020 ; Bai et al. , 2020 ) , a more precise understanding of the optimal sample complexities within these two types of algorithms ( respectively ) is still lacking . In the specific setting of two-player zero-sum Markov games , the current best sample complexity for model-based algorithms is achieved by the VI-ULCB ( Value Iteration with Upper/Lower Confidence Bounds ) algorithm ( Bai & Jin , 2020 ; Xie et al. , 2020 ) : In a tabular Markov game with S states , { A , B } actions for the two players , and horizon length H , VI-ULCB is able to find an -approximate Nash equilibrium policy in Õ ( H4S2AB/ 2 ) episodes of game playing . However , compared with the information-theoretic lower bound Ω ( H3S ( A+B ) / 2 ) , this rate has suboptimal dependencies on all of H , S , and A , B . In contrast , the current best sample complexity for model-free algorithms is achieved by Nash V-Learning ( Bai et al. , 2020 ) , which finds an -approximate Nash policy in Õ ( H6S ( A + B ) / 2 ) episodes . Compared with the lower bound , this is tight except for a poly ( H ) factor , which may seemingly suggest that model-free algorithms could be superior to model-based ones in multi-agent RL . However , such a conclusion would be in stark contrast to the single-agent MDP setting , where it is known that model-based algorithms are able to achieve minimax optimal sample complexities ( Jaksch et al. , 2010 ; Azar et al. , 2017 ) . It naturally arises whether model-free algorithms are indeed superior in multi-agent settings , or whether the existing analyses of model-based algorithms are not tight . This motivates us to ask the following research question : Question : How sample-efficient are model-based algorithms in multi-agent RL ? In this paper , we advance the theoretical understandings of multi-agent RL by presenting a sharp analysis of model-based algorithms on Markov games . Our core contribution is the design of a new model-based algorithm Optimistic Nash Value Iteration ( Nash-VI ) that achieves an almost optimal sample complexity for zero-sum Markov games and improves significantly over existing modelbased approaches . We summarize our main contributions as follows . A comparison between our and prior results can be found in Table 1 . • We design a new model-based algorithm Optimistic Nash Value Iteration ( Nash-VI ) that provably finds -approximate Nash equilibria for Markov games in Õ ( H3SAB/ 2 ) episodes of game playing ( Section 3 ) . This improves over the best existing model-based algorithm by O ( HS ) and is the first algorithm that matches the sample complexity lower bound except for a Õ ( min { A , B } ) factor , showing that model-based algorithms can indeed achieve an almost optimal sample complexity . Further , unlike state-of-the-art model-free algorithms such as Nash V-Learning ( Bai et al. , 2020 ) , this algorithm achieves in addition a Õ ( √ T ) regret bound , and outputs a simple Markov policy ( instead of a nested mixture of Markov policies as returned by Nash V-Learning ) . • We design an alternative algorithm Optimistic Value Iteration with Zero Reward ( VI-Zero ) that is able to perform task-agnostic ( reward-free ) learning for multiple Markov games sharing the same transition ( Section 4 ) . For N > 1 games with the same transition and different ( known ) rewards , VI-Zero can find -approximate Nash policy for all games simultaneously in Õ ( H4SAB logN/ 2 ) episodes of game playing , which scales logarithmically in the number of games . • We design the first line of sample-efficient algorithms for multi-player general-sum Markov games . In a multi-player game with M players and Ai actions per player , we show that an nearoptimal policy can be found in Õ ( H4S2 ∏ i∈ [ M ] Ai/ 2 ) episodes , where the desired optimality can be either one of Nash equilibrium , correlated equilibrium ( CE ) , or coarse correlated equilibrium ( CCE ) . We achieve this guarantee by either a multi-player version of Nash-VI or a multi-player version of reward-free value iteration ( Section 5 & Appendix C ) . Due to space limit , we defer a detailed survey of related works to Appendix A . 2 PRELIMINARIES . In this paper , we consider Markov Games ( MGs , Shapley , 1953 ; Littman , 1994 ) , which are also known as stochastic games in the literature . Markov games are the generalization of standard Markov Decision Processes ( MDPs ) into the multi-player setting , where each player seeks to maximize her own utility . For simplicity , in this section we describe the important special case of twoplayer zero-sum games , and return to the general formulation in Appendix C. Formally , we consider the tabular episodic version of two-player zero-sum Markov game , which we denote as MG ( H , S , A , B , P , r ) . HereH is the number of steps in each episode , S is the set of states with |S| ≤ S , ( A , B ) are the sets of actions of the max-player and the min-player respectively with |A| ≤ A and |B| ≤ B , P = { Ph } h∈ [ H ] is a collection of transition matrices , so that Ph ( ·|s , a , b ) gives the distribution of the next state if action pair ( a , b ) is taken at state s at step h , and r = { rh } h∈ [ H ] is a collection of reward functions , where rh : S × A × B → [ 0 , 1 ] is the deterministic reward function at step h.1 This reward represents both the gain of the max-player and the loss of the min-player , making the problem a zero-sum Markov game . In each episode of this MG , we start with a fixed initial state s1 . At each step h ∈ [ H ] , both players observe state sh ∈ S , and pick their own actions ah ∈ A and bh ∈ B simultaneously . Then , both players observe the actions of their opponent , receive reward rh ( sh , ah , bh ) , and then the environment transitions to the next state sh+1 ∼ Ph ( ·|sh , ah , bh ) . The episode ends when sH+1 is reached . Policy , value function . A ( Markov ) policy µ of the max-player is a collection of H functions { µh : S → ∆A } h∈ [ H ] , each mapping from a state to a distribution over actions . ( Here ∆A is the probability simplex over action set A . ) Similarly , a policy ν of the min-player is a collection of H functions { νh : S → ∆B } h∈ [ H ] . We use the notation µh ( a|s ) and νh ( b|s ) to represent the probability of taking action a or b for state s at step h under Markov policy µ or ν respectively . We use V µ , νh : S → R to denote the value function at step h under policy µ and ν , so that V µ , ν h ( s ) gives the expected cumulative rewards received under policy µ and ν , starting from s at step h : V µ , νh ( s ) : = Eµ , ν [ ∑H h′=h rh′ ( sh′ , ah′ , bh′ ) ∣∣∣ sh = s ] . ( 1 ) We also define Qµ , νh : S × A × B → R to be the Q-value function at step h so that Q µ , ν h ( s , a , b ) gives the cumulative rewards received under policy µ and ν , starting from ( s , a , b ) at step h : Qµ , νh ( s , a , b ) : = Eµ , ν [ ∑H h′=h rh′ ( sh′ , ah′ , bh′ ) ∣∣∣ sh = s , ah = a , bh = b ] . ( 2 ) For simplicity , we define operator Ph as [ PhV ] ( s , a , b ) : = Es′∼Ph ( ·|s , a , b ) V ( s′ ) for any value function V . We also use notation [ DπQ ] ( s ) : = E ( a , b ) ∼π ( · , ·|s ) Q ( s , a , b ) for any action-value function Q . By definition of value functions , we have the Bellman equation Qµ , νh ( s , a , b ) = ( rh + PhV µ , ν h+1 ) ( s , a , b ) , V µ , ν h ( s ) = ( Dµh×νhQ µ , ν h ) ( s ) 1We assume the rewards in [ 0 , 1 ] for normalization . Our results directly generalize to randomized reward functions , since learning the transition is more difficult than learning the reward . for all ( s , a , b , h ) ∈ S ×A×B× [ H ] , and at the ( H + 1 ) th step we have V µ , νH+1 ( s ) = 0 for all s ∈ S. Best response and Nash equilibrium . For any policy of the max-player µ , there exists a best response of the min-player , which is a policy ν† ( µ ) satisfying V µ , ν † ( µ ) h ( s ) = infν V µ , ν h ( s ) for any ( s , h ) ∈ S× [ H ] . We denote V µ , †h : = V µ , ν† ( µ ) h . By symmetry , we can also define µ † ( ν ) and V † , νh . It is further known ( cf . ( Filar & Vrieze , 2012 ) ) that there exist policies µ ? , ν ? that are optimal against the best responses of the opponents , in the sense that V µ ? , † h ( s ) = supµ V µ , † h ( s ) , V † , ν ? h ( s ) = infν V † , ν h ( s ) , for all ( s , h ) . We call these optimal strategies ( µ ? , ν ? ) the Nash equilibrium of the Markov game , which satisfies the following minimax equation 2 : supµ infν V µ , ν h ( s ) = V µ ? , ν ? h ( s ) = infν supµ V µ , ν h ( s ) . Intuitively , a Nash equilibrium gives a solution in which no player has anything to gain by changing only her own policy . We further abbreviate the values of Nash equilibrium V µ ? , ν ? h andQ µ ? , ν ? h as V ? h and Q ? h . We refer readers to Appendix D for Bellman optimality equations for ( the value functions of ) the best responses and the Nash equilibrium . Learning Objective . We measure the suboptimality of any pair of general policies ( µ̂ , ν̂ ) using the gap between their performance and the performance of the optimal strategy ( i.e. , Nash equilibrium ) when playing against the best responses respectively : V † , ν̂1 ( s1 ) − V µ̂ , † 1 ( s1 ) = [ V † , ν̂1 ( s1 ) − V ? 1 ( s1 ) ] + [ V ? 1 ( s1 ) − V µ̂ , † 1 ( s1 ) ] Definition 1 ( -approximate Nash equilibrium ) . A pair of general policies ( µ̂ , ν̂ ) is an - approximate Nash equilibrium , if V † , ν̂1 ( s1 ) − V µ̂ , † 1 ( s1 ) ≤ . Definition 2 ( Regret ) . Let ( µk , νk ) denote the policies deployed by the algorithm in the kth episode . After a total of K episodes , the regret is defined as Regret ( K ) = K∑ k=1 ( V † , ν k 1 − V µk , † 1 ) ( s1 ) . One goal of reinforcement learning is to design algorithms for Markov games that can find an -approximate Nash equilibrium using a number of episodes that is small in its dependency on S , A , B , H as well as 1/ ( PAC sample complexity bound ) . An alternative goal is to design algorithms for Markov games that achieves regret that is sublinear in K , and polynomial in S , A , B , H ( regret bound ) . We remark that any sublinear regret algorithm can be directly converted to a polynomial-sample PAC algorithm via the standard online-to-batch conversion ( see e.g. , Jin et al . ( 2018 ) ) .
The authors introduce new algorithms to solve two-players zero-sum Markov games, as well as two-players Markov game in the reward-free setting. The approach is model-based, based on successive episods of planning and counting for updating the model estimate. It involves solving a matrix game at each iteration, looking for a notion of equilibria that is computable in polynomial time (unlike Nash equilibria) An extension to multi-player games is proposed for both reward and reward free setting (in the appendix).
SP:e4db134ad2f3217ae370cb58399efc86047166f7
Adapt-and-Adjust: Overcoming the Long-tail Problem of Multilingual Speech Recognition
1 INTRODUCTION . Deploying a single Automatic Speech Recognition ( ASR ) model to recognize multiple languages is highly desired but very challenging for real-world multilingual ASR scenarios due to the wellknown long-tailed distribution challenge , namely , that some resource-rich languages like English have abundant training data , while the majority low-resource languages have varying amounts of training data . The recent popular end-to-end ( E2E ) monolingual ASR architecture ( Graves et al. , 2013 ; Chan et al. , 2015 ; Vaswani et al. , 2017 ) is promising to achieve state-of-the-art performance for resource-rich languages but suffers dramatically from the long tail of low-resource languages due to the lack of training data . This paper aims to investigate an end-to-end multilingual ASR framework where a single model is trained end-to-end from a pooled dataset of all target languages to improve the overall performance of multilingual ASR tasks , especially for low-resource languages . The long-tailed data distribution problem makes building an end-to-end multilingual ASR notoriously challenging . This imbalanced data setting poses a multitude of open challenges for multi-task training because the distribution of the training data is very skewed . These challenges stem from two aspects . First , very limited audio samples are available for low-resource languages , such as Kyrgyz , Swedish , and Turkish , while simultaneously , vast amounts of data exist from high-resource languages , such as English , French , and Spanish . Second , graphemes or subword labels follow a long-tailed distribution in ASR since some labels appear significantly more frequently , even for a monolingual setting . Furthermore , a multilingual system may include languages with writing scripts other than the Latin alphabet , such as Chinese or Cyrillic , that further worsen the skewness . To further illustrate the long-tail distribution in our study , Figure 1 shows the frequencies of sentence piece tokens in the curated multilingual dataset from CommonVoice ( Ardila et al. , 2020 ) . While a standard end-to-end multilingual training approach can improve overall performance compared with monolingual end-to-end approaches , it does not address the long-tail problem explicitly . One of the key challenges is the class imbalance issue , which will bias the multilingual model towards the dominant languages . To address this , one straightforward approach is to resample the training data ( Kannan et al. , 2019 ; Pratap et al. , 2020 ) during batch assembly . However , such an ad-hoc approach does not fully resolve the underlying long-tail distribution problem , and only a marginal improvement is obtained in practice . Another challenge is how to model the languages with limited training data robustly . In this paper , the “ long-tail problem ” is twofold : 1 ) the longtailed class distribution arising from the skewed multilingual data and sentence piece distribution 2 ) the robust modelling of languages with limited training data , i.e. , tail languages . To this end , we propose the Adapt-and-Adjust ( A2 ) framework for multilingual speech recognition using a speech transformer to address the twofold long-tail problem . Firstly , for better language modeling , a distilled mBERT ( Devlin et al. , 2019 ) is converted to an autoregressive transformer decoder to jointly explore the multilingual acoustic and text space to improve the performance of low-resource languages . Secondly , to adapt the multilingual network to specific languages with minimal additional parameters , both language-specific and language-agnostic adapters are used to augment each encoder and decoder layer . While the language-specific adapters focus on adapting the shared network weights to a particular language , a common adapter is proposed to learn some shared and language-agnostic knowledge for better knowledge transfer across languages . Lastly , to increase the relative margin between logits of rare versus dominant languages , we perform class imbalance adjustments during multilingual model training or inference by revisiting the classic idea of logit adjustment ( Zhou & Liu , 2006 ) . Class imbalance adjustment ( Collell et al. , 2016 ; Cui et al. , 2019 ; Menon et al. , 2020 ) is applied by adjusting the logits of the softmax input with the class priors . We conduct experiments and establish a benchmark from the CommonVoice corpus with a realistic long-tailed distribution of different languages . The extensive experiments show that A2 significantly outperforms conventional approaches for end-to-end multilingual ASR . Our key contributions are as follows : • We propose Adapt-and-Adjust ( A2 ) , a novel end-to-end transformer-based framework for real-world multilingual speech recognition to overcome the “ long-tail problem ” ; • We demonstrate the effectiveness of utilizing a pretrained multilingual language model as a speech decoder to improve multilingual text representations and language adapters to better share the learned information across all languages . To the best of our knowledge , this work is the first to adapt a pretrained multilingual language model for multilingual ASR . • We show that incorporating class priors during training or inference is effective and essential to addressing the long-tail distribution issue in multilingual training . • We establish a reproducible multilingual speech recognition benchmark with long-tailed distributions of 11 languages from different language families for the research community . 2 ADAPT-AND-ADJUST FRAMEWORK . 2.1 OVERVIEW . Figure 2 gives an overview of the proposed A2 framework for end-to-end multilingual ASR . A2 is built on a transformer-based sequence-to-sequence model with three key novel contributions : ( 1 ) an mBERT-based decoder , ( 2 ) language adapters , and ( 3 ) class-imbalance adjustments . Firstly , the vanilla transformer decoder is replaced with mBERT for better language modeling , particularly for low-resource languages . Secondly , the common and language-specific adapters are added to each encoder and decoder layer to learn both the shared and language-specific information for better acoustic modelling . Finally , we perform class imbalance adjustments during training or inference , where the logits are adjusted with the class priors estimated from the training data . 2.2 BASE MODEL : HYBRID CTC-ATTENTION SPEECH TRANSFORMER . A sequence-to-sequence speech transformer model ( Dong et al. , 2018 ; Kim et al. , 2016 ; Karita et al. , 2019b ) based on the hybrid CTC-Attention network is used for acoustic modeling . It takes in the acoustic features x ∈ RT×F and outputs the sentence piece tokens y , where T and F denote the sequence length and feature dimension . The encoder consists of several 2D convolution layers followed by self-attention layers . The convolution layers are used to extract more robust features before they are sent to the transformer . The decoder layers have two attention mechanisms , one for self-attention and the other for the encoder output . The network is trained in an autoregressive manner by predicting the next token given the current output . In addition , the CTC layer ( Graves et al. , 2006 ) is added to the encoder output to serve as a regularizer to the attention model . Training Multi-task loss LMTL ( Watanabe et al. , 2018 ; Karita et al. , 2019b ) , combining the CTC loss ( Graves et al. , 2006 ) and attention lossLATTN , is used to train the speech transformer . The multitask loss is computed as an interpolation of the two losses with a hyper-parameter λ ( 0 ≤ λ ≤ 1 ) : LATTN = KL ( pattn||py ) , ( 1 ) LMTL = λ logpctc ( y|henc ) + ( 1− λ ) Lattn , ( 2 ) where py is the label distribution after label smoothing ( Müller et al. , 2019 ) to prevent the model from making over-confident predictions . Kullback-Leibler divergence loss ( KL ) ( Kullback & Leibler , 1951 ) , is used for the attention loss . Decoding Beam search is used to predict the sentence pieces without any additional language models . The decoding score is computed as a weighted sum of both the CTC and attention network probabilities using β as the decoding parameter to balance them ( Karita et al. , 2019a ) : ŷ = argmax y∈Y∗ { βpctc ( y|henc ) + ( 1− β ) pattn ( y|henc , y′ ) } , ( 3 ) where y′ is the decoded sequence so far . 2.3 MULTILINGUAL BERT AS TRANSFORMER DECODER . For better language modeling , especially for low-resource languages , mBERT is used as the transformer decoder . Since mBERT is pre-trained on text data , it is essential to augment a cross-attention layer to the encoder output for each mBERT layer . The cross-attention and its self-attention layers are learned to “ align ” the acoustic and text spaces for the speech recognition . This is because the text space may diverge significantly from the acoustic space of the encoder output . Autoregressive mBERT Figure 3 depicts the adaptation of mBERT as an autoregressive transformer decoder . We copy the embeddings and self-attention parameters of mBERT into the decoder layers . Let t denote the current decoding step . The autoregressive decoder takes the current input token yt to predict the next token yt+1 . The mBERT embedding layer converts the input token to a vector representation . Subsequently , the cross-attention layer takes the encoder output henc as the key and value , and the self-attention output as the query , and computes the attention output . Vocabulary Mapping The vocabulary size of the vanilla mBERT is too large ( 119,547 tokens ) for training the end-to-end speech recognition system . Therefore , vocabulary mapping is performed to reduce the number of targets for the speech transformer . In this work , sentence pieces ( SP ) ( Kudo , 2018 ) are used as the target tokens . The SP models are trained on the transcriptions with a preset vocabulary size . In this work , we use a shared set of 5,237 tokens as the multilingual system ’ s vocabulary . The minimum number in the token set for the sentence piece model is 150 for all the monolingual systems , except Chinese with 2,265 tokens . The generated sentence piece tokens are then matched against the mBERT token set . During training , the embeddings of all tokens in the mBERT vocabulary are initialized with mBERT embeddings . 2.4 LANGUAGE ADAPTERS . Similar to Kannan et al . ( 2019 ) , lightweight residual language adapters are used for better acoustic modelling with minimal language-specific parameters to increase the model robustness to languages with limited resources . As shown in Figure 4 , in addition to the language-specific adapter for capturing the language-intrinsic knowledge , a common adapter is also trained to learn language-agnostic information in the multilingual data ; we call these Dual-Adapters . The language-specific and common adapters are denoted as Alang and Acom , respectively . Each adapter of layer l consists of a down-projection layer Wld , followed by a ReLU activation function , and an up-projection layer Wlu . The adapters take h l as the input , where hl is the self attention output of layer l. We compute the output of Adapter ( hl ) as follows for both the language-specific and common adapters : Adapter ( hl ) = Wlu ( ReLU ( W l d ( LayerNorm ( h l ) ) ) ) + hl . ( 4 ) The final adapter output is computed as ol = ollang + o l com . o l is then used as the input to the next encoder or decoder layer . We create a language mask to specify the language-specific adapters . 2.5 SENTENCE PIECE CLASS IMBALANCE ADJUSTMENTS . The sentence piece class imbalance problem is addressed by incorporating the class priors during training or inference via logit adjustments . Derived from a Bayesian point of view in Menon et al . ( 2020 ) for computer vision tasks , the softmax classifier with adjusted logits as input minimizes the balanced error across all classes . A natural adjustment is to scale the logits fy ( x ) by the inverse of the corresponding class prior πy . In log domain , the adjustment can be performed as follows : f adjy ( x ) = fy ( x ) − τ · log πy , ( 5 ) where τ > 0 is a hyper-parameter . The adjustment can be viewed as applying a class-dependent offset to re-weight each logit according to its class prior . Class priors The class priors are the natural frequencies of the sentence piece tokens estimated from the multilingual training data . To form a valid prior distribution , smoothing is applied to the raw counts according to Equation 6 for zero occurrence tokens : πy = { Ci C − 1 ( N−n0 ) ×C , ci > 0 1 n0×C , otherwise , ( 6 ) whereC is the total number of counts for all labels , n0 is the number of labels with zero occurrences , N is the number of classes and ci is the raw count of class i . Training phase class imbalance adjustments To incorporate the priors during training , the logits f decyt of the last decoder layer are adjusted before softmax according to the following : f decyt = w T y · Decoder ( henc , Embedding ( yt−1 ) ) ( 7 ) f adjyt = f dec yt − τ · log πyt , ( 8 ) padjyt = exp ( f adjyt ) ∑ y′t∈ [ N ] exp ( f adjy′t ) . ( 9 ) The adjusted softmax output vector padjy of the sequence is used to compute the KL loss and perform the backward propagation to update the model . yt−1 is the previous label available only during training . To reduce the training and inference discrepancy , scheduled sampling ( Bengio et al. , 2015 ) is commonly used for sequential classification tasks like speech recognition . During later training iterations , instead of using the ground truth label yt−1 for computing the logits , y′t−1 is chosen from the maximum prediction output of the current model to simulate the inference : y′t−1 = argmax y padjyt−1 . ( 10 ) If the scheduled sampling is used , the adjusted logits at step t will have influence over all of the following tokens in the current sequence . This is a crucial difference from the image classification task in Menon et al . ( 2020 ) . If τ is set to be 1 , the training phase logit adjustment becomes similar to the widely used label smoothing technique Müller et al . ( 2019 ) . However , in conventional label smoothing , the prior πy is usually a uniform distribution that is independent of the data . The logit adjustment applies a class-specific “ smoothing ” based on the class prior , and has been shown to be superior to the baseline with the standard label smoothing . Inference phase class imbalance adjustments Alternatively , the class priors can be incorporated during inference via logit adjustments . The decoding score is computed as follows : ŷ = argmax y∈Y∗ { βpctc ( y|henc ) + ( 1− β ) padjy } . ( 11 ) During beam search , the attention decoding scores padjy are computed in the same way as the scheduled sampling from the adjusted logits .
This paper addresses multi-lingual speech synthesis, where one ASR model is responsible for recognizing speech in multiple languages. In this example the authors look at 11 languages with between 80 and 4 hours of training data. The "long-tail problem" (which isn't clearly stated) that this work is addressing is that the discrepancy in available training data leads to a discrepancy in performance. The paper sets out two goals 1) "to improve the overall performance of multilingual ASR tasks" and 2) (implicitly) to flatten the distribution across languages.
SP:85884c827deebdf6be8feacefde4800e4837b55a
Adapt-and-Adjust: Overcoming the Long-tail Problem of Multilingual Speech Recognition
1 INTRODUCTION . Deploying a single Automatic Speech Recognition ( ASR ) model to recognize multiple languages is highly desired but very challenging for real-world multilingual ASR scenarios due to the wellknown long-tailed distribution challenge , namely , that some resource-rich languages like English have abundant training data , while the majority low-resource languages have varying amounts of training data . The recent popular end-to-end ( E2E ) monolingual ASR architecture ( Graves et al. , 2013 ; Chan et al. , 2015 ; Vaswani et al. , 2017 ) is promising to achieve state-of-the-art performance for resource-rich languages but suffers dramatically from the long tail of low-resource languages due to the lack of training data . This paper aims to investigate an end-to-end multilingual ASR framework where a single model is trained end-to-end from a pooled dataset of all target languages to improve the overall performance of multilingual ASR tasks , especially for low-resource languages . The long-tailed data distribution problem makes building an end-to-end multilingual ASR notoriously challenging . This imbalanced data setting poses a multitude of open challenges for multi-task training because the distribution of the training data is very skewed . These challenges stem from two aspects . First , very limited audio samples are available for low-resource languages , such as Kyrgyz , Swedish , and Turkish , while simultaneously , vast amounts of data exist from high-resource languages , such as English , French , and Spanish . Second , graphemes or subword labels follow a long-tailed distribution in ASR since some labels appear significantly more frequently , even for a monolingual setting . Furthermore , a multilingual system may include languages with writing scripts other than the Latin alphabet , such as Chinese or Cyrillic , that further worsen the skewness . To further illustrate the long-tail distribution in our study , Figure 1 shows the frequencies of sentence piece tokens in the curated multilingual dataset from CommonVoice ( Ardila et al. , 2020 ) . While a standard end-to-end multilingual training approach can improve overall performance compared with monolingual end-to-end approaches , it does not address the long-tail problem explicitly . One of the key challenges is the class imbalance issue , which will bias the multilingual model towards the dominant languages . To address this , one straightforward approach is to resample the training data ( Kannan et al. , 2019 ; Pratap et al. , 2020 ) during batch assembly . However , such an ad-hoc approach does not fully resolve the underlying long-tail distribution problem , and only a marginal improvement is obtained in practice . Another challenge is how to model the languages with limited training data robustly . In this paper , the “ long-tail problem ” is twofold : 1 ) the longtailed class distribution arising from the skewed multilingual data and sentence piece distribution 2 ) the robust modelling of languages with limited training data , i.e. , tail languages . To this end , we propose the Adapt-and-Adjust ( A2 ) framework for multilingual speech recognition using a speech transformer to address the twofold long-tail problem . Firstly , for better language modeling , a distilled mBERT ( Devlin et al. , 2019 ) is converted to an autoregressive transformer decoder to jointly explore the multilingual acoustic and text space to improve the performance of low-resource languages . Secondly , to adapt the multilingual network to specific languages with minimal additional parameters , both language-specific and language-agnostic adapters are used to augment each encoder and decoder layer . While the language-specific adapters focus on adapting the shared network weights to a particular language , a common adapter is proposed to learn some shared and language-agnostic knowledge for better knowledge transfer across languages . Lastly , to increase the relative margin between logits of rare versus dominant languages , we perform class imbalance adjustments during multilingual model training or inference by revisiting the classic idea of logit adjustment ( Zhou & Liu , 2006 ) . Class imbalance adjustment ( Collell et al. , 2016 ; Cui et al. , 2019 ; Menon et al. , 2020 ) is applied by adjusting the logits of the softmax input with the class priors . We conduct experiments and establish a benchmark from the CommonVoice corpus with a realistic long-tailed distribution of different languages . The extensive experiments show that A2 significantly outperforms conventional approaches for end-to-end multilingual ASR . Our key contributions are as follows : • We propose Adapt-and-Adjust ( A2 ) , a novel end-to-end transformer-based framework for real-world multilingual speech recognition to overcome the “ long-tail problem ” ; • We demonstrate the effectiveness of utilizing a pretrained multilingual language model as a speech decoder to improve multilingual text representations and language adapters to better share the learned information across all languages . To the best of our knowledge , this work is the first to adapt a pretrained multilingual language model for multilingual ASR . • We show that incorporating class priors during training or inference is effective and essential to addressing the long-tail distribution issue in multilingual training . • We establish a reproducible multilingual speech recognition benchmark with long-tailed distributions of 11 languages from different language families for the research community . 2 ADAPT-AND-ADJUST FRAMEWORK . 2.1 OVERVIEW . Figure 2 gives an overview of the proposed A2 framework for end-to-end multilingual ASR . A2 is built on a transformer-based sequence-to-sequence model with three key novel contributions : ( 1 ) an mBERT-based decoder , ( 2 ) language adapters , and ( 3 ) class-imbalance adjustments . Firstly , the vanilla transformer decoder is replaced with mBERT for better language modeling , particularly for low-resource languages . Secondly , the common and language-specific adapters are added to each encoder and decoder layer to learn both the shared and language-specific information for better acoustic modelling . Finally , we perform class imbalance adjustments during training or inference , where the logits are adjusted with the class priors estimated from the training data . 2.2 BASE MODEL : HYBRID CTC-ATTENTION SPEECH TRANSFORMER . A sequence-to-sequence speech transformer model ( Dong et al. , 2018 ; Kim et al. , 2016 ; Karita et al. , 2019b ) based on the hybrid CTC-Attention network is used for acoustic modeling . It takes in the acoustic features x ∈ RT×F and outputs the sentence piece tokens y , where T and F denote the sequence length and feature dimension . The encoder consists of several 2D convolution layers followed by self-attention layers . The convolution layers are used to extract more robust features before they are sent to the transformer . The decoder layers have two attention mechanisms , one for self-attention and the other for the encoder output . The network is trained in an autoregressive manner by predicting the next token given the current output . In addition , the CTC layer ( Graves et al. , 2006 ) is added to the encoder output to serve as a regularizer to the attention model . Training Multi-task loss LMTL ( Watanabe et al. , 2018 ; Karita et al. , 2019b ) , combining the CTC loss ( Graves et al. , 2006 ) and attention lossLATTN , is used to train the speech transformer . The multitask loss is computed as an interpolation of the two losses with a hyper-parameter λ ( 0 ≤ λ ≤ 1 ) : LATTN = KL ( pattn||py ) , ( 1 ) LMTL = λ logpctc ( y|henc ) + ( 1− λ ) Lattn , ( 2 ) where py is the label distribution after label smoothing ( Müller et al. , 2019 ) to prevent the model from making over-confident predictions . Kullback-Leibler divergence loss ( KL ) ( Kullback & Leibler , 1951 ) , is used for the attention loss . Decoding Beam search is used to predict the sentence pieces without any additional language models . The decoding score is computed as a weighted sum of both the CTC and attention network probabilities using β as the decoding parameter to balance them ( Karita et al. , 2019a ) : ŷ = argmax y∈Y∗ { βpctc ( y|henc ) + ( 1− β ) pattn ( y|henc , y′ ) } , ( 3 ) where y′ is the decoded sequence so far . 2.3 MULTILINGUAL BERT AS TRANSFORMER DECODER . For better language modeling , especially for low-resource languages , mBERT is used as the transformer decoder . Since mBERT is pre-trained on text data , it is essential to augment a cross-attention layer to the encoder output for each mBERT layer . The cross-attention and its self-attention layers are learned to “ align ” the acoustic and text spaces for the speech recognition . This is because the text space may diverge significantly from the acoustic space of the encoder output . Autoregressive mBERT Figure 3 depicts the adaptation of mBERT as an autoregressive transformer decoder . We copy the embeddings and self-attention parameters of mBERT into the decoder layers . Let t denote the current decoding step . The autoregressive decoder takes the current input token yt to predict the next token yt+1 . The mBERT embedding layer converts the input token to a vector representation . Subsequently , the cross-attention layer takes the encoder output henc as the key and value , and the self-attention output as the query , and computes the attention output . Vocabulary Mapping The vocabulary size of the vanilla mBERT is too large ( 119,547 tokens ) for training the end-to-end speech recognition system . Therefore , vocabulary mapping is performed to reduce the number of targets for the speech transformer . In this work , sentence pieces ( SP ) ( Kudo , 2018 ) are used as the target tokens . The SP models are trained on the transcriptions with a preset vocabulary size . In this work , we use a shared set of 5,237 tokens as the multilingual system ’ s vocabulary . The minimum number in the token set for the sentence piece model is 150 for all the monolingual systems , except Chinese with 2,265 tokens . The generated sentence piece tokens are then matched against the mBERT token set . During training , the embeddings of all tokens in the mBERT vocabulary are initialized with mBERT embeddings . 2.4 LANGUAGE ADAPTERS . Similar to Kannan et al . ( 2019 ) , lightweight residual language adapters are used for better acoustic modelling with minimal language-specific parameters to increase the model robustness to languages with limited resources . As shown in Figure 4 , in addition to the language-specific adapter for capturing the language-intrinsic knowledge , a common adapter is also trained to learn language-agnostic information in the multilingual data ; we call these Dual-Adapters . The language-specific and common adapters are denoted as Alang and Acom , respectively . Each adapter of layer l consists of a down-projection layer Wld , followed by a ReLU activation function , and an up-projection layer Wlu . The adapters take h l as the input , where hl is the self attention output of layer l. We compute the output of Adapter ( hl ) as follows for both the language-specific and common adapters : Adapter ( hl ) = Wlu ( ReLU ( W l d ( LayerNorm ( h l ) ) ) ) + hl . ( 4 ) The final adapter output is computed as ol = ollang + o l com . o l is then used as the input to the next encoder or decoder layer . We create a language mask to specify the language-specific adapters . 2.5 SENTENCE PIECE CLASS IMBALANCE ADJUSTMENTS . The sentence piece class imbalance problem is addressed by incorporating the class priors during training or inference via logit adjustments . Derived from a Bayesian point of view in Menon et al . ( 2020 ) for computer vision tasks , the softmax classifier with adjusted logits as input minimizes the balanced error across all classes . A natural adjustment is to scale the logits fy ( x ) by the inverse of the corresponding class prior πy . In log domain , the adjustment can be performed as follows : f adjy ( x ) = fy ( x ) − τ · log πy , ( 5 ) where τ > 0 is a hyper-parameter . The adjustment can be viewed as applying a class-dependent offset to re-weight each logit according to its class prior . Class priors The class priors are the natural frequencies of the sentence piece tokens estimated from the multilingual training data . To form a valid prior distribution , smoothing is applied to the raw counts according to Equation 6 for zero occurrence tokens : πy = { Ci C − 1 ( N−n0 ) ×C , ci > 0 1 n0×C , otherwise , ( 6 ) whereC is the total number of counts for all labels , n0 is the number of labels with zero occurrences , N is the number of classes and ci is the raw count of class i . Training phase class imbalance adjustments To incorporate the priors during training , the logits f decyt of the last decoder layer are adjusted before softmax according to the following : f decyt = w T y · Decoder ( henc , Embedding ( yt−1 ) ) ( 7 ) f adjyt = f dec yt − τ · log πyt , ( 8 ) padjyt = exp ( f adjyt ) ∑ y′t∈ [ N ] exp ( f adjy′t ) . ( 9 ) The adjusted softmax output vector padjy of the sequence is used to compute the KL loss and perform the backward propagation to update the model . yt−1 is the previous label available only during training . To reduce the training and inference discrepancy , scheduled sampling ( Bengio et al. , 2015 ) is commonly used for sequential classification tasks like speech recognition . During later training iterations , instead of using the ground truth label yt−1 for computing the logits , y′t−1 is chosen from the maximum prediction output of the current model to simulate the inference : y′t−1 = argmax y padjyt−1 . ( 10 ) If the scheduled sampling is used , the adjusted logits at step t will have influence over all of the following tokens in the current sequence . This is a crucial difference from the image classification task in Menon et al . ( 2020 ) . If τ is set to be 1 , the training phase logit adjustment becomes similar to the widely used label smoothing technique Müller et al . ( 2019 ) . However , in conventional label smoothing , the prior πy is usually a uniform distribution that is independent of the data . The logit adjustment applies a class-specific “ smoothing ” based on the class prior , and has been shown to be superior to the baseline with the standard label smoothing . Inference phase class imbalance adjustments Alternatively , the class priors can be incorporated during inference via logit adjustments . The decoding score is computed as follows : ŷ = argmax y∈Y∗ { βpctc ( y|henc ) + ( 1− β ) padjy } . ( 11 ) During beam search , the attention decoding scores padjy are computed in the same way as the scheduled sampling from the adjusted logits .
The paper proposes three additions to improve a monolithic multilingual end-to-end ASR system. The problem of training a monolithic multilingual ASR system is that using data from multiple languages does not necessary improve over individual monolingual systems. The three additions are a large multilingual language model, the use of language adapters, and smoothing on the token probabilities. Mixing the three additions in a specific way helps improve the average word error rates.
SP:85884c827deebdf6be8feacefde4800e4837b55a
More or Less: When and How to Build Convolutional Neural Network Ensembles
1 INTRODUCTION . Scaling capacity of deep learning models . Convolutional neural network models are becoming as accurate as humans on perceptual tasks . They are now used in numerous and diverse applications such as drug discovery , data compression , and automating gameplay . These models increasingly grow in size with more parameters and layers , driven by two major trends . First , there is a continuous rise in data complexity and sizes in many applications ( Shazeer et al. , 2017 ) . Second , there is an increasing need for higher accuracy as models are utilized in more critical applications – such as self-driving cars and medical diagnosis ( Grzywaczewski , 2017 ) . This effect is especially pronounced in computer vision and natural language processing : Model sizes are three orders of magnitude larger than they were just three years ago ( Sanh et al. , 2019 ) . With bigger model sizes , the time , computation , and memory needed to train and deploy such models also increase . Thus , it is a consistent challenge to design models that maximize accuracy while remaining practical with respect to the resources they need ( Lee et al. , 2015 ; Huang et al. , 2017b ) . In this paper , we study the following question : Given a number of parameters ( neurons ) , how to design a convolutional neural network to optimize holistically for accuracy , training cost , and inference cost ? The holistic design space is very complex . Designers of convolutional neural network models navigate a complex design landscape to address this question : First , they need to decide on network architecture . Then , they have to consider whether to use a single network or build an ensemble model with multiple networks . Additionally , they have to decide how many neural networks to use and their individual designs , i.e. , the depth , width , and number of networks in their model . Modern applications with diverse requirements further complicate these decisions as what is desirable varies . Facebook , for instance , requires convolutional neural network models that strike specific tradeoffs between accuracy and inference time across 250 different types of smartphones ( Wu et al. , 2019 ) . As a result , not just accuracy but a diversity of metrics – such as inference time and memory usage – inform whether a model gets used ( Sze et al. , 2017b ) . Scattered conventional wisdom . There exist bits and pieces of scattered conventional wisdom to guide a neural network designer . These take the form of various empirical studies that demonstrate how depth and width in a single neural network model relate to certain metrics such as accuracy . First , it is generally known that deeper and wider networks can improve accuracy . In fact , recent convolutional architectures – such as ResNets and DenseNets – are designed precisely to enable this outcome ( He et al. , 2016 ; Huang et al. , 2017b ; a ) . The caveat with beefing up a neural network is that accuracy runs into diminishing returns as we continue to add more layers or widen existing ones ( Coates et al. , 2011 ; Dauphin and Bengio , 2013 ) . On the other hand , increasing the number of networks in the model , i.e. , building ensembles , is considered a relatively robust but expensive approach to improve accuracy as ensemble models train and deploy k networks instead of one ( Russakovsky et al. , 2015 ; Wasay et al. , 2020 ) . The consensus is to use ensembles when the goal is to achieve high accuracy without much regard to training cost , inference time , and memory usage , e.g. , competitions such as COCO and ImageNet ( Lee et al. , 2015 ; Russakovsky et al. , 2015 ; Huang et al. , 2017a ; Ju et al. , 2017 ) . All these studies , however , exist in silos . Any form of cross-comparison is impossible as they use different data sets , network architectures , and hardware . Lack of a robust and holistic assessment . Most past studies operate within the confines of a single convolutional network and do not consider the dimension of ensemble models . Those that compare with ensembles mostly do so unfairly comparing ensembles with k networks against a model that contains only one such network ( Lee et al. , 2015 ; Russakovsky et al. , 2015 ; Huang et al. , 2017a ; Ju et al. , 2017 ) . There are recent studies that make this comparison under a fixed parameter budget ( Chirkova et al. , 2020 ; Kondratyuk et al. , 2020 ) . However , these studies consider only the metric of generalization accuracy and explore a very small part of the design space – two different classes of convolutional architectures with a single depth . A holistic analysis needs to include resource-related metrics such as training time , inference cost , and memory usage . All these metrics are critical for practical applications ( Sze et al. , 2017a ; Wu et al. , 2019 ) . Furthermore , to provide reliable guidance to a model designer , a robust comparison needs to consider a range of architectures and model sizes with various depth and width configurations . This is critical , especially because varying just the width of convolutional networks in isolation , as done by recent studies ( Chirkova et al. , 2020 ; Kondratyuk et al. , 2020 ) , is known to be far less effective to improve accuracy ( Eigen et al. , 2013 ; Ba and Caruana , 2014 ) . Single networks vs. ensembles . In this paper , we bridge the gap in the understanding of the design space by providing answers to the following questions . Given specific requirements in terms of accuracy , training time , and inference time , should we train and deploy a convolutional model with a single network or one that contains an ensemble of networks ? How should we design the networks within an ensemble ? As these constraints and requirements evolve , should we switch between these alternatives , why , and when ? Method . We introduce the following methodology to map the design space accurately . Since there is no robust theoretical framework to consistently analyze the design space and the complex interactions among its many parameters and metrics , we develop a detailed and extensive experimental framework to isolate the impact of the critical design knobs : ( i ) depth , ( ii ) width , and ( iii ) number of networks , on all relevant metrics : ( i ) accuracy , ( ii ) training time , ( iii ) inference time , and ( iv ) memory usage . Crucially the number of parameters is a control knob in our framework , and we only compare alternatives under the same parameter budget . To establish the robustness of our findings , we experiment across various architectures , data complexities , and classification tasks . We present and analyze data amounting to over one year of GPU run time . We also explain trends breaking down metrics into their constituents when necessary . Results : The Ensemble Switchover Threshold ( EST ) . ( i ) Contrary to conventional wisdom , we show that when we make a holistic and robust comparison between single convolutional networks and ensembles of networks , we discover a vast design space where ensembles provide not just better overall accuracy but also train faster compared to a single network . ( ii ) Specifically , we uncover the Ensemble Switchover Threshold ( EST ) . This is the amount of resources ( measured in terms of the number of parameters and training epochs ) beyond which ensembles provide superior generalization accuracy to a single model . ( iii ) We show that EST occurs consistently across numerous data sets and architectures . ( iv ) We demonstrate that the number of networks in an ensemble and their individual designs determine the EST . ( v ) Ensembles can also provide comparable inference times for a considerable part of the design space . ( vi ) We also show that ensembles require significantly less memory to train for the same number of parameters . ( vii ) Finally , we make available a superset of our results for visual exploration and help with model design at : daslab.seas.harvard.edu/more-or-less . , 2 FRAMEWORK : DESIGN SPACE . The design space we explore consists of single convolutional neural network models and two classes of architecturally-homogenous ensembles . These ensemble classes help isolate the effect of the two design knobs – depth and width – on the quality and cost of an ensemble design . We first describe how we ensure a robust comparison of alternative model designs and then explain the degrees of freedom we explore . Establishing grounds for fair ranking . A key element of our framework is that the possible model designs are compared to each other only under equivalent resources . We ensure this by only comparing designs that have the same number of parameters . This comparison allows us to separate the quality of a design from the amount of resources given to it . Another way to think about this is that given a parameter budget , we can investigate how the three design classes rank for all relevant metrics ( training and inference time , accuracy , and memory usage ) . We fix the number of parameters because of its two distinctive properties over other metrics ( that we could have fixed ) , such as training time , inference time , or accuracy : First , the number of parameters of a network is directly proportional to all other resource-related metrics ( Jain et al. , 2020 ; Wasay et al. , 2020 ) . Second , the number of parameters is independent of the hardware or the software platform used and can be computed exactly from a network specification . The single network versus ensemble design space . Our design space considers a convolutional neural network architecture S ( w , d ) from a class of neural network architectures C. S ( w , d ) has width factor w , depth d , and number of parameters |S| . Similarly an ensemble is described as E = { E1 . . . Ek } . Ensembles are architecturally-homogenous i.e. , all ensemble networks E1 . . . Ek have the same architecture and each network has |E|/k parameters . When we compare a single network S ( w , d ) from C with an ensemble E we ensure that E1 . . . Ek ∈ C and |E1|+. . .+|Ek| = |S| . The reason why we restrict the design space to homogenous ensembles is to reduce the otherwise intractably large space1 of all possible ensembles given a single network to a size that we can 1Given a single network with |S| number of parameters , there are { |S| k } ( Stirling number of the second kind ) as many ways of forming ensembles of size k. This number grows at a similar rate to exponential polynomials , ( Boyadzhiev , 2009 ) e.g. , { 100 4 } ≈ 1059. feasibly and thoroughly experiment with and reason about . Furthermore , many neural network ensembles introduced in research and used in practice are similarly homogenous , for instance , SnapShot Ensembles and Fast Geometric Ensembles ( Huang et al. , 2017a ; Garipov et al. , 2018 ) . Additionally , our method provides a deterministic procedure of going between single network models and ensembles given a certain amount of parameters . Major sources of diversity in neural network ensembles are random weight initialization and stochastic training , both of which we incorporate in our framework . Depth-equivalent and width-equivalent ensembles . Convolutional neural network architectures are determined by two design knobs – the depth and the width factor . Corresponding to these two design knobs , we create two classes of ensembles : depth-equivalent ensembles and width-equivalent ensembles . These are depicted in Figure 1 : In depth-equivalent ensembles , the depth of the individual ensemble networks is the same as S ( i.e. , d ) , and the width factor is set to the highest possible value ( i.e. , w′ ) without exceeding the parameter budget of |S| . In width-equivalent ensembles , on the other hand , the width factor is conserved across all ensemble networks ( i.e. , w ) , and the depth is modulated to the highest possible value ( i.e. , d′ ) without exceeding |S| : w′ : k · |E ( w ′ , d ) i | ≤ |S ( w , d ) | ≤ k · |E ( w ′+1 , d ) i | d ′ : k · |E ( w , d ′ ) i | ≤ |S ( w , d ) | ≤ k · |E ( w , d ′+1 ) i | The above definition follows that neural networks in depth-equivalent ensembles have higher depth than those in width-equivalent ensembles . Width-equivalent ensembles contain wider neural networks than their depth-equivalent counterparts . In this way , we isolate and study the effect of depth and width on ensemble accuracy and resource requirement . Overall , our design space spans three classes of convolutional neural network designs : ( i ) single network models , ( ii ) width-equivalent ensembles , and ( iii ) depth-equivalent ensembles . Every class contains several model designs instantiated by the four-tuple { w , d , |S| , C } . We next describe how we designed an exhaustive experimental framework to cover various configurations of these four-tuples .
This paper establish a robust and holistic framework to compare scaling up an ensemble with scaling up a single networks, where test accuracy, number of paramaters, inference time, memory consumption and training time to converge are considered. To reduce the intractably large design space of scaling up an ensemble, the author mainly investigate two types of ensembles: depth-equivalent and width-equivalent ensembles. Through extensive experiments on SVHN, CIFAR-10, CIFAR-100, and Tiny ImageNet with VGGNets, ResNets, DenseNets and WideResNets, the authors discovered an surprising and consistently emerging phenomenon named The Ensemble Switchover Threshold: When the amount of resources (measured by number of parameters, training cost) is beyond this threshold, ensembles methods provide better performance and computation trade-off.
SP:934cb790cd96e5a81539938b05d63d0dcb82df0a
More or Less: When and How to Build Convolutional Neural Network Ensembles
1 INTRODUCTION . Scaling capacity of deep learning models . Convolutional neural network models are becoming as accurate as humans on perceptual tasks . They are now used in numerous and diverse applications such as drug discovery , data compression , and automating gameplay . These models increasingly grow in size with more parameters and layers , driven by two major trends . First , there is a continuous rise in data complexity and sizes in many applications ( Shazeer et al. , 2017 ) . Second , there is an increasing need for higher accuracy as models are utilized in more critical applications – such as self-driving cars and medical diagnosis ( Grzywaczewski , 2017 ) . This effect is especially pronounced in computer vision and natural language processing : Model sizes are three orders of magnitude larger than they were just three years ago ( Sanh et al. , 2019 ) . With bigger model sizes , the time , computation , and memory needed to train and deploy such models also increase . Thus , it is a consistent challenge to design models that maximize accuracy while remaining practical with respect to the resources they need ( Lee et al. , 2015 ; Huang et al. , 2017b ) . In this paper , we study the following question : Given a number of parameters ( neurons ) , how to design a convolutional neural network to optimize holistically for accuracy , training cost , and inference cost ? The holistic design space is very complex . Designers of convolutional neural network models navigate a complex design landscape to address this question : First , they need to decide on network architecture . Then , they have to consider whether to use a single network or build an ensemble model with multiple networks . Additionally , they have to decide how many neural networks to use and their individual designs , i.e. , the depth , width , and number of networks in their model . Modern applications with diverse requirements further complicate these decisions as what is desirable varies . Facebook , for instance , requires convolutional neural network models that strike specific tradeoffs between accuracy and inference time across 250 different types of smartphones ( Wu et al. , 2019 ) . As a result , not just accuracy but a diversity of metrics – such as inference time and memory usage – inform whether a model gets used ( Sze et al. , 2017b ) . Scattered conventional wisdom . There exist bits and pieces of scattered conventional wisdom to guide a neural network designer . These take the form of various empirical studies that demonstrate how depth and width in a single neural network model relate to certain metrics such as accuracy . First , it is generally known that deeper and wider networks can improve accuracy . In fact , recent convolutional architectures – such as ResNets and DenseNets – are designed precisely to enable this outcome ( He et al. , 2016 ; Huang et al. , 2017b ; a ) . The caveat with beefing up a neural network is that accuracy runs into diminishing returns as we continue to add more layers or widen existing ones ( Coates et al. , 2011 ; Dauphin and Bengio , 2013 ) . On the other hand , increasing the number of networks in the model , i.e. , building ensembles , is considered a relatively robust but expensive approach to improve accuracy as ensemble models train and deploy k networks instead of one ( Russakovsky et al. , 2015 ; Wasay et al. , 2020 ) . The consensus is to use ensembles when the goal is to achieve high accuracy without much regard to training cost , inference time , and memory usage , e.g. , competitions such as COCO and ImageNet ( Lee et al. , 2015 ; Russakovsky et al. , 2015 ; Huang et al. , 2017a ; Ju et al. , 2017 ) . All these studies , however , exist in silos . Any form of cross-comparison is impossible as they use different data sets , network architectures , and hardware . Lack of a robust and holistic assessment . Most past studies operate within the confines of a single convolutional network and do not consider the dimension of ensemble models . Those that compare with ensembles mostly do so unfairly comparing ensembles with k networks against a model that contains only one such network ( Lee et al. , 2015 ; Russakovsky et al. , 2015 ; Huang et al. , 2017a ; Ju et al. , 2017 ) . There are recent studies that make this comparison under a fixed parameter budget ( Chirkova et al. , 2020 ; Kondratyuk et al. , 2020 ) . However , these studies consider only the metric of generalization accuracy and explore a very small part of the design space – two different classes of convolutional architectures with a single depth . A holistic analysis needs to include resource-related metrics such as training time , inference cost , and memory usage . All these metrics are critical for practical applications ( Sze et al. , 2017a ; Wu et al. , 2019 ) . Furthermore , to provide reliable guidance to a model designer , a robust comparison needs to consider a range of architectures and model sizes with various depth and width configurations . This is critical , especially because varying just the width of convolutional networks in isolation , as done by recent studies ( Chirkova et al. , 2020 ; Kondratyuk et al. , 2020 ) , is known to be far less effective to improve accuracy ( Eigen et al. , 2013 ; Ba and Caruana , 2014 ) . Single networks vs. ensembles . In this paper , we bridge the gap in the understanding of the design space by providing answers to the following questions . Given specific requirements in terms of accuracy , training time , and inference time , should we train and deploy a convolutional model with a single network or one that contains an ensemble of networks ? How should we design the networks within an ensemble ? As these constraints and requirements evolve , should we switch between these alternatives , why , and when ? Method . We introduce the following methodology to map the design space accurately . Since there is no robust theoretical framework to consistently analyze the design space and the complex interactions among its many parameters and metrics , we develop a detailed and extensive experimental framework to isolate the impact of the critical design knobs : ( i ) depth , ( ii ) width , and ( iii ) number of networks , on all relevant metrics : ( i ) accuracy , ( ii ) training time , ( iii ) inference time , and ( iv ) memory usage . Crucially the number of parameters is a control knob in our framework , and we only compare alternatives under the same parameter budget . To establish the robustness of our findings , we experiment across various architectures , data complexities , and classification tasks . We present and analyze data amounting to over one year of GPU run time . We also explain trends breaking down metrics into their constituents when necessary . Results : The Ensemble Switchover Threshold ( EST ) . ( i ) Contrary to conventional wisdom , we show that when we make a holistic and robust comparison between single convolutional networks and ensembles of networks , we discover a vast design space where ensembles provide not just better overall accuracy but also train faster compared to a single network . ( ii ) Specifically , we uncover the Ensemble Switchover Threshold ( EST ) . This is the amount of resources ( measured in terms of the number of parameters and training epochs ) beyond which ensembles provide superior generalization accuracy to a single model . ( iii ) We show that EST occurs consistently across numerous data sets and architectures . ( iv ) We demonstrate that the number of networks in an ensemble and their individual designs determine the EST . ( v ) Ensembles can also provide comparable inference times for a considerable part of the design space . ( vi ) We also show that ensembles require significantly less memory to train for the same number of parameters . ( vii ) Finally , we make available a superset of our results for visual exploration and help with model design at : daslab.seas.harvard.edu/more-or-less . , 2 FRAMEWORK : DESIGN SPACE . The design space we explore consists of single convolutional neural network models and two classes of architecturally-homogenous ensembles . These ensemble classes help isolate the effect of the two design knobs – depth and width – on the quality and cost of an ensemble design . We first describe how we ensure a robust comparison of alternative model designs and then explain the degrees of freedom we explore . Establishing grounds for fair ranking . A key element of our framework is that the possible model designs are compared to each other only under equivalent resources . We ensure this by only comparing designs that have the same number of parameters . This comparison allows us to separate the quality of a design from the amount of resources given to it . Another way to think about this is that given a parameter budget , we can investigate how the three design classes rank for all relevant metrics ( training and inference time , accuracy , and memory usage ) . We fix the number of parameters because of its two distinctive properties over other metrics ( that we could have fixed ) , such as training time , inference time , or accuracy : First , the number of parameters of a network is directly proportional to all other resource-related metrics ( Jain et al. , 2020 ; Wasay et al. , 2020 ) . Second , the number of parameters is independent of the hardware or the software platform used and can be computed exactly from a network specification . The single network versus ensemble design space . Our design space considers a convolutional neural network architecture S ( w , d ) from a class of neural network architectures C. S ( w , d ) has width factor w , depth d , and number of parameters |S| . Similarly an ensemble is described as E = { E1 . . . Ek } . Ensembles are architecturally-homogenous i.e. , all ensemble networks E1 . . . Ek have the same architecture and each network has |E|/k parameters . When we compare a single network S ( w , d ) from C with an ensemble E we ensure that E1 . . . Ek ∈ C and |E1|+. . .+|Ek| = |S| . The reason why we restrict the design space to homogenous ensembles is to reduce the otherwise intractably large space1 of all possible ensembles given a single network to a size that we can 1Given a single network with |S| number of parameters , there are { |S| k } ( Stirling number of the second kind ) as many ways of forming ensembles of size k. This number grows at a similar rate to exponential polynomials , ( Boyadzhiev , 2009 ) e.g. , { 100 4 } ≈ 1059. feasibly and thoroughly experiment with and reason about . Furthermore , many neural network ensembles introduced in research and used in practice are similarly homogenous , for instance , SnapShot Ensembles and Fast Geometric Ensembles ( Huang et al. , 2017a ; Garipov et al. , 2018 ) . Additionally , our method provides a deterministic procedure of going between single network models and ensembles given a certain amount of parameters . Major sources of diversity in neural network ensembles are random weight initialization and stochastic training , both of which we incorporate in our framework . Depth-equivalent and width-equivalent ensembles . Convolutional neural network architectures are determined by two design knobs – the depth and the width factor . Corresponding to these two design knobs , we create two classes of ensembles : depth-equivalent ensembles and width-equivalent ensembles . These are depicted in Figure 1 : In depth-equivalent ensembles , the depth of the individual ensemble networks is the same as S ( i.e. , d ) , and the width factor is set to the highest possible value ( i.e. , w′ ) without exceeding the parameter budget of |S| . In width-equivalent ensembles , on the other hand , the width factor is conserved across all ensemble networks ( i.e. , w ) , and the depth is modulated to the highest possible value ( i.e. , d′ ) without exceeding |S| : w′ : k · |E ( w ′ , d ) i | ≤ |S ( w , d ) | ≤ k · |E ( w ′+1 , d ) i | d ′ : k · |E ( w , d ′ ) i | ≤ |S ( w , d ) | ≤ k · |E ( w , d ′+1 ) i | The above definition follows that neural networks in depth-equivalent ensembles have higher depth than those in width-equivalent ensembles . Width-equivalent ensembles contain wider neural networks than their depth-equivalent counterparts . In this way , we isolate and study the effect of depth and width on ensemble accuracy and resource requirement . Overall , our design space spans three classes of convolutional neural network designs : ( i ) single network models , ( ii ) width-equivalent ensembles , and ( iii ) depth-equivalent ensembles . Every class contains several model designs instantiated by the four-tuple { w , d , |S| , C } . We next describe how we designed an exhaustive experimental framework to cover various configurations of these four-tuples .
This paper addresses when to use a single network model vs an ensemble of convolutional neural network models based on resource budgets. The authors challenge the notion that ensemble methods should only be used when resources are a non-issue. The authors compare single networks to width-equivalent and depth-equivalent ensemble methods for SVHN, cifar10, cifar100 and tiny imagenet across multiple network architectures and describe the 'Ensemble Switchover Threshold (EST)', the amount of resources beyond which ensembles provide better generalization accuracy than single models.
SP:934cb790cd96e5a81539938b05d63d0dcb82df0a
To be Robust or to be Fair: Towards Fairness in Adversarial Training
1 INTRODUCTION . The existence of adversarial examples ( Goodfellow et al. , 2014 ; Szegedy et al. , 2013 ) causes huge concerns when applying deep neural networks on safety-critical tasks , such as autonomous driving vehicles and face identification ( Morgulis et al. , 2019 ; Sharif et al. , 2016 ) . These adversarial examples are artificially crafted samples which do not change the semantic meaning of the natural samples , but can misguide the model to give wrong predictions . As countermeasures against the attack from adversarial examples , adversarial training algorithms aim to train classifier that can classify the input samples correctly even when they are adversarially perturbed . Namely , they optimize the model to have minimum adversarial risk of that a sample can be perturbed to be wrongly classified : min f E x [ max ||δ|≤ L ( f ( x+ δ ) , y ) ] These adversarial training methods ( Kurakin et al. , 2016 ; Madry et al. , 2017 ; Zhang et al. , 2019b ) have been shown to be one type of the most effective and reliable ways to improve the model robustness against adversarial attacks . Although promising to improve model ’ s robustness , recent studies show side-effects of adversarial training : it usually degrades model ’ s clean accuracy ( Tsipras et al. , 2018 ) . In our work , we find a new intriguing property about adversarial training algorithms : they usually result in a large disparity of accuracy and robustness between different classes . As a preliminary study in Section 2 , we apply natural training and PGD adversarial training ( Madry et al. , 2017 ) on the CIFAR10 dataset ( Krizhevsky et al. , 2009 ) using a ResNet18 ( He et al. , 2016 ) architecture . For a naturally trained model , the model performance in each class is similar . However , in the adversarially trained model , there is a severe performance discrepancy ( both accuracy and robustness ) of the model for data in different classes . For example , the model has high clean accuracy and robust accuracy ( 93 % and 67 % successful rate , separately ) on the samples from the class “ car ” , but much poorer performance on those “ cat ” images ( 59 % and 17 % successful rate ) . More preliminary results in Section 2 further show the similar “ unfair ” phenomenon from other datasets and models . Meanwhile , we find that this fairness issue does not appear in natural models which are trained on clean data . This fact demonstrates that adversarial training algorithms can indeed unequally help to improve model robustness for different data groups and unequally degrade their clean accuracy . 1The model ’ s accuracy on the input samples that have been adversarially perturbed . In this work we first define this problem as the unfairness problem of adversarial training algorithms . If this phenomenon happens in real-world applications , it can raise huge concerns about safety or even social ethics . Imagine that an adversarially trained traffic sign recognizer has overall high robustness , but it is very inaccurate and vulnerable to perturbations for some specific signs such as stop signs . The safety of this autonomous driving car is still not guaranteed . In such case , the safety of this recognizer depends on the worst class performance . Therefore , in addition to achieving overall performance , it is also essential to achieve fair accuracy and robustness among different classes , which can guarantee the worst performance . Meanwhile , this problem may also lead to the issues from social ethics perspectives , which are similar to traditional ML fairness problems ( Buolamwini & Gebru , 2018 ) . For example , a robustly trained face identification system might provide different qualitative levels of service safety for different ethnic communities . In this paper , we first explore the potential reason which may cause this unfair accuracy / unfair robustness problem . In particular , we aim to answer the question - “ Will adversarial training algorithms naturally cause unfairness problems , such as the disparity of clean accuracy and adversarial robustness between different classes ? ” To answer this question , we first propose a conceptual example under a mixture of two spherical Gaussian distributions which resembles to the previous work ( Tsipras et al. , 2018 ) but with different variances . In this setting , we hypothesize that adversarial training tends to only use robust features for model prediction , whose dimension is much lower than the non-robust feature space . In the lower dimensional space , an optimal linear model is more sensitive to the inherent data distributional difference and be biased when making predictions . Motivated by these empirical and theoretical findings , we then propose a Fair Robust Learning ( FRL ) framework to mitigate this unfairness issue , which is inspired from the traditional debiasing strategy to solve a series of cost-sensitive classification problems but we make specific effort to achieve the fairness goal in adversarial setting . Our main contributions can be summarized as following : ( a ) We discover the phenomenon of “ unfairness ” problem of adversarial training algorithms and implement empirical studies to present this problem can be general ; ( b ) We build a conceptual example to theoretically investigate the main reasons that cause this unfairness problem ; and ( c ) We propose a Fair Robust Learning ( FRL ) framework to mitigate the unfairness issue in adversarial setting . 2 PRELIMINARY STUDIES . CIFAR10 In this section , we present our preliminary studies to show that adversarial training algorithms usually present the unfairness issues , which are related to the strong disparity of clean accuracy and robustness among different classes . We implement algorithms including PGD adversarial training ( Madry et al. , 2017 ) and TRADES ( Zhang et al. , 2019b ) on the CIFAR10 dataset ( Krizhevsky et al. , 2009 ) . In CIFAR10 , we both naturally and adversarially train ResNet18 ( He & Garcia , 2009 ) models . In Figure 1 , we present list the the model ’ s accuracy and robustness performance ( under PGD attack by intensity 4/255 and 8/255 ) for each individual class . From the Figure 1 , we can observe that – for the naturally trained models , every class has similar clean accuracy ( around 90 ± 5 % ) and adversarial accuracy ( close to 0 % ) under the PGD attack . It suggests that naturally trained models do not have strong disparity of both clean and robustness performance among classes . However , for adversarially trained models ( under PGD Adv . Training or TRADES ) , the disparity phenomenon becomes severe . For example , a PGD-adversarially trained model has 59.1 % clean accuracy and 17.4 % adversarial accuracy for the samples in the class “ cat ” , which are much lower than the model ’ s overall performance . This phenomenon demonstrates that adversarial training algorithms can not provide the same help for the robustness for the samples in class “ cat ” as other classes , and unfairly degrades too much clean accuracy for “ cat ” . We list our empirical studies under more model architectures in Table 3 and more datasets ( GTRSB ( Stallkamp et al. , 2011 ) ) in Appendix A.2 , where we can find the similar observations . GTSRB We also investigate the fairness issue in German Traffic Sign Recognition Benchmark ( GTRSB ) ( Stallkamp et al. , 2011 ) . It consists of 43 classes of images from different traffic signs , with image sizes 32 × 32 × 3 . In this dataset we also both naturally and adversarially train a 3-Layer CNN classifier . We list the model ’ s performance and sort the classes in the order of decreasing clean accuracy and adv . accuracy . From the Figure 2 , we can see that for the naturally trained model ( left ) , most classes have high accuracy which is over 90 % , but for adversarial training , some classes ’ accuracy drops by a large margin . Meanwhile , adversarial training also unequally improves the model ’ s robustness against PGD attacks given that some classes have very low adversarial accuracy . In this dataset , both natural model and robust model have clear distinguished adversairal accuracy ( robustness ) among classes . 3 THEORETICAL ANALYSIS BASED ON A CONCEPTUAL EXAMPLE . From our preliminary studies , we always observe that adversarially trained models have huge performance disparity ( clean and adversarial accuracy ) between different groups . In this section , we try to understand the unfairness problem via theoretical analysis based on a binary classification problem on a mixture-Gaussian distribution , which is similar to ( Tsipras et al. , 2018 ) . We first state the necessary notions in this paper . Notations . In the following , we use f to denote the classification model which is a mapping f : X → Y from input data space X and output labels Y . Generally , naturally training will find the optimal f to minimize the overall clean error Rnat ( f ) = Pr . ( f ( x ) 6= y ) ; and adversarially training will minimize the overall robust errorRrob ( f ) = Pr . ( ∃δ , ||δ|| ≤ , s.t.f ( x+ δ ) 6= y ) . Specifically in the following binary classification problem , Y = { −1 , +1 } and each class ’ s clean error and robust error are denoted as the conditional probabilities : Rnat ( f , −1 ) = Pr . ( f ( x ) = +1|y = −1 ) , and Rrob ( f , −1 ) = Pr . ( ∃δ , ||δ|| ≤ , s.t.f ( x+ δ ) = +1|y = −1 ) , respectively . 3.1 A BINARY CLASSIFICATION TASK . Our study is motivated by ( Tsipras et al. , 2018 ) which uncovers one key behavior of adversarial training : it excludes high-dimensional non-robust features ( which are vulnerable to attack ) and only preserves lower-dimensional robust features for prediction . Thus , in our case , we assume our conceptual dataset has the data-label pairs ( x , y ) sampled from a distribution D follows : y u.a.r∼ { −1 , +1 } , θ = ( dim = m︷ ︸︸ ︷ γ , ... , γ , dim = d︷ ︸︸ ︷ η , ... , η ) , x ∼ { N ( θ , σ2+1I ) if y = +1 N ( −θ , σ2−1I ) if y = −1 ( 1 ) whereN ( θ , σ2+1I ) is a normal distribution with mean vector θ and covariance matrix σ2+1I and same for class “ -1 ” . Following the work ( Tsipras et al. , 2018 ) , we suppose that the feature space consists of two kinds of features : ( a ) robust features with center γ and dimension m ; and ( b ) non-robust features with center η and dimension d. We assume η < < γ , so an adversarial perturbation δ with intensity ||δ||∞ ≤ can manipulate a non-robust feature to have a different sign in expectation , but δ can not attack a robust feature . Usually , the non-robust features ’ dimension d is far higher than the robust features ’ dimension d , i.e. , ( m < < d ) . In our case , we assume that the 2 classes have a key difference between their variances : σ+1 : σ−1 = K : 1 , where K > 1 . In this theoretical example , our main hypothesis is that : the variance difference between 2 classes will not lead to strong disparity of model performance for a naturally trained model whose prediction is based on a high dimensional feature space . However , the variance difference can cause large performance gap ( both accuracy and robustness ) for adversarially trained models which are based on low-dimensional robust features . To illustrate this fact , we will explicitly calculate the 2 classes ’ clean and robust errors in the proposed distribution for both clean models and robust models .
The authors study adversarially trained classifiers and observe that the accuracy discrepancy between classes is larger than that of standard models. They then propose a theoretical model where this phenomenon provably arises. Finally, they propose a method to reduce the (standard and robust) accuracy discrepancy between classes, by adapting existing methods from the non-adversarial setting.
SP:29537439a3017e0d6982b9b819dd83ea0c3b20ab
To be Robust or to be Fair: Towards Fairness in Adversarial Training
1 INTRODUCTION . The existence of adversarial examples ( Goodfellow et al. , 2014 ; Szegedy et al. , 2013 ) causes huge concerns when applying deep neural networks on safety-critical tasks , such as autonomous driving vehicles and face identification ( Morgulis et al. , 2019 ; Sharif et al. , 2016 ) . These adversarial examples are artificially crafted samples which do not change the semantic meaning of the natural samples , but can misguide the model to give wrong predictions . As countermeasures against the attack from adversarial examples , adversarial training algorithms aim to train classifier that can classify the input samples correctly even when they are adversarially perturbed . Namely , they optimize the model to have minimum adversarial risk of that a sample can be perturbed to be wrongly classified : min f E x [ max ||δ|≤ L ( f ( x+ δ ) , y ) ] These adversarial training methods ( Kurakin et al. , 2016 ; Madry et al. , 2017 ; Zhang et al. , 2019b ) have been shown to be one type of the most effective and reliable ways to improve the model robustness against adversarial attacks . Although promising to improve model ’ s robustness , recent studies show side-effects of adversarial training : it usually degrades model ’ s clean accuracy ( Tsipras et al. , 2018 ) . In our work , we find a new intriguing property about adversarial training algorithms : they usually result in a large disparity of accuracy and robustness between different classes . As a preliminary study in Section 2 , we apply natural training and PGD adversarial training ( Madry et al. , 2017 ) on the CIFAR10 dataset ( Krizhevsky et al. , 2009 ) using a ResNet18 ( He et al. , 2016 ) architecture . For a naturally trained model , the model performance in each class is similar . However , in the adversarially trained model , there is a severe performance discrepancy ( both accuracy and robustness ) of the model for data in different classes . For example , the model has high clean accuracy and robust accuracy ( 93 % and 67 % successful rate , separately ) on the samples from the class “ car ” , but much poorer performance on those “ cat ” images ( 59 % and 17 % successful rate ) . More preliminary results in Section 2 further show the similar “ unfair ” phenomenon from other datasets and models . Meanwhile , we find that this fairness issue does not appear in natural models which are trained on clean data . This fact demonstrates that adversarial training algorithms can indeed unequally help to improve model robustness for different data groups and unequally degrade their clean accuracy . 1The model ’ s accuracy on the input samples that have been adversarially perturbed . In this work we first define this problem as the unfairness problem of adversarial training algorithms . If this phenomenon happens in real-world applications , it can raise huge concerns about safety or even social ethics . Imagine that an adversarially trained traffic sign recognizer has overall high robustness , but it is very inaccurate and vulnerable to perturbations for some specific signs such as stop signs . The safety of this autonomous driving car is still not guaranteed . In such case , the safety of this recognizer depends on the worst class performance . Therefore , in addition to achieving overall performance , it is also essential to achieve fair accuracy and robustness among different classes , which can guarantee the worst performance . Meanwhile , this problem may also lead to the issues from social ethics perspectives , which are similar to traditional ML fairness problems ( Buolamwini & Gebru , 2018 ) . For example , a robustly trained face identification system might provide different qualitative levels of service safety for different ethnic communities . In this paper , we first explore the potential reason which may cause this unfair accuracy / unfair robustness problem . In particular , we aim to answer the question - “ Will adversarial training algorithms naturally cause unfairness problems , such as the disparity of clean accuracy and adversarial robustness between different classes ? ” To answer this question , we first propose a conceptual example under a mixture of two spherical Gaussian distributions which resembles to the previous work ( Tsipras et al. , 2018 ) but with different variances . In this setting , we hypothesize that adversarial training tends to only use robust features for model prediction , whose dimension is much lower than the non-robust feature space . In the lower dimensional space , an optimal linear model is more sensitive to the inherent data distributional difference and be biased when making predictions . Motivated by these empirical and theoretical findings , we then propose a Fair Robust Learning ( FRL ) framework to mitigate this unfairness issue , which is inspired from the traditional debiasing strategy to solve a series of cost-sensitive classification problems but we make specific effort to achieve the fairness goal in adversarial setting . Our main contributions can be summarized as following : ( a ) We discover the phenomenon of “ unfairness ” problem of adversarial training algorithms and implement empirical studies to present this problem can be general ; ( b ) We build a conceptual example to theoretically investigate the main reasons that cause this unfairness problem ; and ( c ) We propose a Fair Robust Learning ( FRL ) framework to mitigate the unfairness issue in adversarial setting . 2 PRELIMINARY STUDIES . CIFAR10 In this section , we present our preliminary studies to show that adversarial training algorithms usually present the unfairness issues , which are related to the strong disparity of clean accuracy and robustness among different classes . We implement algorithms including PGD adversarial training ( Madry et al. , 2017 ) and TRADES ( Zhang et al. , 2019b ) on the CIFAR10 dataset ( Krizhevsky et al. , 2009 ) . In CIFAR10 , we both naturally and adversarially train ResNet18 ( He & Garcia , 2009 ) models . In Figure 1 , we present list the the model ’ s accuracy and robustness performance ( under PGD attack by intensity 4/255 and 8/255 ) for each individual class . From the Figure 1 , we can observe that – for the naturally trained models , every class has similar clean accuracy ( around 90 ± 5 % ) and adversarial accuracy ( close to 0 % ) under the PGD attack . It suggests that naturally trained models do not have strong disparity of both clean and robustness performance among classes . However , for adversarially trained models ( under PGD Adv . Training or TRADES ) , the disparity phenomenon becomes severe . For example , a PGD-adversarially trained model has 59.1 % clean accuracy and 17.4 % adversarial accuracy for the samples in the class “ cat ” , which are much lower than the model ’ s overall performance . This phenomenon demonstrates that adversarial training algorithms can not provide the same help for the robustness for the samples in class “ cat ” as other classes , and unfairly degrades too much clean accuracy for “ cat ” . We list our empirical studies under more model architectures in Table 3 and more datasets ( GTRSB ( Stallkamp et al. , 2011 ) ) in Appendix A.2 , where we can find the similar observations . GTSRB We also investigate the fairness issue in German Traffic Sign Recognition Benchmark ( GTRSB ) ( Stallkamp et al. , 2011 ) . It consists of 43 classes of images from different traffic signs , with image sizes 32 × 32 × 3 . In this dataset we also both naturally and adversarially train a 3-Layer CNN classifier . We list the model ’ s performance and sort the classes in the order of decreasing clean accuracy and adv . accuracy . From the Figure 2 , we can see that for the naturally trained model ( left ) , most classes have high accuracy which is over 90 % , but for adversarial training , some classes ’ accuracy drops by a large margin . Meanwhile , adversarial training also unequally improves the model ’ s robustness against PGD attacks given that some classes have very low adversarial accuracy . In this dataset , both natural model and robust model have clear distinguished adversairal accuracy ( robustness ) among classes . 3 THEORETICAL ANALYSIS BASED ON A CONCEPTUAL EXAMPLE . From our preliminary studies , we always observe that adversarially trained models have huge performance disparity ( clean and adversarial accuracy ) between different groups . In this section , we try to understand the unfairness problem via theoretical analysis based on a binary classification problem on a mixture-Gaussian distribution , which is similar to ( Tsipras et al. , 2018 ) . We first state the necessary notions in this paper . Notations . In the following , we use f to denote the classification model which is a mapping f : X → Y from input data space X and output labels Y . Generally , naturally training will find the optimal f to minimize the overall clean error Rnat ( f ) = Pr . ( f ( x ) 6= y ) ; and adversarially training will minimize the overall robust errorRrob ( f ) = Pr . ( ∃δ , ||δ|| ≤ , s.t.f ( x+ δ ) 6= y ) . Specifically in the following binary classification problem , Y = { −1 , +1 } and each class ’ s clean error and robust error are denoted as the conditional probabilities : Rnat ( f , −1 ) = Pr . ( f ( x ) = +1|y = −1 ) , and Rrob ( f , −1 ) = Pr . ( ∃δ , ||δ|| ≤ , s.t.f ( x+ δ ) = +1|y = −1 ) , respectively . 3.1 A BINARY CLASSIFICATION TASK . Our study is motivated by ( Tsipras et al. , 2018 ) which uncovers one key behavior of adversarial training : it excludes high-dimensional non-robust features ( which are vulnerable to attack ) and only preserves lower-dimensional robust features for prediction . Thus , in our case , we assume our conceptual dataset has the data-label pairs ( x , y ) sampled from a distribution D follows : y u.a.r∼ { −1 , +1 } , θ = ( dim = m︷ ︸︸ ︷ γ , ... , γ , dim = d︷ ︸︸ ︷ η , ... , η ) , x ∼ { N ( θ , σ2+1I ) if y = +1 N ( −θ , σ2−1I ) if y = −1 ( 1 ) whereN ( θ , σ2+1I ) is a normal distribution with mean vector θ and covariance matrix σ2+1I and same for class “ -1 ” . Following the work ( Tsipras et al. , 2018 ) , we suppose that the feature space consists of two kinds of features : ( a ) robust features with center γ and dimension m ; and ( b ) non-robust features with center η and dimension d. We assume η < < γ , so an adversarial perturbation δ with intensity ||δ||∞ ≤ can manipulate a non-robust feature to have a different sign in expectation , but δ can not attack a robust feature . Usually , the non-robust features ’ dimension d is far higher than the robust features ’ dimension d , i.e. , ( m < < d ) . In our case , we assume that the 2 classes have a key difference between their variances : σ+1 : σ−1 = K : 1 , where K > 1 . In this theoretical example , our main hypothesis is that : the variance difference between 2 classes will not lead to strong disparity of model performance for a naturally trained model whose prediction is based on a high dimensional feature space . However , the variance difference can cause large performance gap ( both accuracy and robustness ) for adversarially trained models which are based on low-dimensional robust features . To illustrate this fact , we will explicitly calculate the 2 classes ’ clean and robust errors in the proposed distribution for both clean models and robust models .
This paper introduces a fairness perspective on accuracy performance among distinct classes in the context of adversarial training. It makes an observation that adversarial training algorithms (Madry et al. 2017, Zhang et al. 2019) yield biased performances on CIFAR 10. It also offers a theoretical study under a Gaussian mixture setting that respects Eq. (1). Three versions of fair robust algorithms are proposed and evaluated on CIFAR 10.
SP:29537439a3017e0d6982b9b819dd83ea0c3b20ab
Inductive Representation Learning in Temporal Networks via Causal Anonymous Walks
1 INTRODUCTION . Temporal networks consider dynamically interacting elements as nodes , interactions as temporal links , with labels of when those interactions happen . Such temporal networks provide abstractions to study many real-world dynamic systems ( Holme & Saramäki , 2012 ) . Researchers have investigated temporal networks in recent several decades and concluded many insightful laws that essentially reflect how these real-world systems evolve over time ( Kovanen et al. , 2011 ; Benson et al. , 2016 ; Paranjape et al. , 2017 ; Zitnik et al. , 2019 ) . For example , the law of triadic closure in social networks , describing that two nodes with common neighbors tend to have a mutual interaction later , reflects how people establish social connections ( Simmel , 1950 ) . Later , a more elaborate law on the correlation between the interaction frequency between two individuals and the degree that they share social connections , further got demonstrated ( Granovetter , 1973 ; Toivonen et al. , 2007 ) . Feedforward control loops that consist of a direct interaction ( from node w to node u ) and an indirect interaction ( from w through another node v to u ) , also work as a law in the modulation of gene regulatory systems ( Mangan & Alon , 2003 ) and also as the control principles of many engineering systems ( Gorochowski et al. , 2018 ) . Although research on temporal networks has achieved the above success , it can hardly be generalized to study more complicated laws : Researchers have to investigate an exponentially increasing number of patterns when incorporating more interacting elements let alone their time-evolving aspects . Recently , representation learning , via learning vector representations of data based on neural networks , has offered unprecedented possibilities to extract , albeit implicitly , more complex structural patterns ( Hamilton et al. , 2017b ; Battaglia et al. , 2018 ) . However , as opposed to the study on static networks , representation learning of temporal networks is far from mature . Two challenges on temporal networks have been frequently discussed . First , the entanglement of structural and temporal ∗Project website with code and data : http : //snap.stanford.edu/caw/ 𝑡3 𝑤 Triadic closure ( 𝑡1 , 𝑡2 < 𝑡3 ) Law explanation : Two nodes that share a common node directly connected to them tend to be connected . uw vw 𝑢 𝑣 𝑤 𝑢 𝑣 𝑤 Feed-forward control ( 𝑡1 < 𝑡2 < 𝑡3 ) 𝑢 𝑣 𝑤 𝑢 𝑣 𝑡1 𝑡2 𝑡1 𝑡2 𝑡1 𝑡2 𝑡1 𝑡2 𝑡3 𝑡1 𝑡2 Law explanation : One node ( w ) activates another node first ( u ) and then activates a third node ( v ) . Mostly the third node will inhibit the second node later . uw vw 𝑡1 𝑡2 CAWs extracted : CAWs extracted : , , Figure 1 : Triadic closure and feed-forward loops : Causal anonymous walks ( CAW ) capture the laws . Example : three 3-step walks ( 𝑡𝑥 , 𝑋 are the default timestamp and the default node when no historical links can be found ) Backtrack m-step random walks over time before t=10 : u b a c 6 3 1 𝑀 walks starting at 𝒖 𝒗𝒖 𝑡 = 10 ? 0,3,8 3,6 4 , 5 3,9 7,9 2 4,88 9 e d b c a g h1 0,3,7 … v e u b 8 7 6 𝑀 walks starting at 𝒗 … u b a c 6 3 1 u c b a 5 3 0 3 u b a x3 0 𝑡𝑥 v e u b 8 7 6 v d u3 2 v g h v 9 7 4 x𝑆𝑣 : 𝑆𝑢 : 0 , 2 , 1 , 0 𝑇 𝑡𝑥 u b a c 16 3 6 𝐼𝐶𝐴𝑊 𝑏𝐼𝐶𝐴𝑊 𝑢 3 𝐼𝐶𝐴𝑊 𝑎 1 𝐼𝐶𝐴𝑊 𝑐 Anonymize : Causality Extraction Set-based Anonymization ✓ ✓ ✓ ✓ 0 , 0 , 0 , 1 𝑇 Count number of 𝑏 ’ s in different positions : 𝐼𝐶𝐴𝑊 𝑏 ; 𝑆𝑢 , 𝑆𝑣 = 𝑔 𝑏 ; 𝑆𝑢 , 𝑔 𝑏 ; 𝑆𝑣 ( Relative node identity ) A temporal graph with timestamped links and a queried link at certain time : Figure 2 : Causal anonymous walks ( CAW ) : causality extraction and set-based anonymization . patterns required an elegant model to digest the two-side information . Second , the model scalability becomes more crucial over temporal networks as new arriving links need to be processed timely while a huge link set due to the repetitive links between two nodes needs to be digested simultaneously . In contrast to the above two challenges , another challenge , the inductive capability of the temporalnetwork representation , is often ignored . However , it is equally important if not more , as the inductive capability indicates whether the models indeed capture the dynamic laws of the systems and can be further generalized to the system that share the same laws but have not been used to train these models . These laws may only depend on structures such as the triadic closure or feed-forward control loops as aforementioned . These laws may also correlate with node attributes , such as interactions between people affected by their gender and age ( Kovanen et al. , 2013 ) . But in both cases , the laws should be independent from network node identities . Although previous works tend to learn inductive models by removing node identities ( Trivedi et al. , 2019 ; Xu et al. , 2020 ) , they run into other issues to inductively represent the dynamic laws , for which we leave more detailed discussion in Sec . 2 . Here we propose Causal Anonymous Walks ( CAW ) for modeling temporal networks . Our idea for inductive learning is inspired by the recent investigation on temporal network motifs that correspond to connected subgraphs with links that appear within a restricted time range ( Kovanen et al. , 2011 ; Paranjape et al. , 2017 ) . Temporal network motifs essentially reflect network dynamics : Both triadic closure and feed-forward control can be viewed as temporal network motifs evolving ( Fig . 1 ) ; An inductive model should predict the 3rd link in both cases when it captures the correlation of these two links as they share a common node , while the model is agnostic to the node identities of these motifs . Our CAW model has two important properties ( Fig . 2 ) : ( 1 ) Causality extraction — a CAW starts from a link of interest and backtracks several adjacent links over time to encode the underlying causality of network dynamics . Each walk essentially gives a temporal network motif ; ( 2 ) Set-based anonymization — CAWs remove the node identities over the walks to guarantee inductive learning while encoding relative node identities based on the counts that they appear at a certain position according to a set of sampled walks . Relative node identities guarantee that the structures of motifs and their correlations are still kept after removing node identities . To predict temporal links between two nodes of interest , we propose a model CAW-Network ( CAW-N ) that samples a few CAWs related to the two nodes of interest , encodes and aggregates these CAWs via RNNs ( Rumelhart et al. , 1986 ) and set-pooling respectively to make the prediction . Experiments show that CAW-N is extremely effective . CAW-N does not need to enumerate the types of motifs and count their numbers that have been used as features to predict network dynamics ( Lahiri & Berger-Wolf , 2007 ; Rahman & Al Hasan , 2016 ; Rossi et al. , 2019 ; AbuOda et al. , 2019 ; Li & Milenkovic , 2017 ) , which significantly saves feature-engineering effort . CAW-N also keeps all fine-grained temporal information along the walks that may be removed by directly counting motifs ( Ahmed et al. , 2015 ; Paranjape et al. , 2017 ) . CAWs share a similar idea as anonymous walks ( AW ) ( Micali & Zhu , 2016 ) to remove node identities . However , AWs have only been used for entire static graph embedding ( Ivanov & Burnaev , 2018 ) and are not directedly applied to represent temporal networks : AWs can not capture causality ; AWs get anonymized based on each single walk and hence lose the correlation between network motifs . In contrast , CAWs capture all the information , temporal , structural , motif-correlation that are needed , to represent temporal networks . We conclude our contributions in three-folds : ( 1 ) A novel approach to represent temporal network CAW-N is proposed , which leverages CAWs to encode temporal network motifs to capture network dynamics while keeping fully inductive . CAW-N is evaluated to predict links over 6 real-world temporal networks . CAW-N outperforms all SOTA methods by about 15 % averaged over 6 networks in the inductive setting and also significantly beat all SOTA methods over 5 networks in the transductive setting ; ( 2 ) CAW-N significantly decreases the feature-engineering effort in traditional motif selection and counting approaches and keeps fine-grained temporal information ; ( 3 ) CAW-N is paired with a CAW sampling method with constant memory and time cost , which conduces to online learning . 2 RELATED WORK . Prior work on representation learning of temporal networks preprocesses the networks by simply aggregating the sequence of links within consecutive time windows into network snapshots , and use graph neural networks ( GNN ) ( Scarselli et al. , 2008 ; Kipf & Welling , 2017 ) and RNNs or transformer networks ( Vaswani et al. , 2017 ) to encode structural patterns and temporal patterns respectively ( Pareja et al. , 2020 ; Manessi et al. , 2020 ; Goyal et al. , 2020 ; Hajiramezanali et al. , 2019 ; Sankar et al. , 2020 ) . The main drawback of these approaches is that they need to predetermine a time granularity for link aggregation , which is hard to learn structural dynamics in different time scales . Therefore , approaches that work on link streams directly have been recently proposed ( Trivedi et al. , 2017 ; 2019 ; Kumar et al. , 2019 ; Xu et al. , 2020 ) . Know-E ( Trivedi et al. , 2017 ) , DyRep ( Trivedi et al. , 2019 ) and JODIE ( Kumar et al. , 2019 ) use RNNs to propagate messages across interactions to update node representations . Know-E , JODIE consider message exchanges between two directly interacted nodes while DyRep considers an additional hop of interactions . Therefore , DyRep gives a more expressive model at a cost of high complexity . TGAT ( Xu et al. , 2020 ) in contrast mimics GraphSAGE ( Hamilton et al. , 2017a ) and GAT ( Veličković et al. , 2018 ) to propagate messages in a GNN-like way from sampled historical neighbors of a node of interest . TGAT ’ s sampling strategy requires to store all historical neighbors , which is unscalable for online learning . Our CAW-N directly works on link streams and only requires to memorize constant many most recent links for each node . Most of the above models are not inductive because they associate each node with an onehot identity ( or the corresponding row of the adjacency matrix , or a free-trained vector ) ( Li et al. , 2018 ; Chen et al. , 2019 ; Kumar et al. , 2019 ; Hajiramezanali et al. , 2019 ; Sankar et al. , 2020 ; Manessi et al. , 2020 ; Goyal et al. , 2020 ) . TGAT ( Xu et al. , 2020 ) claimed to be inductive by removing node identities and just encoding link timestamps and attributes . However , TGAT was only evaluated over networks with rich link attributes , where the structural dynamics is not captured essentially : If we focus on structural dynamics only , it is easy to show a case when TGAT confuses node representations and will fail : Suppose in the history , two node pairs { a , b } and { a′ , b′ } only interact within each pair but share the timestamps ( Fig . 3 ) . Intuitively , a proper model should predict that future links still appear within each pair . However , TGAT can not distinguish a v.s . a′ , and b v.s . b′ , which leads to incorrect prediction . Note that GraphSAGE ( Hamilton et al. , 2017a ) and GAT ( Veličković et al. , 2018 ) also share the similar issue when representing static networks for link prediction ( Zhang et al. , 2020 ; Srinivasan & Ribeiro , 2019 ) . DyRep ( Trivedi et al. , 2019 ) is able to relieve such ambiguity by merging node representations with their neighbors ’ via RNNs . However , when DyRep runs over a new network , it frequently encounters node representations unseen during its training and will fail to make correct prediction . 6 Return { Wi|1 ≤ i ≤M } ; Our CAW-N removes node identities and leverages relative node identities to avoid the issue in Fig . 3 . Detailed explanations are given in Sec.4.2 . Network-embedding approaches may also be applied to temporal networks ( Zhou et al. , 2018 ; Du et al. , 2018 ; Mahdavi et al. , 2018 ; Singer et al. , 2019 ; Nguyen et al. , 2018 ) . However , they directly assign each node with a learnable vector . Therefore , they are not inductive and can not digest attributes .
The authors provide in-depth analysis on the critical topic of capturing dynamic laws for the inductive representation learning of temporal graphs. The authors leverage the causal anonymous walk to capture the topological laws of the dynamic graph, while not requiring to memorize node identities such that inductive learning is still feasible. Compared with the previous work, the paper emphasizes on scenarios where node/edge attributes are less informative of the inductive reasoning. Some workaround methods are also proposed to deal with the edge features and to enable the efficient computation and sampling procedure.
SP:de83ec082fee45976ef980f33e068a32da3fdcd9
Inductive Representation Learning in Temporal Networks via Causal Anonymous Walks
1 INTRODUCTION . Temporal networks consider dynamically interacting elements as nodes , interactions as temporal links , with labels of when those interactions happen . Such temporal networks provide abstractions to study many real-world dynamic systems ( Holme & Saramäki , 2012 ) . Researchers have investigated temporal networks in recent several decades and concluded many insightful laws that essentially reflect how these real-world systems evolve over time ( Kovanen et al. , 2011 ; Benson et al. , 2016 ; Paranjape et al. , 2017 ; Zitnik et al. , 2019 ) . For example , the law of triadic closure in social networks , describing that two nodes with common neighbors tend to have a mutual interaction later , reflects how people establish social connections ( Simmel , 1950 ) . Later , a more elaborate law on the correlation between the interaction frequency between two individuals and the degree that they share social connections , further got demonstrated ( Granovetter , 1973 ; Toivonen et al. , 2007 ) . Feedforward control loops that consist of a direct interaction ( from node w to node u ) and an indirect interaction ( from w through another node v to u ) , also work as a law in the modulation of gene regulatory systems ( Mangan & Alon , 2003 ) and also as the control principles of many engineering systems ( Gorochowski et al. , 2018 ) . Although research on temporal networks has achieved the above success , it can hardly be generalized to study more complicated laws : Researchers have to investigate an exponentially increasing number of patterns when incorporating more interacting elements let alone their time-evolving aspects . Recently , representation learning , via learning vector representations of data based on neural networks , has offered unprecedented possibilities to extract , albeit implicitly , more complex structural patterns ( Hamilton et al. , 2017b ; Battaglia et al. , 2018 ) . However , as opposed to the study on static networks , representation learning of temporal networks is far from mature . Two challenges on temporal networks have been frequently discussed . First , the entanglement of structural and temporal ∗Project website with code and data : http : //snap.stanford.edu/caw/ 𝑡3 𝑤 Triadic closure ( 𝑡1 , 𝑡2 < 𝑡3 ) Law explanation : Two nodes that share a common node directly connected to them tend to be connected . uw vw 𝑢 𝑣 𝑤 𝑢 𝑣 𝑤 Feed-forward control ( 𝑡1 < 𝑡2 < 𝑡3 ) 𝑢 𝑣 𝑤 𝑢 𝑣 𝑡1 𝑡2 𝑡1 𝑡2 𝑡1 𝑡2 𝑡1 𝑡2 𝑡3 𝑡1 𝑡2 Law explanation : One node ( w ) activates another node first ( u ) and then activates a third node ( v ) . Mostly the third node will inhibit the second node later . uw vw 𝑡1 𝑡2 CAWs extracted : CAWs extracted : , , Figure 1 : Triadic closure and feed-forward loops : Causal anonymous walks ( CAW ) capture the laws . Example : three 3-step walks ( 𝑡𝑥 , 𝑋 are the default timestamp and the default node when no historical links can be found ) Backtrack m-step random walks over time before t=10 : u b a c 6 3 1 𝑀 walks starting at 𝒖 𝒗𝒖 𝑡 = 10 ? 0,3,8 3,6 4 , 5 3,9 7,9 2 4,88 9 e d b c a g h1 0,3,7 … v e u b 8 7 6 𝑀 walks starting at 𝒗 … u b a c 6 3 1 u c b a 5 3 0 3 u b a x3 0 𝑡𝑥 v e u b 8 7 6 v d u3 2 v g h v 9 7 4 x𝑆𝑣 : 𝑆𝑢 : 0 , 2 , 1 , 0 𝑇 𝑡𝑥 u b a c 16 3 6 𝐼𝐶𝐴𝑊 𝑏𝐼𝐶𝐴𝑊 𝑢 3 𝐼𝐶𝐴𝑊 𝑎 1 𝐼𝐶𝐴𝑊 𝑐 Anonymize : Causality Extraction Set-based Anonymization ✓ ✓ ✓ ✓ 0 , 0 , 0 , 1 𝑇 Count number of 𝑏 ’ s in different positions : 𝐼𝐶𝐴𝑊 𝑏 ; 𝑆𝑢 , 𝑆𝑣 = 𝑔 𝑏 ; 𝑆𝑢 , 𝑔 𝑏 ; 𝑆𝑣 ( Relative node identity ) A temporal graph with timestamped links and a queried link at certain time : Figure 2 : Causal anonymous walks ( CAW ) : causality extraction and set-based anonymization . patterns required an elegant model to digest the two-side information . Second , the model scalability becomes more crucial over temporal networks as new arriving links need to be processed timely while a huge link set due to the repetitive links between two nodes needs to be digested simultaneously . In contrast to the above two challenges , another challenge , the inductive capability of the temporalnetwork representation , is often ignored . However , it is equally important if not more , as the inductive capability indicates whether the models indeed capture the dynamic laws of the systems and can be further generalized to the system that share the same laws but have not been used to train these models . These laws may only depend on structures such as the triadic closure or feed-forward control loops as aforementioned . These laws may also correlate with node attributes , such as interactions between people affected by their gender and age ( Kovanen et al. , 2013 ) . But in both cases , the laws should be independent from network node identities . Although previous works tend to learn inductive models by removing node identities ( Trivedi et al. , 2019 ; Xu et al. , 2020 ) , they run into other issues to inductively represent the dynamic laws , for which we leave more detailed discussion in Sec . 2 . Here we propose Causal Anonymous Walks ( CAW ) for modeling temporal networks . Our idea for inductive learning is inspired by the recent investigation on temporal network motifs that correspond to connected subgraphs with links that appear within a restricted time range ( Kovanen et al. , 2011 ; Paranjape et al. , 2017 ) . Temporal network motifs essentially reflect network dynamics : Both triadic closure and feed-forward control can be viewed as temporal network motifs evolving ( Fig . 1 ) ; An inductive model should predict the 3rd link in both cases when it captures the correlation of these two links as they share a common node , while the model is agnostic to the node identities of these motifs . Our CAW model has two important properties ( Fig . 2 ) : ( 1 ) Causality extraction — a CAW starts from a link of interest and backtracks several adjacent links over time to encode the underlying causality of network dynamics . Each walk essentially gives a temporal network motif ; ( 2 ) Set-based anonymization — CAWs remove the node identities over the walks to guarantee inductive learning while encoding relative node identities based on the counts that they appear at a certain position according to a set of sampled walks . Relative node identities guarantee that the structures of motifs and their correlations are still kept after removing node identities . To predict temporal links between two nodes of interest , we propose a model CAW-Network ( CAW-N ) that samples a few CAWs related to the two nodes of interest , encodes and aggregates these CAWs via RNNs ( Rumelhart et al. , 1986 ) and set-pooling respectively to make the prediction . Experiments show that CAW-N is extremely effective . CAW-N does not need to enumerate the types of motifs and count their numbers that have been used as features to predict network dynamics ( Lahiri & Berger-Wolf , 2007 ; Rahman & Al Hasan , 2016 ; Rossi et al. , 2019 ; AbuOda et al. , 2019 ; Li & Milenkovic , 2017 ) , which significantly saves feature-engineering effort . CAW-N also keeps all fine-grained temporal information along the walks that may be removed by directly counting motifs ( Ahmed et al. , 2015 ; Paranjape et al. , 2017 ) . CAWs share a similar idea as anonymous walks ( AW ) ( Micali & Zhu , 2016 ) to remove node identities . However , AWs have only been used for entire static graph embedding ( Ivanov & Burnaev , 2018 ) and are not directedly applied to represent temporal networks : AWs can not capture causality ; AWs get anonymized based on each single walk and hence lose the correlation between network motifs . In contrast , CAWs capture all the information , temporal , structural , motif-correlation that are needed , to represent temporal networks . We conclude our contributions in three-folds : ( 1 ) A novel approach to represent temporal network CAW-N is proposed , which leverages CAWs to encode temporal network motifs to capture network dynamics while keeping fully inductive . CAW-N is evaluated to predict links over 6 real-world temporal networks . CAW-N outperforms all SOTA methods by about 15 % averaged over 6 networks in the inductive setting and also significantly beat all SOTA methods over 5 networks in the transductive setting ; ( 2 ) CAW-N significantly decreases the feature-engineering effort in traditional motif selection and counting approaches and keeps fine-grained temporal information ; ( 3 ) CAW-N is paired with a CAW sampling method with constant memory and time cost , which conduces to online learning . 2 RELATED WORK . Prior work on representation learning of temporal networks preprocesses the networks by simply aggregating the sequence of links within consecutive time windows into network snapshots , and use graph neural networks ( GNN ) ( Scarselli et al. , 2008 ; Kipf & Welling , 2017 ) and RNNs or transformer networks ( Vaswani et al. , 2017 ) to encode structural patterns and temporal patterns respectively ( Pareja et al. , 2020 ; Manessi et al. , 2020 ; Goyal et al. , 2020 ; Hajiramezanali et al. , 2019 ; Sankar et al. , 2020 ) . The main drawback of these approaches is that they need to predetermine a time granularity for link aggregation , which is hard to learn structural dynamics in different time scales . Therefore , approaches that work on link streams directly have been recently proposed ( Trivedi et al. , 2017 ; 2019 ; Kumar et al. , 2019 ; Xu et al. , 2020 ) . Know-E ( Trivedi et al. , 2017 ) , DyRep ( Trivedi et al. , 2019 ) and JODIE ( Kumar et al. , 2019 ) use RNNs to propagate messages across interactions to update node representations . Know-E , JODIE consider message exchanges between two directly interacted nodes while DyRep considers an additional hop of interactions . Therefore , DyRep gives a more expressive model at a cost of high complexity . TGAT ( Xu et al. , 2020 ) in contrast mimics GraphSAGE ( Hamilton et al. , 2017a ) and GAT ( Veličković et al. , 2018 ) to propagate messages in a GNN-like way from sampled historical neighbors of a node of interest . TGAT ’ s sampling strategy requires to store all historical neighbors , which is unscalable for online learning . Our CAW-N directly works on link streams and only requires to memorize constant many most recent links for each node . Most of the above models are not inductive because they associate each node with an onehot identity ( or the corresponding row of the adjacency matrix , or a free-trained vector ) ( Li et al. , 2018 ; Chen et al. , 2019 ; Kumar et al. , 2019 ; Hajiramezanali et al. , 2019 ; Sankar et al. , 2020 ; Manessi et al. , 2020 ; Goyal et al. , 2020 ) . TGAT ( Xu et al. , 2020 ) claimed to be inductive by removing node identities and just encoding link timestamps and attributes . However , TGAT was only evaluated over networks with rich link attributes , where the structural dynamics is not captured essentially : If we focus on structural dynamics only , it is easy to show a case when TGAT confuses node representations and will fail : Suppose in the history , two node pairs { a , b } and { a′ , b′ } only interact within each pair but share the timestamps ( Fig . 3 ) . Intuitively , a proper model should predict that future links still appear within each pair . However , TGAT can not distinguish a v.s . a′ , and b v.s . b′ , which leads to incorrect prediction . Note that GraphSAGE ( Hamilton et al. , 2017a ) and GAT ( Veličković et al. , 2018 ) also share the similar issue when representing static networks for link prediction ( Zhang et al. , 2020 ; Srinivasan & Ribeiro , 2019 ) . DyRep ( Trivedi et al. , 2019 ) is able to relieve such ambiguity by merging node representations with their neighbors ’ via RNNs . However , when DyRep runs over a new network , it frequently encounters node representations unseen during its training and will fail to make correct prediction . 6 Return { Wi|1 ≤ i ≤M } ; Our CAW-N removes node identities and leverages relative node identities to avoid the issue in Fig . 3 . Detailed explanations are given in Sec.4.2 . Network-embedding approaches may also be applied to temporal networks ( Zhou et al. , 2018 ; Du et al. , 2018 ; Mahdavi et al. , 2018 ; Singer et al. , 2019 ; Nguyen et al. , 2018 ) . However , they directly assign each node with a learnable vector . Therefore , they are not inductive and can not digest attributes .
This paper proposes Causal Anonymous Walks (CAWs) that are extracted by temporal random walks and work as automatic retrieval of temporal network motifs to represent network dynamics while avoiding the time-consuming selection and counting of those motifs. CAWs adopt an anonymization strategy that replaces node identities with the hitting counts of the nodes based on a set of sampled walks to keep the method inductive, and simultaneously establish the correlation between motifs. CAW-N to encode CAWs with a neural network model. CAW-N was evaluated to predict links over 6 real temporal showed better AUC gain compared to baselines.
SP:de83ec082fee45976ef980f33e068a32da3fdcd9
Deep Partial Updating
1 INTRODUCTION . To deploy deep neural networks ( DNNs ) on resource-constrained edge devices , extensive research has been done to compress a well-trained model via pruning ( Han et al. , 2016 ; Renda et al. , 2020 ) and quantization ( Courbariaux et al. , 2015 ; Rastegari et al. , 2016 ) . During on-device inference , compressed networks may achieve a good balance between model performance ( e.g. , prediction accuracy ) and resource demand ( e.g. , memory , computation , energy ) . However , due to the lack of relevant training data or an unknown sensing environment , pre-trained DNN models may not yield satisfactory performance . Retraining the model leveraging newly collected data ( from edge devices or from other sources ) is needed for desirable performance . Example application scenarios of relevance include vision robotic sensing in an unknown environment ( e.g. , Mars ) ( Meng et al. , 2017 ) , local translators on mobile phones ( Bhandare et al. , 2019 ) , and acoustic sensor networks deployed in Alpine environments ( Meyer et al. , 2019 ) . It is mostly impossible to perform on-device retraining on edge devices due to their resourceconstrained nature . Instead , retraining often occurs on a remote server with sufficient resources . One possible strategy to continuously improve the model performance on edge devices is a two-stage iterative process : ( i ) at each round , edge devices collect new data samples and send them to the server , and ( ii ) the server retrains the network using all collected data , and then sends the updates to each edge device ( Brown & Sreenan , 2006 ) . An essential challenge herein is that the transmissions in the second stage are highly constrained by the limited communication resource ( e.g. , bandwidth , energy ) in comparison to the first stage . State-of-the-art DNN models always require tens or even hundreds of mega-Bytes ( MB ) to store parameters , whereas a single batch of data samples ( a number of samples that can lead to reasonable updates in batch training ) needs a relatively smaller amount of data . For example , for CIFAR10 dataset ( Krizhevsky et al. , 2009 ) , the weights of a popular VGGNet require 56.09MB storage , while one batch of 128 samples only uses around 0.40MB ( Simonyan & Zisserman , 2015 ; Rastegari et al. , 2016 ) . As an alternative , the server sends a full update once or rarely . But in this case , every node will suffer from a low performance until such an update occurs . Besides , edge devices could decide on and send only critical samples by using active learning schemes ( Ash et al. , 2020 ) . The server may also receive training data from other sources , e.g. , through data augmentation or new data collection campaigns . These considerations indicate that the updated weights which are sent to edge devices by the server at the second stage become a major bottleneck . To resolve the above challenges pertaining to updating the network , we propose to partially update the network through changing only a small subset of the weights at each round . Doing so can significantly reduce the server-to-device communication overhead . Furthermore , fewer parameter updates also lead to less memory access on edge devices , which in turn results in smaller energy consumption related to ( compressed ) full updating ( Horowitz , 2014 ) . Our goal of performing partial updating is to determine which subset of weights shall be updated at each round , such that a similar accuracy can be achieved compared to fully updating all weights . Our key concept for partial updating is based on the hypothesis , that a weight shall be updated only if it has a large contribution to the loss reduction given the newly collected data samples . Specially , we define a binary mask m to describe which weights are subject to update , i.e. , mi = 1 implies updating this weight andmi = 0 implies fixing the weight to its initial value . For any m , we establish an analytical upper bound on the difference between the loss value under partial updating and that under full updating . We determine an optimized mask m by combining two different view points : ( i ) measuring the “ global contribution ” of each weight to the upper bound through computing the Euclidean distance , and ( ii ) measuring each weight ’ s “ local contribution ” within each optimization step using gradient-related information . The weights to be updated according to m will be further sparsely fine-tuned while the remaining weights are rewound to their initial values . Related Work . Although partial updating has been adopted in some prior works , it is conducted in a fairly coarse-grained manner , e.g. , layer-wise or neuron-wise , and targets at completely different objectives . Especially , under continual learning settings , ( Yoon et al. , 2018 ; Jung et al. , 2020 ) propose to freeze all weights related to the neurons which are more critical in performing prior tasks than new ones , to preserve existing knowledge . Under adversarial attack settings , ( Shokri & Shmatikov , 2015 ) updates the weights in the first several layers only , which yield a dominating impact on the extracted features , for better attack efficacy . Under architecture generalization settings , ( Chatterji et al. , 2020 ) studies the generalization performance through the resulting loss degradation when rewinding the weights of each individual layer to their initial values . Unfortunately , such techniques can not be applied in our problem setting which seeks a fine-grained , i.e. , weight-wise , partial updating given newly collected training samples in an iterative manner . The communication cost could also be reduced through some other techniques , e.g. , quantizing/encoding the updated weights and the transmission signal . But note that these techniques are orthogonal to our approach and could be applied in addition . Also note that our defined partial updating setting differs from the communication-efficient distributed ( federated ) training settings ( Lin et al. , 2018 ; Kairouz et al. , 2019 ) , which study how to compress multiple gradients calculated on different sets of non-i.i.d . local data , such that the aggregation of these ( compressed ) gradients could result in a similar convergence performance as centralized training on all data . Traditional pruning methods ( Han et al. , 2016 ; Frankle & Carbin , 2019 ; Renda et al. , 2020 ) aim at reducing the number of operations and storage consumption by setting some weights to zero . Sending a pruned network ( non-zero ’ s weights ) may also reduce the communication cost , but to a much lesser extent as shown in the experimental results , see Section 4.4 . In addition , since our objective namely reducing the server-to-edge communication cost when updating the deployed networks is fundamentally different from pruning , we can leverage some learned knowledge by retaining previous weights ( i.e. , partial updating ) instead of zero-outing ( i.e. , pruning ) . Contributions . Our contributions can be summarized as follows . • We formalize the deep partial updating paradigm , i.e. , how to iteratively perform weightwise partial updating of deep neural networks on remote edge devices if newly collected training samples are available at the server . This substantially reduces the computation and communication demand on the edge devices . • We propose a new approach that determines the optimized subset of weights that shall be selected for partial updating , through measuring each weight ’ s contribution to the analytical upper bound on the loss reduction . • Experimental results on three popular vision datasets show that under the similar accuracy level , our approach can reduce the size of the transmitted data by 91.7 % on average ( up to 99.3 % ) , namely can update the model averagely 12 times more frequent than full updating . 2 NOTATION AND SETTING . In this section , we define the notation used throughout this paper , and provide a formalized problem setting , i.e. , deep partial updating . We consider a set of remote edge devices that implement on-device inference . They are connected to a host server that is able to perform network training and retraining . We consider the necessary amount of information that needs to be communicated to each edge device to update its inference network . Assume there are in total R rounds of network updates . The network deployed in the rth round is represented with its weight vector wr . The training data used to update the network for the rth round is represented as Dr = δDr ∪ Dr−1 . In other words , newly collected data samples δDr are made available to the server in round r − 1 . To reduce the amount of information that needs to be sent to edge devices , only partial weights of wr−1 shall be updated when determining wr . The overall optimization problem for weight-wise partial updating in round r − 1 can thus be formulated as min δwr ` ( wr−1 + δwr ; Dr ) ( 1 ) s.t . ‖δwr‖0 ≤ k · I ( 2 ) where ` denotes the loss function , ‖.‖0 denotes the L0-norm , k denotes the defined updating ratio which is closely related to the communication demand between server and edge devices , and δwr denotes the increment of wr−1 . Note that both wr−1 and δwr are drawn from RI , where I denotes the total number of weights . In this case , only a fraction of k · I weights and the corresponding index information need to be communicated to each edge device for updating the network in round r , namely the partial updates δwr . It is worth noting that the index information is relatively small in size compared to the partially updated weights ( see Section 4 ) . On each edge device , the weight vector is updated as wr = wr−1 + δwr . To simplify the notation , we will only consider a single update , i.e. , from weight vector w ( corresponding to wr−1 ) to weight vector w̃ ( corresponding to wr ) with w̃ = w + δ̃w 3 PARTIAL UPDATING lowed according to the mask , i.e. , δ̃w has only nonzero elements where the mask is 1 . We develop a two-step approach for resolving the partial updating optimization problem in Eq. ( 1 ) -Eq. ( 2 ) . The final implementation used for the experimental results , see Section 4 , contains some minor adaptations that do not change the main principles as explained next . In the first step , we compute a subset of all weights with only k · I weights . These weights will be allowed to change their values . In the second step , we optimize the weights in the chosen subset ( considering the constraint of Eq . ( 2 ) ) to minimize the loss function in Eq. ( 1 ) . The overall approach is depicted in Figure 1 . The approach for the first step not only determines the subset of weights but also computes the initial values for the second ( sparse ) optimization step . In particular , we first optimize the loss function Eq . ( 1 ) from initial weights w with a standard optimizer , e.g. , SGD or its variants . As a result , we obtain the minimized loss ` ( wf ) with wf = w + δwf , where the superscript f denotes “ full updating ” . To consider the constraint Eq . ( 2 ) , the information gathered during this optimization is used to determine the subset of weights that will be changed and therefore , that need to be communicated to the edge devices . In the explanation of the method in Section 3.1 , we use the mask m with m ∈ { 0 , 1 } I to describe which weights are subject to change and which ones are not . The weights with mi = 1 are trainable , whereas the weights with mi = 0 will be rewound from the values in wf to their initial values in w , i.e. , unchanged . Obviously , we find ‖m‖0 = ∑ imi = k · I . In summary , the purpose of this first step is to determine an optimized mask m. In the second step we start a weight optimization from a network with k · I weights from the optimized network wf and ( 1− k ) · I weights from the previous , still deployed network w. In other words , the initial weights for this optimization are w + δwf m , where denotes an element-wise multiplication . We still use a standard optimizer . To determine the final solution w̃ = w + δ̃w , we conduct a sparse fine-tuning , i.e. , we keep all weights with mi = 0 constant during the optimization . Therefore , δ̃w is zero wherever mi = 0 , and only weights where mi = 1 are updated .
In this paper, the authors have proposed a new approach to determine the optimized subset of weights instead of simply conduct full weights updating. In order to better update the weights, they measure each weight's contribution to the analytical upper bound on the loss reduction from two sides (global and locally). After evaluation, a weight will be updated only if it has a large contribution to the loss reduction given the newly collected data samples. The experimental results show that their method can achieve a high inference accuracy while updating a rather small number of weights.
SP:41db1e50777ea9db3c15ce7d62a2fc50925abe5b
Deep Partial Updating
1 INTRODUCTION . To deploy deep neural networks ( DNNs ) on resource-constrained edge devices , extensive research has been done to compress a well-trained model via pruning ( Han et al. , 2016 ; Renda et al. , 2020 ) and quantization ( Courbariaux et al. , 2015 ; Rastegari et al. , 2016 ) . During on-device inference , compressed networks may achieve a good balance between model performance ( e.g. , prediction accuracy ) and resource demand ( e.g. , memory , computation , energy ) . However , due to the lack of relevant training data or an unknown sensing environment , pre-trained DNN models may not yield satisfactory performance . Retraining the model leveraging newly collected data ( from edge devices or from other sources ) is needed for desirable performance . Example application scenarios of relevance include vision robotic sensing in an unknown environment ( e.g. , Mars ) ( Meng et al. , 2017 ) , local translators on mobile phones ( Bhandare et al. , 2019 ) , and acoustic sensor networks deployed in Alpine environments ( Meyer et al. , 2019 ) . It is mostly impossible to perform on-device retraining on edge devices due to their resourceconstrained nature . Instead , retraining often occurs on a remote server with sufficient resources . One possible strategy to continuously improve the model performance on edge devices is a two-stage iterative process : ( i ) at each round , edge devices collect new data samples and send them to the server , and ( ii ) the server retrains the network using all collected data , and then sends the updates to each edge device ( Brown & Sreenan , 2006 ) . An essential challenge herein is that the transmissions in the second stage are highly constrained by the limited communication resource ( e.g. , bandwidth , energy ) in comparison to the first stage . State-of-the-art DNN models always require tens or even hundreds of mega-Bytes ( MB ) to store parameters , whereas a single batch of data samples ( a number of samples that can lead to reasonable updates in batch training ) needs a relatively smaller amount of data . For example , for CIFAR10 dataset ( Krizhevsky et al. , 2009 ) , the weights of a popular VGGNet require 56.09MB storage , while one batch of 128 samples only uses around 0.40MB ( Simonyan & Zisserman , 2015 ; Rastegari et al. , 2016 ) . As an alternative , the server sends a full update once or rarely . But in this case , every node will suffer from a low performance until such an update occurs . Besides , edge devices could decide on and send only critical samples by using active learning schemes ( Ash et al. , 2020 ) . The server may also receive training data from other sources , e.g. , through data augmentation or new data collection campaigns . These considerations indicate that the updated weights which are sent to edge devices by the server at the second stage become a major bottleneck . To resolve the above challenges pertaining to updating the network , we propose to partially update the network through changing only a small subset of the weights at each round . Doing so can significantly reduce the server-to-device communication overhead . Furthermore , fewer parameter updates also lead to less memory access on edge devices , which in turn results in smaller energy consumption related to ( compressed ) full updating ( Horowitz , 2014 ) . Our goal of performing partial updating is to determine which subset of weights shall be updated at each round , such that a similar accuracy can be achieved compared to fully updating all weights . Our key concept for partial updating is based on the hypothesis , that a weight shall be updated only if it has a large contribution to the loss reduction given the newly collected data samples . Specially , we define a binary mask m to describe which weights are subject to update , i.e. , mi = 1 implies updating this weight andmi = 0 implies fixing the weight to its initial value . For any m , we establish an analytical upper bound on the difference between the loss value under partial updating and that under full updating . We determine an optimized mask m by combining two different view points : ( i ) measuring the “ global contribution ” of each weight to the upper bound through computing the Euclidean distance , and ( ii ) measuring each weight ’ s “ local contribution ” within each optimization step using gradient-related information . The weights to be updated according to m will be further sparsely fine-tuned while the remaining weights are rewound to their initial values . Related Work . Although partial updating has been adopted in some prior works , it is conducted in a fairly coarse-grained manner , e.g. , layer-wise or neuron-wise , and targets at completely different objectives . Especially , under continual learning settings , ( Yoon et al. , 2018 ; Jung et al. , 2020 ) propose to freeze all weights related to the neurons which are more critical in performing prior tasks than new ones , to preserve existing knowledge . Under adversarial attack settings , ( Shokri & Shmatikov , 2015 ) updates the weights in the first several layers only , which yield a dominating impact on the extracted features , for better attack efficacy . Under architecture generalization settings , ( Chatterji et al. , 2020 ) studies the generalization performance through the resulting loss degradation when rewinding the weights of each individual layer to their initial values . Unfortunately , such techniques can not be applied in our problem setting which seeks a fine-grained , i.e. , weight-wise , partial updating given newly collected training samples in an iterative manner . The communication cost could also be reduced through some other techniques , e.g. , quantizing/encoding the updated weights and the transmission signal . But note that these techniques are orthogonal to our approach and could be applied in addition . Also note that our defined partial updating setting differs from the communication-efficient distributed ( federated ) training settings ( Lin et al. , 2018 ; Kairouz et al. , 2019 ) , which study how to compress multiple gradients calculated on different sets of non-i.i.d . local data , such that the aggregation of these ( compressed ) gradients could result in a similar convergence performance as centralized training on all data . Traditional pruning methods ( Han et al. , 2016 ; Frankle & Carbin , 2019 ; Renda et al. , 2020 ) aim at reducing the number of operations and storage consumption by setting some weights to zero . Sending a pruned network ( non-zero ’ s weights ) may also reduce the communication cost , but to a much lesser extent as shown in the experimental results , see Section 4.4 . In addition , since our objective namely reducing the server-to-edge communication cost when updating the deployed networks is fundamentally different from pruning , we can leverage some learned knowledge by retaining previous weights ( i.e. , partial updating ) instead of zero-outing ( i.e. , pruning ) . Contributions . Our contributions can be summarized as follows . • We formalize the deep partial updating paradigm , i.e. , how to iteratively perform weightwise partial updating of deep neural networks on remote edge devices if newly collected training samples are available at the server . This substantially reduces the computation and communication demand on the edge devices . • We propose a new approach that determines the optimized subset of weights that shall be selected for partial updating , through measuring each weight ’ s contribution to the analytical upper bound on the loss reduction . • Experimental results on three popular vision datasets show that under the similar accuracy level , our approach can reduce the size of the transmitted data by 91.7 % on average ( up to 99.3 % ) , namely can update the model averagely 12 times more frequent than full updating . 2 NOTATION AND SETTING . In this section , we define the notation used throughout this paper , and provide a formalized problem setting , i.e. , deep partial updating . We consider a set of remote edge devices that implement on-device inference . They are connected to a host server that is able to perform network training and retraining . We consider the necessary amount of information that needs to be communicated to each edge device to update its inference network . Assume there are in total R rounds of network updates . The network deployed in the rth round is represented with its weight vector wr . The training data used to update the network for the rth round is represented as Dr = δDr ∪ Dr−1 . In other words , newly collected data samples δDr are made available to the server in round r − 1 . To reduce the amount of information that needs to be sent to edge devices , only partial weights of wr−1 shall be updated when determining wr . The overall optimization problem for weight-wise partial updating in round r − 1 can thus be formulated as min δwr ` ( wr−1 + δwr ; Dr ) ( 1 ) s.t . ‖δwr‖0 ≤ k · I ( 2 ) where ` denotes the loss function , ‖.‖0 denotes the L0-norm , k denotes the defined updating ratio which is closely related to the communication demand between server and edge devices , and δwr denotes the increment of wr−1 . Note that both wr−1 and δwr are drawn from RI , where I denotes the total number of weights . In this case , only a fraction of k · I weights and the corresponding index information need to be communicated to each edge device for updating the network in round r , namely the partial updates δwr . It is worth noting that the index information is relatively small in size compared to the partially updated weights ( see Section 4 ) . On each edge device , the weight vector is updated as wr = wr−1 + δwr . To simplify the notation , we will only consider a single update , i.e. , from weight vector w ( corresponding to wr−1 ) to weight vector w̃ ( corresponding to wr ) with w̃ = w + δ̃w 3 PARTIAL UPDATING lowed according to the mask , i.e. , δ̃w has only nonzero elements where the mask is 1 . We develop a two-step approach for resolving the partial updating optimization problem in Eq. ( 1 ) -Eq. ( 2 ) . The final implementation used for the experimental results , see Section 4 , contains some minor adaptations that do not change the main principles as explained next . In the first step , we compute a subset of all weights with only k · I weights . These weights will be allowed to change their values . In the second step , we optimize the weights in the chosen subset ( considering the constraint of Eq . ( 2 ) ) to minimize the loss function in Eq. ( 1 ) . The overall approach is depicted in Figure 1 . The approach for the first step not only determines the subset of weights but also computes the initial values for the second ( sparse ) optimization step . In particular , we first optimize the loss function Eq . ( 1 ) from initial weights w with a standard optimizer , e.g. , SGD or its variants . As a result , we obtain the minimized loss ` ( wf ) with wf = w + δwf , where the superscript f denotes “ full updating ” . To consider the constraint Eq . ( 2 ) , the information gathered during this optimization is used to determine the subset of weights that will be changed and therefore , that need to be communicated to the edge devices . In the explanation of the method in Section 3.1 , we use the mask m with m ∈ { 0 , 1 } I to describe which weights are subject to change and which ones are not . The weights with mi = 1 are trainable , whereas the weights with mi = 0 will be rewound from the values in wf to their initial values in w , i.e. , unchanged . Obviously , we find ‖m‖0 = ∑ imi = k · I . In summary , the purpose of this first step is to determine an optimized mask m. In the second step we start a weight optimization from a network with k · I weights from the optimized network wf and ( 1− k ) · I weights from the previous , still deployed network w. In other words , the initial weights for this optimization are w + δwf m , where denotes an element-wise multiplication . We still use a standard optimizer . To determine the final solution w̃ = w + δ̃w , we conduct a sparse fine-tuning , i.e. , we keep all weights with mi = 0 constant during the optimization . Therefore , δ̃w is zero wherever mi = 0 , and only weights where mi = 1 are updated .
This paper presents a method to reduce the bandwidth required to update DNN models on edge devices. The key insight is that model updates typically incorporate new data (training samples), and that after doing so, a minority of weights capture the majority of change due to retraining. The authors propose a method by which to identify this weight subset, and compare the relative size (and test accuracy) of that update to that of other solutions (such as sending the entire network or sending a random subset of the weights on each retraining round). Experiments with a number of existing data sets and models illustrate that the approach reduces update size more than 77% while maintaining reasonable test accuracy.
SP:41db1e50777ea9db3c15ce7d62a2fc50925abe5b
BOIL: Towards Representation Change for Few-shot Learning
1 INTRODUCTION . Meta-learning , also known as “ learning to learn , ” is a methodology that imitates human intelligence that can adapt quickly with even a small amount of previously unseen data through the use of previous learning experiences . To this aim , meta-learning with deep neural networks has mainly been studied using metric- and gradient-based approaches . Metric-based meta-learning ( Koch , 2015 ; Vinyals et al. , 2016 ; Snell et al. , 2017 ; Sung et al. , 2018 ) compares the distance between feature embeddings using models as a mapping function of data into an embedding space , whereas gradient-based meta-learning ( Ravi & Larochelle , 2016 ; Finn et al. , 2017 ; Nichol et al. , 2018 ) quickly learns the parameters to be optimized when the models encounter new tasks . Model-agnostic meta-learning ( MAML ) ( Finn et al. , 2017 ) is the most representative gradient-based meta-learning algorithm . MAML algorithm consists of two optimization loops : an inner loop and an outer loop . The inner loop learns task-specific knowledge , and the outer loop finds a universally good meta-initialized parameter allowing the inner loop to quickly learn any task from the initial point with only a few examples . This algorithm has been highly influential in the field of meta-learning , and numerous follow-up studies have been conducted ( Oreshkin et al. , 2018 ; Rusu et al. , 2018 ; Zintgraf et al. , 2018 ; Yoon et al. , 2018 ; Finn et al. , 2018 ; Triantafillou et al. , 2019 ; Sun et al. , 2019 ; Na et al. , 2019 ; Tseng et al. , 2020 ) . Very recent studies ( Raghu et al. , 2020 ; Arnold et al. , 2019 ) have attributed the success of MAML to high-quality features before the inner updates from the meta-initialized parameters . For instance , Raghu et al . ( 2020 ) claimed that MAML learns new tasks by updating the head ( the last fully connected layer ) with almost the same features ( the output of the penultimate layer ) from the metainitialized network . In this paper , we categorize the learning patterns as follows : A small change in the representations during task learning is named representation reuse , whereas a large change is named representation change.1 Thus , representation reuse was the common belief of MAML . ∗The authors contribute equally to this paper . 1In our paper , representation reuse and representation change correspond to feature reuse and rapid learning in ( Raghu et al. , 2020 ) , respectively . To prevent confusion from terminology , we re-express the terms . Herein , we pose an intriguing question : Is representation reuse sufficient for meta-learning ? We believe that the key to successful meta-learning is closer to representation change than to representation reuse . More importantly , representation change is crucial for cross-domain adaptation , which is considered the ultimate goal of meta-learning . By contrast , the MAML accomplished with representation reuse might be poorly trained for cross-domain adaptation since the success of representation reuse might rely heavily on the similarity between the source and the target domains . To answer this question , we propose a novel meta-learning algorithm that leverages representation change . Our contributions can be summarized as follows : • We emphasize the necessity of representation change for meta-learning through crossdomain adaptation experiments . • We propose a simple but effective meta-learning algorithm that learns the Body ( extractor ) of the model Only in the Inner Loop ( BOIL ) . We empirically show that BOIL improves the performance over most of benchmark data sets and that this improvement is particularly noticeable in fine-grained data sets or cross-domain adaptation . • We interpret the connection between BOIL and the algorithm using preconditioning gradients ( Flennerhag et al. , 2020 ) and show their compatibility , improving performance . • We demonstrate that the BOIL algorithm enjoys representation layer reuse on the low-/midlevel body and representation layer change on the high-level body using the cosine similarity and the Centered Kernel Alignment ( CKA ) . We visualize the features between before and after an adaptation , and empirically analyze the effectiveness of the body of BOIL through an ablation study on eliminating the head . • For ResNet architectures , we propose a disconnection trick that removes the backpropagation path of the last skip connection . The disconnection trick strengthens representation layer change on the high-level body . 2 PROBLEM SETTING . 2.1 META-LEARNING FRAMEWORK ( MAML ) . The MAML algorithm ( Finn et al. , 2017 ) attempts to meta-learn the best initialization of the parameters for a task-learner . It consists of two main optimization loops : an inner loop and an outer loop . First , we sample a batch of tasks within a data set distribution . Each task τi consists of a support set Sτi and a query set Qτi . When we sample a support set for each task , we first sample n labels from the label set and then sample k instances for each label . Thus , each support set contains n× k instances . For a query set , we sample instances from the same labels with the support set . With these tasks , the MAML algorithm conducts both meta-training and meta-testing . During metatraining , we first sample a meta-batch consisting of B tasks from the meta-training data set . In the inner loops , we update the meta-initialized parameters θ to task-specific parameters θτi using the task-specific loss LSτi ( fθ ) , where fθ is a neural network parameterized by θ , as follows : 2 θτi = θ − α∇θLSτi ( fθ ) ( 1 ) Using the query set of the corresponding task , we compute the loss LQτi ( fθτi ) based on each inner updated parameter . By summing all these losses , the meta-loss of each meta-batch , Lmeta ( θ ) , is computed . The meta-initialized parameters are then updated using the meta-loss in the outer loop through a gradient descent . θ′ = θ − β∇θLmeta ( θ ) , whereLmeta ( θ ) = B∑ i=1 LQτi ( fθτi ) ( 2 ) In meta-testing , the inner loop , which can be interpreted as task-specific learning , is the same as in meta-training . However , the outer loop only computes the accuracy using a query set of tasks and does not perform a gradient descent ; thus , it does not update the meta-initialization parameters . 2.2 EXPERIMENTAL SETUP . We used two backbone networks , 4conv network with 64 channels from Vinyals et al . ( 2016 ) and ResNet-12 starting with 64 channels and doubling them after every block from Oreshkin et al . ( 2018 ) . For the batch normalization , we used batch statistics instead of the running statistics during metatesting , following the original MAML ( Finn et al. , 2017 ) . We trained 4conv network and ResNet-12 for 30,000 and 10,000 epochs , respectively , and then used the model with the best accuracy on metavalidation data set to verify the performance . We applied an inner update once for both meta-training and meta-testing . The outer learning rate was set to 0.001 and 0.0006 and the inner learning rate was set to 0.5 and 0.3 for 4conv network and ResNet-12 , respectively . All results were reproduced by our group and reported as the average and standard deviation of the accuracies over 5 × 1,000 tasks , and the values in parentheses in the algorithm name column of the tables are the number of shots . We validated both MAML/ANIL and BOIL on two general data sets , miniImageNet ( Vinyals et al. , 2016 ) and tieredImageNet ( Ren et al. , 2018 ) , and two specific data sets , Cars ( Krause et al. , 2013 ) and CUB ( Welinder et al. , 2010 ) . Note that our algorithm is not for state-of-the-art performance but for a proposal of a new learning scheme for meta-learning . Full details on the implementation and data sets are described in Appendix A.3 In addition , the results of the other data sets at a size of 32 × 32 and using the 4conv network with 32 channels from Finn et al . ( 2017 ) ( i.e. , original setting ) are reported in Appendix C and Appendix D , respectively . 3 BOIL ( BODY ONLY UPDATE IN INNER LOOP ) . 3.1 THE ULTIMATE GOAL OF META-LEARNING : DOMAIN-AGNOSTIC ADAPTATION . Recently , Raghu et al . ( 2020 ) proposed two opposing hypotheses , representation reuse and representation change , and demonstrated that representation reuse is the dominant factor of MAML . We can discriminate two hypotheses according to which part of the neural network , body or head , is mostly updated through the inner loop . Here , the body indicates all convolutional layers , and the head indicates the remaining fully connected layer . In other words , the representation change hypothesis attributes the capability of MAML to the updates on the body , whereas the representation reuse hypothesis considers that the network body is already universal to various tasks before the inner loops . To demonstrate the representation reuse hypothesis of MAML , the authors proposed the ANIL ( Almost No Inner Loop ) algorithm , which only updates the head in the inner loops during training and testing , and showed that ANIL has a performance comparable to that of MAML . This implies that the representation trained by MAML/ANIL , even before updated task-specifically , is sufficient 2Although the inner loop ( s ) can be applied through one or more steps , for simplicity , we consider only the case of a single inner loop . 3All implementations are based on Torchmeta ( Deleu et al. , 2019 ) except for WarpGrad , and all results were reproduced according to our details . These results are not the highest for MAML/ANIL because our setting is more fitted to BOIL . However , under more suitable hyperparameters for each algorithm , the best performance of BOIL is better than that of MAML/ANIL . to achieve the desired performance . Furthermore , they proposed the NIL-testing ( No Inner Loop ) algorithm , which removes the head and performs unseen tasks using only the distance between the representations of a support set and those of a query set during testing to identify the capability of representation reuse . NIL-testing of MAML also achieves a performance comparable to MAML . Based on these results , it was claimed that the success of MAML is attributed to representation reuse . Here , we investigate the necessity of representation change . We believe that the meta-trained models should achieve a good performance in many other domains , which is referred to as domain-agnostic adaptation in this paper . To this end , representation reuse is not appropriate since representation reuse uses the similarity between the source and target domains . The higher the similarity , the higher the efficiency . Therefore , when there are no strong similarities between the source and target domains , good representations for the source domain could be imperfect representations for the target domain . Table 2 , which lists our experimental results on cross-domain tasks , shows that the MAML enjoying representation reuse is worse than BOIL leveraging representation change , which will be discussed in detail in the next section . 3.2 BOIL ALGORITHM . Inspired by the necessity , we design an algorithm that updates only the body of the model and freezes the head of the model during the task learning to enforce representation change through inner updates . Because the gradients must be back-propagated to update the body , we set the learning rate of the head to zero in the inner updates during both meta-training and meta-testing . Otherwise , the learning and evaluation procedures of BOIL are the same as those of MAML . Therefore , the computational overhead does not change . Formally speaking , with the notations used in Section 2.1 , the meta-initialized parameters θ can be separated into body parameters θb and head parameters θh , that is , θ = { θb , θh } . For a sample image x ∈ Ri , an output can be expressed as ŷ = fθ ( x ) = fθh ( fθb ( x ) ) ∈ Rn , where fθb ( x ) ∈ Rd . The task-specific body parameters θb , τi and head parameters θh , τi through an inner loop given task τi are thus as follows : θb , τi = θb − αb∇θbLSτi ( fθ ) & θh , τi = θh − αh∇θhLSτi ( fθ ) ( 3 ) where αb and αh are the inner loop learning rates corresponding to the body and head , respectively . MAML usually sets α = αb = αh ( 6= 0 ) , ANIL sets αb = 0 and αh 6= 0 , and BOIL sets αb 6= 0 and αh = 0 . These simple differences force the change in the dominant factor of task-specific updates , from the head to the body . Figure 1 shows the main difference in the inner updates between MAML/ANIL and BOIL . To solve new tasks , the head mainly or only changes in MAML/ANIL ( Raghu et al. , 2020 ) , whereas in BOIL , the body changes .
This paper proposes a variant of MAML, called body only in the inner loop (BOIL), in which the output layer is not trained (learning rate is set to 0, always) but gradients are still backpropagated to the remaining layers, which are trained as in MAML. In essence, this is the inverse of the ANIL method of Raghu et al., which showed that MAML mainly adapts only the output layer for few-shot image classification. This paper shows that never training the output layer of the network (simply leaving it at its randomly-initialized values) can provide much better performance across a number of few-shot image classification tasks, including those requiring domain transfer.
SP:be6df295f535480586a951445b824142bb60b56e
BOIL: Towards Representation Change for Few-shot Learning
1 INTRODUCTION . Meta-learning , also known as “ learning to learn , ” is a methodology that imitates human intelligence that can adapt quickly with even a small amount of previously unseen data through the use of previous learning experiences . To this aim , meta-learning with deep neural networks has mainly been studied using metric- and gradient-based approaches . Metric-based meta-learning ( Koch , 2015 ; Vinyals et al. , 2016 ; Snell et al. , 2017 ; Sung et al. , 2018 ) compares the distance between feature embeddings using models as a mapping function of data into an embedding space , whereas gradient-based meta-learning ( Ravi & Larochelle , 2016 ; Finn et al. , 2017 ; Nichol et al. , 2018 ) quickly learns the parameters to be optimized when the models encounter new tasks . Model-agnostic meta-learning ( MAML ) ( Finn et al. , 2017 ) is the most representative gradient-based meta-learning algorithm . MAML algorithm consists of two optimization loops : an inner loop and an outer loop . The inner loop learns task-specific knowledge , and the outer loop finds a universally good meta-initialized parameter allowing the inner loop to quickly learn any task from the initial point with only a few examples . This algorithm has been highly influential in the field of meta-learning , and numerous follow-up studies have been conducted ( Oreshkin et al. , 2018 ; Rusu et al. , 2018 ; Zintgraf et al. , 2018 ; Yoon et al. , 2018 ; Finn et al. , 2018 ; Triantafillou et al. , 2019 ; Sun et al. , 2019 ; Na et al. , 2019 ; Tseng et al. , 2020 ) . Very recent studies ( Raghu et al. , 2020 ; Arnold et al. , 2019 ) have attributed the success of MAML to high-quality features before the inner updates from the meta-initialized parameters . For instance , Raghu et al . ( 2020 ) claimed that MAML learns new tasks by updating the head ( the last fully connected layer ) with almost the same features ( the output of the penultimate layer ) from the metainitialized network . In this paper , we categorize the learning patterns as follows : A small change in the representations during task learning is named representation reuse , whereas a large change is named representation change.1 Thus , representation reuse was the common belief of MAML . ∗The authors contribute equally to this paper . 1In our paper , representation reuse and representation change correspond to feature reuse and rapid learning in ( Raghu et al. , 2020 ) , respectively . To prevent confusion from terminology , we re-express the terms . Herein , we pose an intriguing question : Is representation reuse sufficient for meta-learning ? We believe that the key to successful meta-learning is closer to representation change than to representation reuse . More importantly , representation change is crucial for cross-domain adaptation , which is considered the ultimate goal of meta-learning . By contrast , the MAML accomplished with representation reuse might be poorly trained for cross-domain adaptation since the success of representation reuse might rely heavily on the similarity between the source and the target domains . To answer this question , we propose a novel meta-learning algorithm that leverages representation change . Our contributions can be summarized as follows : • We emphasize the necessity of representation change for meta-learning through crossdomain adaptation experiments . • We propose a simple but effective meta-learning algorithm that learns the Body ( extractor ) of the model Only in the Inner Loop ( BOIL ) . We empirically show that BOIL improves the performance over most of benchmark data sets and that this improvement is particularly noticeable in fine-grained data sets or cross-domain adaptation . • We interpret the connection between BOIL and the algorithm using preconditioning gradients ( Flennerhag et al. , 2020 ) and show their compatibility , improving performance . • We demonstrate that the BOIL algorithm enjoys representation layer reuse on the low-/midlevel body and representation layer change on the high-level body using the cosine similarity and the Centered Kernel Alignment ( CKA ) . We visualize the features between before and after an adaptation , and empirically analyze the effectiveness of the body of BOIL through an ablation study on eliminating the head . • For ResNet architectures , we propose a disconnection trick that removes the backpropagation path of the last skip connection . The disconnection trick strengthens representation layer change on the high-level body . 2 PROBLEM SETTING . 2.1 META-LEARNING FRAMEWORK ( MAML ) . The MAML algorithm ( Finn et al. , 2017 ) attempts to meta-learn the best initialization of the parameters for a task-learner . It consists of two main optimization loops : an inner loop and an outer loop . First , we sample a batch of tasks within a data set distribution . Each task τi consists of a support set Sτi and a query set Qτi . When we sample a support set for each task , we first sample n labels from the label set and then sample k instances for each label . Thus , each support set contains n× k instances . For a query set , we sample instances from the same labels with the support set . With these tasks , the MAML algorithm conducts both meta-training and meta-testing . During metatraining , we first sample a meta-batch consisting of B tasks from the meta-training data set . In the inner loops , we update the meta-initialized parameters θ to task-specific parameters θτi using the task-specific loss LSτi ( fθ ) , where fθ is a neural network parameterized by θ , as follows : 2 θτi = θ − α∇θLSτi ( fθ ) ( 1 ) Using the query set of the corresponding task , we compute the loss LQτi ( fθτi ) based on each inner updated parameter . By summing all these losses , the meta-loss of each meta-batch , Lmeta ( θ ) , is computed . The meta-initialized parameters are then updated using the meta-loss in the outer loop through a gradient descent . θ′ = θ − β∇θLmeta ( θ ) , whereLmeta ( θ ) = B∑ i=1 LQτi ( fθτi ) ( 2 ) In meta-testing , the inner loop , which can be interpreted as task-specific learning , is the same as in meta-training . However , the outer loop only computes the accuracy using a query set of tasks and does not perform a gradient descent ; thus , it does not update the meta-initialization parameters . 2.2 EXPERIMENTAL SETUP . We used two backbone networks , 4conv network with 64 channels from Vinyals et al . ( 2016 ) and ResNet-12 starting with 64 channels and doubling them after every block from Oreshkin et al . ( 2018 ) . For the batch normalization , we used batch statistics instead of the running statistics during metatesting , following the original MAML ( Finn et al. , 2017 ) . We trained 4conv network and ResNet-12 for 30,000 and 10,000 epochs , respectively , and then used the model with the best accuracy on metavalidation data set to verify the performance . We applied an inner update once for both meta-training and meta-testing . The outer learning rate was set to 0.001 and 0.0006 and the inner learning rate was set to 0.5 and 0.3 for 4conv network and ResNet-12 , respectively . All results were reproduced by our group and reported as the average and standard deviation of the accuracies over 5 × 1,000 tasks , and the values in parentheses in the algorithm name column of the tables are the number of shots . We validated both MAML/ANIL and BOIL on two general data sets , miniImageNet ( Vinyals et al. , 2016 ) and tieredImageNet ( Ren et al. , 2018 ) , and two specific data sets , Cars ( Krause et al. , 2013 ) and CUB ( Welinder et al. , 2010 ) . Note that our algorithm is not for state-of-the-art performance but for a proposal of a new learning scheme for meta-learning . Full details on the implementation and data sets are described in Appendix A.3 In addition , the results of the other data sets at a size of 32 × 32 and using the 4conv network with 32 channels from Finn et al . ( 2017 ) ( i.e. , original setting ) are reported in Appendix C and Appendix D , respectively . 3 BOIL ( BODY ONLY UPDATE IN INNER LOOP ) . 3.1 THE ULTIMATE GOAL OF META-LEARNING : DOMAIN-AGNOSTIC ADAPTATION . Recently , Raghu et al . ( 2020 ) proposed two opposing hypotheses , representation reuse and representation change , and demonstrated that representation reuse is the dominant factor of MAML . We can discriminate two hypotheses according to which part of the neural network , body or head , is mostly updated through the inner loop . Here , the body indicates all convolutional layers , and the head indicates the remaining fully connected layer . In other words , the representation change hypothesis attributes the capability of MAML to the updates on the body , whereas the representation reuse hypothesis considers that the network body is already universal to various tasks before the inner loops . To demonstrate the representation reuse hypothesis of MAML , the authors proposed the ANIL ( Almost No Inner Loop ) algorithm , which only updates the head in the inner loops during training and testing , and showed that ANIL has a performance comparable to that of MAML . This implies that the representation trained by MAML/ANIL , even before updated task-specifically , is sufficient 2Although the inner loop ( s ) can be applied through one or more steps , for simplicity , we consider only the case of a single inner loop . 3All implementations are based on Torchmeta ( Deleu et al. , 2019 ) except for WarpGrad , and all results were reproduced according to our details . These results are not the highest for MAML/ANIL because our setting is more fitted to BOIL . However , under more suitable hyperparameters for each algorithm , the best performance of BOIL is better than that of MAML/ANIL . to achieve the desired performance . Furthermore , they proposed the NIL-testing ( No Inner Loop ) algorithm , which removes the head and performs unseen tasks using only the distance between the representations of a support set and those of a query set during testing to identify the capability of representation reuse . NIL-testing of MAML also achieves a performance comparable to MAML . Based on these results , it was claimed that the success of MAML is attributed to representation reuse . Here , we investigate the necessity of representation change . We believe that the meta-trained models should achieve a good performance in many other domains , which is referred to as domain-agnostic adaptation in this paper . To this end , representation reuse is not appropriate since representation reuse uses the similarity between the source and target domains . The higher the similarity , the higher the efficiency . Therefore , when there are no strong similarities between the source and target domains , good representations for the source domain could be imperfect representations for the target domain . Table 2 , which lists our experimental results on cross-domain tasks , shows that the MAML enjoying representation reuse is worse than BOIL leveraging representation change , which will be discussed in detail in the next section . 3.2 BOIL ALGORITHM . Inspired by the necessity , we design an algorithm that updates only the body of the model and freezes the head of the model during the task learning to enforce representation change through inner updates . Because the gradients must be back-propagated to update the body , we set the learning rate of the head to zero in the inner updates during both meta-training and meta-testing . Otherwise , the learning and evaluation procedures of BOIL are the same as those of MAML . Therefore , the computational overhead does not change . Formally speaking , with the notations used in Section 2.1 , the meta-initialized parameters θ can be separated into body parameters θb and head parameters θh , that is , θ = { θb , θh } . For a sample image x ∈ Ri , an output can be expressed as ŷ = fθ ( x ) = fθh ( fθb ( x ) ) ∈ Rn , where fθb ( x ) ∈ Rd . The task-specific body parameters θb , τi and head parameters θh , τi through an inner loop given task τi are thus as follows : θb , τi = θb − αb∇θbLSτi ( fθ ) & θh , τi = θh − αh∇θhLSτi ( fθ ) ( 3 ) where αb and αh are the inner loop learning rates corresponding to the body and head , respectively . MAML usually sets α = αb = αh ( 6= 0 ) , ANIL sets αb = 0 and αh 6= 0 , and BOIL sets αb 6= 0 and αh = 0 . These simple differences force the change in the dominant factor of task-specific updates , from the head to the body . Figure 1 shows the main difference in the inner updates between MAML/ANIL and BOIL . To solve new tasks , the head mainly or only changes in MAML/ANIL ( Raghu et al. , 2020 ) , whereas in BOIL , the body changes .
Previous work studied MAML and showed that representation reuse is the main contributing factor in performance and not representation change. This paper first asks the question of whether representation reuse is enough for meta-learning? The paper hypothesizes and empirically evaluates the need/benefit for representation change in meta-learning tasks especially for cross-domain transfer. For this, they propose BOIL, a variant of MAML where the head of the network is not updated during inner loop updates.
SP:be6df295f535480586a951445b824142bb60b56e
Hopper: Multi-hop Transformer for Spatiotemporal Reasoning
1 INTRODUCTION In this paper , we address the problem of spatiotemporal object-centric reasoning in videos . Specifically , we focus on the problem of object permanence , which is the ability to represent the existence and the trajectory of hidden moving objects ( Baillargeon , 1986 ) . Object permanence can be essential in understanding videos in the domain of : ( 1 ) sports like soccer , where one needs to reason , “ which player initiated the pass that resulted in a goal ? ” , ( 2 ) activities like shopping , one needs to infer “ what items the shopper should be billed for ? ” , and ( 3 ) driving , to infer “ is there a car next to me in the right lane ? ” . Answering these questions requires the ability to detect and understand the motion of objects in the scene . This requires detecting the temporal order of one or more actions of objects . Furthermore , it also requires learning object permanence , since it requires the ability to predict the location of non-visible objects as ∗Work done as a NEC Labs intern . 1https : //github.com/necla-ml/cater-h they are occluded , contained or carried by other objects ( Shamsian et al. , 2020 ) . Hence , solving this task requires compositional , multi-step spatiotemporal reasoning which has been difficult to achieve using existing deep learning models ( Bottou , 2014 ; Lake et al. , 2017 ) . Existing models have been found lacking when applying to video reasoning and object permanence tasks ( Girdhar & Ramanan , 2020 ) . Despite rapid progress in video understanding benchmarks such as action recognition over large datasets , deep learning based models often suffer from spatial and temporal biases and are often easily fooled by statistical spurious patterns and undesirable dataset biases ( Johnson et al. , 2017b ) . For example , researchers have found that models can recognize the action “ swimming ” even when the actor is masked out , because the models rely on the swimming pool , the scene bias , instead of the dynamics of the actor ( Choi et al. , 2019 ) . Hence , we propose Hopper to address debiased video reasoning . Hopper uses multi-hop reasoning over videos to reason about object permanence . Humans realize object permanence by identifying key frames where objects become hidden ( Bremner et al. , 2015 ) and reason to predict the motion and final location of objects in the video . Given a video and a localization query , Hopper uses a Multi-hop Transformer ( MHT ) over image and object tracks to automatically identify and hop over critical frames in an iterative fashion to predict the final position of the object of interest . Additionally , Hopper uses a contrastive debiasing loss that enforces consistency between attended objects and correct predictions . This improves model robustness and generalization . We also build a new dataset , CATER-h , that reduces temporal bias in CATER and requires long-term reasoning . We demonstrate the effectiveness of Hopper over the recently proposed CATER ‘ Snitch Localization ’ task ( Girdhar & Ramanan , 2020 ) ( Figure 1 ) . Hopper achieves 73.2 % Top-1 accuracy in this task at just 1 FPS . More importantly , Hopper identifies the critical frames where objects become invisible or reappears , providing an interpretable summary of the reasoning performed by the model . To summarize , the contributions of our paper are as follows : First , we introduce Hopper that provides a framework for multi-step compositional reasoning in videos and achieves state-of-the-art accuracy in CATER object permanence task . Second , we describe how to perform interpretable reasoning in videos by using iterative reasoning over critical frames . Third , we perform extensive studies to understand the effectiveness of multi-step reasoning and debiasing methods that are used by Hopper . Based on our results , we also propose a new dataset , CATER-h , that requires longer reasoning hops , and demonstrates the gaps of existing deep learning models . 2 RELATED WORK . Video understanding . Video tasks have matured quickly in recent years ( Hara et al. , 2018 ) ; approaches have been migrated from 2D or 3D ConvNets ( Ji et al. , 2012 ) to two-stream networks ( Simonyan & Zisserman , 2014 ) , inflated design ( Carreira & Zisserman , 2017 ) , models with additional emphasis on capturing the temporal structures ( Zhou et al. , 2018 ) , and recently models that better capture spatiotemporal interactions ( Wang et al. , 2018 ; Girdhar et al. , 2019 ) . Despite the progress , these models often suffer undesirable dataset biases , easily confused by backgrounds objects in new environments as well as varying temporal scales ( Choi et al. , 2019 ) . Furthermore , they are unable to capture reasoning-based constructs such as causal relationships ( Fire & Zhu , 2017 ) or long-term video understanding ( Girdhar & Ramanan , 2020 ) . Visual and video reasoning . Visual and video reasoning have been well-studied recently , but existing research has largely focused on the task of question answering ( Johnson et al. , 2017a ; Hudson & Manning , 2018 ; 2019a ; Yi et al. , 2020 ) . CATER , a recently proposed diagnostic video recognition dataset focuses on spatial and temporal reasoning as well as localizing particular object of interest . There also has been significant research in object tracking , often with an emphasis on occlusions with the goal of providing object permanence ( Wojke et al. , 2017 ; Wang et al. , 2019b ) . Traditional object tracking approaches often require expensive supervision of location of the objects in every frame . In contrast , we address object permanence and video recognition on CATER with a model that performs tracking-integrated object-centric reasoning without this strong supervision . Multi-hop reasoning . Reasoning systems vary in expressive power and predictive abilities , which include symbolic reasoning , probabilistic reasoning , causal reasoning , etc . ( Bottou , 2014 ) . Among them , multi-hop reasoning is the ability to reason with information collected from multiple passages to derive the answer ( Wang et al. , 2019a ) , and it gives a discrete intermediate output of the reasoning process , which can help gauge model ’ s behavior beyond just the final task accuracy ( Chen et al. , 2019 ) . Several multi-hop datasets and models have been proposed for the reading comprehension Target : video query representation object class label positional spatial resolution encoding Time CNN feature maps DETR : End-to-end Transformer based object detector positional time encoding Tracking : Hungarian Between Frame Matching Algorithm Multi-Hop Transformer MLP image features Source object queries object representation object bounding box MLP ... : the number of frames : the number of objects : batch size ... Track 0 Track 1 Track 2 Track N IMG OBJ OBJ OBJ positional time encoding Target : video query Classification Source Sequence A. backbone Ref . Figure 16 B. obj ect det ect ion and r epr esentat ion C. t r acking D. video Quer y r epr esentat ion and r ecognit ion ... : dimension size positional encoded feature maps Figure 2 : An overview of the Hopper framework . Hopper first obtains frame representations from the input video . Object representations and object tracks are then computed to enable tracking-integrated object-centric reasoning for the Multi-hop Transformer ( details in Section 4 ) . task ( Welbl et al. , 2018 ; Yang et al. , 2018b ; Dua et al. , 2019 ; Dhingra et al. , 2020 ) . We extend multihop reasoning to the video domain by developing a dataset that explicitly requires aggregating clues from different spatiotemporal parts of the video , as well as a multi-hop model that automatically extracts a step-by-step reasoning chain , which improves interpretability and imitates a natural way of thinking . We provide an extended discussion of related work in Appendix I . 3 HOPPER . Hopper ( Figure 2 ) is a framework inspired from the observation that humans think in terms of entities and relations . Unlike traditional deep visual networks that perform processing over the pixels from which they learn and extract features , object-centric learning-based architecture explicitly separates information about entities through grouping and abstraction from the low-level information ( Locatello et al. , 2020 ) . Hopper obtains representations of object entities from the lowlevel pixel information of every frame ( Section 3.2 ) . Additionally , to maintain object permanence , humans are able to identify key moments when the objects disappear and reappear . To imitate that , Hopper computes object tracks with the goal to have a more consistent object representation ( Section 3.3 ) and then achieves multi-step compositional long-term reasoning with the Multi-hop Transformer to pinpoint these critical moments . Furthermore , Hopper combines both fine-grained ( object ) and coarse-grained ( image ) information to form a contextual understanding of a video . As shown in Figure 2 , Hopper contains 4 components ; we describe them below . 3.1 BACKBONE . Starting from the initial RGB-based video representation xv ∈ RT×3×H0×W0 where T represents the number of frames of the video , 3 is for the three color channels , and H0 and W0 denote the original resolution height and width , a conventional CNN backbone would extract the feature map f ∈ RT×P×H×W and for every frame t a compact image representation it ∈ RP . The backbone we use is ResNeXt-101 from Ma et al . ( 2018 ) , P = 2048 and H , W = 8 , 10 . A 1×1 convolution ( Carion et al. , 2020 ) then reduces the channel dimension of f from P to a smaller dimension d ( d = 256 ) , and a linear layer is used to turn the dimension of it from P to d . 3.2 OBJECT DETECTION AND REPRESENTATION . We collapse the spatial dimensions into 1 dimension and combine the batch dimension with the temporal dimension for the feature map f . Positional encodings are learned for each time step ( T in total ) and each spatial location ( H × W in total ) , which are further added to the feature map in an element-wise manner . The positional encoding-augmented feature map is the source input to the transformer encoder ( Vaswani et al. , 2017 ) of DETR ( Carion et al. , 2020 ) . DETR is a recently proposed transformer-based object detector for image input ; it additionally accepts N embeddings of object queries for every image ( assuming every image at most has N objects2 ) to the transformer decoder . We also combine the batch dimension with temporal dimension for the object queries . Outputs from DETR are transformed object representations that are used as inputs to a multilayer perceptron ( MLP ) to predict the bounding box and class label of every object . For Snitch Localization , DETR is trained on object annotations from LA-CATER ( Shamsian et al. , 2020 ) . 2∅ , i.e. , none object , will be predicted if the number of objects in an image is less than N . 3.3 TRACKING . Tracking produces consistent object representations as it links the representations of each object through time . We perform tracking using the unordered object representations , bounding boxes and labels as inputs , and applying our Hungarian-based algorithm to match objects between every two consecutive frames . We describe the details as follows . Tracking is essentially an association problem ( Bewley et al. , 2016 ) . An association between 2 objects respectively from consecutive 2 frames can be defined by the object class agreement and the difference of the two bounding boxes . Let us denote by ŷ = [ ŷt ] Tt=1 the predicted list of objects at all frames in a video , where ŷt = { ŷit } Ni=1 denotes the predicted set of objects at frame t. Each object is represented as a 4-tuple ŷit = ( ĉ i t , b̂ i t , { p̂it ( c ) |c ∈ C } , oit ) where ĉit denotes the class label that has the maximum predicted likelihood for object i at frame t , b̂it ∈ [ 0 , 1 ] 4 is a vector that defines the bounding box top left and bottom right coordinates relative to the image size , p̂it ( c ) denotes the predicted likelihood for class c ( where C = { large metal green cube , small metal green cube , . . . , ∅ } ) , and oit ∈ Rd denotes the representation vector of this object i at frame t. In order to obtain the optimal bipartite matching between the set of predicted objects at frame t and t+ 1 , we search for a permutation of N elements σ ∈ SN with the lowest permutation cost : σ̂ = argmin σ∈SN N∑ i=1 Ltrack ( ŷit , ŷ σ ( i ) t+1 ) ( 1 ) where Ltrack is a pair-wise track matching cost between predicted object ŷit ( i.e. , object i at frame t ) and predicted object at frame t + 1 with index σ ( i ) from the permutation σ , denoted by ŷσ ( i ) t+1 . Following Carion et al . ( 2020 ) , the optimal assignment is computed efficiently with the Hungarian algorithm . The track matching cost at time t for object i is defined as Ltrack ( ŷit , ŷ σ ( i ) t+1 ) = −λc1 { ĉit 6=∅ } p̂ σ ( i ) t+1 ( ĉit ) + λb1 { ĉit 6=∅ } Lbox ( b̂it , b̂ σ ( i ) t+1 ) ( 2 ) where 1 denotes an indicator function such that the equation after the symbol 1 only takes effect when the condition inside the { . . . } is true , otherwise the term will be 0. λc , λb ∈ R weight each term . Lbox is defined as a linear combination of the L1 loss and the generalized IoU loss ( Rezatofighi et al. , 2019 ) . When the predicted class label of object i at frame t is not ∅ , we aim to maximize the likelihood of the class label ĉit for the predicted object σ ( i ) at frame t+ 1 , and minimize the bounding box difference between the two . The total track matching cost of a video is the aggregation of Ltrack ( ŷit , ŷ σ ( i ) t+1 ) from object i = 1 to N and frame t = 1 to T − 1 . This Hungarian-based tracking algorithm is used due to its simplicity . A more sophisticated tracking solution ( e.g . DeepSORT ( Wojke et al. , 2017 ) ) could be easily integrated into Hopper , and may improve the accuracy of tracking in complex scenes .
This paper introduces an architecture (Multi-Hop Transformer) for spatio-temporal reasoning in video, focusing on a localisation task for scenes where the object of interest is often occluded (Snitch Localisation task in CATER). The model extracts objects using an external object-detector and predicts objects’ trajectories using the Hungarian algorithm. The Multi-Hop Transformers learns to hop over unnecessary frames, by focusing only on a set of few critical steps (at each time step, the next critical frame is the one containing the most attended object). To alleviate the problems encountered during the training procedure (such as error propagation), several auxiliary training methods are proposed to guide the first few hops or to ensure contrastive debias. Additionally, a harder version of the existing CATER dataset is created, to alleviate the temporal bias existent in the previous version of the dataset.
SP:fa3f5e47eea572915c94134222535f4f48b2fe83
Hopper: Multi-hop Transformer for Spatiotemporal Reasoning
1 INTRODUCTION In this paper , we address the problem of spatiotemporal object-centric reasoning in videos . Specifically , we focus on the problem of object permanence , which is the ability to represent the existence and the trajectory of hidden moving objects ( Baillargeon , 1986 ) . Object permanence can be essential in understanding videos in the domain of : ( 1 ) sports like soccer , where one needs to reason , “ which player initiated the pass that resulted in a goal ? ” , ( 2 ) activities like shopping , one needs to infer “ what items the shopper should be billed for ? ” , and ( 3 ) driving , to infer “ is there a car next to me in the right lane ? ” . Answering these questions requires the ability to detect and understand the motion of objects in the scene . This requires detecting the temporal order of one or more actions of objects . Furthermore , it also requires learning object permanence , since it requires the ability to predict the location of non-visible objects as ∗Work done as a NEC Labs intern . 1https : //github.com/necla-ml/cater-h they are occluded , contained or carried by other objects ( Shamsian et al. , 2020 ) . Hence , solving this task requires compositional , multi-step spatiotemporal reasoning which has been difficult to achieve using existing deep learning models ( Bottou , 2014 ; Lake et al. , 2017 ) . Existing models have been found lacking when applying to video reasoning and object permanence tasks ( Girdhar & Ramanan , 2020 ) . Despite rapid progress in video understanding benchmarks such as action recognition over large datasets , deep learning based models often suffer from spatial and temporal biases and are often easily fooled by statistical spurious patterns and undesirable dataset biases ( Johnson et al. , 2017b ) . For example , researchers have found that models can recognize the action “ swimming ” even when the actor is masked out , because the models rely on the swimming pool , the scene bias , instead of the dynamics of the actor ( Choi et al. , 2019 ) . Hence , we propose Hopper to address debiased video reasoning . Hopper uses multi-hop reasoning over videos to reason about object permanence . Humans realize object permanence by identifying key frames where objects become hidden ( Bremner et al. , 2015 ) and reason to predict the motion and final location of objects in the video . Given a video and a localization query , Hopper uses a Multi-hop Transformer ( MHT ) over image and object tracks to automatically identify and hop over critical frames in an iterative fashion to predict the final position of the object of interest . Additionally , Hopper uses a contrastive debiasing loss that enforces consistency between attended objects and correct predictions . This improves model robustness and generalization . We also build a new dataset , CATER-h , that reduces temporal bias in CATER and requires long-term reasoning . We demonstrate the effectiveness of Hopper over the recently proposed CATER ‘ Snitch Localization ’ task ( Girdhar & Ramanan , 2020 ) ( Figure 1 ) . Hopper achieves 73.2 % Top-1 accuracy in this task at just 1 FPS . More importantly , Hopper identifies the critical frames where objects become invisible or reappears , providing an interpretable summary of the reasoning performed by the model . To summarize , the contributions of our paper are as follows : First , we introduce Hopper that provides a framework for multi-step compositional reasoning in videos and achieves state-of-the-art accuracy in CATER object permanence task . Second , we describe how to perform interpretable reasoning in videos by using iterative reasoning over critical frames . Third , we perform extensive studies to understand the effectiveness of multi-step reasoning and debiasing methods that are used by Hopper . Based on our results , we also propose a new dataset , CATER-h , that requires longer reasoning hops , and demonstrates the gaps of existing deep learning models . 2 RELATED WORK . Video understanding . Video tasks have matured quickly in recent years ( Hara et al. , 2018 ) ; approaches have been migrated from 2D or 3D ConvNets ( Ji et al. , 2012 ) to two-stream networks ( Simonyan & Zisserman , 2014 ) , inflated design ( Carreira & Zisserman , 2017 ) , models with additional emphasis on capturing the temporal structures ( Zhou et al. , 2018 ) , and recently models that better capture spatiotemporal interactions ( Wang et al. , 2018 ; Girdhar et al. , 2019 ) . Despite the progress , these models often suffer undesirable dataset biases , easily confused by backgrounds objects in new environments as well as varying temporal scales ( Choi et al. , 2019 ) . Furthermore , they are unable to capture reasoning-based constructs such as causal relationships ( Fire & Zhu , 2017 ) or long-term video understanding ( Girdhar & Ramanan , 2020 ) . Visual and video reasoning . Visual and video reasoning have been well-studied recently , but existing research has largely focused on the task of question answering ( Johnson et al. , 2017a ; Hudson & Manning , 2018 ; 2019a ; Yi et al. , 2020 ) . CATER , a recently proposed diagnostic video recognition dataset focuses on spatial and temporal reasoning as well as localizing particular object of interest . There also has been significant research in object tracking , often with an emphasis on occlusions with the goal of providing object permanence ( Wojke et al. , 2017 ; Wang et al. , 2019b ) . Traditional object tracking approaches often require expensive supervision of location of the objects in every frame . In contrast , we address object permanence and video recognition on CATER with a model that performs tracking-integrated object-centric reasoning without this strong supervision . Multi-hop reasoning . Reasoning systems vary in expressive power and predictive abilities , which include symbolic reasoning , probabilistic reasoning , causal reasoning , etc . ( Bottou , 2014 ) . Among them , multi-hop reasoning is the ability to reason with information collected from multiple passages to derive the answer ( Wang et al. , 2019a ) , and it gives a discrete intermediate output of the reasoning process , which can help gauge model ’ s behavior beyond just the final task accuracy ( Chen et al. , 2019 ) . Several multi-hop datasets and models have been proposed for the reading comprehension Target : video query representation object class label positional spatial resolution encoding Time CNN feature maps DETR : End-to-end Transformer based object detector positional time encoding Tracking : Hungarian Between Frame Matching Algorithm Multi-Hop Transformer MLP image features Source object queries object representation object bounding box MLP ... : the number of frames : the number of objects : batch size ... Track 0 Track 1 Track 2 Track N IMG OBJ OBJ OBJ positional time encoding Target : video query Classification Source Sequence A. backbone Ref . Figure 16 B. obj ect det ect ion and r epr esentat ion C. t r acking D. video Quer y r epr esentat ion and r ecognit ion ... : dimension size positional encoded feature maps Figure 2 : An overview of the Hopper framework . Hopper first obtains frame representations from the input video . Object representations and object tracks are then computed to enable tracking-integrated object-centric reasoning for the Multi-hop Transformer ( details in Section 4 ) . task ( Welbl et al. , 2018 ; Yang et al. , 2018b ; Dua et al. , 2019 ; Dhingra et al. , 2020 ) . We extend multihop reasoning to the video domain by developing a dataset that explicitly requires aggregating clues from different spatiotemporal parts of the video , as well as a multi-hop model that automatically extracts a step-by-step reasoning chain , which improves interpretability and imitates a natural way of thinking . We provide an extended discussion of related work in Appendix I . 3 HOPPER . Hopper ( Figure 2 ) is a framework inspired from the observation that humans think in terms of entities and relations . Unlike traditional deep visual networks that perform processing over the pixels from which they learn and extract features , object-centric learning-based architecture explicitly separates information about entities through grouping and abstraction from the low-level information ( Locatello et al. , 2020 ) . Hopper obtains representations of object entities from the lowlevel pixel information of every frame ( Section 3.2 ) . Additionally , to maintain object permanence , humans are able to identify key moments when the objects disappear and reappear . To imitate that , Hopper computes object tracks with the goal to have a more consistent object representation ( Section 3.3 ) and then achieves multi-step compositional long-term reasoning with the Multi-hop Transformer to pinpoint these critical moments . Furthermore , Hopper combines both fine-grained ( object ) and coarse-grained ( image ) information to form a contextual understanding of a video . As shown in Figure 2 , Hopper contains 4 components ; we describe them below . 3.1 BACKBONE . Starting from the initial RGB-based video representation xv ∈ RT×3×H0×W0 where T represents the number of frames of the video , 3 is for the three color channels , and H0 and W0 denote the original resolution height and width , a conventional CNN backbone would extract the feature map f ∈ RT×P×H×W and for every frame t a compact image representation it ∈ RP . The backbone we use is ResNeXt-101 from Ma et al . ( 2018 ) , P = 2048 and H , W = 8 , 10 . A 1×1 convolution ( Carion et al. , 2020 ) then reduces the channel dimension of f from P to a smaller dimension d ( d = 256 ) , and a linear layer is used to turn the dimension of it from P to d . 3.2 OBJECT DETECTION AND REPRESENTATION . We collapse the spatial dimensions into 1 dimension and combine the batch dimension with the temporal dimension for the feature map f . Positional encodings are learned for each time step ( T in total ) and each spatial location ( H × W in total ) , which are further added to the feature map in an element-wise manner . The positional encoding-augmented feature map is the source input to the transformer encoder ( Vaswani et al. , 2017 ) of DETR ( Carion et al. , 2020 ) . DETR is a recently proposed transformer-based object detector for image input ; it additionally accepts N embeddings of object queries for every image ( assuming every image at most has N objects2 ) to the transformer decoder . We also combine the batch dimension with temporal dimension for the object queries . Outputs from DETR are transformed object representations that are used as inputs to a multilayer perceptron ( MLP ) to predict the bounding box and class label of every object . For Snitch Localization , DETR is trained on object annotations from LA-CATER ( Shamsian et al. , 2020 ) . 2∅ , i.e. , none object , will be predicted if the number of objects in an image is less than N . 3.3 TRACKING . Tracking produces consistent object representations as it links the representations of each object through time . We perform tracking using the unordered object representations , bounding boxes and labels as inputs , and applying our Hungarian-based algorithm to match objects between every two consecutive frames . We describe the details as follows . Tracking is essentially an association problem ( Bewley et al. , 2016 ) . An association between 2 objects respectively from consecutive 2 frames can be defined by the object class agreement and the difference of the two bounding boxes . Let us denote by ŷ = [ ŷt ] Tt=1 the predicted list of objects at all frames in a video , where ŷt = { ŷit } Ni=1 denotes the predicted set of objects at frame t. Each object is represented as a 4-tuple ŷit = ( ĉ i t , b̂ i t , { p̂it ( c ) |c ∈ C } , oit ) where ĉit denotes the class label that has the maximum predicted likelihood for object i at frame t , b̂it ∈ [ 0 , 1 ] 4 is a vector that defines the bounding box top left and bottom right coordinates relative to the image size , p̂it ( c ) denotes the predicted likelihood for class c ( where C = { large metal green cube , small metal green cube , . . . , ∅ } ) , and oit ∈ Rd denotes the representation vector of this object i at frame t. In order to obtain the optimal bipartite matching between the set of predicted objects at frame t and t+ 1 , we search for a permutation of N elements σ ∈ SN with the lowest permutation cost : σ̂ = argmin σ∈SN N∑ i=1 Ltrack ( ŷit , ŷ σ ( i ) t+1 ) ( 1 ) where Ltrack is a pair-wise track matching cost between predicted object ŷit ( i.e. , object i at frame t ) and predicted object at frame t + 1 with index σ ( i ) from the permutation σ , denoted by ŷσ ( i ) t+1 . Following Carion et al . ( 2020 ) , the optimal assignment is computed efficiently with the Hungarian algorithm . The track matching cost at time t for object i is defined as Ltrack ( ŷit , ŷ σ ( i ) t+1 ) = −λc1 { ĉit 6=∅ } p̂ σ ( i ) t+1 ( ĉit ) + λb1 { ĉit 6=∅ } Lbox ( b̂it , b̂ σ ( i ) t+1 ) ( 2 ) where 1 denotes an indicator function such that the equation after the symbol 1 only takes effect when the condition inside the { . . . } is true , otherwise the term will be 0. λc , λb ∈ R weight each term . Lbox is defined as a linear combination of the L1 loss and the generalized IoU loss ( Rezatofighi et al. , 2019 ) . When the predicted class label of object i at frame t is not ∅ , we aim to maximize the likelihood of the class label ĉit for the predicted object σ ( i ) at frame t+ 1 , and minimize the bounding box difference between the two . The total track matching cost of a video is the aggregation of Ltrack ( ŷit , ŷ σ ( i ) t+1 ) from object i = 1 to N and frame t = 1 to T − 1 . This Hungarian-based tracking algorithm is used due to its simplicity . A more sophisticated tracking solution ( e.g . DeepSORT ( Wojke et al. , 2017 ) ) could be easily integrated into Hopper , and may improve the accuracy of tracking in complex scenes .
This paper proposes a multi-hop transformer method for the video-based object permanence task. The proposed method performs multi-hop reasoning via the encoder-decoder architecture of transformers over critical frames in the video. To mitigate the problem of lacking ground truth for the middle hops, the paper proposes some interesting training tricks. Overall, the paper is well organized and easy to follow.
SP:fa3f5e47eea572915c94134222535f4f48b2fe83
Contrastive Video Textures
1 INTRODUCTION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) and Variational Autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) have achieved great success in generating images “ from scratch ” . While one might have hoped that video generation would be a simple extension of image-generation methods , this has not been the case . A major reason is that videos are much higher dimensional than images , and producing correct transitions between frames is a difficult problem . While video generation ( Vondrick et al. , 2016 ; Mallya et al. , 2020 ; Lee et al. , 2019 ; Wang et al. , 2018a ; b ) has shown some success , videos generated using such methods are relatively short and are unable to match the realism of actual videos . In comparison , classic non-parametric video synthesis methods from two decades ago , most notably Video Textures ( Schödl et al. , 2000 ) , are much simpler and can often produce videos of arbitrary lengths . In these models , a new plausible video is generated by stitching together snippets of an existing video . While video textures have been very successful on simple videos with a high degree of regularity , they use simple Euclidean pixel distance as a similarity metric between frames , which causes them to fail for less constrained videos containing irregularities and chaotic movements , such as dance or playing a musical instrument . They are also sensitive to subtle changes in brightness and often produce jarring transitions . In this work , we propose Contrastive Video Textures , a non-parametric learning-based approach for video texture synthesis that overcomes the limitations of classic video textures . As in Schödl et al . ( 2000 ) , we synthesize textures by resampling frames from the input video . However , as opposed to using pixel similarity , we learn feature representations and a distance metric to compare frames by training a deep model on a single input video . The network is trained using contrastive learning to fit an example-specific bi-gram model ( i.e . a Markov chain ) . To synthesize the video texture , we use the video-specific model to compute probabilities of transitioning between frames of the same video . We represent the video as a graph where the individual frames are nodes and the edges represent transition probabilities predicted by our video-specific model . We generate output videos ( or textures ) by randomly traversing edges with high transition probabilities . We additionally incorporate deep video interpolation into our contrastive video textures framework to suppress visual discontinuities and to allow for large transitions . Our proposed method is able to synthesize realistic , smooth , and diverse output textures on a variety of domains , including dance and music videos as shown at this website . Fig . 1 illustrates the distinction between video generation/prediction , video textures and our contrastive model . We also extend our model to an audio conditioned video synthesis task . Given a source video with associated audio and a new conditioning audio not in the source , we synthesize a new video that approximately matches the conditioning audio . A demonstration of this task is shown at this link . We modify the inference algorithm to include an additional constraint that the predicted frame ’ s audio should match the conditioning audio . We trade off between temporal coherence ( frames predicted by the constrastive video texture model ) and audio similarity ( frames predicted by the audio matching algorithm ) to generate videos which align well with the conditioning audio and are also temporally smooth . We assess the perceptual quality of the synthesized textures by conducting human perceptual evaluations comparing our method to a number of baselines . In the case of unconditional video texture synthesis , we compare to the classic video texture algorithm ( Schödl et al. , 2000 ) and variations to this which we describe in Sec . 4 . For the audio conditioning setting , we compare to three different baselines : classic video textures with audio conditioning , visual rhythm and beat ( Davis & Agrawala , 2018 ) , and a random baseline . Our results confirm that our method is perceptually better than all the baselines . 2 CONTRASTIVE VIDEO TEXTURES . We propose a non-parametric learning-based approach for video texture synthesis . At a high-level , we fit an example-specific bi-gram model ( i.e . a Markov chain ) and use it to re-sample input frames , producing a diverse and temporally coherent video . In the following , we first define the bi-gram model , and then describe how to train and sample from it . Given an input video , we extract N overlapping segments denoted by Vi where i ∈ [ 1 , ... N ] , with a sliding window of length W and stride s. Consider these segments to be the states of a Markov chain , where the probability of transition is computed by a deep similarity function parameterized by encoders φ and ψ : P ( Vi+1|Vi ) ∝ exp ( sim ( φ ( Vi ) , ψ ( Vi+1 ) ) /τ ) ( 1 ) Fitting the transition probabilities amounts to fitting the parameters of φ and ψ , which here will take form of a 3D convolutional network , by maximizing the log-likelihood of the sequence under the model : L ( V , φ ) = N∑ i=1 − logP ( Vi+1|Vi ) = N∑ i=1 −log exp ( sim ( φ ( Vi ) , ψ ( Vi+1 ) ) /τ ) ∑N j=1 [ j 6=i , i+1 ] exp ( sim ( φ ( Vi ) , ψ ( Vj ) ) /τ ) ( 2 ) where τ denotes a temperature term that modulates the sharpness of the softmax distribution . As the complexity increases with number of negatives in the denominator , for efficiency , we use negative sampling ( Mikolov et al. , 2013 ) to approximate in Eq 2 . Fitting the encoder in this manner amounts to learning a video representation by contrastive learning , where the positive is the segment that follows , and negatives are sampled from the set of all other segments . The encoder thus learns features useful for predicting the dynamics of phenomena specific to the input video . Given that we fit the model on a single video , it is important that we ensure there is enough entropy in the transition distribution in order to ensure diversity in samples synthesized during inference . While we assume that our input video sequence exhibits sufficient hierarchical , periodic structure to ensure repetition and multi-modality , we can also directly adjust the conditional entropy of the model through the softmax temperature term τ . As we will see in Sec . 2 , the encoder used for conditioning and prediction also plays a role in ensuring diversity in the sampling distribution . An overview of our method is provided in Fig . 2 . Video Texture Synthesis . To synthesize the texture , we represent the video as a graph , with nodes as segments and edges indicating the transition probabilities computed by our model . We randomly select a query segment Vt among the segments of the video and set the output sequence to all the W frames in Vt. Next , our contrastive model computes φ ( Vt ) and ψ ( Vj ) for all segments in the video and updates the edges of the graph with the transition probabilities , given by sim ( φ ( Vt ) , ψ ( Vj ) ) . The target segment with the highest transition probability is chosen as the positive segment . We then append the last s number of frames in the positive segment to the output . This predicted positive segment Vt+1 is again fed into the network as the query and this is repeated to generate the whole output in an autoregressive fashion . This approach would regurgitate the original sequence , as the model was trained to predict Vi+1 as the positive segment given Vi as the query . The edge with the maximum weight is always directed to the next segment in the video . In order to introduce variance in the generated textures , we select segments which are similar to the positive segment Vi+1 . First , we vary the temperature term τ to adjust the weights of the graph . The temperature term controls the entropy of the output distribution . A lower temperature would flatten the prediction probabilities/increase the entropy and reduce the difference in probabilities of the positive segment and segments similar to it . We then threshold the probabilities and set values to zero if they are less than t % of the max weighted edge connecting Vt to any other node Vj , we set , sim ( φ ( Vt ) , ψ ( Vj ) ) = 0 ∀ j , where sim ( φ ( Vt ) , ψ ( Vj ) ) < max l=1 , ... , N ( sim ( φ ( Vt ) , ψ ( Vl ) ) − t % Next , we randomly select a frame to transition to from the edges with non-zero probabilities . This introduces variance in the generated textures and also ensures that the transitions are smooth and coherent . Video Encoding . We use the SlowFast ( Feichtenhofer et al. , 2019 ) action recognition framework for encoding the video segments . We introduce two separate query and target multi-layer perceptrons to break the symmetry between the query and target embeddings . This ensures sim ( Vi , Vi+1 ) 6= sim ( Vi+1 , Vi ) which allows us to learn the arrow of time . Interpolation . For smoother transitions , we also conditionally interpolate between frames of the synthesized texture when there are transitions to different parts of the video . We use a pre-trained interpolation network of Jiang et al . ( 2018 ) . We include results both with and without interpolation to show that interpolation helps with smoothing . 3 AUDIO-CONDITIONED CONTRASTIVE VIDEO SYNTHESIS . We extend Contrastive Video Textures to synthesize videos that match a conditioning audio signal . Given an input video and a conditioning audio Ac we synthesize a new video that is synchronized with the audio . We extract N overlapping segments from the conditioning audio , as before . We compute the similarity of the source audio segments As to the conditioning audio segment Ac by matching them in an embedding space and computing the similarity between the audio segments . We construct a transition probability matrix Ta in the audio space as in Eq . 3 . Ta ( i , j ) = sim ( ϕ ( A c i ) , ϕ ( A s j ) ) ( 3 ) T = αTv + ( 1− α ) Ta ( 4 ) We compute the transition probabilities Tv for the target video segments given the previous predicted segment using the contrastive video textures model ( Eq . 2 ) . The joint transition probabilities for a segment are formulated as a trade-off between the audio conditioning signal and the temporal coherence constraint as in Eq . 4 . Table 1 : Perceptual Studies for Unconditional Video Textures and Audio Conditioned Video Synthesis . ( a ) We show MTurk evaluators textures synthesized by all 5 methods and ask them to pick the most realistic one . We also report the chance evaluators chose any of the variation of the classic model . Method Preference % Classic 3.33 ± 2.42 % Classic Deep 6.66 ± 3.37 % Classic+ 10.95 ± 4.22 % Classic++ 9.52 ± 3.97 % Any Classic 30.48 ± 6.22 Contrastive 69.52 ± 6.22 % ( b ) Unconditional : Real vs . Fake study . We show evaluators a pair of videos ( generated and real video ) without labels , ask them to pick the real one . Our method fools evaluators more times than Classic . Method Real vs . Fake Classic++ 11.4 ± 4.30 % Classic+ 15.7 ± 4.92 % Contrastive 45.7 ± 4.3 % ( c ) Conditional : Real vs . Fake study . We show evaluators a pair of videos ( generated and real video ) without labels and ask them to pick the real one . Our method fooled evaluators more often than did baselines . Method Real vs Fake Random Clip 15.33 ± 5.76 % Audio NN 20.4 ± 6.63 % Contrastive 26.74 ± 6.14 % Audio encoding . We embed the audio segments using the VGGish model ( Hershey et al. , 2017 ) pretrained on AudioSet ( Gemmeke et al. , 2017 ) . We remove the last fully connected layer from the model and use the output of the final convolutional layer as audio features . We describe details of the implementation of our method in Sec . A.1 .
In this paper, the authors proposed a non-parametric approach for video generation, i.e., video frame (un)conditional resampling. The proposed method is inspired by Video Textures (Sch¨odl et al., 2000), which synthesizes new videos by stitching together snippets of an existing video. Comparing to existing 'video textures' methods, the authors mainly made two improvements/contributions. (i) a new pipeline for modeling and calculating probabilities of transitioning between frames of the same videos. Specifically, giving a video clip, the authors first extract overlapping segments from it and fit a bi-gram model. The adjacent segments are regarded as positive pairs with high transitioning probability, yet other random sampled pairs are negative pairs. Similar to contrastive learning works, NCE loss is utilized to train the bi-gram model. (ii) Extending the model to a conditional situation and performing the task of audio conditioned video synthesis. The authors made a trade-off between the audio conditioning signal and the learned transition probabilities. Finally, experiments including multiple qualitative resampled videos and quantitative user studies were provided. And the proposed method demonstrated promising performance.
SP:bafcf085e146530fbae6b30f7966f413eb003df6
Contrastive Video Textures
1 INTRODUCTION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) and Variational Autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) have achieved great success in generating images “ from scratch ” . While one might have hoped that video generation would be a simple extension of image-generation methods , this has not been the case . A major reason is that videos are much higher dimensional than images , and producing correct transitions between frames is a difficult problem . While video generation ( Vondrick et al. , 2016 ; Mallya et al. , 2020 ; Lee et al. , 2019 ; Wang et al. , 2018a ; b ) has shown some success , videos generated using such methods are relatively short and are unable to match the realism of actual videos . In comparison , classic non-parametric video synthesis methods from two decades ago , most notably Video Textures ( Schödl et al. , 2000 ) , are much simpler and can often produce videos of arbitrary lengths . In these models , a new plausible video is generated by stitching together snippets of an existing video . While video textures have been very successful on simple videos with a high degree of regularity , they use simple Euclidean pixel distance as a similarity metric between frames , which causes them to fail for less constrained videos containing irregularities and chaotic movements , such as dance or playing a musical instrument . They are also sensitive to subtle changes in brightness and often produce jarring transitions . In this work , we propose Contrastive Video Textures , a non-parametric learning-based approach for video texture synthesis that overcomes the limitations of classic video textures . As in Schödl et al . ( 2000 ) , we synthesize textures by resampling frames from the input video . However , as opposed to using pixel similarity , we learn feature representations and a distance metric to compare frames by training a deep model on a single input video . The network is trained using contrastive learning to fit an example-specific bi-gram model ( i.e . a Markov chain ) . To synthesize the video texture , we use the video-specific model to compute probabilities of transitioning between frames of the same video . We represent the video as a graph where the individual frames are nodes and the edges represent transition probabilities predicted by our video-specific model . We generate output videos ( or textures ) by randomly traversing edges with high transition probabilities . We additionally incorporate deep video interpolation into our contrastive video textures framework to suppress visual discontinuities and to allow for large transitions . Our proposed method is able to synthesize realistic , smooth , and diverse output textures on a variety of domains , including dance and music videos as shown at this website . Fig . 1 illustrates the distinction between video generation/prediction , video textures and our contrastive model . We also extend our model to an audio conditioned video synthesis task . Given a source video with associated audio and a new conditioning audio not in the source , we synthesize a new video that approximately matches the conditioning audio . A demonstration of this task is shown at this link . We modify the inference algorithm to include an additional constraint that the predicted frame ’ s audio should match the conditioning audio . We trade off between temporal coherence ( frames predicted by the constrastive video texture model ) and audio similarity ( frames predicted by the audio matching algorithm ) to generate videos which align well with the conditioning audio and are also temporally smooth . We assess the perceptual quality of the synthesized textures by conducting human perceptual evaluations comparing our method to a number of baselines . In the case of unconditional video texture synthesis , we compare to the classic video texture algorithm ( Schödl et al. , 2000 ) and variations to this which we describe in Sec . 4 . For the audio conditioning setting , we compare to three different baselines : classic video textures with audio conditioning , visual rhythm and beat ( Davis & Agrawala , 2018 ) , and a random baseline . Our results confirm that our method is perceptually better than all the baselines . 2 CONTRASTIVE VIDEO TEXTURES . We propose a non-parametric learning-based approach for video texture synthesis . At a high-level , we fit an example-specific bi-gram model ( i.e . a Markov chain ) and use it to re-sample input frames , producing a diverse and temporally coherent video . In the following , we first define the bi-gram model , and then describe how to train and sample from it . Given an input video , we extract N overlapping segments denoted by Vi where i ∈ [ 1 , ... N ] , with a sliding window of length W and stride s. Consider these segments to be the states of a Markov chain , where the probability of transition is computed by a deep similarity function parameterized by encoders φ and ψ : P ( Vi+1|Vi ) ∝ exp ( sim ( φ ( Vi ) , ψ ( Vi+1 ) ) /τ ) ( 1 ) Fitting the transition probabilities amounts to fitting the parameters of φ and ψ , which here will take form of a 3D convolutional network , by maximizing the log-likelihood of the sequence under the model : L ( V , φ ) = N∑ i=1 − logP ( Vi+1|Vi ) = N∑ i=1 −log exp ( sim ( φ ( Vi ) , ψ ( Vi+1 ) ) /τ ) ∑N j=1 [ j 6=i , i+1 ] exp ( sim ( φ ( Vi ) , ψ ( Vj ) ) /τ ) ( 2 ) where τ denotes a temperature term that modulates the sharpness of the softmax distribution . As the complexity increases with number of negatives in the denominator , for efficiency , we use negative sampling ( Mikolov et al. , 2013 ) to approximate in Eq 2 . Fitting the encoder in this manner amounts to learning a video representation by contrastive learning , where the positive is the segment that follows , and negatives are sampled from the set of all other segments . The encoder thus learns features useful for predicting the dynamics of phenomena specific to the input video . Given that we fit the model on a single video , it is important that we ensure there is enough entropy in the transition distribution in order to ensure diversity in samples synthesized during inference . While we assume that our input video sequence exhibits sufficient hierarchical , periodic structure to ensure repetition and multi-modality , we can also directly adjust the conditional entropy of the model through the softmax temperature term τ . As we will see in Sec . 2 , the encoder used for conditioning and prediction also plays a role in ensuring diversity in the sampling distribution . An overview of our method is provided in Fig . 2 . Video Texture Synthesis . To synthesize the texture , we represent the video as a graph , with nodes as segments and edges indicating the transition probabilities computed by our model . We randomly select a query segment Vt among the segments of the video and set the output sequence to all the W frames in Vt. Next , our contrastive model computes φ ( Vt ) and ψ ( Vj ) for all segments in the video and updates the edges of the graph with the transition probabilities , given by sim ( φ ( Vt ) , ψ ( Vj ) ) . The target segment with the highest transition probability is chosen as the positive segment . We then append the last s number of frames in the positive segment to the output . This predicted positive segment Vt+1 is again fed into the network as the query and this is repeated to generate the whole output in an autoregressive fashion . This approach would regurgitate the original sequence , as the model was trained to predict Vi+1 as the positive segment given Vi as the query . The edge with the maximum weight is always directed to the next segment in the video . In order to introduce variance in the generated textures , we select segments which are similar to the positive segment Vi+1 . First , we vary the temperature term τ to adjust the weights of the graph . The temperature term controls the entropy of the output distribution . A lower temperature would flatten the prediction probabilities/increase the entropy and reduce the difference in probabilities of the positive segment and segments similar to it . We then threshold the probabilities and set values to zero if they are less than t % of the max weighted edge connecting Vt to any other node Vj , we set , sim ( φ ( Vt ) , ψ ( Vj ) ) = 0 ∀ j , where sim ( φ ( Vt ) , ψ ( Vj ) ) < max l=1 , ... , N ( sim ( φ ( Vt ) , ψ ( Vl ) ) − t % Next , we randomly select a frame to transition to from the edges with non-zero probabilities . This introduces variance in the generated textures and also ensures that the transitions are smooth and coherent . Video Encoding . We use the SlowFast ( Feichtenhofer et al. , 2019 ) action recognition framework for encoding the video segments . We introduce two separate query and target multi-layer perceptrons to break the symmetry between the query and target embeddings . This ensures sim ( Vi , Vi+1 ) 6= sim ( Vi+1 , Vi ) which allows us to learn the arrow of time . Interpolation . For smoother transitions , we also conditionally interpolate between frames of the synthesized texture when there are transitions to different parts of the video . We use a pre-trained interpolation network of Jiang et al . ( 2018 ) . We include results both with and without interpolation to show that interpolation helps with smoothing . 3 AUDIO-CONDITIONED CONTRASTIVE VIDEO SYNTHESIS . We extend Contrastive Video Textures to synthesize videos that match a conditioning audio signal . Given an input video and a conditioning audio Ac we synthesize a new video that is synchronized with the audio . We extract N overlapping segments from the conditioning audio , as before . We compute the similarity of the source audio segments As to the conditioning audio segment Ac by matching them in an embedding space and computing the similarity between the audio segments . We construct a transition probability matrix Ta in the audio space as in Eq . 3 . Ta ( i , j ) = sim ( ϕ ( A c i ) , ϕ ( A s j ) ) ( 3 ) T = αTv + ( 1− α ) Ta ( 4 ) We compute the transition probabilities Tv for the target video segments given the previous predicted segment using the contrastive video textures model ( Eq . 2 ) . The joint transition probabilities for a segment are formulated as a trade-off between the audio conditioning signal and the temporal coherence constraint as in Eq . 4 . Table 1 : Perceptual Studies for Unconditional Video Textures and Audio Conditioned Video Synthesis . ( a ) We show MTurk evaluators textures synthesized by all 5 methods and ask them to pick the most realistic one . We also report the chance evaluators chose any of the variation of the classic model . Method Preference % Classic 3.33 ± 2.42 % Classic Deep 6.66 ± 3.37 % Classic+ 10.95 ± 4.22 % Classic++ 9.52 ± 3.97 % Any Classic 30.48 ± 6.22 Contrastive 69.52 ± 6.22 % ( b ) Unconditional : Real vs . Fake study . We show evaluators a pair of videos ( generated and real video ) without labels , ask them to pick the real one . Our method fools evaluators more times than Classic . Method Real vs . Fake Classic++ 11.4 ± 4.30 % Classic+ 15.7 ± 4.92 % Contrastive 45.7 ± 4.3 % ( c ) Conditional : Real vs . Fake study . We show evaluators a pair of videos ( generated and real video ) without labels and ask them to pick the real one . Our method fooled evaluators more often than did baselines . Method Real vs Fake Random Clip 15.33 ± 5.76 % Audio NN 20.4 ± 6.63 % Contrastive 26.74 ± 6.14 % Audio encoding . We embed the audio segments using the VGGish model ( Hershey et al. , 2017 ) pretrained on AudioSet ( Gemmeke et al. , 2017 ) . We remove the last fully connected layer from the model and use the output of the final convolutional layer as audio features . We describe details of the implementation of our method in Sec . A.1 .
of this paper: In this work, the authors propose a method to learn to generate long-range video sequences. The general idea is starting from a prior work (Video Textures) and extending this work with a learning framework. Specifically, during training a model is used to learn the transition probability between different video segments. During inference, long-range video synthesis is achieved through iterative sampling of new video segments. To guarantee the smoothness of the transition between different segments, an existing interpolation method is used to connect these video segments in a sequential order.
SP:bafcf085e146530fbae6b30f7966f413eb003df6
Auto Seg-Loss: Searching Metric Surrogates for Semantic Segmentation
1 INTRODUCTION . Loss functions are of indispensable components in training deep networks , as they drive the feature learning process for various applications with specific evaluation metrics . However , most metrics , like the commonly used 0-1 classification error , are non-differentiable in their original forms and can not be directly optimized via gradient-based methods . Empirically , the cross-entropy loss serves well as an effective surrogate objective function for a variety of tasks concerning categorization . This phenomenon is especially prevailing in image semantic segmentation , where various evaluation metrics have been designed to address the diverse task focusing on different scenarios . Some metrics measure the accuracy on the whole image , while others focus more on the segmentation boundaries . Although cross-entropy and its variants work well for many metrics , the mis-alignment between network training and evaluation still exist and inevitably leads to performance degradation . Typically , there are two ways for designing metric-specific loss functions in semantic segmentation . The first is to modify the standard cross-entropy loss to meet the target metric ( Ronneberger et al. , 2015 ; Wu et al. , 2016 ) . The other is to design other clever surrogate losses for specific evaluation metrics ( Rahman & Wang , 2016 ; Milletari et al. , 2016 ) . Despite the improvements , these handcrafted losses need expertise and are non-trivial to extend to other evaluation metrics . In contrast to designing loss functions manually , an alternative approach is to find a framework that can design proper loss functions for different evaluation metrics in an automated manner , motivated by recent progress in AutoML ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2018 ; Li et al. , 2019 ) . Although automating the design process for loss functions is attractive , it is non-trivial to apply an ∗Equal contribution . †This work is done when Hao Li and Chenxin Tao are interns at SenseTime Research . ‡Corresponding author . AutoML framework to loss functions . Typical AutoML algorithms require a proper search space , in which some search algorithms are conducted . Previous search spaces are either unsuitable for loss design , or too general to be searched efficiently . Recently Li et al . ( 2019 ) and Wang et al . ( 2020 ) proposed search spaces based on existing handcrafted loss functions . And the algorithm searches for the best combination . However , these search spaces are still limited to the variants of cross-entropy loss , and thus do not address the mis-alignment problem well . In this paper , we propose a general framework for searching surrogate losses for mainstream nondifferentiable segmentation metrics . The key idea is that we can build the search space according to the form of evaluation metrics . In this way , the training criteria and evaluation metrics are unified . Meanwhile , the search space is compact enough for efficient search . Specifically , the metrics are first relaxed to the continuous domain by substituting the one-hot prediction and logical operations , which are the non-differentiable parts in most metrics , with their differentiable approximations . Parameterized functions are introduced to approximate the logical operations , ensuring that the loss surfaces are smooth while effective for training . The loss parameterization functions can be of arbitrary families defined on [ 0 , 1 ] . Parameter search is further conducted on the chosen family so as to optimize the network performance on the validation set with the given evaluation metric . Two essential constraints are introduced to regularize the parameter search space . We find that the searched surrogate losses can effectively generalize to different networks and datasets . Extensive experiments on Pascal VOC ( Everingham et al. , 2015 ) and Cityscapes ( Cordts et al. , 2016 ) show our approach delivers accuracy superior than the existing losses specifically designed for individual segmentation metrics with a mild computational overhead . Our contributions can be summarized as follows : 1 ) Our approach is the first general framework of surrogate loss search for mainstream segmentation metrics . 2 ) We propose an effective parameter regularization and parameter search algorithm , which can find loss surrogates optimizing the target metric performance with mild computational overhead . 3 ) The surrogate losses obtained via the proposed searching framework promote our understandings on loss function design and by themselves are novel contributions , because they are different from existing loss functions specifically designed for individual metrics , and are transferable across different datasets and networks . 2 RELATED WORK . Loss function design is an active topic in deep network training ( Ma , 2020 ) . In the area of image semantic segmentation , cross-entropy loss is widely used ( Ronneberger et al. , 2015 ; Chen et al. , 2018 ) . But the cross-entropy loss is designed for optimizing the global accuracy measure ( Rahman & Wang , 2016 ; Patel et al. , 2020 ) , which is not aligned with many other metrics . Numerous studies are conducted to design proper loss functions for the prevalent evaluation metrics . For the mIoU metric , many works ( Ronneberger et al. , 2015 ; Wu et al. , 2016 ) incorporate class frequency to mitigate the class imbalance problem . For the boundary F1 score , the losses at boundary regions are up-weighted ( Caliva et al. , 2019 ; Qin et al. , 2019 ) , so as to deliver more accurate boundaries . These works carefully analyze the property of specific evaluation metrics , and design the loss functions in a fully handcrafted way , which needs expertise . By contrast , we propose a unified framework for deriving parameterized surrogate losses for various evaluation metrics . Wherein , the parameters are searched by reinforcement learning in an automatic way . The networks trained with the searched surrogate losses deliver accuracy on par or even superior than those with the best handcrafted losses . Direct loss optimization for non-differentiable evaluation metrics has long been studied for structural SVM models ( Joachims , 2005 ; Yue et al. , 2007 ; Ranjbar et al. , 2012 ) . However , the gradients w.r.t . features can not be derived from these approaches . Therefore , they can not drive the training of deep networks through back-propagation . Hazan et al . ( 2010 ) proposes to optimize structural SVM with gradient descent , where loss-augmented inference is applied to get the gradients of the expectation of evaluation metrics . Song et al . ( 2016 ) further extends this approach to non-linear models ( e.g. , deep neural networks ) . However , the computational complexity is very high during each step in gradient descent . Although Song et al . ( 2016 ) and Mohapatra et al . ( 2018 ) have designed efficient algorithms for the Average Precision ( AP ) metric , other metrics still need specially designed efficient algorithms . Our method , by contrast , is general for the mainstream segmentation metrics . Thanks to the good generalizability , our method only needs to perform the search process once for a specific metric , and the searched surrogate loss can be directly used henceforth . Applying the searched loss for training networks brings very little additional computational cost . Surrogate loss is introduced to derive loss gradients for the non-differentiable evaluation metrics . There are usually two ways for designing surrogate losses . The first is to handcraft an approximated differentiable metric function . For the IoU measure , Rahman & Wang ( 2016 ) propose to approximate the intersection and union seperately using the softmax probabilities in a differentiable form , and show its effectiveness on binary segmentation tasks . Berman et al . ( 2018 ) further deal with multi-class segmentation problems by extending mIoU from binary inputs to the continuous domain with the convex Lovàsz extension , and their method outperforms standard cross entropy loss in multi-class segmentation tasks . For the F1 measure , dice loss is proposed by Milletari et al . ( 2016 ) as a direct objective by substituting the binary prediction with the softmax probability . In spite of the success , they do not apply for other metrics . The second solution is to train a network to approximate the target metric . Nagendar et al . ( 2018 ) train a network to approximate mIoU . Patel et al . ( 2020 ) design a neural network to learn embeddings for predictions and ground truths for tasks other than segmentation . This line of research focuses on minimizing the approximation error w.r.t . the target metrics . But there is no guarantee that their approximations provide good loss signals for training . These approximated losses are just employed in a post-tuning setup , still relying on cross-entropy pre-trained models . Our method significantly differs in that we search surrogate losses to directly optimize the evaluation metrics in applications . AutoML is a long-pursued target of machine learning ( He et al. , 2019 ) . Recently a sub-field of AutoML , neural architecture search ( NAS ) , has attracted much attention due to its success in automating the process of neural network architecture design ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2018 ) . As an essential element , loss function has also raised the interest of researchers to automate its design process . Li et al . ( 2019 ) and Wang et al . ( 2020 ) design search spaces based on existing human-designed loss functions and search for the best combination parameters . There are two issues : a ) the search process outputs whole network models rather than loss functions . For every new network or dataset , the expensive search procedure is conducted again , and b ) the search space are filled with variants of cross-entropy , which can not solve the mis-alignment between cross-entropy loss and many target metrics . By contrast , our method outputs the searched surrogate loss functions of close form with the target metrics , which are transferable between networks and datasets . 3 REVISITING EVALUATION METRICS FOR SEMANTIC SEGMENTATION . Various evaluation metrics are defined for semantic segmentation , to address the diverse task focusing on different scenarios . Most of them are of three typical classes : Acc-based , IoU-based , and F1-score-based . This section revisits the evaluation metrics , under a unified notation set . Table 1 summarizes the mainstream evaluation metrics . The notations are as follows : suppose the validation set is composed of N images , labeled with categories from C classes ( background included ) . Let In , n ∈ { 1 , . . . , N } be the n-th image , and Yn be the corresponding ground-truth segmentation mask . Here Yn = { yn , c , h , w } c , h , w is a one-hot vector , where yn , c , h , w ∈ { 0 , 1 } indicates whether the pixel at spatial location ( h , w ) belongs to the c-th category ( c ∈ { 1 , . . . , C } ) . In evaluation , the ground-truth segmentation mask Yn is compared to the network prediction Ŷn = { ŷn , c , h , w } c , h , w , where ŷn , c , h , w ∈ { 0 , 1 } . ŷn , c , h , w is quantized from the continuous scores produced by the network ( by argmax operation ) . Acc-based metrics . The global accuracy measure ( gAcc ) counts the number of pixels correctly classified . It can be written with logical operator AND as Eq . ( 1 ) . The gAcc metric counts each pixel equally , so the results of the long-tailed categories have little impact on the metric number . The mean accuracy ( mAcc ) metric mitigates this by normalizing within each category as in Eq . ( 2 ) . IoU-based metrics . The evaluation is on set similarity rather than pixel accuracy . The intersectionover-union ( IoU ) score is evaluated between the prediction and the ground-truth mask of each category . The mean IoU ( mIoU ) metric averages the IoU scores of all categories , as in Eq . ( 3 ) . In the variants , the frequency weighted IoU ( FWIoU ) metric weighs each category IoU score by the category pixel number , as in Eq . ( 4 ) . The boudary IoU ( BIoU ) ( Kohli et al. , 2009 ) metric only cares about the segmentation quality around the boundary , so it picks the boundary pixels out in evaluation and ignores the rest pixels . It can be calculated with Eq . ( 5 ) , in which BD ( yn ) denotes the boundary region in map yn . BD ( yn ) is derived by applying XOR operation on the min-pooled ground-truth mask . The stride of the Min-Pooling ( · ) is 1 . F1-score-based metrics . F1-score is a criterion that takes both precision and recall into consideration . A well-known metric of this type is boundary F1-score ( BF1-score ) ( Csurka et al. , 2013 ) , which is widely used for evaluating boundary segmentation accuracy . The computation of precision and recall in BF1-score is as in Eq . ( 6 ) , where BD ( ŷn ) and BD ( yn ) are derived from Eq . ( 5 ) . Max pooling with stride 1 , Max-Pooling ( · ) , is applied on the boundary regions to allow error tolerance .
This paper aims to directly optimize the metrics of semantic segmentation tasks, such as mIoU, which is different from the most existing methods which minimize the cross-entropy as a proxy. The metrics typically contain one-hot labels and logical operations. In order to directly optimize them, the authors first relax the one-hot label/prediction by Softmax. Then the logical operations applied on the one-hot label are extended by a continuous parameter function which is Monotonical and has the same output as the logical operation with 0/1 input. Finally, the authors describe a reinforcement learning framework to optimize the metrics parameterization (i.e., the outer objective), while the inner objective (i.e., the segmentation network) is trained by standard SGD. The experiments have been performed on Pascal VOC 2012 and Cityscapes datasets, showing the searched loss outperformed the traditional ones such as cross-entropy.
SP:e6b2bd6e602c95d5f0e17ea55e966da9955bd718
Auto Seg-Loss: Searching Metric Surrogates for Semantic Segmentation
1 INTRODUCTION . Loss functions are of indispensable components in training deep networks , as they drive the feature learning process for various applications with specific evaluation metrics . However , most metrics , like the commonly used 0-1 classification error , are non-differentiable in their original forms and can not be directly optimized via gradient-based methods . Empirically , the cross-entropy loss serves well as an effective surrogate objective function for a variety of tasks concerning categorization . This phenomenon is especially prevailing in image semantic segmentation , where various evaluation metrics have been designed to address the diverse task focusing on different scenarios . Some metrics measure the accuracy on the whole image , while others focus more on the segmentation boundaries . Although cross-entropy and its variants work well for many metrics , the mis-alignment between network training and evaluation still exist and inevitably leads to performance degradation . Typically , there are two ways for designing metric-specific loss functions in semantic segmentation . The first is to modify the standard cross-entropy loss to meet the target metric ( Ronneberger et al. , 2015 ; Wu et al. , 2016 ) . The other is to design other clever surrogate losses for specific evaluation metrics ( Rahman & Wang , 2016 ; Milletari et al. , 2016 ) . Despite the improvements , these handcrafted losses need expertise and are non-trivial to extend to other evaluation metrics . In contrast to designing loss functions manually , an alternative approach is to find a framework that can design proper loss functions for different evaluation metrics in an automated manner , motivated by recent progress in AutoML ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2018 ; Li et al. , 2019 ) . Although automating the design process for loss functions is attractive , it is non-trivial to apply an ∗Equal contribution . †This work is done when Hao Li and Chenxin Tao are interns at SenseTime Research . ‡Corresponding author . AutoML framework to loss functions . Typical AutoML algorithms require a proper search space , in which some search algorithms are conducted . Previous search spaces are either unsuitable for loss design , or too general to be searched efficiently . Recently Li et al . ( 2019 ) and Wang et al . ( 2020 ) proposed search spaces based on existing handcrafted loss functions . And the algorithm searches for the best combination . However , these search spaces are still limited to the variants of cross-entropy loss , and thus do not address the mis-alignment problem well . In this paper , we propose a general framework for searching surrogate losses for mainstream nondifferentiable segmentation metrics . The key idea is that we can build the search space according to the form of evaluation metrics . In this way , the training criteria and evaluation metrics are unified . Meanwhile , the search space is compact enough for efficient search . Specifically , the metrics are first relaxed to the continuous domain by substituting the one-hot prediction and logical operations , which are the non-differentiable parts in most metrics , with their differentiable approximations . Parameterized functions are introduced to approximate the logical operations , ensuring that the loss surfaces are smooth while effective for training . The loss parameterization functions can be of arbitrary families defined on [ 0 , 1 ] . Parameter search is further conducted on the chosen family so as to optimize the network performance on the validation set with the given evaluation metric . Two essential constraints are introduced to regularize the parameter search space . We find that the searched surrogate losses can effectively generalize to different networks and datasets . Extensive experiments on Pascal VOC ( Everingham et al. , 2015 ) and Cityscapes ( Cordts et al. , 2016 ) show our approach delivers accuracy superior than the existing losses specifically designed for individual segmentation metrics with a mild computational overhead . Our contributions can be summarized as follows : 1 ) Our approach is the first general framework of surrogate loss search for mainstream segmentation metrics . 2 ) We propose an effective parameter regularization and parameter search algorithm , which can find loss surrogates optimizing the target metric performance with mild computational overhead . 3 ) The surrogate losses obtained via the proposed searching framework promote our understandings on loss function design and by themselves are novel contributions , because they are different from existing loss functions specifically designed for individual metrics , and are transferable across different datasets and networks . 2 RELATED WORK . Loss function design is an active topic in deep network training ( Ma , 2020 ) . In the area of image semantic segmentation , cross-entropy loss is widely used ( Ronneberger et al. , 2015 ; Chen et al. , 2018 ) . But the cross-entropy loss is designed for optimizing the global accuracy measure ( Rahman & Wang , 2016 ; Patel et al. , 2020 ) , which is not aligned with many other metrics . Numerous studies are conducted to design proper loss functions for the prevalent evaluation metrics . For the mIoU metric , many works ( Ronneberger et al. , 2015 ; Wu et al. , 2016 ) incorporate class frequency to mitigate the class imbalance problem . For the boundary F1 score , the losses at boundary regions are up-weighted ( Caliva et al. , 2019 ; Qin et al. , 2019 ) , so as to deliver more accurate boundaries . These works carefully analyze the property of specific evaluation metrics , and design the loss functions in a fully handcrafted way , which needs expertise . By contrast , we propose a unified framework for deriving parameterized surrogate losses for various evaluation metrics . Wherein , the parameters are searched by reinforcement learning in an automatic way . The networks trained with the searched surrogate losses deliver accuracy on par or even superior than those with the best handcrafted losses . Direct loss optimization for non-differentiable evaluation metrics has long been studied for structural SVM models ( Joachims , 2005 ; Yue et al. , 2007 ; Ranjbar et al. , 2012 ) . However , the gradients w.r.t . features can not be derived from these approaches . Therefore , they can not drive the training of deep networks through back-propagation . Hazan et al . ( 2010 ) proposes to optimize structural SVM with gradient descent , where loss-augmented inference is applied to get the gradients of the expectation of evaluation metrics . Song et al . ( 2016 ) further extends this approach to non-linear models ( e.g. , deep neural networks ) . However , the computational complexity is very high during each step in gradient descent . Although Song et al . ( 2016 ) and Mohapatra et al . ( 2018 ) have designed efficient algorithms for the Average Precision ( AP ) metric , other metrics still need specially designed efficient algorithms . Our method , by contrast , is general for the mainstream segmentation metrics . Thanks to the good generalizability , our method only needs to perform the search process once for a specific metric , and the searched surrogate loss can be directly used henceforth . Applying the searched loss for training networks brings very little additional computational cost . Surrogate loss is introduced to derive loss gradients for the non-differentiable evaluation metrics . There are usually two ways for designing surrogate losses . The first is to handcraft an approximated differentiable metric function . For the IoU measure , Rahman & Wang ( 2016 ) propose to approximate the intersection and union seperately using the softmax probabilities in a differentiable form , and show its effectiveness on binary segmentation tasks . Berman et al . ( 2018 ) further deal with multi-class segmentation problems by extending mIoU from binary inputs to the continuous domain with the convex Lovàsz extension , and their method outperforms standard cross entropy loss in multi-class segmentation tasks . For the F1 measure , dice loss is proposed by Milletari et al . ( 2016 ) as a direct objective by substituting the binary prediction with the softmax probability . In spite of the success , they do not apply for other metrics . The second solution is to train a network to approximate the target metric . Nagendar et al . ( 2018 ) train a network to approximate mIoU . Patel et al . ( 2020 ) design a neural network to learn embeddings for predictions and ground truths for tasks other than segmentation . This line of research focuses on minimizing the approximation error w.r.t . the target metrics . But there is no guarantee that their approximations provide good loss signals for training . These approximated losses are just employed in a post-tuning setup , still relying on cross-entropy pre-trained models . Our method significantly differs in that we search surrogate losses to directly optimize the evaluation metrics in applications . AutoML is a long-pursued target of machine learning ( He et al. , 2019 ) . Recently a sub-field of AutoML , neural architecture search ( NAS ) , has attracted much attention due to its success in automating the process of neural network architecture design ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2018 ) . As an essential element , loss function has also raised the interest of researchers to automate its design process . Li et al . ( 2019 ) and Wang et al . ( 2020 ) design search spaces based on existing human-designed loss functions and search for the best combination parameters . There are two issues : a ) the search process outputs whole network models rather than loss functions . For every new network or dataset , the expensive search procedure is conducted again , and b ) the search space are filled with variants of cross-entropy , which can not solve the mis-alignment between cross-entropy loss and many target metrics . By contrast , our method outputs the searched surrogate loss functions of close form with the target metrics , which are transferable between networks and datasets . 3 REVISITING EVALUATION METRICS FOR SEMANTIC SEGMENTATION . Various evaluation metrics are defined for semantic segmentation , to address the diverse task focusing on different scenarios . Most of them are of three typical classes : Acc-based , IoU-based , and F1-score-based . This section revisits the evaluation metrics , under a unified notation set . Table 1 summarizes the mainstream evaluation metrics . The notations are as follows : suppose the validation set is composed of N images , labeled with categories from C classes ( background included ) . Let In , n ∈ { 1 , . . . , N } be the n-th image , and Yn be the corresponding ground-truth segmentation mask . Here Yn = { yn , c , h , w } c , h , w is a one-hot vector , where yn , c , h , w ∈ { 0 , 1 } indicates whether the pixel at spatial location ( h , w ) belongs to the c-th category ( c ∈ { 1 , . . . , C } ) . In evaluation , the ground-truth segmentation mask Yn is compared to the network prediction Ŷn = { ŷn , c , h , w } c , h , w , where ŷn , c , h , w ∈ { 0 , 1 } . ŷn , c , h , w is quantized from the continuous scores produced by the network ( by argmax operation ) . Acc-based metrics . The global accuracy measure ( gAcc ) counts the number of pixels correctly classified . It can be written with logical operator AND as Eq . ( 1 ) . The gAcc metric counts each pixel equally , so the results of the long-tailed categories have little impact on the metric number . The mean accuracy ( mAcc ) metric mitigates this by normalizing within each category as in Eq . ( 2 ) . IoU-based metrics . The evaluation is on set similarity rather than pixel accuracy . The intersectionover-union ( IoU ) score is evaluated between the prediction and the ground-truth mask of each category . The mean IoU ( mIoU ) metric averages the IoU scores of all categories , as in Eq . ( 3 ) . In the variants , the frequency weighted IoU ( FWIoU ) metric weighs each category IoU score by the category pixel number , as in Eq . ( 4 ) . The boudary IoU ( BIoU ) ( Kohli et al. , 2009 ) metric only cares about the segmentation quality around the boundary , so it picks the boundary pixels out in evaluation and ignores the rest pixels . It can be calculated with Eq . ( 5 ) , in which BD ( yn ) denotes the boundary region in map yn . BD ( yn ) is derived by applying XOR operation on the min-pooled ground-truth mask . The stride of the Min-Pooling ( · ) is 1 . F1-score-based metrics . F1-score is a criterion that takes both precision and recall into consideration . A well-known metric of this type is boundary F1-score ( BF1-score ) ( Csurka et al. , 2013 ) , which is widely used for evaluating boundary segmentation accuracy . The computation of precision and recall in BF1-score is as in Eq . ( 6 ) , where BD ( ŷn ) and BD ( yn ) are derived from Eq . ( 5 ) . Max pooling with stride 1 , Max-Pooling ( · ) , is applied on the boundary regions to allow error tolerance .
1.) In comparison with traditional loss function such as Cross-Entropy, WCE, DPCE, and SSIM, the proposed method achieves competitive performance. In addition, the authors also compare with the searched loss functions such as searched mIoU, searched FWIoU, etc. By combining the searched mIoU with the BIoU/BFI surrogate losses, the overall method achieves reasonable global performance, while refines the boundaries.
SP:e6b2bd6e602c95d5f0e17ea55e966da9955bd718
Revisiting Few-sample BERT Fine-tuning
1 INTRODUCTION . Fine-tuning self-supervised pre-trained models has significantly boosted state-of-the-art performance on natural language processing ( NLP ) tasks ( Liu , 2019 ; Yang et al. , 2019a ; Wadden et al. , 2019 ; Zhu et al. , 2020 ; Guu et al. , 2020 ) . One of the most effective models for this process is BERT ( Devlin et al. , 2019 ) . However , despite significant success , fine-tuning remains unstable , especially when using the large variant of BERT ( BERTLarge ) on small datasets , where pre-training stands to provide the most significant benefit . Identical learning processes with different random seeds often result in significantly different and sometimes degenerate models following fine-tuning , even though only a few , seemingly insignificant aspects of the learning process are impacted by the random seed ( Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) .1 As a result , practitioners resort to multiple random trials for model selection . This increases model deployment costs and time , and makes scientific comparison challenging ( Dodge et al. , 2020 ) . This paper is a study of different aspects of the few-sample fine-tuning optimization process . Our goal is to better understand the impact of common choices with regard to the optimization algorithm , model initialization , and the number of fine-tuning training iterations . We identify suboptimalities in common community practices : the use of a non-standard optimizer introduces bias in the gradient estimation ; the top layers of the pre-trained BERT model provide a bad initialization point for finetuning ; and the use of a pre-determined , but commonly adopted number of training iterations hurts convergence . We study these issues and their remedies through experiments on multiple common benchmarks , focusing on few-sample fine-tuning scenarios . Once these suboptimal practices are addressed , we observe that degenerate runs are eliminated and performance becomes much more stable . This makes it unnecessary to execute numerous random restarts as proposed in Dodge et al . ( 2020 ) . Our experiments show the remedies we experiment with for each issue have overlapping effect . For example , allocating more training iterations can eventually compensate for using the non-standard biased optimizer , even though the combination of a bias-corrected optimizer and re-initializing some of the pre-trained model parameters can reduce fine-tuning computational costs . This empirically highlights how different aspects of fine-tuning influence the stability of the process , at times in a similar manner . In the light of our observations , we re-evaluate several techniques ( Phang et al. , 2018 ; Lee et al. , 2020 ; Howard & Ruder , 2018 ) that ∗Equal contribution , 4 Work done at ASAPP . 1Fine-tuning instability is also receiving significant practitioner attention . For example : https : //github.com/zihangdai/xlnet/issues/96 and https : //github.com/huggingface/transformers/issues/265 . were recently proposed to increase few-sample fine-tuning stability and show a significant decrease in their impact . Our work furthers the empirical understanding of the fine-tuning process , and the optimization practices we outline identify impactful avenues for the development of future methods . 2 BACKGROUND AND RELATED WORK . BERT The Bidirectional Encoder Representations from Transformers ( BERT ; Devlin et al. , 2019 ) model is a Transformer encoder ( Vaswani et al. , 2017 ) trained on raw text using masked language modeling and next-sentence prediction objectives . It generates an embedding vector contextualized through a stack of Transformer blocks for each input token . BERT prepends a special [ CLS ] token to the input sentence or sentence pairs . The embedding of this token is used as a summary token for the input for classification tasks . This embedding is computed with an additional fully-connected layer with a tanh non-linearity , commonly referred to as the pooler , to aggregate the information for the [ CLS ] embedding . Fine-tuning The common approach for using the pre-trained BERT model is to replace the original output layer with a new task-specific layer and fine-tune the complete model . This includes learning the new output layer parameters and modifying all the original weights , including the weights of word embeddings , Transformer blocks , and the pooler . For example , for sentence-level classification , an added linear classifier projects the [ CLS ] embedding to an unnormalized probability vector over the output classes . This process introduces two sources of randomness : the weight initialization of the new output layer and the data order in the stochastic fine-tuning optimization . Existing work ( Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) shows that these seemingly benign factors can influence the results significantly , especially on small datasets ( i.e. , < 10K examples ) . Consequently , practitioners often conduct many random trials of fine-tuning and pick the best model based on validation performance ( Devlin et al. , 2019 ) . Fine-tuning Instability The instability of the BERT fine-tuning process has been known since its introduction ( Devlin et al. , 2019 ) , and various methods have been proposed to address it . Phang et al . ( 2018 ) show that fine-tuning the pre-trained model on a large intermediate task stabilizes later fine-tuning on small datasets . Lee et al . ( 2020 ) introduce a new regularization method to constrain the fine-tuned model to stay close to the pre-trained weights and show that it stabilizes fine-tuning . Dodge et al . ( 2020 ) propose an early stopping method to efficiently filter out random seeds likely to lead to bad performance . Concurrently to our work , Mosbach et al . ( 2020 ) also show that BERTADAM leads to instability during fine-tuning . Our experiments studying the effect of training longer are related to previous work studying this question in the context of training models from scratch ( Popel & Bojar , 2018 ; Nakkiran et al. , 2019 ) . BERT Representation Transferability BERT pre-trained representations have been widely studied using probing methods showing that the pre-trained features from intermediate layers are more transferable ( Tenney et al. , 2019b ; a ; Liu et al. , 2019a ; Hewitt & Manning , 2019 ; Hewitt & Liang , 2019 ) or applicable ( Zhang et al. , 2020 ) to new tasks than features from later layers , which change more after fine-tuning ( Peters et al. , 2019 ; Merchant et al. , 2020 ) . Our work is inspired by these findings , but focuses on studying how the pre-trained weights influence the fine-tuning process . Li et al . ( 2020 ) propose to re-initialize the final fully-connected layer of a ConvNet and show performance gain for image classification.2 Concurrent to our work , Tamkin et al . ( 2020 ) adopt a similar methodology of weight re-initialization ( Section 5 ) to study the transferability of BERT . In contrast to our study , their work emphasizes pinpointing the layers that contribute the most in transfer learning , and the relation between probing performance and transferability . 3 EXPERIMENTAL METHODOLOGY . Data We follow the data setup of previous studies ( Lee et al. , 2020 ; Phang et al. , 2018 ; Dodge et al. , 2020 ) to study few-sample fine-tuning using eight datasets from the GLUE benchmark ( Wang et al. , 2019b ) . The datasets cover four tasks : natural language inference ( RTE , QNLI , MNLI ) , paraphrase detection ( MRPC , QQP ) , sentiment classification ( SST-2 ) , and linguistic acceptability ( CoLA ) . Appendix A provides dataset statistics and a description of each dataset . We primarily 2This concurrent work was published shortly after our study was posted . Algorithm 1 : the ADAM pseudocode adapted from Kingma & Ba ( 2014 ) , and provided for reference . g2t denotes the elementwise square gt gt . β1 and β2 to the power t are denoted as βt1 β t 2 . All operations on vectors are element-wise . The suggested hyperparameter values according to Kingma & Ba ( 2014 ) are : α = 0.001 , β1 = 0.9 , β2 = 0.999 , and = 10−8 . BERTADAM ( Devlin et al. , 2019 ) omits the bias correction ( lines 9–10 ) , and treats mt and vt as m̂t and v̂t in line 11 . Require : α : learning rate ; β1 , β2 ∈ [ 0 , 1 ) : exponential decay rates for the moment estimates ; f ( θ ) : stochastic objective function with parameters θ ; θ0 : initial parameter vector ; λ ∈ [ 0 , 1 ) : decoupled weight decay . 1 : m0 ← 0 ( Initialize first moment vector ) 2 : v0 ← 0 ( Initialize second moment vector ) 3 : t← 0 ( Initialize timestep ) 4 : while θt not converged do 5 : t← t+ 1 6 : gt ← ∇θft ( θt−1 ) ( Get gradients w.r.t . stochastic objective at timestep t ) 7 : mt ← β1 ·mt−1 + ( 1− β1 ) · gt ( Update biased first moment estimate ) 8 : vt ← β2 · vt−1 + ( 1− β2 ) · g2t ( Update biased second raw moment estimate ) 9 : m̂t ← mt/ ( 1− βt1 ) ( Compute bias-corrected first moment estimate ) 10 : v̂t ← vt/ ( 1− βt2 ) ( Compute bias-corrected second raw moment estimate ) 11 : θt ← θt−1 − α · m̂t/ ( √ v̂t + ) ( Update parameters ) 12 : end while 13 : return θt ( Resulting parameters ) focus on four datasets ( RTE , MRPC , STS-B , CoLA ) that have fewer than 10k training samples , because BERT fine-tuning on these datasets is known to be unstable ( Devlin et al. , 2019 ) . We also complement our study by downsampling all eight datasets to 1k training examples following Phang et al . ( 2018 ) . While previous studies ( Lee et al. , 2020 ; Phang et al. , 2018 ; Dodge et al. , 2020 ) focus on the validation performance , we split held-out test sets for our study.3 For RTE , MRPC , STS-B , and CoLA , we divide the original validation set in half , using one half for validation and the other for test . For the other four larger datasets , we only study the downsampled versions , and split additional 1k samples from the training set as our validation data and test on the original validation set . Experimental Setup Unless noted otherwise , we follow the hyperparameter setup of Lee et al . ( 2020 ) . We fine-tune the uncased , 24-layer BERTLarge model with batch size 32 , dropout 0.1 , and peak learning rate 2 × 10−5 for three epochs . We clip the gradients to have a maximum norm of 1 . We apply linear learning rate warm-up during the first 10 % of the updates followed by a linear decay . We use mixed precision training using Apex4 to speed up experiments . We show that mixed precision training does not affect fine-tuning performance in Appendix C. We evaluate ten times on the validation set during training and perform early stopping . We fine-tune with 20 random seeds to compare different settings . 4 OPTIMIZATION ALGORITHM : DEBIASING OMISSION IN BERTADAM . The most commonly used optimizer for fine-tuning BERT is BERTADAM , a modified version of the ADAM first-order stochastic optimization method . It differs from the original ADAM algorithm ( Kingma & Ba , 2014 ) in omitting a bias correction step . This change was introduced by Devlin et al . ( 2019 ) , and subsequently made its way into common open source libraries , including the official implementation,5 huggingface ’ s Transformers ( Wolf et al. , 2019 ) ,6 AllenNLP ( Gardner et al. , 2018 ) , GluonNLP ( Guo et al. , 2019 ) , jiant ( Wang et al. , 2019c ) , MT-DNN ( Liu et al. , 2020 ) , and FARM.7 As a result , this non-standard implementation is widely used in both industry and research ( Wang et al. , 2019a ; Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ; Sun et al. , 2019 ; Clark et al. , 2020 ; Lan et al. , 2020 ; Houlsby et al. , 2019 ; Stickland & Murray , 2019 ; Liu et al. , 2019b ) . We observe that the bias correction omission influences the learning rate , especially early in the fine-tuning process , and is one of the primary reasons for instability in fine-tuning BERT ( Devlin et al. , 2019 ; Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) . Algorithm 1 shows the ADAM algorithm , and highlights the omitted line in the non-standard BERTADAM implementation . At each optimization step ( lines 4–11 ) , ADAM computes the exponen- 3The original test sets are not publicly available . 4https : //github.com/NVIDIA/apex 5https : //github.com/google-research/bert/blob/f39e881/optimization.py # L108-L157 6The default was changed from BERTADAM to debiased ADAM in commit ec07cf5a on July 11 , 2019 . 7https : //github.com/deepset-ai/FARM 3 tial moving average of the gradients ( mt ) and the squared gradients ( vt ) , where β1 , β2 parameterize the averaging ( lines 7–8 ) . Because ADAM initializes mt and vt to 0 and sets exponential decay rates β1 and β2 close to 1 , the estimates of mt and vt are heavily biased towards 0 early during learning when t is small . Kingma & Ba ( 2014 ) computes the ratio between the biased and the unbiased estimates of mt and vt as ( 1− βt1 ) and ( 1− βt2 ) . This ratio is independent of the training data . The model parameters θ are updated in the direction of the averaged gradient mt divided by the square root of the second moment √ vt ( line 11 ) . BERTADAM omits the debiasing ( lines 9–10 ) , and directly uses the biased estimates in the parameters update . Figure 1 shows the ratio m̂t√ v̂t between the update using the biased and the unbiased estimation as a function of training iterations . The bias is relatively high early during learning , indicating overestimation . It eventually converges to one , suggesting that when training for sufficient iterations , the estimation bias will have negligible effect.8 Therefore , the bias ratio term is most important early during learning to counteract the overestimation of mt and vt during early iterations . In practice , ADAM adaptively re-scales the learning rate by √ 1−βt2 1−βt1 . This correction is crucial for BERT finetuning on small datasets with fewer than 10k training samples because they are typically fine-tuned with less than 1k iterations ( Devlin et al. , 2019 ) . The figure shows the number of training iterations for RTE , MRPC , STS-B , CoLA , and MNLI . MNLI is the only one of this set with a large number of supervised training examples . For small datasets , the bias ratio is significantly higher than one for the entire fine-tuning process , implying that these datasets suffer heavily from overestimation in the update magnitude . In comparison , for MNLI , the majority of fine-tuning occurs in the region where the bias ratio has converged to one . This explains why fine-tuning on MNLI is known to be relatively stable ( Devlin et al. , 2019 ) . We evaluate the importance of the debiasing step empirically by fine-tuning BERT with both BERTADAM and the debiased ADAM9 for 50 random seeds on RTE , MRPC , STS-B , and CoLA . Figure 2 summarizes the performance distribution . The bias correction significantly reduces the performance variance across different random trials and the four datasets . Without the bias correction we observe many degenerate runs , where fine-tuned models fail to outperform the random baseline . For example , on RTE , 48 % of fine-tuning runs have an accuracy less than 55 % , which is close to random guessing . Figure 3 further illustrates this difference by plotting the mean and the range of training loss during fine-tuning across different random trials on RTE . Figure 11 in Appendix F shows similar plots for MRPC , STS-B , and CoLA . The biased BERTADAM consistently leads to worse averaged training loss , and on all datasets to higher maximum training loss . This indicates models trained with BERTAdam are underfitting and the root of instability lies in optimization . 8Our experiments on the completely MNLI dataset confirm using the unbiased estimation does not improve nor degrade performance for large datasets ( Appendix D ) . 9We use the PyTorch ADAM implementation https : //pytorch.org/docs/1.4.0/_modules/torch/optim/adamw.html . We simulate a realistic setting of multiple random trials following Dodge et al . ( 2020 ) . We use bootstrapping for the simulation : given the 50 fine-tuned models we trained , we sample models with replacement , perform model selection on the validation set , and record the test results ; we repeat this process 1k times to estimate mean and variance . Figure 4 shows the simulated test results as a function of the number of random trials . Appendix E provides the same plots for validation performance . Using the debiased ADAM we can reliably achieve good results using fewer random trials ; the difference in expected performance is especially pronounced when we perform less than 10 trials . Whereas the expected validation performance monotonically improves with more random trials ( Dodge et al. , 2020 ) , the expected test performance deteriorates when we perform too many random trials because the model selection process potentially overfits the validation set . Based on these observations , we recommend performing a moderate number of random trials ( i.e. , 5 or 10 ) .
Large language models (LM) architectures, such as BERT, XLNet, etc., are not generally trained from scratch, but rather used as pretrained models. Among all, BERT is one of the most widely used ones, and its use on downstream tasks mainly consists on a stage of fine-tuning, where the new layers added are trained, and the rest of parameters of the network are left unfrozen, and hence are adjusted slightly to better fit the new task. However, this step of fine-tuning BERT is known to be quite unstable, and depends on a large set of factors, especially the initialization. Since the final performance on these downstream tasks can vary notably, different approaches has been proposed to circumvent this, but still the most common solution consists simply on choosing the best performing model, from a few random initialisation, using the validation set.
SP:9a71fc1f596ef67bf5228d779246f8e9ae04c8e0
Revisiting Few-sample BERT Fine-tuning
1 INTRODUCTION . Fine-tuning self-supervised pre-trained models has significantly boosted state-of-the-art performance on natural language processing ( NLP ) tasks ( Liu , 2019 ; Yang et al. , 2019a ; Wadden et al. , 2019 ; Zhu et al. , 2020 ; Guu et al. , 2020 ) . One of the most effective models for this process is BERT ( Devlin et al. , 2019 ) . However , despite significant success , fine-tuning remains unstable , especially when using the large variant of BERT ( BERTLarge ) on small datasets , where pre-training stands to provide the most significant benefit . Identical learning processes with different random seeds often result in significantly different and sometimes degenerate models following fine-tuning , even though only a few , seemingly insignificant aspects of the learning process are impacted by the random seed ( Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) .1 As a result , practitioners resort to multiple random trials for model selection . This increases model deployment costs and time , and makes scientific comparison challenging ( Dodge et al. , 2020 ) . This paper is a study of different aspects of the few-sample fine-tuning optimization process . Our goal is to better understand the impact of common choices with regard to the optimization algorithm , model initialization , and the number of fine-tuning training iterations . We identify suboptimalities in common community practices : the use of a non-standard optimizer introduces bias in the gradient estimation ; the top layers of the pre-trained BERT model provide a bad initialization point for finetuning ; and the use of a pre-determined , but commonly adopted number of training iterations hurts convergence . We study these issues and their remedies through experiments on multiple common benchmarks , focusing on few-sample fine-tuning scenarios . Once these suboptimal practices are addressed , we observe that degenerate runs are eliminated and performance becomes much more stable . This makes it unnecessary to execute numerous random restarts as proposed in Dodge et al . ( 2020 ) . Our experiments show the remedies we experiment with for each issue have overlapping effect . For example , allocating more training iterations can eventually compensate for using the non-standard biased optimizer , even though the combination of a bias-corrected optimizer and re-initializing some of the pre-trained model parameters can reduce fine-tuning computational costs . This empirically highlights how different aspects of fine-tuning influence the stability of the process , at times in a similar manner . In the light of our observations , we re-evaluate several techniques ( Phang et al. , 2018 ; Lee et al. , 2020 ; Howard & Ruder , 2018 ) that ∗Equal contribution , 4 Work done at ASAPP . 1Fine-tuning instability is also receiving significant practitioner attention . For example : https : //github.com/zihangdai/xlnet/issues/96 and https : //github.com/huggingface/transformers/issues/265 . were recently proposed to increase few-sample fine-tuning stability and show a significant decrease in their impact . Our work furthers the empirical understanding of the fine-tuning process , and the optimization practices we outline identify impactful avenues for the development of future methods . 2 BACKGROUND AND RELATED WORK . BERT The Bidirectional Encoder Representations from Transformers ( BERT ; Devlin et al. , 2019 ) model is a Transformer encoder ( Vaswani et al. , 2017 ) trained on raw text using masked language modeling and next-sentence prediction objectives . It generates an embedding vector contextualized through a stack of Transformer blocks for each input token . BERT prepends a special [ CLS ] token to the input sentence or sentence pairs . The embedding of this token is used as a summary token for the input for classification tasks . This embedding is computed with an additional fully-connected layer with a tanh non-linearity , commonly referred to as the pooler , to aggregate the information for the [ CLS ] embedding . Fine-tuning The common approach for using the pre-trained BERT model is to replace the original output layer with a new task-specific layer and fine-tune the complete model . This includes learning the new output layer parameters and modifying all the original weights , including the weights of word embeddings , Transformer blocks , and the pooler . For example , for sentence-level classification , an added linear classifier projects the [ CLS ] embedding to an unnormalized probability vector over the output classes . This process introduces two sources of randomness : the weight initialization of the new output layer and the data order in the stochastic fine-tuning optimization . Existing work ( Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) shows that these seemingly benign factors can influence the results significantly , especially on small datasets ( i.e. , < 10K examples ) . Consequently , practitioners often conduct many random trials of fine-tuning and pick the best model based on validation performance ( Devlin et al. , 2019 ) . Fine-tuning Instability The instability of the BERT fine-tuning process has been known since its introduction ( Devlin et al. , 2019 ) , and various methods have been proposed to address it . Phang et al . ( 2018 ) show that fine-tuning the pre-trained model on a large intermediate task stabilizes later fine-tuning on small datasets . Lee et al . ( 2020 ) introduce a new regularization method to constrain the fine-tuned model to stay close to the pre-trained weights and show that it stabilizes fine-tuning . Dodge et al . ( 2020 ) propose an early stopping method to efficiently filter out random seeds likely to lead to bad performance . Concurrently to our work , Mosbach et al . ( 2020 ) also show that BERTADAM leads to instability during fine-tuning . Our experiments studying the effect of training longer are related to previous work studying this question in the context of training models from scratch ( Popel & Bojar , 2018 ; Nakkiran et al. , 2019 ) . BERT Representation Transferability BERT pre-trained representations have been widely studied using probing methods showing that the pre-trained features from intermediate layers are more transferable ( Tenney et al. , 2019b ; a ; Liu et al. , 2019a ; Hewitt & Manning , 2019 ; Hewitt & Liang , 2019 ) or applicable ( Zhang et al. , 2020 ) to new tasks than features from later layers , which change more after fine-tuning ( Peters et al. , 2019 ; Merchant et al. , 2020 ) . Our work is inspired by these findings , but focuses on studying how the pre-trained weights influence the fine-tuning process . Li et al . ( 2020 ) propose to re-initialize the final fully-connected layer of a ConvNet and show performance gain for image classification.2 Concurrent to our work , Tamkin et al . ( 2020 ) adopt a similar methodology of weight re-initialization ( Section 5 ) to study the transferability of BERT . In contrast to our study , their work emphasizes pinpointing the layers that contribute the most in transfer learning , and the relation between probing performance and transferability . 3 EXPERIMENTAL METHODOLOGY . Data We follow the data setup of previous studies ( Lee et al. , 2020 ; Phang et al. , 2018 ; Dodge et al. , 2020 ) to study few-sample fine-tuning using eight datasets from the GLUE benchmark ( Wang et al. , 2019b ) . The datasets cover four tasks : natural language inference ( RTE , QNLI , MNLI ) , paraphrase detection ( MRPC , QQP ) , sentiment classification ( SST-2 ) , and linguistic acceptability ( CoLA ) . Appendix A provides dataset statistics and a description of each dataset . We primarily 2This concurrent work was published shortly after our study was posted . Algorithm 1 : the ADAM pseudocode adapted from Kingma & Ba ( 2014 ) , and provided for reference . g2t denotes the elementwise square gt gt . β1 and β2 to the power t are denoted as βt1 β t 2 . All operations on vectors are element-wise . The suggested hyperparameter values according to Kingma & Ba ( 2014 ) are : α = 0.001 , β1 = 0.9 , β2 = 0.999 , and = 10−8 . BERTADAM ( Devlin et al. , 2019 ) omits the bias correction ( lines 9–10 ) , and treats mt and vt as m̂t and v̂t in line 11 . Require : α : learning rate ; β1 , β2 ∈ [ 0 , 1 ) : exponential decay rates for the moment estimates ; f ( θ ) : stochastic objective function with parameters θ ; θ0 : initial parameter vector ; λ ∈ [ 0 , 1 ) : decoupled weight decay . 1 : m0 ← 0 ( Initialize first moment vector ) 2 : v0 ← 0 ( Initialize second moment vector ) 3 : t← 0 ( Initialize timestep ) 4 : while θt not converged do 5 : t← t+ 1 6 : gt ← ∇θft ( θt−1 ) ( Get gradients w.r.t . stochastic objective at timestep t ) 7 : mt ← β1 ·mt−1 + ( 1− β1 ) · gt ( Update biased first moment estimate ) 8 : vt ← β2 · vt−1 + ( 1− β2 ) · g2t ( Update biased second raw moment estimate ) 9 : m̂t ← mt/ ( 1− βt1 ) ( Compute bias-corrected first moment estimate ) 10 : v̂t ← vt/ ( 1− βt2 ) ( Compute bias-corrected second raw moment estimate ) 11 : θt ← θt−1 − α · m̂t/ ( √ v̂t + ) ( Update parameters ) 12 : end while 13 : return θt ( Resulting parameters ) focus on four datasets ( RTE , MRPC , STS-B , CoLA ) that have fewer than 10k training samples , because BERT fine-tuning on these datasets is known to be unstable ( Devlin et al. , 2019 ) . We also complement our study by downsampling all eight datasets to 1k training examples following Phang et al . ( 2018 ) . While previous studies ( Lee et al. , 2020 ; Phang et al. , 2018 ; Dodge et al. , 2020 ) focus on the validation performance , we split held-out test sets for our study.3 For RTE , MRPC , STS-B , and CoLA , we divide the original validation set in half , using one half for validation and the other for test . For the other four larger datasets , we only study the downsampled versions , and split additional 1k samples from the training set as our validation data and test on the original validation set . Experimental Setup Unless noted otherwise , we follow the hyperparameter setup of Lee et al . ( 2020 ) . We fine-tune the uncased , 24-layer BERTLarge model with batch size 32 , dropout 0.1 , and peak learning rate 2 × 10−5 for three epochs . We clip the gradients to have a maximum norm of 1 . We apply linear learning rate warm-up during the first 10 % of the updates followed by a linear decay . We use mixed precision training using Apex4 to speed up experiments . We show that mixed precision training does not affect fine-tuning performance in Appendix C. We evaluate ten times on the validation set during training and perform early stopping . We fine-tune with 20 random seeds to compare different settings . 4 OPTIMIZATION ALGORITHM : DEBIASING OMISSION IN BERTADAM . The most commonly used optimizer for fine-tuning BERT is BERTADAM , a modified version of the ADAM first-order stochastic optimization method . It differs from the original ADAM algorithm ( Kingma & Ba , 2014 ) in omitting a bias correction step . This change was introduced by Devlin et al . ( 2019 ) , and subsequently made its way into common open source libraries , including the official implementation,5 huggingface ’ s Transformers ( Wolf et al. , 2019 ) ,6 AllenNLP ( Gardner et al. , 2018 ) , GluonNLP ( Guo et al. , 2019 ) , jiant ( Wang et al. , 2019c ) , MT-DNN ( Liu et al. , 2020 ) , and FARM.7 As a result , this non-standard implementation is widely used in both industry and research ( Wang et al. , 2019a ; Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ; Sun et al. , 2019 ; Clark et al. , 2020 ; Lan et al. , 2020 ; Houlsby et al. , 2019 ; Stickland & Murray , 2019 ; Liu et al. , 2019b ) . We observe that the bias correction omission influences the learning rate , especially early in the fine-tuning process , and is one of the primary reasons for instability in fine-tuning BERT ( Devlin et al. , 2019 ; Phang et al. , 2018 ; Lee et al. , 2020 ; Dodge et al. , 2020 ) . Algorithm 1 shows the ADAM algorithm , and highlights the omitted line in the non-standard BERTADAM implementation . At each optimization step ( lines 4–11 ) , ADAM computes the exponen- 3The original test sets are not publicly available . 4https : //github.com/NVIDIA/apex 5https : //github.com/google-research/bert/blob/f39e881/optimization.py # L108-L157 6The default was changed from BERTADAM to debiased ADAM in commit ec07cf5a on July 11 , 2019 . 7https : //github.com/deepset-ai/FARM 3 tial moving average of the gradients ( mt ) and the squared gradients ( vt ) , where β1 , β2 parameterize the averaging ( lines 7–8 ) . Because ADAM initializes mt and vt to 0 and sets exponential decay rates β1 and β2 close to 1 , the estimates of mt and vt are heavily biased towards 0 early during learning when t is small . Kingma & Ba ( 2014 ) computes the ratio between the biased and the unbiased estimates of mt and vt as ( 1− βt1 ) and ( 1− βt2 ) . This ratio is independent of the training data . The model parameters θ are updated in the direction of the averaged gradient mt divided by the square root of the second moment √ vt ( line 11 ) . BERTADAM omits the debiasing ( lines 9–10 ) , and directly uses the biased estimates in the parameters update . Figure 1 shows the ratio m̂t√ v̂t between the update using the biased and the unbiased estimation as a function of training iterations . The bias is relatively high early during learning , indicating overestimation . It eventually converges to one , suggesting that when training for sufficient iterations , the estimation bias will have negligible effect.8 Therefore , the bias ratio term is most important early during learning to counteract the overestimation of mt and vt during early iterations . In practice , ADAM adaptively re-scales the learning rate by √ 1−βt2 1−βt1 . This correction is crucial for BERT finetuning on small datasets with fewer than 10k training samples because they are typically fine-tuned with less than 1k iterations ( Devlin et al. , 2019 ) . The figure shows the number of training iterations for RTE , MRPC , STS-B , CoLA , and MNLI . MNLI is the only one of this set with a large number of supervised training examples . For small datasets , the bias ratio is significantly higher than one for the entire fine-tuning process , implying that these datasets suffer heavily from overestimation in the update magnitude . In comparison , for MNLI , the majority of fine-tuning occurs in the region where the bias ratio has converged to one . This explains why fine-tuning on MNLI is known to be relatively stable ( Devlin et al. , 2019 ) . We evaluate the importance of the debiasing step empirically by fine-tuning BERT with both BERTADAM and the debiased ADAM9 for 50 random seeds on RTE , MRPC , STS-B , and CoLA . Figure 2 summarizes the performance distribution . The bias correction significantly reduces the performance variance across different random trials and the four datasets . Without the bias correction we observe many degenerate runs , where fine-tuned models fail to outperform the random baseline . For example , on RTE , 48 % of fine-tuning runs have an accuracy less than 55 % , which is close to random guessing . Figure 3 further illustrates this difference by plotting the mean and the range of training loss during fine-tuning across different random trials on RTE . Figure 11 in Appendix F shows similar plots for MRPC , STS-B , and CoLA . The biased BERTADAM consistently leads to worse averaged training loss , and on all datasets to higher maximum training loss . This indicates models trained with BERTAdam are underfitting and the root of instability lies in optimization . 8Our experiments on the completely MNLI dataset confirm using the unbiased estimation does not improve nor degrade performance for large datasets ( Appendix D ) . 9We use the PyTorch ADAM implementation https : //pytorch.org/docs/1.4.0/_modules/torch/optim/adamw.html . We simulate a realistic setting of multiple random trials following Dodge et al . ( 2020 ) . We use bootstrapping for the simulation : given the 50 fine-tuned models we trained , we sample models with replacement , perform model selection on the validation set , and record the test results ; we repeat this process 1k times to estimate mean and variance . Figure 4 shows the simulated test results as a function of the number of random trials . Appendix E provides the same plots for validation performance . Using the debiased ADAM we can reliably achieve good results using fewer random trials ; the difference in expected performance is especially pronounced when we perform less than 10 trials . Whereas the expected validation performance monotonically improves with more random trials ( Dodge et al. , 2020 ) , the expected test performance deteriorates when we perform too many random trials because the model selection process potentially overfits the validation set . Based on these observations , we recommend performing a moderate number of random trials ( i.e. , 5 or 10 ) .
This paper investigates fine-tuning BERT for few-sample datasets. Notably, the authors find debiasing omission in BERT-adam. They find original debiased adam is better than BERT-adam. Besides, they also find re-initializing top layers can speed up learning and achieve better performance. These two findings are interesting. Another finding fine-tuning BERT for Longer is incremental to some extend.
SP:9a71fc1f596ef67bf5228d779246f8e9ae04c8e0
On Nondeterminism and Instability in Neural Network Optimization
1 INTRODUCTION . Consider this common scenario : you have a baseline “ current best ” model , and are trying to improve it . Now , one of your experiments has produced a model whose metrics are slightly better than the baseline . Yet you have your reservations — how do you know the improvement is “ real ” , and not due to random fluctuations that create run-to-run variability ? Similarly , consider performing hyperparameter optimization , in which there are many possible values for a set of hyperparameters , and you find minor differences in performance between them . How do you pick the best hyperparameters , and how can you be sure that you ’ ve actually picked wisely ? In both scenarios , the standard practice is to perform multiple independent training runs of your model to understand its variability . While this does indeed help address the problem , it can be extremely wasteful , increasing the time required for effective research , using more computing power , and making reproducibility more difficult , while still leaving some uncertainty . Ultimately , the source of this problem is the nondeterminism in optimizing models — randomized components of model training that cause each training run to produce different models with their own performance characteristics . Nondeterminism itself occurs due to many factors : while the most salient source is the random initialization of parameters , other sources exist , including random shuffling of training data , per-example stochasticity of data augmentation , any explicit random operations ( e.g . dropout ( Srivastava et al. , 2014 ) ) , asynchronous model training ( Recht et al. , 2011 ) , and even nondeterminism in low-level libraries such as cuDNN ( Chetlur et al. , 2014 ) , which are present to improve throughput on hardware accelerators . Despite the clear impact nondeterminism has on the efficacy of modeling , relatively little attention has been paid towards understanding its mechanisms , even in the classical supervised setting . In this work , we establish an experimental protocol for analyzing the impact of nondeterminism in model training , allowing us to quantify the independent effect of each source of nondeterminism . In doing so , we make a surprising discovery : each source has nearly the same effect on the variability of final model performance . Further , we find each source produces models of similar diversity , as measured by correlations between model predictions , functional changes in model performance while ensembling , and state-of-the-art methods of model similarity ( Kornblith et al. , 2019 ) . To emphasize one particularly interesting result : nondeterminism in low-level libraries like cuDNN can matter just as much with respect to model diversity and variability as varying the entire network initialization . We explain this mystery by demonstrating that it can be attributed to an inherent numerical instability in optimizing neural networks — when training with SGD-like approaches , we show that small changes to initial parameters result in large changes to final parameter values . In fact , the instabilities in the optimization process are extreme : changing a single weight by the smallest possible amount within machine precision ( ∼6 ∗ 10−11 ) produces nearly as much variability as all other sources combined . Therefore , any source of nondeterminism that has any effect at all on model weights is doomed to inherit at least this level of variability . Last , we present promising results in reducing the effects of instability . While we find that many approaches result in no apparent change , we demonstrate that methods for accelerated model ensembling actually do reduce the variability of trained models without an increase in model training time , providing the first encouraging signs for tractability of the problem . 2 RELATED WORK . NONDETERMINISM . Relatively little prior work has studied the effects of nondeterminism on model optimization . Within reinforcement learning , nondeterminism is recognized as a significant barrier to reproducibility and evaluating progress in the field ( Nagarajan et al. , 2018 ; Henderson et al. , 2018 ; Islam et al. , 2017 ; Machado et al. , 2018 ) . In the setting of supervised learning , though , the focus of this work , the problem is much less studied . Madhyastha & Jain ( 2019 ) aggregate all sources of nondeterminism together into a single random seed and analyze the variability of model attention and accuracy as a function of it across various NLP datasets . They also propose a method for reducing this variability ( see Sec . A for details of our reproduction attempt ) . More common in the field , results across multiple random seeds are reported ( see Erhan et al . ( 2010 ) for a particularly extensive example ) , but the precise nature of nondeterminism ’ s influence on variability goes unstudied . INSTABILITY . We use the term “ stability ” to refer to numerical stability , in which a stable algorithm is one for which the final output ( converged model ) does not vary much as the input ( initial parameters ) are changed . Historically , the term “ stability ” has been used both in learning theory ( Bousquet & Elisseeff , 2002 ) , in reference to vanishing and exploding gradients ( Haber & Ruthotto , 2017 ) , and in the adversarial robustness community for a particular form of training ( Zheng et al. , 2016 ) . 3 NONDETERMINISM . Many sources of nondeterminism exist when optimizing neural networks , each of which can affect the variability and performance of trained models . We begin with a very brief overview : PARAMETER INITIALIZATION . When training a model , parameters without preset values are initialized randomly according to a given distribution , e.g . a Gaussian with mean 0 and variance determined by the number of input connections to the layer ( Glorot & Bengio , 2010 ; He et al. , 2015 ) . DATA SHUFFLING . In stochastic gradient descent ( SGD ) , the overall gradient is approximated by the gradient on a random subset of examples . Most commonly , this is implemented by shuffling the training data , after which the data is iterated through in order . Shuffling may happen either once , before training , or in between each epoch of training , the variant we use in this work . DATA AUGMENTATION . A very common practice , data augmentation refers to randomly altering each training example to artificially expand the training dataset . For example , in the case of images , it is common to randomly flip an image , which encourages invariance to left/right orientation . STOCHASTIC REGULARIZATION . Some forms of regularization , such as Dropout ( Srivastava et al. , 2014 ) , take the form of stochastic operations in a model during training . Dropout is the most common instance of this type of regularization , with a variety of others also in relatively common use , such as DropConnect ( Wan et al. , 2013 ) , variational dropout ( Gal & Ghahramani , 2016 ) , and variable length backpropagation through time ( Merity et al. , 2017 ) , among many others . LOW-LEVEL OPERATIONS . An underlooked source of nondeterminism , the very libraries that many deep learning frameworks are built on , such as cuDNN ( Chetlur et al. , 2014 ) often are run nondeterministically for performance reasons . This nondeterminism is small in magnitude — in one test we performed this caused a difference of roughly 0.003 % . In the case of cuDNN , the library we test with , it is possible to disable nondeterministic behavior , incurring a speed penalty typically on the order of∼15 % . However , unlike the other sources of nondeterminism , it is not possible to “ seed ” this nondeterminism ; it is only possible to turn it on or off , but not control its nondeterministic behavior . 3.1 PROTOCOL FOR TESTING EFFECTS OF NONDETERMINISM . DIVERSITY IN PERFORMANCE . Our protocol for testing the effects of sources of nondeterminism is based on properly controlling for each source . In general , suppose there are N sources of nondeterminism , with source i controlled by a seed Si . To test the effect of source i , we keep all values Sj , j 6= i set to a constant , and vary Si with R different values , where R is the number of independent training runs performed . For sources of nondeterminism which can not be effectively seeded , such as cuDNN , we indicate one of these values as the deterministic value , which it must be set to when varying the other sources of nondeterminism . For example , suppose that we wish to study three sources of nondeterminism , denoting S1 the seed for random parameter initialization , S2 for training data shuffling , and S3 for cuDNN , where S3 = 1 is the deterministic value for cuDNN . To test the effect of random parameter initialization , with a budget of R = 30 training runs , then we set S3 to the deterministic value of 1 , S2 to an arbitrary constant ( also 1 for simplicity ) , and test 30 different values of S1 . All together , this corresponds to training models for ( S1 , S2 , S3 ) ∈ { ( i , 1 , 1 ) } 30i=1 , producing a set of 30 models . To look at variability according to a particular evaluation metric ( e.g . cross-entropy or accuracy for classification ) , we calculate the standard deviation ( across all R = 30 models ) of the metric . Note that it is also possible to test the effects of several sources of nondeterminism in tandem this way . For example , to test all sources of nondeterminism together , the set of models can be changed to ( S1 , S2 , S3 ) ∈ { ( i , i , 0 ) } Ri=1 . DIVERSITY IN REPRESENTATION . Beyond looking at diversity of test set generalization , though , it is worth examining how different the representations of trained models actually are — even though the diversity in performance might be similar between models trained with different types of nondeterminism , it might be the case that one type of nondeterminism produces models that have learned largely similar concepts , with the variance in generalization due to other factors . In order to rigorously examine these , we consider four distinct analyses on the functional behavior of models : The first and most straightforward metric we consider is the average disagreement between pairs of models , where higher disagreement corresponds to higher levels of diversity . In contrast to our other metrics , this considers only the argmax of a model ’ s predictions , which makes it both the most limited and the most interpretable of the group . This metric has also been used recently to compare network similarity in the context of network ensembles ( Fort et al. , 2019 ) . Second , we consider the average correlation between the predictions of two models , i.e . the expectation ( across pairs of models from the same nondeterminism source ) , of the correlation of predictions , calculated across examples and classes . For example , for a classification problem , the predicted logits from each of R models are flattened into vectors of length N ∗ C ( with N the number of test examples and C the number of classes ) , and we calculate the mean correlation coefficient of the predictions across all ( R 2 ) pairs of models . We use Spearman ’ s ρ for the correlation coefficient , but note that others such as Pearson ’ s r are possible and yield similar conclusions . For this metric , a lower score indicates a more diverse set of models . The third analysis we perform examines the change in performance from ensembling two models from the same source of nondeterminism . The intuition is as follows : If a pair of models are completely redundant , then ensembling them would result in no change in performance . However , if models actually learn different representations , then we expect an improvement from ensembling , with a greater improvement the greater the diversity in a set of models . Denoting by f ( Si ) some particular evaluation metric f calculated on the predictions of model Si , this change is equivalent to : 1 ( R 2 ) R∑ i=1 R∑ j=i+1 ( f ( Si + Sj 2 ) − f ( Si ) + f ( Sj ) 2 ) ( 1 ) Last , for a more detailed view of learned representations within a network , we consider a stateof-the-art method for measuring the similarity of learned neural network representations , centered kernel alignment ( CKA ) ( Kornblith et al. , 2019 ) , which has been used to analyze models trained with different random initializations , widths , and even entirely different architectures . We use the linear version of CKA , which Kornblith et al . ( 2019 ) found performed similarly to an RBF kernel .
The paper investigates the effect of nondeterminism and stability in Neural Networks (NNs) for supervised learning tasks in a systematic manner. The paper is very well-written. All the steps towards the claims of the paper are clearly stated. The empirical analysis is systematic and the two main results are thought provoking and interesting: 1) Different sources of nondeterminism (such as random initialization, data augmentation, data shuffling, etc.) causes similar levels of variability (based on standard deviation and correlation metrics), and 2) Changes in the optimization even in the order of 10^-10 in a single weight can have same variability level as changing the random seed entirely. The paper also validates that a prior work called Snapshot Ensembles (to some degree) resolves the instability problem in NNs.
SP:40ed38eb25d29057685c22a2118da3f7d269535b
On Nondeterminism and Instability in Neural Network Optimization
1 INTRODUCTION . Consider this common scenario : you have a baseline “ current best ” model , and are trying to improve it . Now , one of your experiments has produced a model whose metrics are slightly better than the baseline . Yet you have your reservations — how do you know the improvement is “ real ” , and not due to random fluctuations that create run-to-run variability ? Similarly , consider performing hyperparameter optimization , in which there are many possible values for a set of hyperparameters , and you find minor differences in performance between them . How do you pick the best hyperparameters , and how can you be sure that you ’ ve actually picked wisely ? In both scenarios , the standard practice is to perform multiple independent training runs of your model to understand its variability . While this does indeed help address the problem , it can be extremely wasteful , increasing the time required for effective research , using more computing power , and making reproducibility more difficult , while still leaving some uncertainty . Ultimately , the source of this problem is the nondeterminism in optimizing models — randomized components of model training that cause each training run to produce different models with their own performance characteristics . Nondeterminism itself occurs due to many factors : while the most salient source is the random initialization of parameters , other sources exist , including random shuffling of training data , per-example stochasticity of data augmentation , any explicit random operations ( e.g . dropout ( Srivastava et al. , 2014 ) ) , asynchronous model training ( Recht et al. , 2011 ) , and even nondeterminism in low-level libraries such as cuDNN ( Chetlur et al. , 2014 ) , which are present to improve throughput on hardware accelerators . Despite the clear impact nondeterminism has on the efficacy of modeling , relatively little attention has been paid towards understanding its mechanisms , even in the classical supervised setting . In this work , we establish an experimental protocol for analyzing the impact of nondeterminism in model training , allowing us to quantify the independent effect of each source of nondeterminism . In doing so , we make a surprising discovery : each source has nearly the same effect on the variability of final model performance . Further , we find each source produces models of similar diversity , as measured by correlations between model predictions , functional changes in model performance while ensembling , and state-of-the-art methods of model similarity ( Kornblith et al. , 2019 ) . To emphasize one particularly interesting result : nondeterminism in low-level libraries like cuDNN can matter just as much with respect to model diversity and variability as varying the entire network initialization . We explain this mystery by demonstrating that it can be attributed to an inherent numerical instability in optimizing neural networks — when training with SGD-like approaches , we show that small changes to initial parameters result in large changes to final parameter values . In fact , the instabilities in the optimization process are extreme : changing a single weight by the smallest possible amount within machine precision ( ∼6 ∗ 10−11 ) produces nearly as much variability as all other sources combined . Therefore , any source of nondeterminism that has any effect at all on model weights is doomed to inherit at least this level of variability . Last , we present promising results in reducing the effects of instability . While we find that many approaches result in no apparent change , we demonstrate that methods for accelerated model ensembling actually do reduce the variability of trained models without an increase in model training time , providing the first encouraging signs for tractability of the problem . 2 RELATED WORK . NONDETERMINISM . Relatively little prior work has studied the effects of nondeterminism on model optimization . Within reinforcement learning , nondeterminism is recognized as a significant barrier to reproducibility and evaluating progress in the field ( Nagarajan et al. , 2018 ; Henderson et al. , 2018 ; Islam et al. , 2017 ; Machado et al. , 2018 ) . In the setting of supervised learning , though , the focus of this work , the problem is much less studied . Madhyastha & Jain ( 2019 ) aggregate all sources of nondeterminism together into a single random seed and analyze the variability of model attention and accuracy as a function of it across various NLP datasets . They also propose a method for reducing this variability ( see Sec . A for details of our reproduction attempt ) . More common in the field , results across multiple random seeds are reported ( see Erhan et al . ( 2010 ) for a particularly extensive example ) , but the precise nature of nondeterminism ’ s influence on variability goes unstudied . INSTABILITY . We use the term “ stability ” to refer to numerical stability , in which a stable algorithm is one for which the final output ( converged model ) does not vary much as the input ( initial parameters ) are changed . Historically , the term “ stability ” has been used both in learning theory ( Bousquet & Elisseeff , 2002 ) , in reference to vanishing and exploding gradients ( Haber & Ruthotto , 2017 ) , and in the adversarial robustness community for a particular form of training ( Zheng et al. , 2016 ) . 3 NONDETERMINISM . Many sources of nondeterminism exist when optimizing neural networks , each of which can affect the variability and performance of trained models . We begin with a very brief overview : PARAMETER INITIALIZATION . When training a model , parameters without preset values are initialized randomly according to a given distribution , e.g . a Gaussian with mean 0 and variance determined by the number of input connections to the layer ( Glorot & Bengio , 2010 ; He et al. , 2015 ) . DATA SHUFFLING . In stochastic gradient descent ( SGD ) , the overall gradient is approximated by the gradient on a random subset of examples . Most commonly , this is implemented by shuffling the training data , after which the data is iterated through in order . Shuffling may happen either once , before training , or in between each epoch of training , the variant we use in this work . DATA AUGMENTATION . A very common practice , data augmentation refers to randomly altering each training example to artificially expand the training dataset . For example , in the case of images , it is common to randomly flip an image , which encourages invariance to left/right orientation . STOCHASTIC REGULARIZATION . Some forms of regularization , such as Dropout ( Srivastava et al. , 2014 ) , take the form of stochastic operations in a model during training . Dropout is the most common instance of this type of regularization , with a variety of others also in relatively common use , such as DropConnect ( Wan et al. , 2013 ) , variational dropout ( Gal & Ghahramani , 2016 ) , and variable length backpropagation through time ( Merity et al. , 2017 ) , among many others . LOW-LEVEL OPERATIONS . An underlooked source of nondeterminism , the very libraries that many deep learning frameworks are built on , such as cuDNN ( Chetlur et al. , 2014 ) often are run nondeterministically for performance reasons . This nondeterminism is small in magnitude — in one test we performed this caused a difference of roughly 0.003 % . In the case of cuDNN , the library we test with , it is possible to disable nondeterministic behavior , incurring a speed penalty typically on the order of∼15 % . However , unlike the other sources of nondeterminism , it is not possible to “ seed ” this nondeterminism ; it is only possible to turn it on or off , but not control its nondeterministic behavior . 3.1 PROTOCOL FOR TESTING EFFECTS OF NONDETERMINISM . DIVERSITY IN PERFORMANCE . Our protocol for testing the effects of sources of nondeterminism is based on properly controlling for each source . In general , suppose there are N sources of nondeterminism , with source i controlled by a seed Si . To test the effect of source i , we keep all values Sj , j 6= i set to a constant , and vary Si with R different values , where R is the number of independent training runs performed . For sources of nondeterminism which can not be effectively seeded , such as cuDNN , we indicate one of these values as the deterministic value , which it must be set to when varying the other sources of nondeterminism . For example , suppose that we wish to study three sources of nondeterminism , denoting S1 the seed for random parameter initialization , S2 for training data shuffling , and S3 for cuDNN , where S3 = 1 is the deterministic value for cuDNN . To test the effect of random parameter initialization , with a budget of R = 30 training runs , then we set S3 to the deterministic value of 1 , S2 to an arbitrary constant ( also 1 for simplicity ) , and test 30 different values of S1 . All together , this corresponds to training models for ( S1 , S2 , S3 ) ∈ { ( i , 1 , 1 ) } 30i=1 , producing a set of 30 models . To look at variability according to a particular evaluation metric ( e.g . cross-entropy or accuracy for classification ) , we calculate the standard deviation ( across all R = 30 models ) of the metric . Note that it is also possible to test the effects of several sources of nondeterminism in tandem this way . For example , to test all sources of nondeterminism together , the set of models can be changed to ( S1 , S2 , S3 ) ∈ { ( i , i , 0 ) } Ri=1 . DIVERSITY IN REPRESENTATION . Beyond looking at diversity of test set generalization , though , it is worth examining how different the representations of trained models actually are — even though the diversity in performance might be similar between models trained with different types of nondeterminism , it might be the case that one type of nondeterminism produces models that have learned largely similar concepts , with the variance in generalization due to other factors . In order to rigorously examine these , we consider four distinct analyses on the functional behavior of models : The first and most straightforward metric we consider is the average disagreement between pairs of models , where higher disagreement corresponds to higher levels of diversity . In contrast to our other metrics , this considers only the argmax of a model ’ s predictions , which makes it both the most limited and the most interpretable of the group . This metric has also been used recently to compare network similarity in the context of network ensembles ( Fort et al. , 2019 ) . Second , we consider the average correlation between the predictions of two models , i.e . the expectation ( across pairs of models from the same nondeterminism source ) , of the correlation of predictions , calculated across examples and classes . For example , for a classification problem , the predicted logits from each of R models are flattened into vectors of length N ∗ C ( with N the number of test examples and C the number of classes ) , and we calculate the mean correlation coefficient of the predictions across all ( R 2 ) pairs of models . We use Spearman ’ s ρ for the correlation coefficient , but note that others such as Pearson ’ s r are possible and yield similar conclusions . For this metric , a lower score indicates a more diverse set of models . The third analysis we perform examines the change in performance from ensembling two models from the same source of nondeterminism . The intuition is as follows : If a pair of models are completely redundant , then ensembling them would result in no change in performance . However , if models actually learn different representations , then we expect an improvement from ensembling , with a greater improvement the greater the diversity in a set of models . Denoting by f ( Si ) some particular evaluation metric f calculated on the predictions of model Si , this change is equivalent to : 1 ( R 2 ) R∑ i=1 R∑ j=i+1 ( f ( Si + Sj 2 ) − f ( Si ) + f ( Sj ) 2 ) ( 1 ) Last , for a more detailed view of learned representations within a network , we consider a stateof-the-art method for measuring the similarity of learned neural network representations , centered kernel alignment ( CKA ) ( Kornblith et al. , 2019 ) , which has been used to analyze models trained with different random initializations , widths , and even entirely different architectures . We use the linear version of CKA , which Kornblith et al . ( 2019 ) found performed similarly to an RBF kernel .
This paper sheds light on the impact of nondeterminism to the run-to-run variability of neural network performance---a situation many people using neural networks have experienced. The authors establish an experimental strategy to analyze the different sources of nondeterminism. Some sources of nondeterminism are parameter initialization, data shuffling, data augmentation, regularization and cuDNN.
SP:40ed38eb25d29057685c22a2118da3f7d269535b
Learning to Share in Multi-Agent Reinforcement Learning
1 INTRODUCTION . In multi-agent reinforcement learning ( MARL ) , there are multiple agents interacting with the environment via their joint action to cooperatively optimize an objective . Many methods of centralized training and decentralized execution ( CTDE ) have been proposed for cooperative MARL , such as VDN ( Sunehag et al. , 2018 ) , QMIX ( Rashid et al. , 2018 ) , and QTRAN ( Son et al. , 2019 ) . However , these methods suffer from the overgeneralization issue ( Palmer et al. , 2018 ; Castellini et al. , 2019 ) . Moreover , they may not easily scale up with the number of agents due to centralized learning ( Qu et al. , 2020a ) . In many MARL applications , there are a large number of agents that are deployed as a partially connected network and collaboratively make decisions to optimize the globally averaged return , such as smart grids ( Dall ’ Anese et al. , 2013 ) , network routing ( Jiang et al. , 2020 ) , traffic signal control ( Chu et al. , 2020 ) , and IoT ( Xu et al. , 2019 ) . To deal with such scenarios , networked MARL is formulated to decompose the dependency among all agents into dependencies between only neighbors in such scenarios . To avoid decision-making with insufficient information , agents are permitted to exchange messages with neighbors over the network . In such settings , it is feasible for agents to learn to make decisions in a decentralized way ( Zhang et al. , 2018 ; Qu et al. , 2020b ) . However , there are still difficulties of dependency if anyone attempts to make decision independently , e.g. , prisoner ’ s dilemma and tragedy of the commons ( Pérolat et al. , 2017 ) . Existing methods tackle these problems by consensus update of value function ( Zhang et al. , 2018 ) , credit assignment ( Wang et al. , 2020 ) , or reward shaping ( Chu et al. , 2020 ) . However , these methods rely on either access to global state and joint action ( Zhang et al. , 2018 ) or handcrafted reward functions ( Wang et al. , 2020 ; Chu et al. , 2020 ) . Inspired by the fact that sharing plays a key role in human ’ s learning of cooperation , in this paper , we propose Learning To Share ( LToS ) , a hierarchically decentralized learning method for networked MARL . LToS enables agents to learn to dynamically share reward with neighbors so as to collaboratively optimize the global objective . The high-level policies decompose the global objective into local ones by determining how to share their rewards , while the low-level policies optimize local objectives induced by the high-level policies . LToS learns in a decentralized manner , and we prove that the high-level policies are a mean-field approximation of the joint high-level policy . Moreover , the high-level and low-level policies form a bi-level optimization and alternately learn to optimize the global objective . LToS is easy to implement and currently realized by DDPG ( Lillicrap et al. , 2016 ) as the high-level policy and DGN ( Jiang et al. , 2020 ) as the low-level policy . We empirically demonstrate that LToS outperforms existing methods for networked MARL in both social dilemma and two real-world scenarios . To the best of our knowledge , LToS is the first to learn to share reward for global optimization in networked MARL . 2 RELATED WORK . There are many recent studies for collaborative MARL . Most of them adopt centralized training and decentralized execution , such as COMA ( Foerster et al. , 2018 ) , VDN ( Sunehag et al. , 2018 ) , QMIX ( Rashid et al. , 2018 ) , and QTRAN ( Son et al. , 2019 ) . Many are constructed on the basis of factorizing the joint Q-function by assuming additivity ( Sunehag et al. , 2018 ) , monotonicity ( Rashid et al. , 2018 ) , or factorizable tasks ( Son et al. , 2019 ) . However , they are learned in a centralized way and hence may not easily scale up with the number of agents in networked MARL ( Qu et al. , 2020a ) . Moreover , these factorized methods suffer from the overgeneralization issue ( Palmer et al. , 2018 ; Castellini et al. , 2019 ) . Other studies focus on decentralized training specifically in networked MARL , to which our work is more closely related . Zhang et al . ( 2018 ) proposed consensus update of value function , but it requires global state at each agent , which is usually unavailable in decentralized training . Chu et al . ( 2020 ) introduced a spatial discount factor to capture the influence between agents , but the spatial discount factor remains hand-tuned . Sodomka et al . ( 2013 ) and Peysakhovich & Lerer ( 2018b ) involved the concept of transferable utility to encourage cooperation , and Peysakhovich & Lerer ( 2018a ) resorted to game theory and gave more complex reward designs . However , these methods can not be extended beyond two-player games . Hughes et al . ( 2018 ) proposed the inequity aversion model to balance agents ’ selfish desire and social fairness . Wang et al . ( 2020 ) considered to learn the Shapley value as the credit assignment . However , these methods still rely on hand-crafted reward designs . Mguni et al . ( 2019 ) added an extra part to the original reward as non-potential based reward shaping and used Bayesian optimization to induce the convergence to a desirable equilibrium between agents . However , the extra part remains fixed during an episode , which makes it less capable of dealing with dynamic environments . Moreover , the reward shaping alters the original optimization problem . 3 BACKGROUND . 3.1 NETWORKED MULTI-AGENT REINFORCEMENT LEARNING . Assume N agents interact with an environment . Let V = { 1 , 2 , · · · , N } be the set of agents . The multi-agent system is modeled as an undirected graph G ( V , E ) , where each agent i serves as vertex i and E ⊆ V × V is the set of all edges . Two agents i , j ∈ V can communicate with each other if and only if eij = ( i , j ) ∈ E . We denote agent i and its all neighbors in the graph together as a set Ni . The state of the environment s ∈ S transitions upon joint action a ∈ A according to transition probability Pa : S ×A× S → [ 0 , 1 ] , where joint action set A = ×i∈VAi . Each agent i has a policy πi ∈ Πi : S ×Ai → [ 0 , 1 ] , and we denote the joint policy of all agents as π ∈ Π = ×i∈VΠi . For networked MARL , a common and realistic assumption is that the reward of each agent i just depends on its action and the actions of its neighbors ( Qu et al. , 2020a ) , i.e. , ri ( s , a ) = ri ( s , aNi ) . Moreover , each agent i may only obtain partial observation oi ∈ Oi , but can approximate the state by the observations ofNi ( Jiang et al. , 2020 ) or the observation history ( Chu et al. , 2020 ) , which are all denoted by oi for simplicity . The global objective is to maximize the sum of cumulative rewards of all agents , i.e. , ∑∞ t=0 ∑N i=1 γ trti . 3.2 MARKOV GAME . In such a setting , each agent can individually maximizes its own expected return , which is known as Markov game . This may lead to stable outcome or Nash equilibrium , which however is usually sub-optimal . Given π , the value function of agent i is given by vπi ( s ) = ∑ a π ( a|s ) ∑ s′ pa ( s ′|s , a ) [ ri + γvπi ( s′ ) ] , ( 1 ) where pa ∈ Pa describes the state transitions . A Nash equilibrium is defined as ( Mguni et al. , 2019 ) v ( πi , π−i ) i ( s ) ≥ v ( π′i , π−i ) i ( s ) , ∀π ′ i ∈ Πi , ∀s ∈ S , ∀i ∈ V , ( 2 ) where π−i = ×j∈V\ { i } πj . 4 METHOD . The basic idea of LToS is to enable agents to learn how to share reward with neighbors such that agents are encouraged to collaboratively optimize the global objective in networked MARL . LToS is a decentralized hierarchy . At each agent , the high-level policy determines the weights of reward sharing based on low-level policies while the low-level policy directly interacts with the environment to optimize local objective induced by high-level policies . Therefore , they form a bi-level optimization and alternately learn towards the global objective . 4.1 REWARD SHARING . The intuition of reward sharing is that if agents share their rewards with others , each agent has to consider the consequence of its actions on others , and thus it promotes cooperation . In networked MARL , as the reward of an agent is assumed to depend on the actions of neighbors , we allow reward sharing between neighboring agents . For the graph of V , we additionally define a set of directed edges , D , constructed from E . Specifically , we add a loop dii ∈ D for each agent i and split each undirected edge eij ∈ E into two directed edges : dij = ( i , j ) and dji = ( j , i ) ∈ D. Each agent i determines a weight wij ∈ [ 0 , 1 ] for each directed edge dij , ∀j ∈ Ni , subject to the constraint ∑ j∈Ni wij = 1 , so that wij proportion of agent i ’ s environment reward ri will be shared to agent j. Letw ∈ W = ×dij∈Dwij be the weights of the graph . Therefore , the shaped reward after sharing for each agent i is defined as rwi = ∑ j∈Ni wjirj . ( 3 ) 4.2 HIERARCHY . Assume there is a joint high-level policy φ ∈ Φ : S ×W → [ 0 , 1 ] to determinew . Given φ andw , we can define the value function of π at each agent i based on ( 1 ) as vπi ( s ; φ ) = ∑ w φ ( w|s ) ∑ a π ( a|s , w ) ∑ s′ pa ( s ′|s , a ) [ rwi + γvπi ( s′ ; φ ) ] , ( 4 ) vπi ( s ; w , φ ) = ∑ a π ( a|s , w ) ∑ s′ pa ( s ′|s , a ) [ rwi + γvπi ( s′ ; φ ) ] . ( 5 ) We express w as a discrete action for simplicity . It also holds for continuous action as long as we change all the summations to integrals . Let V φV ( s ; π ) . = ∑ i∈V v π i ( s ; φ ) and Q φ V ( s , w ; π ) . = ∑ i∈V v π i ( s ; w , φ ) . Proposition 4.1 . Given π , V φV ( s ; π ) and Q φ V ( s , w ; π ) are respectively the value function and action-value function of φ . Proof . Let rφi . = ∑ a π ( a|s , w ) rwi and pw ( s′|s , w ) . = ∑ a π ( a|s , w ) pa ( s′|s , a ) . As commonly assumed the reward is deterministic given s and a , from ( 4 ) , we have , vπi ( s ; φ ) = ∑ w φ ( w|s ) ∑ a π ( a|s , w ) [ rwi + ∑ s′ pa ( s ′|s , a ) γvπi ( s′ ; φ ) ] ( 6 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφi + γv π i ( s ′ ; φ ) ] , ( 7 ) where pw ∈ Pw : S ×W × S → [ 0 , 1 ] describes the state transitions given π . Let rφV . = ∑ i∈V r φ i , and from ( 7 ) we have V φV ( s ; π ) = ∑ i∈V ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφi + γv π i ( s ′ ; φ ) ] ( 8 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ ∑ i∈V rφi + γ ∑ i∈V vπi ( s ′ ; φ ) ] ( 9 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφV + γV φ V ( s ′ ; π ) ] , ( 10 ) and similarly , QφV ( s , w ; π ) = ∑ i∈V ∑ s′ pw ( s ′|s , w ) [ rφi + γ ∑ w′ φ ( w′|s′ ) vπi ( s′ ; w′ , φ ) ] ( 11 ) = ∑ s′ pw ( s ′|s , w ) [ ∑ i∈V rφi + γ ∑ w′ φ ( w′|s′ ) ∑ i∈V vπi ( s ′ ; w′ , φ ) ] ( 12 ) = ∑ s′ pw ( s ′|s , w ) [ rφV + γ ∑ w′ φ ( w′|s′ ) QφV ( s ′ , w′ ; π ) ] . ( 13 ) Moreover , from the definitions of rwi and r φ i we have rφV = ∑ a π ( a|s , w ) ∑ i∈V rwi = ∑ a π ( a|s , w ) ∑ i∈V ∑ j∈Ni wjirj ( 14 ) = ∑ a π ( a|s , w ) ∑ ( i , j ) ∈D wijri = ∑ a π ( a|s , w ) ∑ i∈V ri , ( 15 ) Thus , given π , V φV ( s ) and Q φ V ( s , w ) are respectively the value function and action-value function of φ in terms of the sum of expected cumulative rewards of all agents , i.e. , the global objective . Proposition 4.1 implies that φ directly optimizes the global objective by generating w given π . Unlike existing hierarchical RL methods , we can directly construct the value function and actionvalue function of φ based on the value function of π at each agent . As φ optimizes the global objective given π while πi optimizes the shaped reward individually at each agent given φ ( assuming π convergent to Nash equilibrium or stable outcome , denoted as lim ) , they form a bi-level optimization . Let Jφ ( π ) and Jπ ( φ ) denote the objectives of φ and π respectively . The bi-level optimization can be formulated as follows , max φ Jφ ( π ∗ ( φ ) ) s.t . π∗ ( φ ) = arg lim π Jπ ( φ ) . ( 16 )
The paper addresses multi-agent RL problems by presenting a decentralized approach where the agents learn to share their reward with their neighbors. In this method, a high-level policy determines a weight vector for weighting the reward of neighboring agents, and then each agent learns their own independent policy. The learning is thus conducted locally in a partially connected network toward a common goal and without the knowledge of global state and actions.
SP:3c7efb6ff61e1589c76a8bbcb156cd6d4fb6b4af
Learning to Share in Multi-Agent Reinforcement Learning
1 INTRODUCTION . In multi-agent reinforcement learning ( MARL ) , there are multiple agents interacting with the environment via their joint action to cooperatively optimize an objective . Many methods of centralized training and decentralized execution ( CTDE ) have been proposed for cooperative MARL , such as VDN ( Sunehag et al. , 2018 ) , QMIX ( Rashid et al. , 2018 ) , and QTRAN ( Son et al. , 2019 ) . However , these methods suffer from the overgeneralization issue ( Palmer et al. , 2018 ; Castellini et al. , 2019 ) . Moreover , they may not easily scale up with the number of agents due to centralized learning ( Qu et al. , 2020a ) . In many MARL applications , there are a large number of agents that are deployed as a partially connected network and collaboratively make decisions to optimize the globally averaged return , such as smart grids ( Dall ’ Anese et al. , 2013 ) , network routing ( Jiang et al. , 2020 ) , traffic signal control ( Chu et al. , 2020 ) , and IoT ( Xu et al. , 2019 ) . To deal with such scenarios , networked MARL is formulated to decompose the dependency among all agents into dependencies between only neighbors in such scenarios . To avoid decision-making with insufficient information , agents are permitted to exchange messages with neighbors over the network . In such settings , it is feasible for agents to learn to make decisions in a decentralized way ( Zhang et al. , 2018 ; Qu et al. , 2020b ) . However , there are still difficulties of dependency if anyone attempts to make decision independently , e.g. , prisoner ’ s dilemma and tragedy of the commons ( Pérolat et al. , 2017 ) . Existing methods tackle these problems by consensus update of value function ( Zhang et al. , 2018 ) , credit assignment ( Wang et al. , 2020 ) , or reward shaping ( Chu et al. , 2020 ) . However , these methods rely on either access to global state and joint action ( Zhang et al. , 2018 ) or handcrafted reward functions ( Wang et al. , 2020 ; Chu et al. , 2020 ) . Inspired by the fact that sharing plays a key role in human ’ s learning of cooperation , in this paper , we propose Learning To Share ( LToS ) , a hierarchically decentralized learning method for networked MARL . LToS enables agents to learn to dynamically share reward with neighbors so as to collaboratively optimize the global objective . The high-level policies decompose the global objective into local ones by determining how to share their rewards , while the low-level policies optimize local objectives induced by the high-level policies . LToS learns in a decentralized manner , and we prove that the high-level policies are a mean-field approximation of the joint high-level policy . Moreover , the high-level and low-level policies form a bi-level optimization and alternately learn to optimize the global objective . LToS is easy to implement and currently realized by DDPG ( Lillicrap et al. , 2016 ) as the high-level policy and DGN ( Jiang et al. , 2020 ) as the low-level policy . We empirically demonstrate that LToS outperforms existing methods for networked MARL in both social dilemma and two real-world scenarios . To the best of our knowledge , LToS is the first to learn to share reward for global optimization in networked MARL . 2 RELATED WORK . There are many recent studies for collaborative MARL . Most of them adopt centralized training and decentralized execution , such as COMA ( Foerster et al. , 2018 ) , VDN ( Sunehag et al. , 2018 ) , QMIX ( Rashid et al. , 2018 ) , and QTRAN ( Son et al. , 2019 ) . Many are constructed on the basis of factorizing the joint Q-function by assuming additivity ( Sunehag et al. , 2018 ) , monotonicity ( Rashid et al. , 2018 ) , or factorizable tasks ( Son et al. , 2019 ) . However , they are learned in a centralized way and hence may not easily scale up with the number of agents in networked MARL ( Qu et al. , 2020a ) . Moreover , these factorized methods suffer from the overgeneralization issue ( Palmer et al. , 2018 ; Castellini et al. , 2019 ) . Other studies focus on decentralized training specifically in networked MARL , to which our work is more closely related . Zhang et al . ( 2018 ) proposed consensus update of value function , but it requires global state at each agent , which is usually unavailable in decentralized training . Chu et al . ( 2020 ) introduced a spatial discount factor to capture the influence between agents , but the spatial discount factor remains hand-tuned . Sodomka et al . ( 2013 ) and Peysakhovich & Lerer ( 2018b ) involved the concept of transferable utility to encourage cooperation , and Peysakhovich & Lerer ( 2018a ) resorted to game theory and gave more complex reward designs . However , these methods can not be extended beyond two-player games . Hughes et al . ( 2018 ) proposed the inequity aversion model to balance agents ’ selfish desire and social fairness . Wang et al . ( 2020 ) considered to learn the Shapley value as the credit assignment . However , these methods still rely on hand-crafted reward designs . Mguni et al . ( 2019 ) added an extra part to the original reward as non-potential based reward shaping and used Bayesian optimization to induce the convergence to a desirable equilibrium between agents . However , the extra part remains fixed during an episode , which makes it less capable of dealing with dynamic environments . Moreover , the reward shaping alters the original optimization problem . 3 BACKGROUND . 3.1 NETWORKED MULTI-AGENT REINFORCEMENT LEARNING . Assume N agents interact with an environment . Let V = { 1 , 2 , · · · , N } be the set of agents . The multi-agent system is modeled as an undirected graph G ( V , E ) , where each agent i serves as vertex i and E ⊆ V × V is the set of all edges . Two agents i , j ∈ V can communicate with each other if and only if eij = ( i , j ) ∈ E . We denote agent i and its all neighbors in the graph together as a set Ni . The state of the environment s ∈ S transitions upon joint action a ∈ A according to transition probability Pa : S ×A× S → [ 0 , 1 ] , where joint action set A = ×i∈VAi . Each agent i has a policy πi ∈ Πi : S ×Ai → [ 0 , 1 ] , and we denote the joint policy of all agents as π ∈ Π = ×i∈VΠi . For networked MARL , a common and realistic assumption is that the reward of each agent i just depends on its action and the actions of its neighbors ( Qu et al. , 2020a ) , i.e. , ri ( s , a ) = ri ( s , aNi ) . Moreover , each agent i may only obtain partial observation oi ∈ Oi , but can approximate the state by the observations ofNi ( Jiang et al. , 2020 ) or the observation history ( Chu et al. , 2020 ) , which are all denoted by oi for simplicity . The global objective is to maximize the sum of cumulative rewards of all agents , i.e. , ∑∞ t=0 ∑N i=1 γ trti . 3.2 MARKOV GAME . In such a setting , each agent can individually maximizes its own expected return , which is known as Markov game . This may lead to stable outcome or Nash equilibrium , which however is usually sub-optimal . Given π , the value function of agent i is given by vπi ( s ) = ∑ a π ( a|s ) ∑ s′ pa ( s ′|s , a ) [ ri + γvπi ( s′ ) ] , ( 1 ) where pa ∈ Pa describes the state transitions . A Nash equilibrium is defined as ( Mguni et al. , 2019 ) v ( πi , π−i ) i ( s ) ≥ v ( π′i , π−i ) i ( s ) , ∀π ′ i ∈ Πi , ∀s ∈ S , ∀i ∈ V , ( 2 ) where π−i = ×j∈V\ { i } πj . 4 METHOD . The basic idea of LToS is to enable agents to learn how to share reward with neighbors such that agents are encouraged to collaboratively optimize the global objective in networked MARL . LToS is a decentralized hierarchy . At each agent , the high-level policy determines the weights of reward sharing based on low-level policies while the low-level policy directly interacts with the environment to optimize local objective induced by high-level policies . Therefore , they form a bi-level optimization and alternately learn towards the global objective . 4.1 REWARD SHARING . The intuition of reward sharing is that if agents share their rewards with others , each agent has to consider the consequence of its actions on others , and thus it promotes cooperation . In networked MARL , as the reward of an agent is assumed to depend on the actions of neighbors , we allow reward sharing between neighboring agents . For the graph of V , we additionally define a set of directed edges , D , constructed from E . Specifically , we add a loop dii ∈ D for each agent i and split each undirected edge eij ∈ E into two directed edges : dij = ( i , j ) and dji = ( j , i ) ∈ D. Each agent i determines a weight wij ∈ [ 0 , 1 ] for each directed edge dij , ∀j ∈ Ni , subject to the constraint ∑ j∈Ni wij = 1 , so that wij proportion of agent i ’ s environment reward ri will be shared to agent j. Letw ∈ W = ×dij∈Dwij be the weights of the graph . Therefore , the shaped reward after sharing for each agent i is defined as rwi = ∑ j∈Ni wjirj . ( 3 ) 4.2 HIERARCHY . Assume there is a joint high-level policy φ ∈ Φ : S ×W → [ 0 , 1 ] to determinew . Given φ andw , we can define the value function of π at each agent i based on ( 1 ) as vπi ( s ; φ ) = ∑ w φ ( w|s ) ∑ a π ( a|s , w ) ∑ s′ pa ( s ′|s , a ) [ rwi + γvπi ( s′ ; φ ) ] , ( 4 ) vπi ( s ; w , φ ) = ∑ a π ( a|s , w ) ∑ s′ pa ( s ′|s , a ) [ rwi + γvπi ( s′ ; φ ) ] . ( 5 ) We express w as a discrete action for simplicity . It also holds for continuous action as long as we change all the summations to integrals . Let V φV ( s ; π ) . = ∑ i∈V v π i ( s ; φ ) and Q φ V ( s , w ; π ) . = ∑ i∈V v π i ( s ; w , φ ) . Proposition 4.1 . Given π , V φV ( s ; π ) and Q φ V ( s , w ; π ) are respectively the value function and action-value function of φ . Proof . Let rφi . = ∑ a π ( a|s , w ) rwi and pw ( s′|s , w ) . = ∑ a π ( a|s , w ) pa ( s′|s , a ) . As commonly assumed the reward is deterministic given s and a , from ( 4 ) , we have , vπi ( s ; φ ) = ∑ w φ ( w|s ) ∑ a π ( a|s , w ) [ rwi + ∑ s′ pa ( s ′|s , a ) γvπi ( s′ ; φ ) ] ( 6 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφi + γv π i ( s ′ ; φ ) ] , ( 7 ) where pw ∈ Pw : S ×W × S → [ 0 , 1 ] describes the state transitions given π . Let rφV . = ∑ i∈V r φ i , and from ( 7 ) we have V φV ( s ; π ) = ∑ i∈V ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφi + γv π i ( s ′ ; φ ) ] ( 8 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ ∑ i∈V rφi + γ ∑ i∈V vπi ( s ′ ; φ ) ] ( 9 ) = ∑ w φ ( w|s ) ∑ s′ pw ( s ′|s , w ) [ rφV + γV φ V ( s ′ ; π ) ] , ( 10 ) and similarly , QφV ( s , w ; π ) = ∑ i∈V ∑ s′ pw ( s ′|s , w ) [ rφi + γ ∑ w′ φ ( w′|s′ ) vπi ( s′ ; w′ , φ ) ] ( 11 ) = ∑ s′ pw ( s ′|s , w ) [ ∑ i∈V rφi + γ ∑ w′ φ ( w′|s′ ) ∑ i∈V vπi ( s ′ ; w′ , φ ) ] ( 12 ) = ∑ s′ pw ( s ′|s , w ) [ rφV + γ ∑ w′ φ ( w′|s′ ) QφV ( s ′ , w′ ; π ) ] . ( 13 ) Moreover , from the definitions of rwi and r φ i we have rφV = ∑ a π ( a|s , w ) ∑ i∈V rwi = ∑ a π ( a|s , w ) ∑ i∈V ∑ j∈Ni wjirj ( 14 ) = ∑ a π ( a|s , w ) ∑ ( i , j ) ∈D wijri = ∑ a π ( a|s , w ) ∑ i∈V ri , ( 15 ) Thus , given π , V φV ( s ) and Q φ V ( s , w ) are respectively the value function and action-value function of φ in terms of the sum of expected cumulative rewards of all agents , i.e. , the global objective . Proposition 4.1 implies that φ directly optimizes the global objective by generating w given π . Unlike existing hierarchical RL methods , we can directly construct the value function and actionvalue function of φ based on the value function of π at each agent . As φ optimizes the global objective given π while πi optimizes the shaped reward individually at each agent given φ ( assuming π convergent to Nash equilibrium or stable outcome , denoted as lim ) , they form a bi-level optimization . Let Jφ ( π ) and Jπ ( φ ) denote the objectives of φ and π respectively . The bi-level optimization can be formulated as follows , max φ Jφ ( π ∗ ( φ ) ) s.t . π∗ ( φ ) = arg lim π Jπ ( φ ) . ( 16 )
The paper present a new method, called LToS which enables agents to share rewards in MARL. Two levels of policies, high-level and low-level, determines rewards and optimize global objectives. Three diverse scenarios were used to test the performance of LToS compared to other baseline methods. LToS consistently outperforms other methods. In the second scenario, authors also show the need for high-level policy by introduction fixed LToS.
SP:3c7efb6ff61e1589c76a8bbcb156cd6d4fb6b4af
Adaptive Procedural Task Generation for Hard-Exploration Problems
1 INTRODUCTION . The effectiveness of reinforcement learning ( RL ) relies on the agent ’ s ability to explore the task environment and collect informative experiences . Given tasks handcrafted with human expertise , RL algorithms have achieved significant progress on solving sequential decision making problems in various domains such as game playing ( Badia et al. , 2020 ; Mnih et al. , 2015 ) and robotics ( OpenAI et al. , 2019 ; Duan et al. , 2016 ) . However , in many hard-exploration problems ( Aytar et al. , 2018 ; Paine et al. , 2020 ) , such trial-and-error paradigms often suffer from sparse and deceptive rewards , stringent environment constraints , and large state and action spaces . A plurality of exploration strategies has been developed to encourage the state coverage by an RL agent ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ; Burda et al. , 2019 ; Conti et al. , 2018 ) . Although successes are achieved in goal-reaching tasks and games of small state spaces , harder tasks often require the agent to complete a series of sub-tasks without any positive feedback until the final mission is accomplished . Naively covering intermediate states can be insufficient for the agent to connect the dots and discover the final solution . In complicated tasks , it could also be difficult to visit diverse states by directly exploring in the given environment ( Maillard et al. , 2014 ) . In contrast , recent advances in curriculum learning ( Bengio et al. , 2009 ; Graves et al. , 2017 ) aim to utilize similar but easier datasets or tasks to facilitate training . Being applied to RL , these techniques select tasks from a predefined set ( Matiisen et al. , 2019 ) or a parameterized space of goals and scenes ( Held et al. , 2018 ; Portelas et al. , 2019 ; Racanière et al. , 2020 ) to accelerate the performance improvement on the target task or the entire task space . However , the flexibility of their curricula is often limited to task spaces using low-dimensional parameters , where the search for a suitable task is relatively easy and the similarity between two tasks can be well defined . 1Project page : https : //kuanfang.github.io/apt-gen/ In this work , we combat this challenge by generating tasks of rich variations as curricula using procedural content generation ( PCG ) . Developed for automated creation of environments in physics simulations and video games ( Summerville et al. , 2018 ; Risi & Togelius , 2019 ; Cobbe et al. , 2020 ) , PCG tools have paved the way for generating diverse tasks of configurable scene layouts , object types , constraints , and objectives . To take advantage of PCG for automated curricula , the key challenge is to measure the learning progress in order to adaptively generate suitable tasks for efficiently learning to solve the target task . In hard-exploration problems , this challenge is intensified since the performance improvement can not always be directly observed on the target task until it is close to being solved . In addition , the progress in a complex task space is hard to estimate when there does not exist a well-defined measure of task difficulty or similarity . We can not always expect the agent to thoroughly investigate the task space and learn to solve all tasks therein , especially when the target task has unknown parameterization and the task space has rich variations . To this end , we introduce Adaptive Procedural Task Generation ( APT-Gen ) , an approach to progressively generate a sequence of tasks to expedite reinforcement learning in hard-exploration problems . As shown in Figure 1 , APT-Gen uses a task generator to create tasks via a black-box procedural generation module . Through the interplay between the task generator and the policy , tasks are continuously generated to provide similar but easier scenarios for training the agent . In order to enable curriculum learning in the absence of a direct indicator of learning progress , we propose to train the task generator by balancing the agent ’ s performance in the generated tasks and the task progress score which measures the similarity between the generated tasks and the target task . To encourage the generated tasks to require similar agent ’ s behaviors with the target task , a task discriminator is adversarially trained to estimate the task progress by comparing the agent ’ s experiences collected from both task sources . APT-Gen can thus be trained for target tasks of unknown parameterization or even outside of the task space defined by the procedural generation module , which expands the scope of its application . By jointly training the task generator , the task discriminator , and the policy , APT-Gen is able to adaptively generate suitable tasks from highly configurable task spaces to facilitate the learning process for challenging target tasks . Our experiments are conducted on various tasks in the grid world and robotic manipulation domains . Tasks generated in these domains are parameterized by 6× to 10× independent variables compared to those in prior work ( Wang et al. , 2019 ; 2020 ; Portelas et al. , 2019 ) . Each task can have different environment layouts , object types , object positions , constraints , and reward functions . In challenging target tasks of sparse rewards and stringent constraints , APT-Gen substantially outperforms existing exploration and curriculum learning baselines by effectively generating new tasks during training . 2 RELATED WORK . Hard-Exploration Problems . Many RL algorithms aim to incentivize the agent to visit more diverse and higher-reward states . Methods on intrinsic motivation augment the sparse and deceptive environment rewards with an additional intrinsic reward that encourages curiosity ( Pathak et al. , 2017 ; Burda et al. , 2019 ; Raileanu & Rocktäschel , 2020 ) and state novelty ( Conti et al. , 2018 ; Eysenbach et al. , 2019 ) . Another family of exploration techniques is derived from an informationtheoretical perspective as maximizing information gain of actions ( Houthooft et al. , 2016 ; Sun et al. , 2011 ) . When human demonstrations are available , they can be used to facilitate an RL agent to visit similar states and transitions as illustrated in the demonstrations ( Vecerik et al. , 2017 ; Nair et al. , 2018 ; Zhu et al. , 2018 ) . A combination of these techniques has been applied to solve hardexploration problems in video game domains ( Aytar et al. , 2018 ; Ecoffet et al. , 2019 ) . However , these methods have focused on learning in relatively simple and fixed environments , and usually can be ineffective in tasks where explorations are thwarted by stringent environment constraints or naively covering states does not lead to the task success . Curriculum Learning . Curriculum learning utilizes alternative datasets and tasks to accelerate the learning process of challenging target tasks ( Bengio et al. , 2009 ; Graves et al. , 2017 ) . To apply curriculum learning to RL , several recent works learn to adaptively select a finite set of easy tasks ( Narvekar et al. , 2017 ; Svetlik et al. , 2017 ; Riedmiller et al. , 2018 ; Peng et al. , 2018 ; Czarnecki et al. , 2018 ; Matiisen et al. , 2019 ; Narvekar & Stone , 2019 ; Lin et al. , 2019 ) or auxiliary rewards ( Jaderberg et al. , 2017 ; Shen et al. , 2019 ) hand-designed by human to maximize a progress signal defined on the target task . Parameterized tasks have been used to form a curriculum through the configuration of goals ( Forestier et al. , 2017 ; Held et al. , 2018 ; Racanière et al. , 2020 ) , environment layouts ( Wöhlke et al. , 2020 ; Baker et al. , 2020 ; Portelas et al. , 2019 ) , and reward functions ( Gupta et al. , 2018 ; Jabri et al. , 2019 ) . OpenAI et al . ( 2019 ) and Mehta et al . ( 2020 ) propose to actively adjust the hyperparameters in physical simulators to alleviate the domain shift . Most of these works are designed for task spaces parameterized by several discrete or continuous variables , where the task space can often be thoroughly explored and the similarity between two tasks could be well defined in the parameter space . In contrast , our approach is able to effectively generate tasks parameterized by a combination of high-dimensional discrete variables and several continuous variables . While most of these works focus on parameterizing a single aspect of the task environment , our approach learns to generate new tasks of rich variations with configurable initial state probability , transition probability , and reward function . Sukhbaatar et al . ( 2018b ) , Florensa et al . ( 2017 ) , and Sukhbaatar et al . ( 2018a ) propose to use an adversarial agent to set goals of growing difficulties by reversely traversing the state space from the goal . While this is related to the adversarial training framework in this paper in principle , we apply our framework beyond goal-reaching and reversible task domains . Procedural Task Generation . Procedural generation has been widely used in computer graphics and robotics ( Fisher et al. , 2012 ; Izadinia et al. , 2017 ; Majerowicz et al. , 2013 ; Izatt & Tedrake , 2020 ; Schwarz & Behnke , 2020 ) . While an increasing number of task sets have been designed to benchmark and empower reinforcement learning research ( Kolve et al. , 2017 ; Xia et al. , 2018 ; Savva et al. , 2019 ; Yu et al. , 2019 ; James et al. , 2020 ) , the design and implementation of each task often require nontrivial human expertise and heavy engineering . A few recent works utilize the random procedural generation of tasks ( Cobbe et al. , 2020 ; Fang et al. , 2018 ; Raileanu & Rocktäschel , 2020 ; Silver & Chitnis , 2020 ) . However , their generation algorithms are handcrafted with limited configurable features . Evolution strategies ( Wang et al. , 2019 ; 2020 ) , automated procedures ( Justesen et al. , 2018 ) , and learning-based methods ( Gravina et al. , 2019 ; Khalifa et al. , 2020 ; Bontrager & Togelius , 2020 ) have been proposed to automatically discover diverse games and task environments for training RL agents . Instead of covering the entire task space or discovering a diverse set of policies in an open-ended manner , our approach aims to train the policy to solve the target tasks of interest by utilizing the generated tasks . 3 ADAPTIVE PROCEDURAL TASK GENERATION . We consider a reinforcement learning problem involving a target task that the policy learns to solve and a parameterized task space that we utilize to generate new tasks . In practice , the parameterized task space can be created by a simulation program or a configurable procedure to set up the environment by a human or a robot in the real world . The target task can be an instance of an unknown parameter or a task outside of the task space , as long as there exist shared properties and transferable knowledge between the generated tasks and the target task . This follows the general paradigm of teacher-student curriculum learning ( Matiisen et al. , 2019 ; Portelas et al. , 2019 ) , while we allow the task space to be parameterized by either continuous or discrete high-dimensional variables and we do not assume the target task has a known parameterization by these variables . We propose Adaptive Procedural Task Generation ( APT-Gen ) , an approach for progressively generating tasks in highly configurable task spaces as curricula . To enable curriculum learning for hard-exploration problems , our key insight is that the learning progress can be jointly estimated by how well the policy can solve the current generated tasks and how similar the generated tasks are to the target task . Starting with a set of tasks that the policy can easily learn to solve , our approach progressively adapts the generated tasks towards the target task while maintaining their feasibility to the policy . As shown in Figure 1 , our approach creates tasks via a black-box procedural generation module by jointly learning the task generator , the task discriminator , and the policy .
This paper tackles the problem of facilitating RL agents' learning in sparse reward, hard-exploration problems. The authors approached this challenge by generating a curriculum of tasks needed to finish the originally assigned task. Though using other auxiliary tasks to assist RL training has been heatedly discussed, their method has its own highlights and novelty. Pros and Cons are listed as follows:
SP:e0600fd9c60fc02e37e332e608673682687f0190
Adaptive Procedural Task Generation for Hard-Exploration Problems
1 INTRODUCTION . The effectiveness of reinforcement learning ( RL ) relies on the agent ’ s ability to explore the task environment and collect informative experiences . Given tasks handcrafted with human expertise , RL algorithms have achieved significant progress on solving sequential decision making problems in various domains such as game playing ( Badia et al. , 2020 ; Mnih et al. , 2015 ) and robotics ( OpenAI et al. , 2019 ; Duan et al. , 2016 ) . However , in many hard-exploration problems ( Aytar et al. , 2018 ; Paine et al. , 2020 ) , such trial-and-error paradigms often suffer from sparse and deceptive rewards , stringent environment constraints , and large state and action spaces . A plurality of exploration strategies has been developed to encourage the state coverage by an RL agent ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ; Burda et al. , 2019 ; Conti et al. , 2018 ) . Although successes are achieved in goal-reaching tasks and games of small state spaces , harder tasks often require the agent to complete a series of sub-tasks without any positive feedback until the final mission is accomplished . Naively covering intermediate states can be insufficient for the agent to connect the dots and discover the final solution . In complicated tasks , it could also be difficult to visit diverse states by directly exploring in the given environment ( Maillard et al. , 2014 ) . In contrast , recent advances in curriculum learning ( Bengio et al. , 2009 ; Graves et al. , 2017 ) aim to utilize similar but easier datasets or tasks to facilitate training . Being applied to RL , these techniques select tasks from a predefined set ( Matiisen et al. , 2019 ) or a parameterized space of goals and scenes ( Held et al. , 2018 ; Portelas et al. , 2019 ; Racanière et al. , 2020 ) to accelerate the performance improvement on the target task or the entire task space . However , the flexibility of their curricula is often limited to task spaces using low-dimensional parameters , where the search for a suitable task is relatively easy and the similarity between two tasks can be well defined . 1Project page : https : //kuanfang.github.io/apt-gen/ In this work , we combat this challenge by generating tasks of rich variations as curricula using procedural content generation ( PCG ) . Developed for automated creation of environments in physics simulations and video games ( Summerville et al. , 2018 ; Risi & Togelius , 2019 ; Cobbe et al. , 2020 ) , PCG tools have paved the way for generating diverse tasks of configurable scene layouts , object types , constraints , and objectives . To take advantage of PCG for automated curricula , the key challenge is to measure the learning progress in order to adaptively generate suitable tasks for efficiently learning to solve the target task . In hard-exploration problems , this challenge is intensified since the performance improvement can not always be directly observed on the target task until it is close to being solved . In addition , the progress in a complex task space is hard to estimate when there does not exist a well-defined measure of task difficulty or similarity . We can not always expect the agent to thoroughly investigate the task space and learn to solve all tasks therein , especially when the target task has unknown parameterization and the task space has rich variations . To this end , we introduce Adaptive Procedural Task Generation ( APT-Gen ) , an approach to progressively generate a sequence of tasks to expedite reinforcement learning in hard-exploration problems . As shown in Figure 1 , APT-Gen uses a task generator to create tasks via a black-box procedural generation module . Through the interplay between the task generator and the policy , tasks are continuously generated to provide similar but easier scenarios for training the agent . In order to enable curriculum learning in the absence of a direct indicator of learning progress , we propose to train the task generator by balancing the agent ’ s performance in the generated tasks and the task progress score which measures the similarity between the generated tasks and the target task . To encourage the generated tasks to require similar agent ’ s behaviors with the target task , a task discriminator is adversarially trained to estimate the task progress by comparing the agent ’ s experiences collected from both task sources . APT-Gen can thus be trained for target tasks of unknown parameterization or even outside of the task space defined by the procedural generation module , which expands the scope of its application . By jointly training the task generator , the task discriminator , and the policy , APT-Gen is able to adaptively generate suitable tasks from highly configurable task spaces to facilitate the learning process for challenging target tasks . Our experiments are conducted on various tasks in the grid world and robotic manipulation domains . Tasks generated in these domains are parameterized by 6× to 10× independent variables compared to those in prior work ( Wang et al. , 2019 ; 2020 ; Portelas et al. , 2019 ) . Each task can have different environment layouts , object types , object positions , constraints , and reward functions . In challenging target tasks of sparse rewards and stringent constraints , APT-Gen substantially outperforms existing exploration and curriculum learning baselines by effectively generating new tasks during training . 2 RELATED WORK . Hard-Exploration Problems . Many RL algorithms aim to incentivize the agent to visit more diverse and higher-reward states . Methods on intrinsic motivation augment the sparse and deceptive environment rewards with an additional intrinsic reward that encourages curiosity ( Pathak et al. , 2017 ; Burda et al. , 2019 ; Raileanu & Rocktäschel , 2020 ) and state novelty ( Conti et al. , 2018 ; Eysenbach et al. , 2019 ) . Another family of exploration techniques is derived from an informationtheoretical perspective as maximizing information gain of actions ( Houthooft et al. , 2016 ; Sun et al. , 2011 ) . When human demonstrations are available , they can be used to facilitate an RL agent to visit similar states and transitions as illustrated in the demonstrations ( Vecerik et al. , 2017 ; Nair et al. , 2018 ; Zhu et al. , 2018 ) . A combination of these techniques has been applied to solve hardexploration problems in video game domains ( Aytar et al. , 2018 ; Ecoffet et al. , 2019 ) . However , these methods have focused on learning in relatively simple and fixed environments , and usually can be ineffective in tasks where explorations are thwarted by stringent environment constraints or naively covering states does not lead to the task success . Curriculum Learning . Curriculum learning utilizes alternative datasets and tasks to accelerate the learning process of challenging target tasks ( Bengio et al. , 2009 ; Graves et al. , 2017 ) . To apply curriculum learning to RL , several recent works learn to adaptively select a finite set of easy tasks ( Narvekar et al. , 2017 ; Svetlik et al. , 2017 ; Riedmiller et al. , 2018 ; Peng et al. , 2018 ; Czarnecki et al. , 2018 ; Matiisen et al. , 2019 ; Narvekar & Stone , 2019 ; Lin et al. , 2019 ) or auxiliary rewards ( Jaderberg et al. , 2017 ; Shen et al. , 2019 ) hand-designed by human to maximize a progress signal defined on the target task . Parameterized tasks have been used to form a curriculum through the configuration of goals ( Forestier et al. , 2017 ; Held et al. , 2018 ; Racanière et al. , 2020 ) , environment layouts ( Wöhlke et al. , 2020 ; Baker et al. , 2020 ; Portelas et al. , 2019 ) , and reward functions ( Gupta et al. , 2018 ; Jabri et al. , 2019 ) . OpenAI et al . ( 2019 ) and Mehta et al . ( 2020 ) propose to actively adjust the hyperparameters in physical simulators to alleviate the domain shift . Most of these works are designed for task spaces parameterized by several discrete or continuous variables , where the task space can often be thoroughly explored and the similarity between two tasks could be well defined in the parameter space . In contrast , our approach is able to effectively generate tasks parameterized by a combination of high-dimensional discrete variables and several continuous variables . While most of these works focus on parameterizing a single aspect of the task environment , our approach learns to generate new tasks of rich variations with configurable initial state probability , transition probability , and reward function . Sukhbaatar et al . ( 2018b ) , Florensa et al . ( 2017 ) , and Sukhbaatar et al . ( 2018a ) propose to use an adversarial agent to set goals of growing difficulties by reversely traversing the state space from the goal . While this is related to the adversarial training framework in this paper in principle , we apply our framework beyond goal-reaching and reversible task domains . Procedural Task Generation . Procedural generation has been widely used in computer graphics and robotics ( Fisher et al. , 2012 ; Izadinia et al. , 2017 ; Majerowicz et al. , 2013 ; Izatt & Tedrake , 2020 ; Schwarz & Behnke , 2020 ) . While an increasing number of task sets have been designed to benchmark and empower reinforcement learning research ( Kolve et al. , 2017 ; Xia et al. , 2018 ; Savva et al. , 2019 ; Yu et al. , 2019 ; James et al. , 2020 ) , the design and implementation of each task often require nontrivial human expertise and heavy engineering . A few recent works utilize the random procedural generation of tasks ( Cobbe et al. , 2020 ; Fang et al. , 2018 ; Raileanu & Rocktäschel , 2020 ; Silver & Chitnis , 2020 ) . However , their generation algorithms are handcrafted with limited configurable features . Evolution strategies ( Wang et al. , 2019 ; 2020 ) , automated procedures ( Justesen et al. , 2018 ) , and learning-based methods ( Gravina et al. , 2019 ; Khalifa et al. , 2020 ; Bontrager & Togelius , 2020 ) have been proposed to automatically discover diverse games and task environments for training RL agents . Instead of covering the entire task space or discovering a diverse set of policies in an open-ended manner , our approach aims to train the policy to solve the target tasks of interest by utilizing the generated tasks . 3 ADAPTIVE PROCEDURAL TASK GENERATION . We consider a reinforcement learning problem involving a target task that the policy learns to solve and a parameterized task space that we utilize to generate new tasks . In practice , the parameterized task space can be created by a simulation program or a configurable procedure to set up the environment by a human or a robot in the real world . The target task can be an instance of an unknown parameter or a task outside of the task space , as long as there exist shared properties and transferable knowledge between the generated tasks and the target task . This follows the general paradigm of teacher-student curriculum learning ( Matiisen et al. , 2019 ; Portelas et al. , 2019 ) , while we allow the task space to be parameterized by either continuous or discrete high-dimensional variables and we do not assume the target task has a known parameterization by these variables . We propose Adaptive Procedural Task Generation ( APT-Gen ) , an approach for progressively generating tasks in highly configurable task spaces as curricula . To enable curriculum learning for hard-exploration problems , our key insight is that the learning progress can be jointly estimated by how well the policy can solve the current generated tasks and how similar the generated tasks are to the target task . Starting with a set of tasks that the policy can easily learn to solve , our approach progressively adapts the generated tasks towards the target task while maintaining their feasibility to the policy . As shown in Figure 1 , our approach creates tasks via a black-box procedural generation module by jointly learning the task generator , the task discriminator , and the policy .
This paper presents a procedurally content generation approach (APT-Gen) that generates a sequence of tasks for an agent to solve. These tasks are automatically generated in a way that helps an RL agent to learn hard-exploration problems. A main innovation of the approach is a task generator system that is both rewarded for generating tasks the agents can solve but also a sequence of tasks that are getting increasingly more similar to the target task.
SP:e0600fd9c60fc02e37e332e608673682687f0190
Max-sliced Bures Distance for Interpreting Discrepancies
We propose the max-sliced Bures distance , a lower bound on the max-sliced Wasserstein-2 distance , to identify the instances associated with the maximum discrepancy between two samples . The max-slicing can be decomposed into two asymmetric divergences each expressed in terms of an optimal slice or equivalently a ‘ witness ’ function that has large magnitude evaluations on a localized subset of instances in one distribution versus the other . We show how witness functions can be used to detect and correct for covariate shift through reweighting and to evaluate generative adversarial networks . Unlike heuristic algorithms for the max-sliced Wasserstein-2 distance that may fail to find the optimal slice , we detail a tractable algorithm that finds the global optimal slice and scales to large sample sizes . As the Bures distance quantifies differences in covariance , we generalize the max-sliced Bures distance by using non-linear mappings , enabling it to capture changes in higher-order statistics . We explore two types of non-linear mappings : positive semidefinite kernels where the witness functions belong to a reproducing kernel Hilbert space , and task-relevant mappings corresponding to a neural network . In the context of samples of natural images , our approach provides an interpretation of the Fréchet Inception distance by identifying the synthetic and natural instances that are either over-represented or under-represented with respect to the other sample . We apply the proposed measure to detect imbalances in class distributions in various data sets and to critique generative models . 1 INTRODUCTION . Divergence measures quantify the dissimilarity between probability distributions . They are fundamental to hypothesis testing and the estimation and criticism of statistical models , and serve as cost functions for optimizing generative adversarial neural networks ( GANs ) . Although a multitude of divergences exists , not all of them are interpretable . A divergence is interpretable if can be expressed in terms of a real-valued witness function ω ( · ) whose level-sets identify the specific subsets that are not well matched between the distributions , specifically , subsets which have much higher or much lower probability under one distribution versus the other . Localizing these discrepancies is useful for understanding and compensating for differences between two samples or distributions , to detect covariate shift ( Shimodaira , 2000 ; Quionero-Candela et al. , 2009 ; Lipton et al. , 2018 ) or to evaluate generative models ( Heusel et al. , 2017 ) . While many divergences can be posed in terms of witness functions , not all witness functions are readily obtained or interpreted . From an information-theoretic perspective , the most natural witness function is the logarithm of the ratio of the densities ( Kullback & Leibler , 1951 ) as in the KullbackLeibler divergence . Applying other convex functions to the density ratio constitutes the family of f -divergences ( Ali & Silvey , 1966 ; Rényi , 1961 ) , which include the Hellinger , Jensen-Shannon , and others . However , without a parametric model estimating the densities from samples is challenging ( Vapnik , 2013 ) . Following Vapnik ’ s advice to “ try to avoid solving a more general problem as an intermediate step , ” previous work has sought to directly model the density ratio via kernel learning ( Nguyen et al. , 2008 ; Kanamori et al. , 2009 ; Yamada et al. , 2011 ; 2013 ; Saito et al. , 2018 ; Lee et al. , 2019 ) or to estimate an f -divergence by optimizing a function from a suitable family ( Nguyen et al. , 2010 ) such as a neural network Nowozin et al . ( 2016 ) . Witness functions need not rely on the density ratio . A wide class of divergences called integral probability metrics ( IPMs ) ( Müller , 1997 ) , which include total variation , the Wasserstein-1 distance , maximum mean discrepancy ( MMD ) ( Gretton et al. , 2007 ) , and others ( Mroueh et al. , 2017 ) , seek a witness function that maximizes the distance between the first moments of the witness function evaluations . In these cases the optimal witness function ω ? ( · ) has a greater expectation in one distribution compared to the other distribution . An IPM between two measures µ and ν is expressed as supω∈F |EX∼µ [ ω ( X ) ] − EY∼ν [ ω ( Y ) ] | for a given family of functions F . A class of related divergences are the max-sliced Wasserstein-p distances , which seek a linear ( Deshpande et al. , 2019 ) or non-linear slicing function ( Kolouri et al. , 2019 ) that maximizes the Wasserstein-p distance between the witness function evaluations for the two distributions . However , there are two difficulties with computing the max-sliced Wasserstein distance for two samples . The first is that it is a saddlepoint optimization problem , whose objective evaluation requires sorting the samples . Previous work has sought to approximate it using a first moment approximation ( Deshpande et al. , 2019 ) or to use a finite number of steps of a local optimizer ( Kolouri et al. , 2019 ) , without any guarantee of obtaining an optimal witness function . Another difficulty is in the interpretation of the obtained witness function . Unlike the density ratio , there is no notion of whether the witness function will take higher values for points associated to one distribution versus the other . To address both of these issues we propose a max-sliced distance that replaces the Wasserstein-2 distance with a second-moment approximation based on the Bures distance ( Dowson & Landau , 1982 ; Gelbrich , 1990 ) . The Bures distance ( Bures , 1969 ; Uhlmann , 1976 ) is a distance metric between positive semidefinite operators . It is well-known in quantum information theory ( Nielsen & Chuang , 2000 ; Koltchinskii & Xia , 2015 ) and machine learning ( Brockmeier et al. , 2017 ; Muzellec & Cuturi , 2018 ; Zhang et al. , 2020 ; Oh et al. , 2020 ; De Meulemeester et al. , 2020 ) . 1.1 CONTRIBUTION . We propose a novel IPM-like divergence measure , the “ max-sliced Bures distance ” , to identify localized regions and instances associated with the maximum discrepancy between two samples . The distance is expressed as the maximal difference between the root mean square ( RMS ) of the witness function evaluations supω∈S ∣∣∣√EX∼µ [ ω2 ( X ) ] −√EY∼ν [ ω2 ( Y ) ] ∣∣∣ , where S is an appropriate family of functions . As |∆| = max { ∆ , −∆ } , the max-sliced Bures can be expressed as the maximum of one-sided max-sliced divergences with optimal witness functions , ωµ > ν = arg maxω∈S √ Eµ [ ω2 ( X ) ] − √ Eν [ ω2 ( Y ) ] , and ωµ < ν = arg maxω∈S √ Eν [ ω2 ( Y ) ] − √ Eµ [ ω2 ( X ) ] . If the distributions are not well-matched , then ωµ > ν has large magnitude function evaluations under a ‘ localized ’ subset of µ and smaller magnitude values for ν , and the opposite for ωµ < ν . The two samples { xi } mi=1 , { yi } ni=1 can be sorted by the magnitude of the witness function evaluations.1 Crucially , we detail a tractable optimization procedure that is guaranteed to yield a global optimum witness function for the one-sided max-sliced Bures divergence . When X = Rd and the first or second moments distinguish the distributions , linear witness functions can be used S = { ω ( · ) = 〈· , w〉 : w ∈ Sd−1 } , where Sd−1 denotes the unit sphere in Rd . The optimal witness function for the one-sided max-sliced Bures divergence ωµ > ν ( · ) = 〈· , wµ > ν〉 coincides with the subspace with the greatest difference in RMS , wµ > ν = arg maxw∈Sd−1 √ w > E [ XX > ] w − √ w > E [ Y Y > ] w. This optimization problem depends on the dimension d ; after computation of the covariance matrices , it is independent of the sample sizes m ≥ n. In comparison , the optimal slice for the max-sliced Wasserstein may not be obtained , and even gradient ascent to a local optimum requiresO ( m logm ) at each function/gradient evaluation . Furthermore , the slice that maximizes the max-sliced Wasser- 1Four groups of ‘ witness points ’ ( top-K instances ) can be inspected to identify any discrepancies : ω2µ > ν ( xπ̀ ( 1 ) ) ≥ · · · ≥ ω2µ > ν ( xπ̀ ( K ) ) ︸ ︷︷ ︸ π̀ sorts { xi } mi=1 to reveal examples from µ̂ with large ω 2 µ > ν ̃ ω2µ > ν ( yσ̀ ( 1 ) ) ≥ · · · ≥ ω2µ > ν ( yσ̀ ( K ) ) ︸ ︷︷ ︸ σ̀ sorts { yi } ni=1 to find the examples from ν̂ with large ω 2 µ > ν , ( 1 ) ω2µ < ν ( xπ́ ( 1 ) ) ≥ · · · ≥ ω2µ < ν ( xπ́ ( K ) ) ︸ ︷︷ ︸ π́ sorts { xi } mi=1 to find examples from µ̂ with large ω 2 µ < ν ̃ ω2µ < ν ( yσ́ ( 1 ) ) ≥ · · · ≥ ω2µ < ν ( yσ́ ( K ) ) ︸ ︷︷ ︸ σ́ sorts { yi } ni=1 to find the examples from ν̂ with large ω 2 µ < ν , ( 2 ) where π̀ , π́ , σ̀ , σ́ denote permutations and ̃ and ̃ denote expected inequalities with a large difference . stein lacks an intrinsic ordering , and it is left to the user to determine whether instances from µ or ν have high or low values or magnitudes . As second-order moments may be insufficient for distinguishing the distributions , we explore non-linear mappings of the random variables . Firstly , we consider a reproducing kernel Hilbert space ( RKHS ) H with the family of witness functions S = { ω ( · ) = 〈φ ( · ) , ω〉H : ω , φ ( · ) ∈ H , 〈ω , ω〉H = 1 } . An example with Gaussian kernels is shown in Figure 1 . Secondly , we use a pre-trained neural network to create a task-relevant mapping , computing the second-order statistics of the hidden-layer activations , and apply this in the context of samples of natural images . This enables interpretation of the Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) by identifying the subspace and images associated with discrepancies between synthetic and natural images . We prove that the max-sliced Bures distance provides a lower bound on the max-sliced Fréchet distance . Because of their similarity , we develop the max-sliced Bures distance in the context of max-sliced versions of the total variation and Wasserstein-2 distances . The kernel-based versions of these are novel contributions themselves . The max-sliced total variation distance is a special case of the covariance feature matching proposed by Mroueh et al . ( 2017 ) . In experimental results , we show applications of the linear and kernel-based versions to detect imbalances in class distributions of natural images and to critique GANs . We compare to other divergences expressed in terms of witness functions including MMD . Finally , we propose algorithms to reweight an empirical distribution in order to minimize max-sliced divergences ( with applications to generating conditional distributions and covariate shift correction ) .
This paper proposes a sliced version of the Bures distance, which is a lower bound on the 2-Wasserstein distance. The purpose behind this is to identify instances that are have the highest contribution towards the discrepancy between two distributions. But compared to other sliced OT distances, this one operates on a the Bures lower bound, which yields a more tractable solution. The paper presents experimental results on image classification datasets, which are claimed to show an advantage of the proposed variant over the full sliced Wasserstein distance .
SP:d154782d1a48802582244b6aa037e8483f58ef19
Max-sliced Bures Distance for Interpreting Discrepancies
We propose the max-sliced Bures distance , a lower bound on the max-sliced Wasserstein-2 distance , to identify the instances associated with the maximum discrepancy between two samples . The max-slicing can be decomposed into two asymmetric divergences each expressed in terms of an optimal slice or equivalently a ‘ witness ’ function that has large magnitude evaluations on a localized subset of instances in one distribution versus the other . We show how witness functions can be used to detect and correct for covariate shift through reweighting and to evaluate generative adversarial networks . Unlike heuristic algorithms for the max-sliced Wasserstein-2 distance that may fail to find the optimal slice , we detail a tractable algorithm that finds the global optimal slice and scales to large sample sizes . As the Bures distance quantifies differences in covariance , we generalize the max-sliced Bures distance by using non-linear mappings , enabling it to capture changes in higher-order statistics . We explore two types of non-linear mappings : positive semidefinite kernels where the witness functions belong to a reproducing kernel Hilbert space , and task-relevant mappings corresponding to a neural network . In the context of samples of natural images , our approach provides an interpretation of the Fréchet Inception distance by identifying the synthetic and natural instances that are either over-represented or under-represented with respect to the other sample . We apply the proposed measure to detect imbalances in class distributions in various data sets and to critique generative models . 1 INTRODUCTION . Divergence measures quantify the dissimilarity between probability distributions . They are fundamental to hypothesis testing and the estimation and criticism of statistical models , and serve as cost functions for optimizing generative adversarial neural networks ( GANs ) . Although a multitude of divergences exists , not all of them are interpretable . A divergence is interpretable if can be expressed in terms of a real-valued witness function ω ( · ) whose level-sets identify the specific subsets that are not well matched between the distributions , specifically , subsets which have much higher or much lower probability under one distribution versus the other . Localizing these discrepancies is useful for understanding and compensating for differences between two samples or distributions , to detect covariate shift ( Shimodaira , 2000 ; Quionero-Candela et al. , 2009 ; Lipton et al. , 2018 ) or to evaluate generative models ( Heusel et al. , 2017 ) . While many divergences can be posed in terms of witness functions , not all witness functions are readily obtained or interpreted . From an information-theoretic perspective , the most natural witness function is the logarithm of the ratio of the densities ( Kullback & Leibler , 1951 ) as in the KullbackLeibler divergence . Applying other convex functions to the density ratio constitutes the family of f -divergences ( Ali & Silvey , 1966 ; Rényi , 1961 ) , which include the Hellinger , Jensen-Shannon , and others . However , without a parametric model estimating the densities from samples is challenging ( Vapnik , 2013 ) . Following Vapnik ’ s advice to “ try to avoid solving a more general problem as an intermediate step , ” previous work has sought to directly model the density ratio via kernel learning ( Nguyen et al. , 2008 ; Kanamori et al. , 2009 ; Yamada et al. , 2011 ; 2013 ; Saito et al. , 2018 ; Lee et al. , 2019 ) or to estimate an f -divergence by optimizing a function from a suitable family ( Nguyen et al. , 2010 ) such as a neural network Nowozin et al . ( 2016 ) . Witness functions need not rely on the density ratio . A wide class of divergences called integral probability metrics ( IPMs ) ( Müller , 1997 ) , which include total variation , the Wasserstein-1 distance , maximum mean discrepancy ( MMD ) ( Gretton et al. , 2007 ) , and others ( Mroueh et al. , 2017 ) , seek a witness function that maximizes the distance between the first moments of the witness function evaluations . In these cases the optimal witness function ω ? ( · ) has a greater expectation in one distribution compared to the other distribution . An IPM between two measures µ and ν is expressed as supω∈F |EX∼µ [ ω ( X ) ] − EY∼ν [ ω ( Y ) ] | for a given family of functions F . A class of related divergences are the max-sliced Wasserstein-p distances , which seek a linear ( Deshpande et al. , 2019 ) or non-linear slicing function ( Kolouri et al. , 2019 ) that maximizes the Wasserstein-p distance between the witness function evaluations for the two distributions . However , there are two difficulties with computing the max-sliced Wasserstein distance for two samples . The first is that it is a saddlepoint optimization problem , whose objective evaluation requires sorting the samples . Previous work has sought to approximate it using a first moment approximation ( Deshpande et al. , 2019 ) or to use a finite number of steps of a local optimizer ( Kolouri et al. , 2019 ) , without any guarantee of obtaining an optimal witness function . Another difficulty is in the interpretation of the obtained witness function . Unlike the density ratio , there is no notion of whether the witness function will take higher values for points associated to one distribution versus the other . To address both of these issues we propose a max-sliced distance that replaces the Wasserstein-2 distance with a second-moment approximation based on the Bures distance ( Dowson & Landau , 1982 ; Gelbrich , 1990 ) . The Bures distance ( Bures , 1969 ; Uhlmann , 1976 ) is a distance metric between positive semidefinite operators . It is well-known in quantum information theory ( Nielsen & Chuang , 2000 ; Koltchinskii & Xia , 2015 ) and machine learning ( Brockmeier et al. , 2017 ; Muzellec & Cuturi , 2018 ; Zhang et al. , 2020 ; Oh et al. , 2020 ; De Meulemeester et al. , 2020 ) . 1.1 CONTRIBUTION . We propose a novel IPM-like divergence measure , the “ max-sliced Bures distance ” , to identify localized regions and instances associated with the maximum discrepancy between two samples . The distance is expressed as the maximal difference between the root mean square ( RMS ) of the witness function evaluations supω∈S ∣∣∣√EX∼µ [ ω2 ( X ) ] −√EY∼ν [ ω2 ( Y ) ] ∣∣∣ , where S is an appropriate family of functions . As |∆| = max { ∆ , −∆ } , the max-sliced Bures can be expressed as the maximum of one-sided max-sliced divergences with optimal witness functions , ωµ > ν = arg maxω∈S √ Eµ [ ω2 ( X ) ] − √ Eν [ ω2 ( Y ) ] , and ωµ < ν = arg maxω∈S √ Eν [ ω2 ( Y ) ] − √ Eµ [ ω2 ( X ) ] . If the distributions are not well-matched , then ωµ > ν has large magnitude function evaluations under a ‘ localized ’ subset of µ and smaller magnitude values for ν , and the opposite for ωµ < ν . The two samples { xi } mi=1 , { yi } ni=1 can be sorted by the magnitude of the witness function evaluations.1 Crucially , we detail a tractable optimization procedure that is guaranteed to yield a global optimum witness function for the one-sided max-sliced Bures divergence . When X = Rd and the first or second moments distinguish the distributions , linear witness functions can be used S = { ω ( · ) = 〈· , w〉 : w ∈ Sd−1 } , where Sd−1 denotes the unit sphere in Rd . The optimal witness function for the one-sided max-sliced Bures divergence ωµ > ν ( · ) = 〈· , wµ > ν〉 coincides with the subspace with the greatest difference in RMS , wµ > ν = arg maxw∈Sd−1 √ w > E [ XX > ] w − √ w > E [ Y Y > ] w. This optimization problem depends on the dimension d ; after computation of the covariance matrices , it is independent of the sample sizes m ≥ n. In comparison , the optimal slice for the max-sliced Wasserstein may not be obtained , and even gradient ascent to a local optimum requiresO ( m logm ) at each function/gradient evaluation . Furthermore , the slice that maximizes the max-sliced Wasser- 1Four groups of ‘ witness points ’ ( top-K instances ) can be inspected to identify any discrepancies : ω2µ > ν ( xπ̀ ( 1 ) ) ≥ · · · ≥ ω2µ > ν ( xπ̀ ( K ) ) ︸ ︷︷ ︸ π̀ sorts { xi } mi=1 to reveal examples from µ̂ with large ω 2 µ > ν ̃ ω2µ > ν ( yσ̀ ( 1 ) ) ≥ · · · ≥ ω2µ > ν ( yσ̀ ( K ) ) ︸ ︷︷ ︸ σ̀ sorts { yi } ni=1 to find the examples from ν̂ with large ω 2 µ > ν , ( 1 ) ω2µ < ν ( xπ́ ( 1 ) ) ≥ · · · ≥ ω2µ < ν ( xπ́ ( K ) ) ︸ ︷︷ ︸ π́ sorts { xi } mi=1 to find examples from µ̂ with large ω 2 µ < ν ̃ ω2µ < ν ( yσ́ ( 1 ) ) ≥ · · · ≥ ω2µ < ν ( yσ́ ( K ) ) ︸ ︷︷ ︸ σ́ sorts { yi } ni=1 to find the examples from ν̂ with large ω 2 µ < ν , ( 2 ) where π̀ , π́ , σ̀ , σ́ denote permutations and ̃ and ̃ denote expected inequalities with a large difference . stein lacks an intrinsic ordering , and it is left to the user to determine whether instances from µ or ν have high or low values or magnitudes . As second-order moments may be insufficient for distinguishing the distributions , we explore non-linear mappings of the random variables . Firstly , we consider a reproducing kernel Hilbert space ( RKHS ) H with the family of witness functions S = { ω ( · ) = 〈φ ( · ) , ω〉H : ω , φ ( · ) ∈ H , 〈ω , ω〉H = 1 } . An example with Gaussian kernels is shown in Figure 1 . Secondly , we use a pre-trained neural network to create a task-relevant mapping , computing the second-order statistics of the hidden-layer activations , and apply this in the context of samples of natural images . This enables interpretation of the Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) by identifying the subspace and images associated with discrepancies between synthetic and natural images . We prove that the max-sliced Bures distance provides a lower bound on the max-sliced Fréchet distance . Because of their similarity , we develop the max-sliced Bures distance in the context of max-sliced versions of the total variation and Wasserstein-2 distances . The kernel-based versions of these are novel contributions themselves . The max-sliced total variation distance is a special case of the covariance feature matching proposed by Mroueh et al . ( 2017 ) . In experimental results , we show applications of the linear and kernel-based versions to detect imbalances in class distributions of natural images and to critique GANs . We compare to other divergences expressed in terms of witness functions including MMD . Finally , we propose algorithms to reweight an empirical distribution in order to minimize max-sliced divergences ( with applications to generating conditional distributions and covariate shift correction ) .
This paper studies a family of integral probability metric (IPM) divergence on Hilbert spaces. This family can be characterized by the choice of the witness function, and specific witness function may give rise to the Bures distance, the MMD, Wasserstein, as well as many sliced variants. While this family has been well understood for distributions on finite dimensional space, this paper extends this insight to distributions on (possibly infinite dimensional) Hilbert space. By leveraging the representer theorem, the paper provides the finite dimensional optimization problems that can be solved to estimate the divergence from samples. The power of the method is demonstrated on the covariate shift experiments.
SP:d154782d1a48802582244b6aa037e8483f58ef19
ItNet: iterative neural networks for fast and efficient anytime prediction
1 INTRODUCTION . For massively-parallel hardware accelerators ( Schemmel et al. , 2010 ; Merolla et al. , 2014 ; Yao et al. , 2020 ; Graphcore , 2020a ) , every neuron and synapse in the network model has its physical counterpart on the hardware system . Usually , by design , memory and computation is not separated anymore , but neuron activations are computed next to the memory , i.e . the parameters , and fully in parallel . This is in contrast to the rather sequential data processing of CPUs and GPUs , for which the computation of a network model is tiled and the same arithmetic unit is re-used multiple times for different neurons . Since the computation is performed fully in parallel and in memory , the throughput of massively-parallel accelerators is usually much higher than for CPUs and GPUs . This can be attributed to the fact that the latency and power consumption for accessing local memory , like for in-memory computing , are much lower than for computations on CPUs and GPUs that require the frequent access to non-local memory like DRAM ( Sze et al. , 2017 ) . However , the network graph has to fit into the memory of the massively-parallel hardware accelerators to allow for maximal throughput . If the network graph exceeds the available memory , in principle , the hardware has to be re-configured at high frequency as it is the case for CPUs and GPUs and the throughput would be substantially reduced . Mixed-signal massively-parallel hardware systems usually operate on shorter time scales than digital ones , e.g . compare Schemmel et al . ( 2010 ) and Yao et al . ( 2020 ) to Merolla et al . ( 2014 ) and Graphcore ( 2020a ) , and would allow for even higher throughputs . In order to achieve neural networks with tiny computational graphs , in which nodes are operations and edges are activations , we heavily re-use a single building block of the network ( see the iterative block in Figure 1a ) . Not only the structure of computations , i.e . the type of network layers including their dimensions and connectivity , is identical for each iteration of this building block , but also the weights are shared between iterations . In the computational graphs of these so-called iterative neural networks ( ItNet ) , the re-used building blocks with shared weights can be represented by nodes with self-loops . Compared to conventional feed-forward networks , loops simplify the graph by reducing the number of unique nodes and , consequently , its computational footprint . However , the restriction of sharing weights usually decreases the number of free parameters and , hence , the accuracy of networks . To isolate and quantify this effect we compare networks with weight sharing to networks , for which the parameters of the building blocks are chosen to be independent between iterations of the building block . In contrast to the above proposal , conventional deep neural networks for image processing usually do not share weights and have no ( e.g . Huang et al. , 2017 ) or few ( e.g . one building block for each scale like by Greff et al. , 2017 ) layers of identical structure . Liao & Poggio ( 2016 ) share weights between re-used building blocks , but use multiple unique building blocks . To improve the training of networks , which contain loops in their graphs , and to reduce the latency of networks during inference we use multiple intermediate outputs . Multi-output networks that heavily re-use intermediate activations are beneficial for a wide range of applications , especially in the mobile domain . In an online manner , they allow to trade off latency versus accuracy with barely any overhead ( e.g . Huang et al. , 2018 ) . From an application point of view , the benefit of this trade-off can be best described in the following two scenarios ( Huang et al. , 2018 ) : In the so-called anytime prediction scenario , the prediction of a network is progressively updated , whereas the first output defines the initial latency of the network . In a second scenario , a limited computational budget can be unevenly distributed over a set of samples with different `` difficulties '' in order to increase the average accuracy . Since all nodes in the network graph are computed in parallel on massively-parallel hardware systems ( e.g . Esser et al. , 2016 ) , the latency for inference is dominated by the depth of the network , i.e . the longest path from input to output ( Fischer et al. , 2018 ) . Consequently , we prefer networks that compute all scales in parallel ( similar to Huang et al. , 2018 ; Ke et al. , 2017 ) and increase their depth for each additional intermediate output to networks that keep the depth constant and progressively increase their width ( Yu et al. , 2019 ) . Furthermore , multi-scale networks are also beneficial for the integration of global information , as especially required by dense prediction tasks like semantic segmentation ( Zhao et al. , 2017 ) . To further reduce the latency we also reduce the depth of the building blocks for each scale . In deep learning literature , the computational costs are usually quantified by counting the parameters and/or the multiply-accumulate operations ( MACs ) required for the inference of a single sample . For fully convolutional networks , the number of parameters is independent of the spatial resolution of the network ’ s input and the intermediate feature maps . Especially for large inputs as commonly used for semantic segmentation , the number of parameters does not cover the main workload and is , hence , not suited as a measure for computational costs . MACs have the advantage that they can be easily calculated and are usually a good approximation for the latency and throughput on CPUs and even GPUs . However , for most novel hardware accelerators , not the MACs , but memory transfers are dominating the computational costs in terms of power consumption ( Chen et al. , 2016 ; Sze et al. , 2017 ; Chao et al. , 2019 ) . These memory transfers are minimized on massivly-parallel hardware systems as long as the network graph fits into the in-computation memory of these systems , i.e . the memory of their arithmetic units . Since both the power consumption during inference and the production cost scale with the size of this memory , in addition to MACS , we also compare the size of the computational graphs between networks . Note that the practical benefits of ItNets can not be demonstrated on conventional CPUs or GPUs , since these hardware systems do not support the processing of neural networks in a fully-parallel and , hence , low-latency fashion . Note that , in this study , we focus on network models in the low-power regime of only few billion MACs , while processing large-scale images as commonly used for semantic segmentation ( for datasets , see Section 2.4 ) . The key contributions of this study are : • We introduce efficient networks with tiny computational graphs that heavily re-use a single building block and provide multiple intermediate outputs ( Sections 2.1 , 2.2 and 2.5 ) . • We search for the best hyperparameters of this model and investigate the effect of multiple outputs and weight sharing on the network training ( Sections 2.3 , 3.1 and 3.2 ) . • To our knowledge , we set the new state-of-the-art in terms of accuracy over the size of the computational graph and discuss the potential benefits for low-power applications . We will release the source code upon acceptance for publication . 2 METHODS . The following networks process images of size x× y × 3 and output N semantic maps mn of size x× y × C with C being the number of classes . 2.1 NETWORK ARCHITECTURE . We are interested in network architectures with a small computational footprint facilitating their application in mobile devices . To this end , we design a neural network that heavily re-uses the intermediate activations and weights ( Figure 1a ) . Conceptionally , the network model can be split into three main building blocks : the data block , the iterative block and the classification block ( for an overview and details , see Figure 1a and Figure 2 , respectively ) . While the data block is executed only once for each image , the iterative block can be executed multiple times in a row by feeding back its output as the input for the next iteration . The classification block outputs the prediction of the semantic map by processing the intermediate activations of the feedback signal . While the weights of the iterative block are shared between iterations , the weights of the classification block are unique for each iteration . We consider the size of the computational graph and the number of MACs as meaningful indicators for the computational footprint ( see also Section 1 ) . To obtain a high-accuracy network architecture under these objectives we reduce the size of the computational graph by introducing loops and optimize the following architectural hyperparameters : the number of scales L , the number of iterations N , and the number of bottleneck residual blocks K . 2.2 NETWORK TRAINING . For training , we use a joint cost function for all outputs of the network : L = ∑ n āncn ( m̃n , mn ) , where cn is the categorical cross entropy between the true labels m̃n and the network predictions mn . The weight factors an are normalized as follows : ān = an/ ( ∑ i ai ) . We use the Adam optimizer with β1 = 0.9 , β2 = 0.999 and a learning rate 0.001 that we multiply with 0.1 after 70 % and 85 % of the number of overall training epochs . We use a batch size of 8 and train the network for 2000 ( 4000 for Figure 5 ) and 900 for the CamVid and Cityscapes datasets , respectively . For Figure 3 , Figure 4 and the appendix , we report the mean values and the errors of the means across 5 trials . For Figures 1 and 5 , we report the trial with the highest peak accuracy over 3 trials . For the results shown in Figures 1 and 5 , we use dropout with rate 0.1 after the depth-wise convolutions in the bottleneck residual blocks and an L2 weight decay of 10−5 in all convolutional layers . For all other results , we do not use dropout and weight decay . 2.3 NETWORK EVALUATION . Throughout this study , we measure the quality of semantic segmentation by calculating the mean intersection-over-union ( mIoU Jaccard , 1912 ) , which is the ratio of the area of overlap and the area of union IoU = label ∩ prediction label ∪ prediction averaged over all classes . We consider a network to perform well if it achieves a high mIoU while requiring few MACs . To this end , we calculate the area under the curve of the mIoU ( yn ) over MACs ( xn ) with output index n as follows : AUC = N−1∑ n=0 ( xn+1 − xn ) ( ( yn+1 − y0 ) + ( yn − y0 ) 2 ) with ( x0 , y0 ) = ( 0 , 0.00828 ) , where y0 denotes the mIoU at chance level for the CamVid dataset . To compensate for different maximum numbers xN of MACs for different sets of hyperparameters , we normalize as follows : AUC = AUCxN . The size of the computational graph is computed by accumulating the memory requirements of all nodes , i.e . network layers , in the network graph . For each layer , the total required memory is the sum of the memory for parameters , input feature maps and output feature maps . The theoretical latency of a network if executed fully in parallel is determined by the length , i.e . the depth , of the path from input to output of this network ( see also Section 1 ) . For both the size of the computational graph and the latency , we only consider convolutional layers like commonly done in literature ( e.g . Paszke et al. , 2016 ; Wu et al. , 2018 ; Mehta et al. , 2019 ) . This means , we ignore other network layers like normalizations , activations , concatenations , additions and spatial resizing , for which we assume that they can be fused with the convolutional layers .
This paper studies homogenious networks, which is defined by the paper as networks that reuse building blocks with shared or different weights multiple times during the inference of the network. During the inference, the network iteratively use the same set of blocks to process input feature maps with different resolutions, and each step, the output feature map can be used by the prediction head to generate the output. This paper studies the cost of the network, in terms of MACs, parameters, memory footprints, and the accuracy vs. the number of iterations. The author noted that for the studied network, they need to increase the MACs by 3x in order to match the performance of regular networks. Despite this, this kind of homogeneous networks can be useful for novel hardware architectures with limited memory bandwidth.
SP:a96e9c050813608f1e198a8b6cdce1a6724060bd
ItNet: iterative neural networks for fast and efficient anytime prediction
1 INTRODUCTION . For massively-parallel hardware accelerators ( Schemmel et al. , 2010 ; Merolla et al. , 2014 ; Yao et al. , 2020 ; Graphcore , 2020a ) , every neuron and synapse in the network model has its physical counterpart on the hardware system . Usually , by design , memory and computation is not separated anymore , but neuron activations are computed next to the memory , i.e . the parameters , and fully in parallel . This is in contrast to the rather sequential data processing of CPUs and GPUs , for which the computation of a network model is tiled and the same arithmetic unit is re-used multiple times for different neurons . Since the computation is performed fully in parallel and in memory , the throughput of massively-parallel accelerators is usually much higher than for CPUs and GPUs . This can be attributed to the fact that the latency and power consumption for accessing local memory , like for in-memory computing , are much lower than for computations on CPUs and GPUs that require the frequent access to non-local memory like DRAM ( Sze et al. , 2017 ) . However , the network graph has to fit into the memory of the massively-parallel hardware accelerators to allow for maximal throughput . If the network graph exceeds the available memory , in principle , the hardware has to be re-configured at high frequency as it is the case for CPUs and GPUs and the throughput would be substantially reduced . Mixed-signal massively-parallel hardware systems usually operate on shorter time scales than digital ones , e.g . compare Schemmel et al . ( 2010 ) and Yao et al . ( 2020 ) to Merolla et al . ( 2014 ) and Graphcore ( 2020a ) , and would allow for even higher throughputs . In order to achieve neural networks with tiny computational graphs , in which nodes are operations and edges are activations , we heavily re-use a single building block of the network ( see the iterative block in Figure 1a ) . Not only the structure of computations , i.e . the type of network layers including their dimensions and connectivity , is identical for each iteration of this building block , but also the weights are shared between iterations . In the computational graphs of these so-called iterative neural networks ( ItNet ) , the re-used building blocks with shared weights can be represented by nodes with self-loops . Compared to conventional feed-forward networks , loops simplify the graph by reducing the number of unique nodes and , consequently , its computational footprint . However , the restriction of sharing weights usually decreases the number of free parameters and , hence , the accuracy of networks . To isolate and quantify this effect we compare networks with weight sharing to networks , for which the parameters of the building blocks are chosen to be independent between iterations of the building block . In contrast to the above proposal , conventional deep neural networks for image processing usually do not share weights and have no ( e.g . Huang et al. , 2017 ) or few ( e.g . one building block for each scale like by Greff et al. , 2017 ) layers of identical structure . Liao & Poggio ( 2016 ) share weights between re-used building blocks , but use multiple unique building blocks . To improve the training of networks , which contain loops in their graphs , and to reduce the latency of networks during inference we use multiple intermediate outputs . Multi-output networks that heavily re-use intermediate activations are beneficial for a wide range of applications , especially in the mobile domain . In an online manner , they allow to trade off latency versus accuracy with barely any overhead ( e.g . Huang et al. , 2018 ) . From an application point of view , the benefit of this trade-off can be best described in the following two scenarios ( Huang et al. , 2018 ) : In the so-called anytime prediction scenario , the prediction of a network is progressively updated , whereas the first output defines the initial latency of the network . In a second scenario , a limited computational budget can be unevenly distributed over a set of samples with different `` difficulties '' in order to increase the average accuracy . Since all nodes in the network graph are computed in parallel on massively-parallel hardware systems ( e.g . Esser et al. , 2016 ) , the latency for inference is dominated by the depth of the network , i.e . the longest path from input to output ( Fischer et al. , 2018 ) . Consequently , we prefer networks that compute all scales in parallel ( similar to Huang et al. , 2018 ; Ke et al. , 2017 ) and increase their depth for each additional intermediate output to networks that keep the depth constant and progressively increase their width ( Yu et al. , 2019 ) . Furthermore , multi-scale networks are also beneficial for the integration of global information , as especially required by dense prediction tasks like semantic segmentation ( Zhao et al. , 2017 ) . To further reduce the latency we also reduce the depth of the building blocks for each scale . In deep learning literature , the computational costs are usually quantified by counting the parameters and/or the multiply-accumulate operations ( MACs ) required for the inference of a single sample . For fully convolutional networks , the number of parameters is independent of the spatial resolution of the network ’ s input and the intermediate feature maps . Especially for large inputs as commonly used for semantic segmentation , the number of parameters does not cover the main workload and is , hence , not suited as a measure for computational costs . MACs have the advantage that they can be easily calculated and are usually a good approximation for the latency and throughput on CPUs and even GPUs . However , for most novel hardware accelerators , not the MACs , but memory transfers are dominating the computational costs in terms of power consumption ( Chen et al. , 2016 ; Sze et al. , 2017 ; Chao et al. , 2019 ) . These memory transfers are minimized on massivly-parallel hardware systems as long as the network graph fits into the in-computation memory of these systems , i.e . the memory of their arithmetic units . Since both the power consumption during inference and the production cost scale with the size of this memory , in addition to MACS , we also compare the size of the computational graphs between networks . Note that the practical benefits of ItNets can not be demonstrated on conventional CPUs or GPUs , since these hardware systems do not support the processing of neural networks in a fully-parallel and , hence , low-latency fashion . Note that , in this study , we focus on network models in the low-power regime of only few billion MACs , while processing large-scale images as commonly used for semantic segmentation ( for datasets , see Section 2.4 ) . The key contributions of this study are : • We introduce efficient networks with tiny computational graphs that heavily re-use a single building block and provide multiple intermediate outputs ( Sections 2.1 , 2.2 and 2.5 ) . • We search for the best hyperparameters of this model and investigate the effect of multiple outputs and weight sharing on the network training ( Sections 2.3 , 3.1 and 3.2 ) . • To our knowledge , we set the new state-of-the-art in terms of accuracy over the size of the computational graph and discuss the potential benefits for low-power applications . We will release the source code upon acceptance for publication . 2 METHODS . The following networks process images of size x× y × 3 and output N semantic maps mn of size x× y × C with C being the number of classes . 2.1 NETWORK ARCHITECTURE . We are interested in network architectures with a small computational footprint facilitating their application in mobile devices . To this end , we design a neural network that heavily re-uses the intermediate activations and weights ( Figure 1a ) . Conceptionally , the network model can be split into three main building blocks : the data block , the iterative block and the classification block ( for an overview and details , see Figure 1a and Figure 2 , respectively ) . While the data block is executed only once for each image , the iterative block can be executed multiple times in a row by feeding back its output as the input for the next iteration . The classification block outputs the prediction of the semantic map by processing the intermediate activations of the feedback signal . While the weights of the iterative block are shared between iterations , the weights of the classification block are unique for each iteration . We consider the size of the computational graph and the number of MACs as meaningful indicators for the computational footprint ( see also Section 1 ) . To obtain a high-accuracy network architecture under these objectives we reduce the size of the computational graph by introducing loops and optimize the following architectural hyperparameters : the number of scales L , the number of iterations N , and the number of bottleneck residual blocks K . 2.2 NETWORK TRAINING . For training , we use a joint cost function for all outputs of the network : L = ∑ n āncn ( m̃n , mn ) , where cn is the categorical cross entropy between the true labels m̃n and the network predictions mn . The weight factors an are normalized as follows : ān = an/ ( ∑ i ai ) . We use the Adam optimizer with β1 = 0.9 , β2 = 0.999 and a learning rate 0.001 that we multiply with 0.1 after 70 % and 85 % of the number of overall training epochs . We use a batch size of 8 and train the network for 2000 ( 4000 for Figure 5 ) and 900 for the CamVid and Cityscapes datasets , respectively . For Figure 3 , Figure 4 and the appendix , we report the mean values and the errors of the means across 5 trials . For Figures 1 and 5 , we report the trial with the highest peak accuracy over 3 trials . For the results shown in Figures 1 and 5 , we use dropout with rate 0.1 after the depth-wise convolutions in the bottleneck residual blocks and an L2 weight decay of 10−5 in all convolutional layers . For all other results , we do not use dropout and weight decay . 2.3 NETWORK EVALUATION . Throughout this study , we measure the quality of semantic segmentation by calculating the mean intersection-over-union ( mIoU Jaccard , 1912 ) , which is the ratio of the area of overlap and the area of union IoU = label ∩ prediction label ∪ prediction averaged over all classes . We consider a network to perform well if it achieves a high mIoU while requiring few MACs . To this end , we calculate the area under the curve of the mIoU ( yn ) over MACs ( xn ) with output index n as follows : AUC = N−1∑ n=0 ( xn+1 − xn ) ( ( yn+1 − y0 ) + ( yn − y0 ) 2 ) with ( x0 , y0 ) = ( 0 , 0.00828 ) , where y0 denotes the mIoU at chance level for the CamVid dataset . To compensate for different maximum numbers xN of MACs for different sets of hyperparameters , we normalize as follows : AUC = AUCxN . The size of the computational graph is computed by accumulating the memory requirements of all nodes , i.e . network layers , in the network graph . For each layer , the total required memory is the sum of the memory for parameters , input feature maps and output feature maps . The theoretical latency of a network if executed fully in parallel is determined by the length , i.e . the depth , of the path from input to output of this network ( see also Section 1 ) . For both the size of the computational graph and the latency , we only consider convolutional layers like commonly done in literature ( e.g . Paszke et al. , 2016 ; Wu et al. , 2018 ; Mehta et al. , 2019 ) . This means , we ignore other network layers like normalizations , activations , concatenations , additions and spatial resizing , for which we assume that they can be fused with the convolutional layers .
This paper proposes a homogeneous network structure for semantic segmentation, which optimizes for prediction accuracy, latency as well as memory footprint. The paper studies anytime prediction setting and designs a re-usable single building block to reduce the memory footprint. Experimental results on CamVid data shows that it's possible to use a homogeneous network architecture to achieve competitive mIoU compared to previous work at the cost of increased MACs. Experimental evaluation on larger datasets such as Cityscapes is prohibited due to memory constraints of the available GPUs.
SP:a96e9c050813608f1e198a8b6cdce1a6724060bd
Evaluating Robustness of Predictive Uncertainty Estimation: Are Dirichlet-based Models Reliable?
1 INTRODUCTION Neural networks achieve high predictive accuracy in many tasks , but they are known to have two substantial weaknesses : First , neural networks are not robust against adversarial perturbations , i.e. , semantically meaningless input changes that lead to wrong predictions ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) . Second , neural networks tend to make over-confident predictions at test time ( Lakshminarayanan et al. , 2017 ) . Even worse , standard neural networks are unable to identify samples that are different from the samples they were trained on . In these cases , they provide uninformed decisions instead of abstaining . These two weaknesses make them impracticable in sensitive domains like financial , autonomous driving or medical areas which require trust in predictions . To increase trust in neural networks , models that provide predictions along with the corresponding uncertainty have been proposed . There are three main families of models that aim to provide meaningful estimates of their predictive uncertainty . The first family are Bayesian Neural Networks ( Blundell et al. , 2015 ; Osawa et al. , 2019 ; Maddox et al. , 2019 ) , which have the drawback that they are computationally demanding . The second family consists of Monte-Carlo drop-out based models ( Gal & Ghahramani , 2016 ) and ensembles ( Lakshminarayanan et al. , 2017 ) that estimate uncertainty by computing statistics such as mean and variance by aggregating forward passes of multiple models . A disadvantage of all of these models is that uncertainty estimation at inference time is expensive . In contrast to these , the recently growing family of Dirichlet-based uncertainty ( DBU ) models ( Malinin & Gales , 2018a ; 2019 ; Sensoy et al. , 2018 ; Malinin et al. , 2019 ; Charpentier et al. , 2020 ) directly predict the parameters of a Dirichlet distribution over categorical probability distributions . They provide efficient uncertainty estimates at test time since they only require a single forward pass . DBU models bring the benefit of providing both , aleatoric and epistemic uncertainty estimates . Aleatoric uncertainty is irreducible and caused by the natural complexity of the data , such as class overlap or noise . Epistemic uncertainty results from the lack of knowledge about unseen data , e.g . when the model is presented an image of an unknown object . Both uncertainty types can be quantified using different uncertainty measures based on a Dirichlet distribution , such as differential entropy , mutual information , or pseudo-counts ( Malinin & Gales , 2018a ; Charpentier et al. , 2020 ) . These uncertainty measures have been shown outstanding performance in , e.g. , the detection of OOD samples and thus are superior to softmax based confidence ( Malinin & Gales , 2019 ; Charpentier et al. , 2020 ) . Neural networks from the families outlined above are expected to know what they don ’ t know , i.e. , notice when they are unsure about a prediction . This raises questions with regards to adversarial examples : should uncertainty estimates detect these corrupted samples and abstain from making a prediction ( i.e . indicated by high uncertainty in the prediction ) , or should they be robust to adversarial examples and produce the correct output even under perturbations ? Using humans as the gold standard of image classification and assuming that the perturbations are semantically meaningless , which is typically implied by small Lp norm of the corruption , we argue that the best option is that the models are robust to adversarial perturbations ( see Figure 1 ) . Beyond being robust w.r.t . label prediction , we expect models to robustly know what they do not know . That is , they should robustly distinguish between ID and OOD data even if those are perturbed . In this work , we focus on DBU models and analyze their robustness capacity w.r.t . the classification decision and uncertainty estimations , going beyond simple softmax output confidence by investigating advanced measures like differential entropy . Specifically , we study the following questions : 1 . Is high certainty a reliable indicator of correct predictions ? 2 . Can we use uncertainty estimates to detect label attacks on the classification decision ? 3 . Are uncertainty estimates such as differential entropy a robust feature for OOD detection ? In addressing these questions we place particular focus on adversarial perturbations of the input in order to evaluate the worst case performance of the models . We address question one by analyzing uncertainty estimation on correctly and wrongly labeled samples , without and with adversarial perturbations on the inputs . To answer question two , we study uncertainty estimates of DBU models on label attacks . More specifically , we analyze whether there is a difference between uncertainty estimates on perturbed and unperturbed inputs and whether DBU models are capable of recognizing successful label attacks by uncertainty estimation . Addressing question three , we use robustness verification based on randomized smoothing and propose to investigate uncertainty attacks . Uncertainty attacks aim at changing the uncertainty estimate such that ID data is marked as OOD data and vice versa . Finally , we propose robust training procedures that use label attacks , uncertainty attacks or random noise and analyze how they affect robustness of DBU models on ID data and OOD data . 2 RELATED WORK Recently , multiple works have analyzed uncertainty estimation and robustness of neural networks . ( Snoek et al. , 2019 ) compares uncertainty estimates of models based on drop-out and ensembles under data set shifts . ( Cardelli et al. , 2019 ; Wicker et al. , 2020 ) study probabilistic safety of Bayesian networks under adversarial perturbations by analyzing inputs sets and the corresponding mappings in the output space . In contrast , our work focus on DBU models and analyze their robustness w.r.t . adversarial perturbations specifically designed to fool label or uncertainty predictions of the models . Furthermore , previous works on attack defenses have focused on evaluating either robustness w.r.t . class predictions ( Carlini & Wagner , 2017 ; Weng et al. , 2018 ) or label attack detection ( Carlini & Wagner , 2017 ) . In contrast , our work jointly evaluates both tasks by analyzing them from the uncertainty perspective . Furthermore , in addition to label attacks , we study a new type of adversarial perturbations that directly target uncertainty estimation . Those attacks are different from traditional label attacks ( Madry et al. , 2018 ; Dang-Nhu et al. , 2020 ) . Different models have been proposed to account for uncertainty while being robust . ( Smith & Gal , 2018 ) and ( Lee et al. , 2018 ) have tried to improve label attack detection based on uncertainty using drop-out or density estimation . In addition from improving label attack detection for large unseen perturbations , ( Stutz et al. , 2020 ) aimed at improving robustness w.r.t . class label predictions on small input perturbations . To this end , they proposed a new adversarial training with softer labels for adversarial samples further from the original input . ( Qin et al. , 2020 ) suggested a similar adversarial training where labels are soften differently depending on the input robustness . These previous works only consider the aleatoric uncertainty contained in the predicted categorical probabilities , i.e . the softmax output . They do not consider DBU models which explicitly account for both aleatoric and epistemic uncertainty . ( Malinin & Gales , 2019 ) proposed to improve a single type of DBU model for label attack detection by assigning them high uncertainty during training . Please note that the works ( Tagasovska & Lopez-Paz , 2019 ; Kumar et al. , 2020 ; Bitterwolf et al. , 2020 ; Meinke & Hein , 2020 ) study a different orthogonal problem . ( Tagasovska & Lopez-Paz , 2019 ) propose to compute confidence intervals while ( Kumar et al. , 2020 ) propose certificates on softmax predictions . ( Bitterwolf et al. , 2020 ) uses interval bound propagation to compute bounds on softmax predictions in the L∞-ball around an OOD point and for ReLU networks , ( Meinke & Hein , 2020 ) proposes an approach to obtain certifiably low confidence for OOD data . These four studies estimate confidence based on softmax predictions , which accounts for aleatoric uncertainty only . In this paper , we provide certificates on the OOD classification task using DBU models directly which is better suited to epistemic uncertainty measures . 3 DIRICHLET-BASED UNCERTAINTY MODELS Standard ( softmax ) neural networks predict the parameters of a categorical distribution p ( i ) = [ p ( i ) 1 , . . . , p ( i ) C ] for a given input x ( i ) ∈ Rd , where C is the number of classes . Given the parameters of a categorical distribution , we can evaluate its aleatoric uncertainty , which is the uncertainty on the class label prediction y ( i ) ∈ { 1 , . . . , C } . For example , when predicting the result of an unbiased coin flip , we expect the model to have high aleatoric uncertainty and predict p ( head ) = 0.5 . In contrast to standard ( softmax ) neural networks , DBU models predict the parameters of a Dirichlet distribution – the natural prior of categorical distributions – given input x ( i ) ( i.e . q ( i ) = Dir ( α ( i ) ) where fθ ( x ( i ) ) = α ( i ) ∈ RC+ ) . Hence , the epistemic distribution q ( i ) expresses the epistemic uncertainty on x ( i ) , i.e . the uncertainty on the categorical distribution prediction p ( i ) . From the epistemic distribution , follows an estimate of the aleatoric distribution of the class label prediction Cat ( p̄ ( i ) ) where Eq ( i ) [ p ( i ) ] = p̄ ( i ) . An advantage of DBU models is that one pass through the neural network is sufficient to compute epistemic distribution , aleatoric distribution , and predict the class label : q ( i ) = Dir ( α ( i ) ) , p̄ ( i ) c = α ( i ) c α ( i ) 0 with α ( i ) 0 = C∑ c=1 α ( i ) c , y ( i ) = arg max [ p̄ ( i ) 1 , ... , p̄ ( i ) C ] ( 1 ) This parametrization allow to compute classic uncertainty measures in closed-form . As an example , the concentration parameters α ( i ) c can be interpreted as a pseudo-count of observed samples of class c and , thus , are a good indicator of epistemic uncertainty . Note that further measures , such as differential entropy of the Dirichlet distribution ( see Equation 2 , where Γ is the Gamma function and Ψ is the Digamma function ) or the mutual information between the label y ( i ) and the categorical p ( i ) can also be computed in closed-form ( App . A.2 , ( Malinin & Gales , 2018a ) ) . Hence , DBU models can efficiently use these measures to assign high uncertainty for unknown data making them specifically suited for detection of OOD samples like anomalies . mdiffE = K∑ c ln Γ ( αc ) − ln Γ ( α0 ) − K∑ c ( αc − 1 ) · ( Ψ ( αc ) −Ψ ( α0 ) ) ( 2 ) Several recently proposed models for uncertainty estimations belong to the family of DBU models , such as PriorNet , EvNet , DDNet and PostNet . These models differ in terms of their parametrization of the Dirichlet distribution , the training , and density estimation . An overview of theses differences is provided in Table 1 . We evaluate all recent versions of these models in our study . Contrary to the other models , Prior Networks ( PriorNet ) ( Malinin & Gales , 2018a ; 2019 ) requires OOD data for training to “ teach ” the neural network the difference between ID and OOD data . PriorNet is trained with a loss function consisting of two KL-divergence terms . The fist term is designed to learn Dirichlet parameters for ID , while the second one is used to learn a flat Dirichlet distribution ( α = 1 ) for OOD data . There a two variants of PriorNet . The first one is trained based on reverse KL-divergence ( Malinin & Gales , 2019 ) , while the second one is trained with KL-divergence ( Malinin & Gales , 2018a ) . We include in our experiment the most recent reverse version of PriorNet , as it shows superior performance ( Malinin & Gales , 2019 ) . Evidential Networks ( EvNet ) ( Sensoy et al. , 2018 ) are trained with a loss that computes the sum of squares between the on-hot encoded true label y∗ ( i ) and the predicted categorical p ( i ) under the Dirichlet distribution . Ensemble Distribution Distillation ( DDNet ) ( Malinin et al. , 2019 ) is trained in two steps . First , an ensemble of M classic neural networks needs to be trained . Then , the softlabels { p ( i ) m } Mm=1 provided by the ensemble of networks are distilled into a Dirichlet-based network by fitting them with the maximum likelihood under the Dirichlet distribution . Posterior Network ( PostNet ) ( Charpentier et al. , 2020 ) performs density estimation for ID data with normalizing flows and uses a Bayesian loss formulation . Note that EvNet and PostNet model the Dirichlet parameters as fθ ( x ( i ) ) = 1 +α ( i ) while PriorNet , RevPriorNet and DDNet compute them as fθ ( x ( i ) ) = α ( i ) . 4 ROBUSTNESS OF DIRICHLET-BASED UNCERTAINTY MODELS We analyze robustness of DBU models in the field of uncertainty estimation w.r.t . the following four aspects : accuracy , confidence calibration , label attack detection and OOD detection . Uncertainty is quantified by differential entropy , mutual information and pseudo counts . A formal definition of all uncertainty estimation measures is provided in the appendix . Robustness of Dirichlet-based uncertainty models is evaluated based on label attacks and a newly proposed type of attacks called uncertainty attacks . While label attacks aim at changing the predicted class , uncertainty attacks aim at changing uncertainty assigned to a prediction . All existing works are based on label attacks and focus on robustness w.r.t . the classification decision . Thus , we are the first to propose attacks targeting uncertainty estimates such as differential entropy and analyze further desirable robustness properties of DBU models . Both attack types compute a perturbed input x̃ ( i ) close to the original input x ( i ) i.e . ||x ( i ) − x̃ ( i ) ||2 < r where r is the attack radius . The perturbed input is obtained by optimizing a loss function l ( x ) using Fast Gradient Sign Method ( FGSM ) or Projected Gradient Descent ( PGD ) . We use also a black box attack ( Noise ) which generates 10 Noise samples from a Gaussian distribution with mean equal to the original sample . The pertrubed sample which fools the most the loss function is selected as an attack . To complement attacks , we propose the first study of certifiable robustness for DBU models , which is based on randomized smoothing ( Cohen et al. , 2019 ) . The following questions we address by our experiments have a common assessment metric . Distinguishing between correctly and wrongly classified samples , between non-attacked input and attacked inputs or between ID data and OOD data can be treated as binary classification problems . To quantify the performance of the models on these binary classification problems , we compute AUC-PR . Experiments are performed on two image data sets ( MNIST ( LeCun & Cortes , 2010 ) and CIFAR10 ( Krizhevsky et al. , 2009 ) ) , which contain bounded inputs and two tabular data sets ( Segment ( Dua & Graff , 2017 ) and Sensorless drive ( Dua & Graff , 2017 ) ) , consisting of unbounded inputs . Note that unbounded inputs are challenging since it is impossible to describe the infinitely large OOD distribution . As PriorNet requires OOD training data , we use two further image data sets ( FashionMNIST ( Xiao et al. , 2017 ) and CIFAR100 ( Krizhevsky et al. , 2009 ) ) for training on MNIST and CIFAR10 , respectively . All other models are trained without OOD data . To obtain OOD data for the tabular data sets , we remove classes from the ID data set ( class window for the Segment data set and class 9 for Sensorless drive ) and use them as the OOD data . See appendix for further details on the setup . 4.1 UNCERTAINTY ESTIMATION UNDER LABEL ATTACKS Label attacks aim at changing the predicted class . To obtain a perturbed input with a different label , we maximize the cross-entropy loss x̃ ( i ) ≈ arg maxx l ( x ) = CE ( p ( i ) , y ( i ) ) under the radius constraint . For the sake of completeness we also analyze label attacks regarding their performance to change class predictions and report their accuracy to show the effectiveness based on different radii ( see Appendix , Table 7 ) . As expected and partially shown by previous works , none of the DBU models is robust against label attacks . However , we noted that PriorNet is slightly more robust than the other models . This might be explained by the use of OOD data during training , which can be seen as some kind of robust training . From now on , we switch to the core focus of this work and analyze robustness properties of uncertainty estimation . Is high certainty a reliable indicator of correct predictions ? Expected behavior : Predictions with high certainty are more likely to be correct than low certainty predictions . Assessment metric : We distinguish between correctly classified samples ( label 0 ) and wrongly classified ones ( label 1 ) based on the differential entropy scores produced by the DBU models ( Malinin & Gales , 2018a ) . Correctly classified samples are expected to have low differential entropy , reflecting the model ’ s confidence , and analogously that wrongly predicted samples tend to have higher differential entropy . Observed behavior : Note that the positive and negative classes are not balanced , thus , the use of AUC-PR scores ( Saito & Rehmsmeier , 2015 ) are important to enable meaningful measures . While uncertainty estimates are indeed an indicator of correctly classified samples on non-perturbed data , none of the models maintains its high performance on perturbed data ( see . Table 2 ) . Thus , using uncertainty estimates as indicator for correctly labeled inputs is not robust to adversarial perturbations , although the used attacks do not target uncertainty . Can we use uncertainty estimates to detect label attacks on the classification decision ? Expected behavior : Adversarial examples are not from the natural data distribution . Therefore , DBU models are expected to detect them as OOD data by assigning them a higher uncertainty . We expect perturbations with larger attack radius r to be easier to detect as they differ more significantly from the data distribution . Assessment metric : The goal of attack-detection is to distinguish between unperturbed samples ( label 0 ) and perturbed samples ( label 1 ) . To quantify the performance , we use the differential entropy ( Malinin & Gales , 2018a ) . Non-perturbed samples are expected to have low differential entropy , reflecting the fact that they are from the distribution the models were trained on , while perturbed samples are expected to have a high differential entropy . Further results based on other uncertainty measures are provided in the appendix . Observed behavior : Table 7 shows that the accuracy of all models decreases significantly under PGD label attacks , but none of the models is able to provide an equivalently increasing high attack detection rate ( see Table 3 ) . Even larger perturbations are hard to detect for DBU models . Although PGD label attacks do not explicitly consider uncertainty , they seem to provide adversarial examples with similar uncertainty as the original input . Such high certainty adversarial examples are illustrated in Figure 2 , where certainty is visualized based on the precision α0 that is supposed to be high for ID data and low for OOD data . While the original input ( perturbation size 0.0 ) is correctly classified as frog and ID data , there exist adversarial examples that are classified as deer or bird . The certainty on the prediction of these adversarial examples has a similar or even higher value than the prediction on the original input . Using the differential entropy to distinguish between ID and OOD data results in the same ID/OOD assignment since the differential entropy of the three right-most adversarial examples is similar or even smaller than on the unperturbed input . For the less powerful FGSM and Noise attacks ( see Appendix ) , DBU models achieve mostly better attack detection rates than for PGD attacks . This suggests that uncertainty estimation is able to detect weak attacks , which is consistent with the observations in ( Malinin & Gales , 2018b ) . Furthermore , PostNet provides better label attack detection rate for large perturbations on tabular data sets . An explanation for this observation is that the density estimation of the ID samples has been shown to work better for tabular data sets ( Charpentier et al. , 2020 ) . Standard adversarial training ( based on label attacks targeting the crossentropy loss function ) improves robustness w.r.t . class predictions ( see Appendix , Table 32 ) , but does not improve label attack detection performance of any model ( see Table 40 ) . Overall , none of the DBU models provides a reliable indicator for adversarial inputs that target the classification decision . DBU models are designed to provide uncertainty estimates ( beyond softmax based confidence ) alongside predictions and use this predictive uncertainty for OOD detection . Thus , in this section we focus on attacking these uncertainty estimates . We present result for attacks based on the differential entropy as loss function ( x̃ ( i ) ≈ arg maxx l ( x ) = Diff-Ent ( Dir ( α ( i ) ) ) ) , since it is the most widely used metric for ID-OOD-differentiation . Result based on further uncertainty measures , loss functions and details on the uncertainty attacks are provided in the appendix . Regarding uncertainty attacks , we analyze model performance w.r.t . two tasks . First , attacks are computed on ID data to transform them in OOD data , while OOD data is left non-attacked . Second , we attack OOD data to transform it into ID data , while ID data is not attacked . Hence , uncertainty attacks aim at posing ID data as OOD data or conversely . Are uncertainty estimates a robust feature for OOD detection ? Expected behavior : We expect Dirichlet-based uncertainty models to be able to distinguish between ID and OOD data by providing reliable uncertainty estimates , even under small perturbations . That is , we expect the uncertainty estimates of DBU models to be robust under attacks . Assessment metric : We distinguish between ID data ( label 0 ) and OOD data ( label 1 ) based on the differential entropy as uncertainty scoring function ( Malinin & Gales , 2018a ) . Differential entropy is expected to be small on ID samples and high on OOD samples . Experiments on further uncertainty measure and results for AUROC are provided in the appendix . Observed behavior : OOD samples are perturbed as illustrated in Figure 3 . The left part shows an OOD-sample , which is identified as OOD . Adding adversarial perturbations≥ 0.5 to it changes the Dirichlet parameters such that the resulting images are identified as ID , based on precision or differential entropy as uncertainty measure . Adding adversarial perturba- tions to an ID sample ( right part ) results in images identified as OOD . OOD detection performance of all DBU models decreases rapidly with the size of the perturbation , regardless of whether attacks are computed on ID or OOD data ( Table 4 ) . Thus , using uncertainty estimation to distinguish between ID and OOD data is not robust . PostNet and DDNet achieve slightly better performance than the other models . Further , PostNet provides better scores for large perturbations on tabular data sets which could again be explained by its density-based approach . Our robustness analysis based on label attacks and uncertainty attacks shows that neither the predicted class , nor the uncertainty corresponding to a prediction , nor the differentiation between ID and OOD-data is robust . Thus , we propose adversarial training procedures to enhance robustness . During training we augment the data set by samples computed based on ( i ) PGD attacks against the crossentropy loss or ( ii ) against the differential entropy function , which is used to distinguish between ID and OOD data , or ( iii ) by adding random noise as proposed for randomized smoothing training . Since attacks are used during robust training , we want to avoid tying robustness evaluation to gradient based attacks . Instead , we propose the first approach that certifies robustness of DBU models based on randomized smoothing ( Cohen et al. , 2019 ) . Randomized smoothing was proposed to verify robustness w.r.t . class predictions and we modify it for ID/OOD-verification . As randomized smoothing treats classifiers as a black-box , we transform distinguishing between ID data ( label 0 ) and OOD data ( label 1 ) into a binary classification problem based on an uncertainty measure , which requires to set a threshold for the uncertainty measure to obtain an actual decision boundary . This is in contrast to our attack-based experiments where we avoided setting thresholds by analyzing area under the curve metrics . Thresholds for uncertainty measure are set for each model individually based on the validation set , such that the accuracy w.r.t . to ID/OOD-assignment of the model is maximized . In the following we discuss results for ID/OOD-verification based on differential entropy on CIFAR10 ( ID data ) and SVHN ( OOD data ) . Further results on other data sets , other uncertainty measures and results on the standard classification based randomized smoothing verification are shown in the appendix . Table 5 shows the percentage of samples which are correctly identified as ID ( resp . OOD ) data and are certifiably robust within this type ( cc ; certified correct ) along with the corresponding mean certified radius . The higher the portion of cc samples and the larger the radius the more robust is ID/OOD-distinguishing w.r.t . the corresponding perturbation size σ.1 For each model , we observe a performance jump between ID- and OOD-verification , where robustness on ID data drops from high values to low ones while the cc percentage and radius on OOD-data increase . These jumps are observed for normal training as well as adversarial training based on the crossentropy or the differential entropy . Thus , either ID-verification or OOD-verification performs well , depending on the chosen threshold . Augmenting the data set with random noise perturbed samples ( randomized smoothing loss ) does not result in such performance jumps ( except for PriorNet ) , but there is also a trade-off between robustness on ID data versus robustness on OOD data and there is no parametrization where ID-verification and OOD-verification perform equally well . 1We want to highlight again that attacks are here only used to enable robust training of the models . The robustness evaluation itself operates on the original data ( not attacked and , thus , seemingly easy ) ; only smoothed via randomized smoothing . The verification provides us a radius that guarantees robustness around the sample . and certifiably robust as this wrong type ( cw ; certified wrong ) . These cw samples are worse than adversarial examples . Neither robust training based on label attacks , uncertainty attacks nor noise perturbed samples consistently reduce the portion of certifiably wrong samples , even worse it seems to increase the number of cw samples . Thus , although robust training improves DBU-model resistance against label attacks ( see Appendix , Table 35 ) , ID/OOD-verification shows that each model is either robust on ID-data or on OOD-data . Achieving robustness on both types is challenging . Our results rise the following question : How do we make DBU models robust w.r.t . class label predictions and ID/OOD-differentiation without favoring either performance on ID data or OOD data ? 5 CONCLUSION This work analyze robustness of uncertainty estimation by DBU models and answer multiple questions in this context . Our results show : ( 1 ) While uncertainty estimates are a good indicator to identify correctly classified samples on unperturbed data , performance decrease drastically on perturbed datapoints . ( 2 ) None of the Dirichlet-based uncertainty models is able to detect PGD label attacks against the classification decision by uncertainty estimation , regardless of the used uncertainty measure . ( 3 ) Detecting OOD samples and distinguishing between ID-data and OOD-data is not robust . ( 4 ) Robust training based on label attacks or uncertainty attacks increases performance of Dirichlet-based uncertainty models w.r.t . either ID data or OOD data , but achieving high robustness on both is challenging – and poses an interesting direction for future studies . REFERENCES Julian Bitterwolf , Alexander Meinke , and Matthias Hein . Provable worst case guarantees for the detection of out-of-distribution data . Neural Information Processing Systems , 2020 . Charles Blundell , Julien Cornebise , Koray Kavukcuoglu , and Daan Wierstra . Weight uncertainty in neural networks . International Conference on Machine Learning , 2015 . Luca Cardelli , Marta Kwiatkowska , Luca Laurenti , Nicola Paoletti , Andrea Patane , and Matthew Wicker . Statistical guarantees for the robustness of bayesian neural networks . Conference on Artificial Intelligence , ( IJCAI ) , 2019 . Nicholas Carlini and David Wagner . Adversarial examples are not easily detected : Bypassing ten detection methods . Workshop on Artificial Intelligence and Security , 2017 . Nicholas Carlini and David Wagner . Towards evaluating the robustness of neural networks . Symposium on Security and Privacy , 2017 . Bertrand Charpentier , Daniel Zügner , and Stephan Günnemann . Posterior network : Uncertainty estimation without ood samples via density-based pseudo-counts . Advances in Neural Information Processing Systems , 2020 . Tarin Clanuwat , Mikel Bober-Irizar , Asanobu Kitamoto , Alex Lamb , Kazuaki Yamamoto , and David Ha . Deep learning for classical japanese literature . Neural Information Processing Systems , 2018 . Jeremy M. Cohen , Elan Rosenfeld , and J. Zico Kolter . Certified adversarial robustness via randomized smoothing . International Conference on Machine Learning , 2019 . Raphaël Dang-Nhu , Gagandeep Singh , Pavol Bielik , and Martin Vechev . Adversarial attacks on probabilistic autoregressive forecasting models . International Conference on Machine Learning ( ICML ) , 2020 . Jesse Davis and Mark Goadrich . The relationship between precision-recall and roc curves . International Conference on Machine Learning , 2006 . Dheeru Dua and Casey Graff . UCI machine learning repository . University of California , Irvine , School of Information and Computer Sciences , 2017 . Yarin Gal and Zoubin Ghahramani . Dropout as a bayesian approximation : Representing model uncertainty in deep learning . Proceedings of Machine Learning Research , 2016 . Ian J. Goodfellow , Jonathon Shlens , and Christian Szegedy . Explaining and harnessing adversarial examples . International Conference on Learning Representations , 2015 . Alex Krizhevsky , Vinod Nair , and Geoffrey Hinton . Cifar-10 . Canadian Institute for Advanced Research , 2009 . Aounon Kumar , Alexander Levine , Soheil Feizi , and Tom Goldstein . Certifying Confidence via Randomized Smoothing . Advances in Neural Information Processing Systems , 2020 . Balaji Lakshminarayanan , Alexander Pritzel , and Charles Blundell . Simple and scalable predictive uncertainty estimation using deep ensembles . Advances in Neural Information Processing Systems , 2017 . Yann LeCun and Corinna Cortes . MNIST handwritten digit database . National Institute of Standards and Technology , 2010 . Kimin Lee , Kibok Lee , Honglak Lee , and Jinwoo Shin . A simple unified framework for detecting out-of-distribution samples and adversarial attacks . Advances in Neural Information Processing Systems , 2018 . Wesley J. Maddox , Pavel Izmailov , Timur Garipov , Dmitry P. Vetrov , and Andrew Gordon Wilson . A simple baseline for bayesian uncertainty in deep learning . Advances in Neural Information Processing Systems , 2019 . Aleksander Madry , Aleksandar Makelov , Ludwig Schmidt , Dimitris Tsipras , and Adrian Vladu . Towards deep learning models resistant to adversarial attacks . International Conference on Learning Representations , 2018 . Andrey Malinin and Mark Gales . Predictive uncertainty estimation via prior networks . Neural Information Processing Systems , 2018a . Andrey Malinin and Mark Gales . Prior networks for detection of adversarial attacks . arXiv:1812.02575 [ stat.ML ] , 2018b . Andrey Malinin and Mark Gales . Reverse kl-divergence training of prior networks : Improved uncertainty and adversarial robustness . Advances in Neural Information Processing Systems , 2019 . Andrey Malinin , Bruno Mlodozeniec , and Mark Gales . Ensemble distribution distillation . International Conference on Learning Representations , 2019 . Alexander Meinke and Matthias Hein . Towards neural networks that provably know when they don ’ t know . International Conference on Learning Representations , 2020 . Yuval Netzer , Tao Wang , Adam Coates , Alessandro Bissacco , Bo Wu , and Andrew Y. Ng . Reading digits in natural images with unsupervised feature learning . NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011 , 2011 . Kazuki Osawa , Siddharth Swaroop , Mohammad Emtiyaz E. Khan , Anirudh Jain , Runa Eschenhagen , Richard E. Turner , and Rio Yokota . Practical deep learning with bayesian principles . Advances in Neural Information Processing Systems , 2019 . Adam Paszke , Sam Gross , Francisco Massa , Adam Lerer , James Bradbury , Gregory Chanan , Trevor Killeen , Zeming Lin , Natalia Gimelshein , Luca Antiga , Alban Desmaison , Andreas Kopf , Edward Yang , Zachary DeVito , Martin Raison , Alykhan Tejani , Sasank Chilamkurthy , Benoit Steiner , Lu Fang , Junjie Bai , and Soumith Chintala . Pytorch : An imperative style , high-performance deep learning library . Advances in Neural Information Processing Systems , 2019 . Yao Qin , Xuezhi Wang , Alex Beutel , and Ed H. Chi . Improving uncertainty estimates through the relationship with adversarial robustness . arXiv:2006.16375 [ cs.LG ] , 2020 . Takaya Saito and Marc Rehmsmeier . The precision-recall plot is more informative than the roc plot when evaluating binary classifiers on imbalanced datasets . PLOS ONE , 2015 . Murat Sensoy , Lance Kaplan , and Melih Kandemir . Evidential deep learning to quantify classification uncertainty . Advances in Neural Information Processing Systems , 2018 . Karen Simonyan and Andrew Zisserman . Very deep convolutional networks for large-scale image recognition . International Conference on Learning Representations , 2015 . Lewis Smith and Yarin Gal . Understanding measures of uncertainty for adversarial example detection . Uncertainty in Artificial Interlligence , 2018 . Jasper Snoek , Yaniv Ovadia , Emily Fertig , Balaji Lakshminarayanan , Sebastian Nowozin , D. Sculley , Joshua Dillon , Jie Ren , and Zachary Nado . Can you trust your models uncertainty ? Advances in Neural Information Processing Systems , 2019 . David Stutz , Matthias Hein , and Bernt Schiele . Confidence-calibrated adversarial training : Generalizing to unseen attacks . International Conference on Machine Learning , 2020 . Christian Szegedy , Wojciech Zaremba , Ilya Sutskever , Joan Bruna , Dumitru Erhan , Ian Goodfellow , and Rob Fergus . Intriguing properties of neural networks . International Conference on Learning Representations , 2014 . Natasa Tagasovska and David Lopez-Paz . Single-model uncertainties for deep learning . Advances in Neural Information Processing Systems , 2019 . Tsui-Wei Weng , Huan Zhang , Pin-Yu Chen , Jinfeng Yi , Dong Su , Yupeng Gao , Cho-Jui Hsieh , and Luca Daniel . Evaluating the robustness of neural networks : An extreme value theory approach . International Conference on Learning Representations ( ICLR ) , 2018 . Matthew Wicker , Luca Laurenti , Andrea Patane , and Marta Kwiatkowska . Probabilistic safety for bayesian neural networks . Proceedings of Machine Learning Research ( PMLR ) , 2020 . Han Xiao , Kashif Rasul , and Roland Vollgraf . Fashion-mnist : a novel image dataset for benchmarking machine learning algorithms . Zalando SE , 2017 . A APPENDIX A.1 DIRICHLET-BASED UNCERTAINTY MODELS In this section , we provide details on the losses used by each DBU model . PostNet uses a Bayesian loss which can be expressed as follows : LPostNet = 1 N ∑ i Eq ( p ( i ) ) [ CE ( p ( i ) , y ( i ) ) ] −H ( q ( i ) ) ( 3 ) where CE denotes the cross-entropy . Both the expectation term ( i.e . Eq ( p ( i ) ) [ CE ( p ( i ) , y ( i ) ) ] ) and the entropy term ( i.e . H ( q ( i ) ) ) can be computed in closed-form ( Charpentier et al. , 2020 ) . PriorNet uses a loss composed of two KL divergence terms for ID and OOD data : LPriorNet = 1 N ∑ x ( i ) ∈ID data [ KL [ Dir ( αID ) ||q ( i ) ] ] + ∑ x ( i ) ∈OODdata [ KL [ Dir ( αOOD ) ||q ( i ) ] ] . ( 4 ) Both KL divergences terms can be computed in closed-form ( Malinin & Gales , 2019 ) . The precision αID and αOOD are hyper-parameters . The precision αID is usually set to 1e1 for the correct class and 1 otherwise . The precision αOOD is usually set to 1 . DDNet uses use the Dirichlet likelihood of soft labels produce by an ensemble of M neural networks : LDDNet = − 1 N ∑ i M∑ m=1 [ ln q ( i ) ( πim ) ] ( 5 ) where πim denotes the soft-label of mth neural network . The Dirichlet likelihood can be computed in closed-form ( Malinin et al. , 2019 ) . EvNet uses the expected mean square error between the one-hot encoded label and the predicted categorical distribution : LEvNet = 1 N ∑ i Ep ( i ) ∼Dir ( α ( i ) ) ||y ∗ ( i ) −p ( i ) ||2 ( 6 ) where y∗ ( i ) denotes the one-hot encoded label . The expected MSE loss can also be computed in closed form ( Sensoy et al. , 2018 ) . For more details please have a look at the original paper on PriorNet ( Malinin & Gales , 2018a ) , PostNet ( Charpentier et al. , 2020 ) , DDNet ( Malinin & Gales , 2019 ) and EvNet ( Sensoy et al. , 2018 ) . A.2 CLOSED-FORM COMPUTATION OF UNCERTAINTY MEASURES & UNCERTAINTY ATTACKS Dirichlet-based uncertainty models allow to compute several uncertainty measures in closed form ( see ( Malinin & Gales , 2018a ) for a derivation ) . As proposed by Malinin & Gales ( 2018a ) , we use precision mα0 , differential entropy mdiffE and mutual information mMI to estimate uncertainty on predictions . The differential entropy mdiffE of a DBU model reaches its maximum value for equally probable categorical distributions and thus , a on flat Dirichlet distribution . It is a measure for distributional uncertainty and expected to be low on ID data , but high on OOD data . mdiffE = K∑ c ln Γ ( αc ) − ln Γ ( α0 ) − K∑ c ( αc − 1 ) · ( Ψ ( αc ) −Ψ ( α0 ) ) ( 7 ) where α are the parameters of the Dirichlet-distribution , Γ is the Gamma function and Ψ is the Digamma function . The mutual information mMI is the difference between the total uncertainty ( entropy of the expected distribution ) and the expected uncertainty on the data ( expected entropy of the distribution ) . This uncertainty is expected to be low on ID data and high on OOD data . mMI = − K∑ c=1 αc α0 ( ln αc α0 −Ψ ( αc + 1 ) + Ψ ( α0 + 1 ) ) ( 8 ) Furthermore , we use the precision α0 to measure uncertainty , which is expected to be high on ID data and low on OOD data . mα0 = α0 = K∑ c=1 αc ( 9 ) As these uncertainty measures are computed in closed form and it is possible to obtain their gradients , we use them ( i.e . mdiffE , mMI , mα0 ) are target function of our uncertainty attacks . Changing the attacked target function allows us to use a wide range of gradient-based attacks such as FGSM attacks , PGD attacks , but also more sophisticated attacks such as Carlini-Wagner attacks . A.3 DETAILS OF THE EXPERIMENTAL SETUP Models . We trained all models with a similar based architecture . We used namely 3 linear layers for vector data sets , 3 convolutional layers with size of 5 + 3 linear layers for MNIST and the VGG16 Simonyan & Zisserman ( 2015 ) architecture with batch normalization for CIFAR10 . All the implementation are performed using Pytorch ( Paszke et al. , 2019 ) . We optimized all models using Adam optimizer . We performed early stopping by checking for loss improvement every 2 epochs and a patience of 10 . The models were trained on GPUs ( 1 TB SSD ) . We performed a grid-search for hyper-parameters for all models . The learning rate grid search was done in [ 1e−5 , 1e−3 ] . For PostNet , we used Radial Flows with a depth of 6 and a latent space equal to 6 . Further , we performed a grid search for the regularizing factor in [ 1e−7 , 1e−4 ] . For PriorNet , we performed a grid search for the OOD loss weight in [ 1 , 10 ] . For DDNet , we distilled the knowledge of 5 neural networks after a grid search in [ 2 , 5 , 10 , 20 ] neural networks . Note that it already implied a significant overhead at training compare to other models . Metrics . For all experiments , we focused on using AUC-PR scores since it is well suited to imbalance tasks ( Saito & Rehmsmeier , 2015 ) while bringing theoretically similar information than AUC-ROC scores ( Davis & Goadrich , 2006 ) . We scaled all scores from [ 0 , 1 ] to [ 0 , 100 ] . All results are average over 5 training runs using the best hyper-parameters found after the grid search . Data sets . For vector data sets , we use 5 different random splits to train all models . We split the data in training , validation and test sets ( 60 % , 20 % , 20 % ) . We use the segment vector data set Dua & Graff ( 2017 ) , where the goal is to classify areas of images into 7 classes ( window , foliage , grass , brickface , path , cement , sky ) . We remove class window from ID training data to provide OOD training data to PriorNet . Further , We remove the class ’ sky ’ from training and instead use it as the OOD data set for OOD detection experiments . Each input is composed of 18 attributes describing the image area . The data set contains 2 , 310 samples in total . We further use the Sensorless Drive vector data set Dua & Graff ( 2017 ) , where the goal is to classify extracted motor current measurements into 11 different classes . We remove class 9 from ID training data to provide OOD training data to PriorNet . We remove classes 10 and 11 from training and use them as the OOD dataset for OOD detection experiments . Each input is composed of 49 attributes describing motor behaviour . The data set contains 58 , 509 samples in total . Additionally , we use the MNIST image data set LeCun & Cortes ( 2010 ) where the goal is to classify pictures of hand-drawn digits into 10 classes ( from digit 0 to digit 9 ) . Each input is composed of a 1× 28× 28 tensor . The data set contains 70 , 000 samples . For OOD detection experiments , we use FashionMNIST Xiao et al . ( 2017 ) and KMNIST Clanuwat et al . ( 2018 ) containing images of Japanese characters and images of clothes , respectively . FashionMNIST was used as training OOD for PriorNet while KMNIST is used as OOD at test time . Finally , we use the CIFAR10 image data set Krizhevsky et al . ( 2009 ) where the goal is to classify a picture of objects into 10 classes ( airplane , automobile , bird , cat , deer , dog , frog , horse , ship , truck ) . Each input is a 3 × 32 × 32 tensor . The data set contains 60 , 000 samples . For OOD detection experiments , we use street view house numbers ( SVHN ) Netzer et al . ( 2011 ) and CIFAR100 ( Krizhevsky et al. , 2009 ) containing images of numbers and objects respectively . CIFAR100 was used as training OOD for PriorNet while SVHN is used as OOD at test time . Perturbations . For all label and uncertainty attacks , we used Fast Gradient Sign Methods and Project Gradient Descent . We tried 6 different radii [ 0.0 , 0.1 , 0.2 , 0.5 , 1.0 , 2.0 , 4.0 ] . These radii operate on the input space after data normalization . We bound perturbations by L∞-norm or by L2-norm , with L∞ ( x ) = max i=1 , ... , D |xi| and L2 ( x ) = ( D∑ i=1 x2i ) 0.5 . ( 10 ) For L∞-norm it is obvious how to relate perturbation size ε with perturbed input images , because all inputs are standardized such that the values of their features are between 0 and 1 . A perturbation of size ε = 0 corresponds to the original input , while a perturbation of size ε = 1 corresponds to the whole input space and allows to change all features to any value . For L2-norm the relation between perturbation size ε and perturbed input images is less obvious . To justify our choice for ε w.r.t . this norm , we relate perturbations size ε2 corresponding to L2-norm with perturbations size ε∞ corresponding to L∞-norm . First , we compute ε2 , such that the L2-norm is the smallest super-set of the L∞-norm . Let us consider a perturbation of ε∞ . The largest L2-norm would be obtained if each feature is perturbed by ε∞ . Thus , perturbation ε2 , such that L2 encloses L∞ is ε2 = ( ∑D i=1 ε 2 ∞ ) 0.5 = √ Dε∞ . For the MNIST-data set , with D = 28× 28 input features L2-norm with ε2 = 28 encloses L∞-norm with ε∞ = 1 . Alternatively , ε2 can be computes such that the volume spanned by L2-norm is equivalent to the one spanned by L∞-norm . Using that the volume spanned by L∞-norm is εD∞ and the volume spanned by L2-norm is π0.5DεD2 Γ ( 0.5D+1 ) ( where Γ is the Gamma-function ) , we obtain volume equivalence if ε2 = Γ ( 0.5D + 1 ) 1 D √ πε∞ . For the MNIST-data set , with D = 28× 28 input features L2-norm with ε2 ≈ 21.39 is volume equivalent to L∞-norm with ε∞ = 1 . A.4 ADDITIONAL EXPERIMENTS Table 7 and 8 illustrate that no DBU model maintains high accuracy under gradient-based label attacks . Accuracy under PGD attacks decreases more than under FGSM attacks , since PGD is stronger . Interestingly Noise attacks achieve also good performances with increasing Noise standard deviation . Note that the attack is not constraint to be with a given radius for Noise attacks . On non-perturbed data uncertainty estimates are an indicator of correctly classified samples , but if the input data is perturbed none of the DBU models maintains its high performance . Thus , uncertainty estimates are not a robust indicator of correctly labeled inputs . better results when they are attacked by FGSM-attacks ( Table 13 ) , but as FGSM attacks provide much weaker adversarial examples than PGD attacks , this can not be seen as real advantage . Can we use uncertainty estimates to detect attacks against the classification decision ? PGD attacks do not explicitly consider uncertainty during the computation of adversarial examples , but they seem to provide perturbed inputs with similar uncertainty as the original input . A.5 ROBUST TRAINING FOR DBU MODELS & ID/OOD VERIFICATION Table 5 and 29 on adversarial training illustrate that there is a jump between ID-verification and OOD-verification , where robustness on ID data drops while robustness on OOD data increases . These jumps are observed for each model and each training ( normal , noise-based , adversarial with label attacks , adversarial with uncertainty attacks ) . Thus , either ID-verification or OOD-verification perform well , depending on the chosen threshold . In contrast to that , adversarial training improves robustness w.r.t . the predicted class label for most pair model/data set ( Fig . 7 , 32 ) . The following Figures visualize the differential entropy distribution for ID data and OOD data for all models with standard training . We used label attacks and uncertainty attacks for CIFAR10 and MNIST . Thus , they show how well the DBU models separate on clean and perturbed ID data and OOD data . Figures 4 and 5 visualizes the differential entropy distribution of ID data and OOD data under label attacks . On CIFAR10 , PriorNet and DDNet can barely distinguish between clean ID and OOD data . We observe a better ID/OOD distinction for PostNet and EvNet for clean data . However , we do not observe for any model an increase of the uncertainty estimates on label attacked data . Even worse , PostNet , PriorNet and DDNet seem to assign higher confidence on class label attacks . On MNIST , models show a slightly better behavior . They are capable to assign a higher uncertainty to label attacks up to some attack radius . Figures 6 , 7 , 8 and 9 visualizes the differential entropy distribution of ID data and OOD data under uncertainty attacks . For both CIFAR10 and MNIST data sets , we observed that uncertainty estimations of all models can be manipulated . That is , OOD uncertainty attacks can shift the OOD uncertainty distribution to more certain predcitions , and ID uncertainty attacks can shift the ID uncertainty distribution to less certain predictions .
This manuscript addresses an important question of how Drichlet-based uncertainty (DBU) measures can be used to quantify robustness to adversarial label attacks. Robustness to OOD samples of these models were already shown in the papers they were proposed but this work differs from them in using adversarial samples as OOD samples. Via extensive experimental results on various datasets, the authors conclude that the uncertainty estimates are not good indicators for identifying correctly classified samples for adversarially perturbed data.
SP:d856b17ff19142ea30fcb687ee8a911b135fc3f5
Evaluating Robustness of Predictive Uncertainty Estimation: Are Dirichlet-based Models Reliable?
1 INTRODUCTION Neural networks achieve high predictive accuracy in many tasks , but they are known to have two substantial weaknesses : First , neural networks are not robust against adversarial perturbations , i.e. , semantically meaningless input changes that lead to wrong predictions ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) . Second , neural networks tend to make over-confident predictions at test time ( Lakshminarayanan et al. , 2017 ) . Even worse , standard neural networks are unable to identify samples that are different from the samples they were trained on . In these cases , they provide uninformed decisions instead of abstaining . These two weaknesses make them impracticable in sensitive domains like financial , autonomous driving or medical areas which require trust in predictions . To increase trust in neural networks , models that provide predictions along with the corresponding uncertainty have been proposed . There are three main families of models that aim to provide meaningful estimates of their predictive uncertainty . The first family are Bayesian Neural Networks ( Blundell et al. , 2015 ; Osawa et al. , 2019 ; Maddox et al. , 2019 ) , which have the drawback that they are computationally demanding . The second family consists of Monte-Carlo drop-out based models ( Gal & Ghahramani , 2016 ) and ensembles ( Lakshminarayanan et al. , 2017 ) that estimate uncertainty by computing statistics such as mean and variance by aggregating forward passes of multiple models . A disadvantage of all of these models is that uncertainty estimation at inference time is expensive . In contrast to these , the recently growing family of Dirichlet-based uncertainty ( DBU ) models ( Malinin & Gales , 2018a ; 2019 ; Sensoy et al. , 2018 ; Malinin et al. , 2019 ; Charpentier et al. , 2020 ) directly predict the parameters of a Dirichlet distribution over categorical probability distributions . They provide efficient uncertainty estimates at test time since they only require a single forward pass . DBU models bring the benefit of providing both , aleatoric and epistemic uncertainty estimates . Aleatoric uncertainty is irreducible and caused by the natural complexity of the data , such as class overlap or noise . Epistemic uncertainty results from the lack of knowledge about unseen data , e.g . when the model is presented an image of an unknown object . Both uncertainty types can be quantified using different uncertainty measures based on a Dirichlet distribution , such as differential entropy , mutual information , or pseudo-counts ( Malinin & Gales , 2018a ; Charpentier et al. , 2020 ) . These uncertainty measures have been shown outstanding performance in , e.g. , the detection of OOD samples and thus are superior to softmax based confidence ( Malinin & Gales , 2019 ; Charpentier et al. , 2020 ) . Neural networks from the families outlined above are expected to know what they don ’ t know , i.e. , notice when they are unsure about a prediction . This raises questions with regards to adversarial examples : should uncertainty estimates detect these corrupted samples and abstain from making a prediction ( i.e . indicated by high uncertainty in the prediction ) , or should they be robust to adversarial examples and produce the correct output even under perturbations ? Using humans as the gold standard of image classification and assuming that the perturbations are semantically meaningless , which is typically implied by small Lp norm of the corruption , we argue that the best option is that the models are robust to adversarial perturbations ( see Figure 1 ) . Beyond being robust w.r.t . label prediction , we expect models to robustly know what they do not know . That is , they should robustly distinguish between ID and OOD data even if those are perturbed . In this work , we focus on DBU models and analyze their robustness capacity w.r.t . the classification decision and uncertainty estimations , going beyond simple softmax output confidence by investigating advanced measures like differential entropy . Specifically , we study the following questions : 1 . Is high certainty a reliable indicator of correct predictions ? 2 . Can we use uncertainty estimates to detect label attacks on the classification decision ? 3 . Are uncertainty estimates such as differential entropy a robust feature for OOD detection ? In addressing these questions we place particular focus on adversarial perturbations of the input in order to evaluate the worst case performance of the models . We address question one by analyzing uncertainty estimation on correctly and wrongly labeled samples , without and with adversarial perturbations on the inputs . To answer question two , we study uncertainty estimates of DBU models on label attacks . More specifically , we analyze whether there is a difference between uncertainty estimates on perturbed and unperturbed inputs and whether DBU models are capable of recognizing successful label attacks by uncertainty estimation . Addressing question three , we use robustness verification based on randomized smoothing and propose to investigate uncertainty attacks . Uncertainty attacks aim at changing the uncertainty estimate such that ID data is marked as OOD data and vice versa . Finally , we propose robust training procedures that use label attacks , uncertainty attacks or random noise and analyze how they affect robustness of DBU models on ID data and OOD data . 2 RELATED WORK Recently , multiple works have analyzed uncertainty estimation and robustness of neural networks . ( Snoek et al. , 2019 ) compares uncertainty estimates of models based on drop-out and ensembles under data set shifts . ( Cardelli et al. , 2019 ; Wicker et al. , 2020 ) study probabilistic safety of Bayesian networks under adversarial perturbations by analyzing inputs sets and the corresponding mappings in the output space . In contrast , our work focus on DBU models and analyze their robustness w.r.t . adversarial perturbations specifically designed to fool label or uncertainty predictions of the models . Furthermore , previous works on attack defenses have focused on evaluating either robustness w.r.t . class predictions ( Carlini & Wagner , 2017 ; Weng et al. , 2018 ) or label attack detection ( Carlini & Wagner , 2017 ) . In contrast , our work jointly evaluates both tasks by analyzing them from the uncertainty perspective . Furthermore , in addition to label attacks , we study a new type of adversarial perturbations that directly target uncertainty estimation . Those attacks are different from traditional label attacks ( Madry et al. , 2018 ; Dang-Nhu et al. , 2020 ) . Different models have been proposed to account for uncertainty while being robust . ( Smith & Gal , 2018 ) and ( Lee et al. , 2018 ) have tried to improve label attack detection based on uncertainty using drop-out or density estimation . In addition from improving label attack detection for large unseen perturbations , ( Stutz et al. , 2020 ) aimed at improving robustness w.r.t . class label predictions on small input perturbations . To this end , they proposed a new adversarial training with softer labels for adversarial samples further from the original input . ( Qin et al. , 2020 ) suggested a similar adversarial training where labels are soften differently depending on the input robustness . These previous works only consider the aleatoric uncertainty contained in the predicted categorical probabilities , i.e . the softmax output . They do not consider DBU models which explicitly account for both aleatoric and epistemic uncertainty . ( Malinin & Gales , 2019 ) proposed to improve a single type of DBU model for label attack detection by assigning them high uncertainty during training . Please note that the works ( Tagasovska & Lopez-Paz , 2019 ; Kumar et al. , 2020 ; Bitterwolf et al. , 2020 ; Meinke & Hein , 2020 ) study a different orthogonal problem . ( Tagasovska & Lopez-Paz , 2019 ) propose to compute confidence intervals while ( Kumar et al. , 2020 ) propose certificates on softmax predictions . ( Bitterwolf et al. , 2020 ) uses interval bound propagation to compute bounds on softmax predictions in the L∞-ball around an OOD point and for ReLU networks , ( Meinke & Hein , 2020 ) proposes an approach to obtain certifiably low confidence for OOD data . These four studies estimate confidence based on softmax predictions , which accounts for aleatoric uncertainty only . In this paper , we provide certificates on the OOD classification task using DBU models directly which is better suited to epistemic uncertainty measures . 3 DIRICHLET-BASED UNCERTAINTY MODELS Standard ( softmax ) neural networks predict the parameters of a categorical distribution p ( i ) = [ p ( i ) 1 , . . . , p ( i ) C ] for a given input x ( i ) ∈ Rd , where C is the number of classes . Given the parameters of a categorical distribution , we can evaluate its aleatoric uncertainty , which is the uncertainty on the class label prediction y ( i ) ∈ { 1 , . . . , C } . For example , when predicting the result of an unbiased coin flip , we expect the model to have high aleatoric uncertainty and predict p ( head ) = 0.5 . In contrast to standard ( softmax ) neural networks , DBU models predict the parameters of a Dirichlet distribution – the natural prior of categorical distributions – given input x ( i ) ( i.e . q ( i ) = Dir ( α ( i ) ) where fθ ( x ( i ) ) = α ( i ) ∈ RC+ ) . Hence , the epistemic distribution q ( i ) expresses the epistemic uncertainty on x ( i ) , i.e . the uncertainty on the categorical distribution prediction p ( i ) . From the epistemic distribution , follows an estimate of the aleatoric distribution of the class label prediction Cat ( p̄ ( i ) ) where Eq ( i ) [ p ( i ) ] = p̄ ( i ) . An advantage of DBU models is that one pass through the neural network is sufficient to compute epistemic distribution , aleatoric distribution , and predict the class label : q ( i ) = Dir ( α ( i ) ) , p̄ ( i ) c = α ( i ) c α ( i ) 0 with α ( i ) 0 = C∑ c=1 α ( i ) c , y ( i ) = arg max [ p̄ ( i ) 1 , ... , p̄ ( i ) C ] ( 1 ) This parametrization allow to compute classic uncertainty measures in closed-form . As an example , the concentration parameters α ( i ) c can be interpreted as a pseudo-count of observed samples of class c and , thus , are a good indicator of epistemic uncertainty . Note that further measures , such as differential entropy of the Dirichlet distribution ( see Equation 2 , where Γ is the Gamma function and Ψ is the Digamma function ) or the mutual information between the label y ( i ) and the categorical p ( i ) can also be computed in closed-form ( App . A.2 , ( Malinin & Gales , 2018a ) ) . Hence , DBU models can efficiently use these measures to assign high uncertainty for unknown data making them specifically suited for detection of OOD samples like anomalies . mdiffE = K∑ c ln Γ ( αc ) − ln Γ ( α0 ) − K∑ c ( αc − 1 ) · ( Ψ ( αc ) −Ψ ( α0 ) ) ( 2 ) Several recently proposed models for uncertainty estimations belong to the family of DBU models , such as PriorNet , EvNet , DDNet and PostNet . These models differ in terms of their parametrization of the Dirichlet distribution , the training , and density estimation . An overview of theses differences is provided in Table 1 . We evaluate all recent versions of these models in our study . Contrary to the other models , Prior Networks ( PriorNet ) ( Malinin & Gales , 2018a ; 2019 ) requires OOD data for training to “ teach ” the neural network the difference between ID and OOD data . PriorNet is trained with a loss function consisting of two KL-divergence terms . The fist term is designed to learn Dirichlet parameters for ID , while the second one is used to learn a flat Dirichlet distribution ( α = 1 ) for OOD data . There a two variants of PriorNet . The first one is trained based on reverse KL-divergence ( Malinin & Gales , 2019 ) , while the second one is trained with KL-divergence ( Malinin & Gales , 2018a ) . We include in our experiment the most recent reverse version of PriorNet , as it shows superior performance ( Malinin & Gales , 2019 ) . Evidential Networks ( EvNet ) ( Sensoy et al. , 2018 ) are trained with a loss that computes the sum of squares between the on-hot encoded true label y∗ ( i ) and the predicted categorical p ( i ) under the Dirichlet distribution . Ensemble Distribution Distillation ( DDNet ) ( Malinin et al. , 2019 ) is trained in two steps . First , an ensemble of M classic neural networks needs to be trained . Then , the softlabels { p ( i ) m } Mm=1 provided by the ensemble of networks are distilled into a Dirichlet-based network by fitting them with the maximum likelihood under the Dirichlet distribution . Posterior Network ( PostNet ) ( Charpentier et al. , 2020 ) performs density estimation for ID data with normalizing flows and uses a Bayesian loss formulation . Note that EvNet and PostNet model the Dirichlet parameters as fθ ( x ( i ) ) = 1 +α ( i ) while PriorNet , RevPriorNet and DDNet compute them as fθ ( x ( i ) ) = α ( i ) . 4 ROBUSTNESS OF DIRICHLET-BASED UNCERTAINTY MODELS We analyze robustness of DBU models in the field of uncertainty estimation w.r.t . the following four aspects : accuracy , confidence calibration , label attack detection and OOD detection . Uncertainty is quantified by differential entropy , mutual information and pseudo counts . A formal definition of all uncertainty estimation measures is provided in the appendix . Robustness of Dirichlet-based uncertainty models is evaluated based on label attacks and a newly proposed type of attacks called uncertainty attacks . While label attacks aim at changing the predicted class , uncertainty attacks aim at changing uncertainty assigned to a prediction . All existing works are based on label attacks and focus on robustness w.r.t . the classification decision . Thus , we are the first to propose attacks targeting uncertainty estimates such as differential entropy and analyze further desirable robustness properties of DBU models . Both attack types compute a perturbed input x̃ ( i ) close to the original input x ( i ) i.e . ||x ( i ) − x̃ ( i ) ||2 < r where r is the attack radius . The perturbed input is obtained by optimizing a loss function l ( x ) using Fast Gradient Sign Method ( FGSM ) or Projected Gradient Descent ( PGD ) . We use also a black box attack ( Noise ) which generates 10 Noise samples from a Gaussian distribution with mean equal to the original sample . The pertrubed sample which fools the most the loss function is selected as an attack . To complement attacks , we propose the first study of certifiable robustness for DBU models , which is based on randomized smoothing ( Cohen et al. , 2019 ) . The following questions we address by our experiments have a common assessment metric . Distinguishing between correctly and wrongly classified samples , between non-attacked input and attacked inputs or between ID data and OOD data can be treated as binary classification problems . To quantify the performance of the models on these binary classification problems , we compute AUC-PR . Experiments are performed on two image data sets ( MNIST ( LeCun & Cortes , 2010 ) and CIFAR10 ( Krizhevsky et al. , 2009 ) ) , which contain bounded inputs and two tabular data sets ( Segment ( Dua & Graff , 2017 ) and Sensorless drive ( Dua & Graff , 2017 ) ) , consisting of unbounded inputs . Note that unbounded inputs are challenging since it is impossible to describe the infinitely large OOD distribution . As PriorNet requires OOD training data , we use two further image data sets ( FashionMNIST ( Xiao et al. , 2017 ) and CIFAR100 ( Krizhevsky et al. , 2009 ) ) for training on MNIST and CIFAR10 , respectively . All other models are trained without OOD data . To obtain OOD data for the tabular data sets , we remove classes from the ID data set ( class window for the Segment data set and class 9 for Sensorless drive ) and use them as the OOD data . See appendix for further details on the setup . 4.1 UNCERTAINTY ESTIMATION UNDER LABEL ATTACKS Label attacks aim at changing the predicted class . To obtain a perturbed input with a different label , we maximize the cross-entropy loss x̃ ( i ) ≈ arg maxx l ( x ) = CE ( p ( i ) , y ( i ) ) under the radius constraint . For the sake of completeness we also analyze label attacks regarding their performance to change class predictions and report their accuracy to show the effectiveness based on different radii ( see Appendix , Table 7 ) . As expected and partially shown by previous works , none of the DBU models is robust against label attacks . However , we noted that PriorNet is slightly more robust than the other models . This might be explained by the use of OOD data during training , which can be seen as some kind of robust training . From now on , we switch to the core focus of this work and analyze robustness properties of uncertainty estimation . Is high certainty a reliable indicator of correct predictions ? Expected behavior : Predictions with high certainty are more likely to be correct than low certainty predictions . Assessment metric : We distinguish between correctly classified samples ( label 0 ) and wrongly classified ones ( label 1 ) based on the differential entropy scores produced by the DBU models ( Malinin & Gales , 2018a ) . Correctly classified samples are expected to have low differential entropy , reflecting the model ’ s confidence , and analogously that wrongly predicted samples tend to have higher differential entropy . Observed behavior : Note that the positive and negative classes are not balanced , thus , the use of AUC-PR scores ( Saito & Rehmsmeier , 2015 ) are important to enable meaningful measures . While uncertainty estimates are indeed an indicator of correctly classified samples on non-perturbed data , none of the models maintains its high performance on perturbed data ( see . Table 2 ) . Thus , using uncertainty estimates as indicator for correctly labeled inputs is not robust to adversarial perturbations , although the used attacks do not target uncertainty . Can we use uncertainty estimates to detect label attacks on the classification decision ? Expected behavior : Adversarial examples are not from the natural data distribution . Therefore , DBU models are expected to detect them as OOD data by assigning them a higher uncertainty . We expect perturbations with larger attack radius r to be easier to detect as they differ more significantly from the data distribution . Assessment metric : The goal of attack-detection is to distinguish between unperturbed samples ( label 0 ) and perturbed samples ( label 1 ) . To quantify the performance , we use the differential entropy ( Malinin & Gales , 2018a ) . Non-perturbed samples are expected to have low differential entropy , reflecting the fact that they are from the distribution the models were trained on , while perturbed samples are expected to have a high differential entropy . Further results based on other uncertainty measures are provided in the appendix . Observed behavior : Table 7 shows that the accuracy of all models decreases significantly under PGD label attacks , but none of the models is able to provide an equivalently increasing high attack detection rate ( see Table 3 ) . Even larger perturbations are hard to detect for DBU models . Although PGD label attacks do not explicitly consider uncertainty , they seem to provide adversarial examples with similar uncertainty as the original input . Such high certainty adversarial examples are illustrated in Figure 2 , where certainty is visualized based on the precision α0 that is supposed to be high for ID data and low for OOD data . While the original input ( perturbation size 0.0 ) is correctly classified as frog and ID data , there exist adversarial examples that are classified as deer or bird . The certainty on the prediction of these adversarial examples has a similar or even higher value than the prediction on the original input . Using the differential entropy to distinguish between ID and OOD data results in the same ID/OOD assignment since the differential entropy of the three right-most adversarial examples is similar or even smaller than on the unperturbed input . For the less powerful FGSM and Noise attacks ( see Appendix ) , DBU models achieve mostly better attack detection rates than for PGD attacks . This suggests that uncertainty estimation is able to detect weak attacks , which is consistent with the observations in ( Malinin & Gales , 2018b ) . Furthermore , PostNet provides better label attack detection rate for large perturbations on tabular data sets . An explanation for this observation is that the density estimation of the ID samples has been shown to work better for tabular data sets ( Charpentier et al. , 2020 ) . Standard adversarial training ( based on label attacks targeting the crossentropy loss function ) improves robustness w.r.t . class predictions ( see Appendix , Table 32 ) , but does not improve label attack detection performance of any model ( see Table 40 ) . Overall , none of the DBU models provides a reliable indicator for adversarial inputs that target the classification decision . DBU models are designed to provide uncertainty estimates ( beyond softmax based confidence ) alongside predictions and use this predictive uncertainty for OOD detection . Thus , in this section we focus on attacking these uncertainty estimates . We present result for attacks based on the differential entropy as loss function ( x̃ ( i ) ≈ arg maxx l ( x ) = Diff-Ent ( Dir ( α ( i ) ) ) ) , since it is the most widely used metric for ID-OOD-differentiation . Result based on further uncertainty measures , loss functions and details on the uncertainty attacks are provided in the appendix . Regarding uncertainty attacks , we analyze model performance w.r.t . two tasks . First , attacks are computed on ID data to transform them in OOD data , while OOD data is left non-attacked . Second , we attack OOD data to transform it into ID data , while ID data is not attacked . Hence , uncertainty attacks aim at posing ID data as OOD data or conversely . Are uncertainty estimates a robust feature for OOD detection ? Expected behavior : We expect Dirichlet-based uncertainty models to be able to distinguish between ID and OOD data by providing reliable uncertainty estimates , even under small perturbations . That is , we expect the uncertainty estimates of DBU models to be robust under attacks . Assessment metric : We distinguish between ID data ( label 0 ) and OOD data ( label 1 ) based on the differential entropy as uncertainty scoring function ( Malinin & Gales , 2018a ) . Differential entropy is expected to be small on ID samples and high on OOD samples . Experiments on further uncertainty measure and results for AUROC are provided in the appendix . Observed behavior : OOD samples are perturbed as illustrated in Figure 3 . The left part shows an OOD-sample , which is identified as OOD . Adding adversarial perturbations≥ 0.5 to it changes the Dirichlet parameters such that the resulting images are identified as ID , based on precision or differential entropy as uncertainty measure . Adding adversarial perturba- tions to an ID sample ( right part ) results in images identified as OOD . OOD detection performance of all DBU models decreases rapidly with the size of the perturbation , regardless of whether attacks are computed on ID or OOD data ( Table 4 ) . Thus , using uncertainty estimation to distinguish between ID and OOD data is not robust . PostNet and DDNet achieve slightly better performance than the other models . Further , PostNet provides better scores for large perturbations on tabular data sets which could again be explained by its density-based approach . Our robustness analysis based on label attacks and uncertainty attacks shows that neither the predicted class , nor the uncertainty corresponding to a prediction , nor the differentiation between ID and OOD-data is robust . Thus , we propose adversarial training procedures to enhance robustness . During training we augment the data set by samples computed based on ( i ) PGD attacks against the crossentropy loss or ( ii ) against the differential entropy function , which is used to distinguish between ID and OOD data , or ( iii ) by adding random noise as proposed for randomized smoothing training . Since attacks are used during robust training , we want to avoid tying robustness evaluation to gradient based attacks . Instead , we propose the first approach that certifies robustness of DBU models based on randomized smoothing ( Cohen et al. , 2019 ) . Randomized smoothing was proposed to verify robustness w.r.t . class predictions and we modify it for ID/OOD-verification . As randomized smoothing treats classifiers as a black-box , we transform distinguishing between ID data ( label 0 ) and OOD data ( label 1 ) into a binary classification problem based on an uncertainty measure , which requires to set a threshold for the uncertainty measure to obtain an actual decision boundary . This is in contrast to our attack-based experiments where we avoided setting thresholds by analyzing area under the curve metrics . Thresholds for uncertainty measure are set for each model individually based on the validation set , such that the accuracy w.r.t . to ID/OOD-assignment of the model is maximized . In the following we discuss results for ID/OOD-verification based on differential entropy on CIFAR10 ( ID data ) and SVHN ( OOD data ) . Further results on other data sets , other uncertainty measures and results on the standard classification based randomized smoothing verification are shown in the appendix . Table 5 shows the percentage of samples which are correctly identified as ID ( resp . OOD ) data and are certifiably robust within this type ( cc ; certified correct ) along with the corresponding mean certified radius . The higher the portion of cc samples and the larger the radius the more robust is ID/OOD-distinguishing w.r.t . the corresponding perturbation size σ.1 For each model , we observe a performance jump between ID- and OOD-verification , where robustness on ID data drops from high values to low ones while the cc percentage and radius on OOD-data increase . These jumps are observed for normal training as well as adversarial training based on the crossentropy or the differential entropy . Thus , either ID-verification or OOD-verification performs well , depending on the chosen threshold . Augmenting the data set with random noise perturbed samples ( randomized smoothing loss ) does not result in such performance jumps ( except for PriorNet ) , but there is also a trade-off between robustness on ID data versus robustness on OOD data and there is no parametrization where ID-verification and OOD-verification perform equally well . 1We want to highlight again that attacks are here only used to enable robust training of the models . The robustness evaluation itself operates on the original data ( not attacked and , thus , seemingly easy ) ; only smoothed via randomized smoothing . The verification provides us a radius that guarantees robustness around the sample . and certifiably robust as this wrong type ( cw ; certified wrong ) . These cw samples are worse than adversarial examples . Neither robust training based on label attacks , uncertainty attacks nor noise perturbed samples consistently reduce the portion of certifiably wrong samples , even worse it seems to increase the number of cw samples . Thus , although robust training improves DBU-model resistance against label attacks ( see Appendix , Table 35 ) , ID/OOD-verification shows that each model is either robust on ID-data or on OOD-data . Achieving robustness on both types is challenging . Our results rise the following question : How do we make DBU models robust w.r.t . class label predictions and ID/OOD-differentiation without favoring either performance on ID data or OOD data ? 5 CONCLUSION This work analyze robustness of uncertainty estimation by DBU models and answer multiple questions in this context . Our results show : ( 1 ) While uncertainty estimates are a good indicator to identify correctly classified samples on unperturbed data , performance decrease drastically on perturbed datapoints . ( 2 ) None of the Dirichlet-based uncertainty models is able to detect PGD label attacks against the classification decision by uncertainty estimation , regardless of the used uncertainty measure . ( 3 ) Detecting OOD samples and distinguishing between ID-data and OOD-data is not robust . ( 4 ) Robust training based on label attacks or uncertainty attacks increases performance of Dirichlet-based uncertainty models w.r.t . either ID data or OOD data , but achieving high robustness on both is challenging – and poses an interesting direction for future studies . REFERENCES Julian Bitterwolf , Alexander Meinke , and Matthias Hein . Provable worst case guarantees for the detection of out-of-distribution data . Neural Information Processing Systems , 2020 . Charles Blundell , Julien Cornebise , Koray Kavukcuoglu , and Daan Wierstra . Weight uncertainty in neural networks . International Conference on Machine Learning , 2015 . Luca Cardelli , Marta Kwiatkowska , Luca Laurenti , Nicola Paoletti , Andrea Patane , and Matthew Wicker . Statistical guarantees for the robustness of bayesian neural networks . Conference on Artificial Intelligence , ( IJCAI ) , 2019 . Nicholas Carlini and David Wagner . Adversarial examples are not easily detected : Bypassing ten detection methods . Workshop on Artificial Intelligence and Security , 2017 . Nicholas Carlini and David Wagner . Towards evaluating the robustness of neural networks . Symposium on Security and Privacy , 2017 . Bertrand Charpentier , Daniel Zügner , and Stephan Günnemann . Posterior network : Uncertainty estimation without ood samples via density-based pseudo-counts . Advances in Neural Information Processing Systems , 2020 . Tarin Clanuwat , Mikel Bober-Irizar , Asanobu Kitamoto , Alex Lamb , Kazuaki Yamamoto , and David Ha . Deep learning for classical japanese literature . Neural Information Processing Systems , 2018 . Jeremy M. Cohen , Elan Rosenfeld , and J. Zico Kolter . Certified adversarial robustness via randomized smoothing . International Conference on Machine Learning , 2019 . Raphaël Dang-Nhu , Gagandeep Singh , Pavol Bielik , and Martin Vechev . Adversarial attacks on probabilistic autoregressive forecasting models . International Conference on Machine Learning ( ICML ) , 2020 . Jesse Davis and Mark Goadrich . The relationship between precision-recall and roc curves . International Conference on Machine Learning , 2006 . Dheeru Dua and Casey Graff . UCI machine learning repository . University of California , Irvine , School of Information and Computer Sciences , 2017 . Yarin Gal and Zoubin Ghahramani . Dropout as a bayesian approximation : Representing model uncertainty in deep learning . Proceedings of Machine Learning Research , 2016 . Ian J. Goodfellow , Jonathon Shlens , and Christian Szegedy . Explaining and harnessing adversarial examples . International Conference on Learning Representations , 2015 . Alex Krizhevsky , Vinod Nair , and Geoffrey Hinton . Cifar-10 . Canadian Institute for Advanced Research , 2009 . Aounon Kumar , Alexander Levine , Soheil Feizi , and Tom Goldstein . Certifying Confidence via Randomized Smoothing . Advances in Neural Information Processing Systems , 2020 . Balaji Lakshminarayanan , Alexander Pritzel , and Charles Blundell . Simple and scalable predictive uncertainty estimation using deep ensembles . Advances in Neural Information Processing Systems , 2017 . Yann LeCun and Corinna Cortes . MNIST handwritten digit database . National Institute of Standards and Technology , 2010 . Kimin Lee , Kibok Lee , Honglak Lee , and Jinwoo Shin . A simple unified framework for detecting out-of-distribution samples and adversarial attacks . Advances in Neural Information Processing Systems , 2018 . Wesley J. Maddox , Pavel Izmailov , Timur Garipov , Dmitry P. Vetrov , and Andrew Gordon Wilson . A simple baseline for bayesian uncertainty in deep learning . Advances in Neural Information Processing Systems , 2019 . Aleksander Madry , Aleksandar Makelov , Ludwig Schmidt , Dimitris Tsipras , and Adrian Vladu . Towards deep learning models resistant to adversarial attacks . International Conference on Learning Representations , 2018 . Andrey Malinin and Mark Gales . Predictive uncertainty estimation via prior networks . Neural Information Processing Systems , 2018a . Andrey Malinin and Mark Gales . Prior networks for detection of adversarial attacks . arXiv:1812.02575 [ stat.ML ] , 2018b . Andrey Malinin and Mark Gales . Reverse kl-divergence training of prior networks : Improved uncertainty and adversarial robustness . Advances in Neural Information Processing Systems , 2019 . Andrey Malinin , Bruno Mlodozeniec , and Mark Gales . Ensemble distribution distillation . International Conference on Learning Representations , 2019 . Alexander Meinke and Matthias Hein . Towards neural networks that provably know when they don ’ t know . International Conference on Learning Representations , 2020 . Yuval Netzer , Tao Wang , Adam Coates , Alessandro Bissacco , Bo Wu , and Andrew Y. Ng . Reading digits in natural images with unsupervised feature learning . NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011 , 2011 . Kazuki Osawa , Siddharth Swaroop , Mohammad Emtiyaz E. Khan , Anirudh Jain , Runa Eschenhagen , Richard E. Turner , and Rio Yokota . Practical deep learning with bayesian principles . Advances in Neural Information Processing Systems , 2019 . Adam Paszke , Sam Gross , Francisco Massa , Adam Lerer , James Bradbury , Gregory Chanan , Trevor Killeen , Zeming Lin , Natalia Gimelshein , Luca Antiga , Alban Desmaison , Andreas Kopf , Edward Yang , Zachary DeVito , Martin Raison , Alykhan Tejani , Sasank Chilamkurthy , Benoit Steiner , Lu Fang , Junjie Bai , and Soumith Chintala . Pytorch : An imperative style , high-performance deep learning library . Advances in Neural Information Processing Systems , 2019 . Yao Qin , Xuezhi Wang , Alex Beutel , and Ed H. Chi . Improving uncertainty estimates through the relationship with adversarial robustness . arXiv:2006.16375 [ cs.LG ] , 2020 . Takaya Saito and Marc Rehmsmeier . The precision-recall plot is more informative than the roc plot when evaluating binary classifiers on imbalanced datasets . PLOS ONE , 2015 . Murat Sensoy , Lance Kaplan , and Melih Kandemir . Evidential deep learning to quantify classification uncertainty . Advances in Neural Information Processing Systems , 2018 . Karen Simonyan and Andrew Zisserman . Very deep convolutional networks for large-scale image recognition . International Conference on Learning Representations , 2015 . Lewis Smith and Yarin Gal . Understanding measures of uncertainty for adversarial example detection . Uncertainty in Artificial Interlligence , 2018 . Jasper Snoek , Yaniv Ovadia , Emily Fertig , Balaji Lakshminarayanan , Sebastian Nowozin , D. Sculley , Joshua Dillon , Jie Ren , and Zachary Nado . Can you trust your models uncertainty ? Advances in Neural Information Processing Systems , 2019 . David Stutz , Matthias Hein , and Bernt Schiele . Confidence-calibrated adversarial training : Generalizing to unseen attacks . International Conference on Machine Learning , 2020 . Christian Szegedy , Wojciech Zaremba , Ilya Sutskever , Joan Bruna , Dumitru Erhan , Ian Goodfellow , and Rob Fergus . Intriguing properties of neural networks . International Conference on Learning Representations , 2014 . Natasa Tagasovska and David Lopez-Paz . Single-model uncertainties for deep learning . Advances in Neural Information Processing Systems , 2019 . Tsui-Wei Weng , Huan Zhang , Pin-Yu Chen , Jinfeng Yi , Dong Su , Yupeng Gao , Cho-Jui Hsieh , and Luca Daniel . Evaluating the robustness of neural networks : An extreme value theory approach . International Conference on Learning Representations ( ICLR ) , 2018 . Matthew Wicker , Luca Laurenti , Andrea Patane , and Marta Kwiatkowska . Probabilistic safety for bayesian neural networks . Proceedings of Machine Learning Research ( PMLR ) , 2020 . Han Xiao , Kashif Rasul , and Roland Vollgraf . Fashion-mnist : a novel image dataset for benchmarking machine learning algorithms . Zalando SE , 2017 . A APPENDIX A.1 DIRICHLET-BASED UNCERTAINTY MODELS In this section , we provide details on the losses used by each DBU model . PostNet uses a Bayesian loss which can be expressed as follows : LPostNet = 1 N ∑ i Eq ( p ( i ) ) [ CE ( p ( i ) , y ( i ) ) ] −H ( q ( i ) ) ( 3 ) where CE denotes the cross-entropy . Both the expectation term ( i.e . Eq ( p ( i ) ) [ CE ( p ( i ) , y ( i ) ) ] ) and the entropy term ( i.e . H ( q ( i ) ) ) can be computed in closed-form ( Charpentier et al. , 2020 ) . PriorNet uses a loss composed of two KL divergence terms for ID and OOD data : LPriorNet = 1 N ∑ x ( i ) ∈ID data [ KL [ Dir ( αID ) ||q ( i ) ] ] + ∑ x ( i ) ∈OODdata [ KL [ Dir ( αOOD ) ||q ( i ) ] ] . ( 4 ) Both KL divergences terms can be computed in closed-form ( Malinin & Gales , 2019 ) . The precision αID and αOOD are hyper-parameters . The precision αID is usually set to 1e1 for the correct class and 1 otherwise . The precision αOOD is usually set to 1 . DDNet uses use the Dirichlet likelihood of soft labels produce by an ensemble of M neural networks : LDDNet = − 1 N ∑ i M∑ m=1 [ ln q ( i ) ( πim ) ] ( 5 ) where πim denotes the soft-label of mth neural network . The Dirichlet likelihood can be computed in closed-form ( Malinin et al. , 2019 ) . EvNet uses the expected mean square error between the one-hot encoded label and the predicted categorical distribution : LEvNet = 1 N ∑ i Ep ( i ) ∼Dir ( α ( i ) ) ||y ∗ ( i ) −p ( i ) ||2 ( 6 ) where y∗ ( i ) denotes the one-hot encoded label . The expected MSE loss can also be computed in closed form ( Sensoy et al. , 2018 ) . For more details please have a look at the original paper on PriorNet ( Malinin & Gales , 2018a ) , PostNet ( Charpentier et al. , 2020 ) , DDNet ( Malinin & Gales , 2019 ) and EvNet ( Sensoy et al. , 2018 ) . A.2 CLOSED-FORM COMPUTATION OF UNCERTAINTY MEASURES & UNCERTAINTY ATTACKS Dirichlet-based uncertainty models allow to compute several uncertainty measures in closed form ( see ( Malinin & Gales , 2018a ) for a derivation ) . As proposed by Malinin & Gales ( 2018a ) , we use precision mα0 , differential entropy mdiffE and mutual information mMI to estimate uncertainty on predictions . The differential entropy mdiffE of a DBU model reaches its maximum value for equally probable categorical distributions and thus , a on flat Dirichlet distribution . It is a measure for distributional uncertainty and expected to be low on ID data , but high on OOD data . mdiffE = K∑ c ln Γ ( αc ) − ln Γ ( α0 ) − K∑ c ( αc − 1 ) · ( Ψ ( αc ) −Ψ ( α0 ) ) ( 7 ) where α are the parameters of the Dirichlet-distribution , Γ is the Gamma function and Ψ is the Digamma function . The mutual information mMI is the difference between the total uncertainty ( entropy of the expected distribution ) and the expected uncertainty on the data ( expected entropy of the distribution ) . This uncertainty is expected to be low on ID data and high on OOD data . mMI = − K∑ c=1 αc α0 ( ln αc α0 −Ψ ( αc + 1 ) + Ψ ( α0 + 1 ) ) ( 8 ) Furthermore , we use the precision α0 to measure uncertainty , which is expected to be high on ID data and low on OOD data . mα0 = α0 = K∑ c=1 αc ( 9 ) As these uncertainty measures are computed in closed form and it is possible to obtain their gradients , we use them ( i.e . mdiffE , mMI , mα0 ) are target function of our uncertainty attacks . Changing the attacked target function allows us to use a wide range of gradient-based attacks such as FGSM attacks , PGD attacks , but also more sophisticated attacks such as Carlini-Wagner attacks . A.3 DETAILS OF THE EXPERIMENTAL SETUP Models . We trained all models with a similar based architecture . We used namely 3 linear layers for vector data sets , 3 convolutional layers with size of 5 + 3 linear layers for MNIST and the VGG16 Simonyan & Zisserman ( 2015 ) architecture with batch normalization for CIFAR10 . All the implementation are performed using Pytorch ( Paszke et al. , 2019 ) . We optimized all models using Adam optimizer . We performed early stopping by checking for loss improvement every 2 epochs and a patience of 10 . The models were trained on GPUs ( 1 TB SSD ) . We performed a grid-search for hyper-parameters for all models . The learning rate grid search was done in [ 1e−5 , 1e−3 ] . For PostNet , we used Radial Flows with a depth of 6 and a latent space equal to 6 . Further , we performed a grid search for the regularizing factor in [ 1e−7 , 1e−4 ] . For PriorNet , we performed a grid search for the OOD loss weight in [ 1 , 10 ] . For DDNet , we distilled the knowledge of 5 neural networks after a grid search in [ 2 , 5 , 10 , 20 ] neural networks . Note that it already implied a significant overhead at training compare to other models . Metrics . For all experiments , we focused on using AUC-PR scores since it is well suited to imbalance tasks ( Saito & Rehmsmeier , 2015 ) while bringing theoretically similar information than AUC-ROC scores ( Davis & Goadrich , 2006 ) . We scaled all scores from [ 0 , 1 ] to [ 0 , 100 ] . All results are average over 5 training runs using the best hyper-parameters found after the grid search . Data sets . For vector data sets , we use 5 different random splits to train all models . We split the data in training , validation and test sets ( 60 % , 20 % , 20 % ) . We use the segment vector data set Dua & Graff ( 2017 ) , where the goal is to classify areas of images into 7 classes ( window , foliage , grass , brickface , path , cement , sky ) . We remove class window from ID training data to provide OOD training data to PriorNet . Further , We remove the class ’ sky ’ from training and instead use it as the OOD data set for OOD detection experiments . Each input is composed of 18 attributes describing the image area . The data set contains 2 , 310 samples in total . We further use the Sensorless Drive vector data set Dua & Graff ( 2017 ) , where the goal is to classify extracted motor current measurements into 11 different classes . We remove class 9 from ID training data to provide OOD training data to PriorNet . We remove classes 10 and 11 from training and use them as the OOD dataset for OOD detection experiments . Each input is composed of 49 attributes describing motor behaviour . The data set contains 58 , 509 samples in total . Additionally , we use the MNIST image data set LeCun & Cortes ( 2010 ) where the goal is to classify pictures of hand-drawn digits into 10 classes ( from digit 0 to digit 9 ) . Each input is composed of a 1× 28× 28 tensor . The data set contains 70 , 000 samples . For OOD detection experiments , we use FashionMNIST Xiao et al . ( 2017 ) and KMNIST Clanuwat et al . ( 2018 ) containing images of Japanese characters and images of clothes , respectively . FashionMNIST was used as training OOD for PriorNet while KMNIST is used as OOD at test time . Finally , we use the CIFAR10 image data set Krizhevsky et al . ( 2009 ) where the goal is to classify a picture of objects into 10 classes ( airplane , automobile , bird , cat , deer , dog , frog , horse , ship , truck ) . Each input is a 3 × 32 × 32 tensor . The data set contains 60 , 000 samples . For OOD detection experiments , we use street view house numbers ( SVHN ) Netzer et al . ( 2011 ) and CIFAR100 ( Krizhevsky et al. , 2009 ) containing images of numbers and objects respectively . CIFAR100 was used as training OOD for PriorNet while SVHN is used as OOD at test time . Perturbations . For all label and uncertainty attacks , we used Fast Gradient Sign Methods and Project Gradient Descent . We tried 6 different radii [ 0.0 , 0.1 , 0.2 , 0.5 , 1.0 , 2.0 , 4.0 ] . These radii operate on the input space after data normalization . We bound perturbations by L∞-norm or by L2-norm , with L∞ ( x ) = max i=1 , ... , D |xi| and L2 ( x ) = ( D∑ i=1 x2i ) 0.5 . ( 10 ) For L∞-norm it is obvious how to relate perturbation size ε with perturbed input images , because all inputs are standardized such that the values of their features are between 0 and 1 . A perturbation of size ε = 0 corresponds to the original input , while a perturbation of size ε = 1 corresponds to the whole input space and allows to change all features to any value . For L2-norm the relation between perturbation size ε and perturbed input images is less obvious . To justify our choice for ε w.r.t . this norm , we relate perturbations size ε2 corresponding to L2-norm with perturbations size ε∞ corresponding to L∞-norm . First , we compute ε2 , such that the L2-norm is the smallest super-set of the L∞-norm . Let us consider a perturbation of ε∞ . The largest L2-norm would be obtained if each feature is perturbed by ε∞ . Thus , perturbation ε2 , such that L2 encloses L∞ is ε2 = ( ∑D i=1 ε 2 ∞ ) 0.5 = √ Dε∞ . For the MNIST-data set , with D = 28× 28 input features L2-norm with ε2 = 28 encloses L∞-norm with ε∞ = 1 . Alternatively , ε2 can be computes such that the volume spanned by L2-norm is equivalent to the one spanned by L∞-norm . Using that the volume spanned by L∞-norm is εD∞ and the volume spanned by L2-norm is π0.5DεD2 Γ ( 0.5D+1 ) ( where Γ is the Gamma-function ) , we obtain volume equivalence if ε2 = Γ ( 0.5D + 1 ) 1 D √ πε∞ . For the MNIST-data set , with D = 28× 28 input features L2-norm with ε2 ≈ 21.39 is volume equivalent to L∞-norm with ε∞ = 1 . A.4 ADDITIONAL EXPERIMENTS Table 7 and 8 illustrate that no DBU model maintains high accuracy under gradient-based label attacks . Accuracy under PGD attacks decreases more than under FGSM attacks , since PGD is stronger . Interestingly Noise attacks achieve also good performances with increasing Noise standard deviation . Note that the attack is not constraint to be with a given radius for Noise attacks . On non-perturbed data uncertainty estimates are an indicator of correctly classified samples , but if the input data is perturbed none of the DBU models maintains its high performance . Thus , uncertainty estimates are not a robust indicator of correctly labeled inputs . better results when they are attacked by FGSM-attacks ( Table 13 ) , but as FGSM attacks provide much weaker adversarial examples than PGD attacks , this can not be seen as real advantage . Can we use uncertainty estimates to detect attacks against the classification decision ? PGD attacks do not explicitly consider uncertainty during the computation of adversarial examples , but they seem to provide perturbed inputs with similar uncertainty as the original input . A.5 ROBUST TRAINING FOR DBU MODELS & ID/OOD VERIFICATION Table 5 and 29 on adversarial training illustrate that there is a jump between ID-verification and OOD-verification , where robustness on ID data drops while robustness on OOD data increases . These jumps are observed for each model and each training ( normal , noise-based , adversarial with label attacks , adversarial with uncertainty attacks ) . Thus , either ID-verification or OOD-verification perform well , depending on the chosen threshold . In contrast to that , adversarial training improves robustness w.r.t . the predicted class label for most pair model/data set ( Fig . 7 , 32 ) . The following Figures visualize the differential entropy distribution for ID data and OOD data for all models with standard training . We used label attacks and uncertainty attacks for CIFAR10 and MNIST . Thus , they show how well the DBU models separate on clean and perturbed ID data and OOD data . Figures 4 and 5 visualizes the differential entropy distribution of ID data and OOD data under label attacks . On CIFAR10 , PriorNet and DDNet can barely distinguish between clean ID and OOD data . We observe a better ID/OOD distinction for PostNet and EvNet for clean data . However , we do not observe for any model an increase of the uncertainty estimates on label attacked data . Even worse , PostNet , PriorNet and DDNet seem to assign higher confidence on class label attacks . On MNIST , models show a slightly better behavior . They are capable to assign a higher uncertainty to label attacks up to some attack radius . Figures 6 , 7 , 8 and 9 visualizes the differential entropy distribution of ID data and OOD data under uncertainty attacks . For both CIFAR10 and MNIST data sets , we observed that uncertainty estimations of all models can be manipulated . That is , OOD uncertainty attacks can shift the OOD uncertainty distribution to more certain predcitions , and ID uncertainty attacks can shift the ID uncertainty distribution to less certain predictions .
The paper focuses on quantifying uncertainty for classification problems using Dirichlet based uncertainty (DBU) estimation techniques. The authors study these techniques for their robustness properties under adversarial attacks, proposes a novel attack type targeting uncertainty estimates through differential entropy, and investigates robust training for detecting in and out of distribution data points. Experiments using image datasets showed that uncertainty from DBU models 1) do not provide robust identification of correct predictions under adversarial attacks, 2) are only able to detect weak attacks and do not perform well under strong attacks, 3) robust training does not guarantee generalization to both in and out of distribution datasets.
SP:d856b17ff19142ea30fcb687ee8a911b135fc3f5
Later Span Adaptation for Language Understanding
Pre-trained contextualized language models ( PrLMs ) broadly use fine-grained tokens ( words or sub-words ) as minimal linguistic units in the pre-training phase . Introducing span-level information in pre-training has shown capable of further enhancing PrLMs . However , such methods require enormous resources and lack adaptivity due to huge computational requirements from pre-training . Instead of too early fixing the linguistic unit input as nearly all previous work did , we propose a novel method that combines span-level information into the representations generated by PrLMs during the fine-tuning phase for better flexibility . In this way , the modeling procedure of span-level texts can be more adaptive to different downstream tasks . In detail , we divide the sentence into various span components according to the segmentation generated by a pre-sampled dictionary . Based on the sub-token-level representation provided by PrLMs , we bridge the connection between the tokens in each span and yield an accumulated representation with enhanced span-level information . Experiments on the GLUE benchmark show that our approach remarkably improves the performance of PrLMs in various natural language understanding tasks . 1 INTRODUCTION . Pre-trained contextualized language models ( PrLMs ) such as BERT ( Devlin et al. , 2018 ) , XLNet ( Yang et al. , 2019 ) , ELECTRA ( Clark et al. , 2020 ) have led to strong performance gains in downstream natural language understanding ( NLU ) tasks . Such models ’ impressive power to generate effective contextualized representations is established by using well-designed selfsupervised training on a large text corpus . Taking BERT as an example , the model used Masked Language Modeling ( MLM ) and Nest Sentence Prediction ( NSP ) as pre-training objects and was trained on a corpus of 3.3 billion words . PrLMs commonly generate fine-grained representations , i.e. , subword-level embeddings , to adapt to broad applications . Different downstream tasks sometimes require representations with different granularity . For example , sentence-level tasks such as natural language inference ( Bowman et al. , 2015 ; Nangia et al. , 2017 ) , demand an overall sentence-level analysis to predict the relationships between each sentence . There are also token-level tasks , including question answering and named entity recognition , which require models to generate fine-grained output at the token level ( Rajpurkar et al. , 2016b ; Sang & De Meulder , 2003 ) . Therefore , the representations provided by PrLMs are finegrained ( word or sub-word ) , which can be easily recombined to representations at any granularity , and applied to various downstream tasks without substantial task-specific modifications . Besides fine-grained tokens and sentences , coarse-grained span-level language units such as phrases , name entities are also essential for NLU tasks . Previous works indicate that the capability to capture span-level information can be enhanced by altering pre-training objectives . SpanBERT ( Joshi et al. , 2019 ) extends BERT by masking and predicting text spans rather than a single token for pre-training . ERNIE models ( Sun et al. , 2019 ; Zhang et al. , 2019a ) employ entity level masking as a strategy for pre-training . StructBERT ( Wang et al. , 2019 ) encourages PrLMs to incorporate span-level structural information by adding trigram de-shuffling as a new pre-training objective . The methods mentioned above show that the incorporation of span-level information in the pre-training phase is effective for various downstream NLU tasks . However , since different downstream tasks have different requirements for span-level information , the strategy of incorporating span-level information in pre-training might not be suitable for all downstream tasks . For example , by leveraging entity level masking strategy in pre-training , ERNIE models ( Sun et al. , 2019 ; Zhang et al. , 2019a ) achieve remarkable gain in entity typing and Relation Classification , but when it comes to language inference tasks like MNLI ( Nangia et al. , 2017 ) , its performance is even worse than BERT . Therefore , incorporating span-level information more flexibly and more universally , is imperatively necessary . The representations generated by PrLMs are supposed to be widely applicable for general cases ; meanwhile , they are also expected to be flexibly adapted to various specific downstream tasks . Thus introducing span-level clues in a good timing matters a lot . In this paper , we propose a novel method , Later Span Adaptapan ( LaSA ) , that would enhance the use of span-level information in a task-specific fine-tuning manner , which is lighter and more adaptive compared to existing methods . In this work , based on the fine-grained representation generated by BERT , a computationally motivated segmentation is applied to further enhance the utilization of span-level information . Previous work has used semantic role labeling ( SRL ) ( Zhang et al. , 2019b ) or dependency parsing ( Zhou et al. , 2019 ) as auxiliary segmentation tools . Nevertheless , these methods require extra parsing procedure , which reduces the simplicity of use . In our method , the segmentation is obtained according to a pre-sampled n-gram dictionary . The fine-grained representation in the same span within the segmentation is aggregated to a span-level representation . On this basis , the span-level representations are further integrated to generate a sentence-level representation to make the most of both fine-grained and span-level information . We conduct the experiments and analysis on the GLUE benchmark ( Wang et al. , 2018 ) , which contain various NLU tasks , including natural language inference , semantic similarity , and text classification . Empirical results show that our method can enhance the performance of PrLMs to the same degree as altering the pre-training objectives , but more simply and adaptively . Ablation studies and analysis verify that the introduced method is essential to the further performance improvement . 2 RELATED WORK . 2.1 PRE-TRAINED LANGUAGE MODELS . Learning reliable and broadly applicable word representations has long been a prosperous topic for the NLP community . Language modeling objectives are shown effective for generating satisfying distributed representation ( Mnih & Hinton , 2009 ) . By leveraging neural network and large text corpus , Mikolov et al . ( 2013 ) and Pennington et al . ( 2014 ) achieve to train widely applicable word embeddings in an unsupervised manner . ELMo ( Peters et al. , 2018 ) further advances state of the art for various downstream NLU tasks by generating deep contextualized word representations . Equipped with Transformer ( Vaswani et al. , 2017 ) , GPT ( Radford et al. , 2018 ) and BERT ( Devlin et al. , 2018 ) further explore transfer learning , where models are firstly pre-trained on a large corpus and then applied to downstream tasks in a fine-tuning manner . Recent PrLMs extends BERT in multiple ways , including using permutation language model ( Yang et al. , 2019 ) , training on a larger corpus and using more efficient parameters ( Liu et al. , 2019b ) , leveraging parameter sharing strategy ( Lan et al. , 2019 ) , employing GAN-style architecture ( Clark et al. , 2020 ) . T5 ( Raffel et al. , 2019 ) further explores the limit of transfer learning by conducting exhaustive experiments . 2.2 COARSE-GRAINED PRE-TRAINING METHODS . Previous works indicate that the incorporation of coarse-grained information in pre-training can enhance the performance of the PrLMs . Initially , BERT uses the prediction of single masked tokens as one of the pre-training objectives . Since BERT uses WordPiece embeddings ( Wu et al. , 2016 ) , sentences are tokenized into the sub-word level so that the masked token can be a sub-word token such as ” # # ing ” . Devlin et al . ( 2018 ) then points out that instead of masking a single token , using “ whole word masking ” strategy can further improve BERT ’ s performance . After that , ( Sun et al. , 2019 ; Zhang et al. , 2019a ) verify that PrLMs can benefit from entity-level masking strategy in pretraining . In SpanBERT ( Joshi et al. , 2019 ) , the model can better represent and predict spans of text by masking random contiguous spans in pre-training . Recently , by making use of both fine-grained and coarse-grained tokenization , AMBERT ( Zhang & Li , 2020 ) outperforms its precursor in various NLU tasks . All these works focus on encouraging PrLMs to incorporate coarse-grained information . To the best of our knowledge , incorporating coarse-grained information in fine-tuning is still a white space , which makes our work a valuable attempt . 2.3 INTEGRATION OF FINE-GRAINED REPRESENTATION . Different formats of downstream tasks require sentence-level representations , such as natural language inference ( Bowman et al. , 2015 ; Nangia et al. , 2017 ) , semantic textual similarity ( Cer et al. , 2017 ) and sentiment classification ( Socher et al. , 2013 ) . Besides directly pre-training the representation of coarser granularity ( Le & Mikolov , 2014 ; Logeswaran & Lee , 2018 ) , a lot of methods have been explored to obtain a task-specific sentence-level representation by integrating fine-grained token-level representations ( Conneau et al. , 2017 ) . Kim ( 2014 ) shows that by applying a convolutional neural network ( CNN ) on top of pre-trained word vectors , we can get a sentencelevel representation that is well adapted to classification tasks . Lin et al . ( 2017 ) leverage a selfattentive module over hidden states of a BiLSTM to generate sentence-level representations . Zhang et al . ( 2019b ) use a CNN layer to extract word-level representations form sub-word representations and combine them with word-level semantic role representations . Inspired by these methods , after a series of preliminary attempts , we choose a hierarchical CNN architecture to recombine fine-grained representations to coarse-grained ones . 3 METHODOLOGY . Figure 1 shows the overview of the framework of our method , which is primarily based on BERT and leverages segmentation as an auxiliary tool . We do not exhaustively illustrate the details of BERT , given the ubiquitousness of the architecture . Further information on BERT is available in Devlin et al . ( 2018 ) . An input sentence is tokenized to the sub-word level and passed to BERT to obtain the fine-grained representation . In the meantime , the segmentation components of the very input sentence is generated according to a pre-sampled n-gram dictionary . Then , we incorporate the segmentation into the fine-grained representation provided by BERT and divide the representation into several spans . After passing the spans through a hierarchical CNN module , we can obtain a coarse-grained enhanced representation . Eventually , the fine-grained representation of [ CLS ] token provided by BERT and the coarse-grained information enhanced representation are concatenated to form the final representation that makes the most of multi-grained information for downstream tasks . 3.1 SENTENCE SEGMENTATION . Previous works use semantic role labeling ( SRL ) ( Zhang et al. , 2019b ) and dependency parsing ( Zhou et al. , 2019 ) as auxiliary segmentation tools . Nevertheless , these methods require extra parsing procedure , which reduces the simplicity of use . To get a reasonable segmentation in a simpler and more convenient manner , we sample meaningful n-grams that occurred in the wikitext103 dataset based on frequency1 and obtain a pre-sampled dictionary . For a given input sentence , we use the pre-sampled dictionary to locate matching n-grams from the start of the sentence . Longer n-grams are prioritized during the matching procedure . Unmatched tokens would be kept as they are , by doing so , we can obtain a segmentation of the sentence . Figure 2 shows several segmentation examples of the sentences from the GLUE dataset .
This paper presents an approach to incorporate span information in pre-trained language models like BERT during fine-tuning. In the proposed approach, the segmentation of a sentence is obtained according to a pre-sampled n-gram dictionary. The fine-grained representation in a same span within the segmentation is aggregated to a span-level representation using a CNN model. These span-level representations are further aggregated using a CNN model to generate sentence-level representation. The experiments show that the proposed model can achieve similar performance gain as other span-based language models which includes span information during pre-training.
SP:f70037a4e9a9be5eeedca1384b11aeb11ae248f6
Later Span Adaptation for Language Understanding
Pre-trained contextualized language models ( PrLMs ) broadly use fine-grained tokens ( words or sub-words ) as minimal linguistic units in the pre-training phase . Introducing span-level information in pre-training has shown capable of further enhancing PrLMs . However , such methods require enormous resources and lack adaptivity due to huge computational requirements from pre-training . Instead of too early fixing the linguistic unit input as nearly all previous work did , we propose a novel method that combines span-level information into the representations generated by PrLMs during the fine-tuning phase for better flexibility . In this way , the modeling procedure of span-level texts can be more adaptive to different downstream tasks . In detail , we divide the sentence into various span components according to the segmentation generated by a pre-sampled dictionary . Based on the sub-token-level representation provided by PrLMs , we bridge the connection between the tokens in each span and yield an accumulated representation with enhanced span-level information . Experiments on the GLUE benchmark show that our approach remarkably improves the performance of PrLMs in various natural language understanding tasks . 1 INTRODUCTION . Pre-trained contextualized language models ( PrLMs ) such as BERT ( Devlin et al. , 2018 ) , XLNet ( Yang et al. , 2019 ) , ELECTRA ( Clark et al. , 2020 ) have led to strong performance gains in downstream natural language understanding ( NLU ) tasks . Such models ’ impressive power to generate effective contextualized representations is established by using well-designed selfsupervised training on a large text corpus . Taking BERT as an example , the model used Masked Language Modeling ( MLM ) and Nest Sentence Prediction ( NSP ) as pre-training objects and was trained on a corpus of 3.3 billion words . PrLMs commonly generate fine-grained representations , i.e. , subword-level embeddings , to adapt to broad applications . Different downstream tasks sometimes require representations with different granularity . For example , sentence-level tasks such as natural language inference ( Bowman et al. , 2015 ; Nangia et al. , 2017 ) , demand an overall sentence-level analysis to predict the relationships between each sentence . There are also token-level tasks , including question answering and named entity recognition , which require models to generate fine-grained output at the token level ( Rajpurkar et al. , 2016b ; Sang & De Meulder , 2003 ) . Therefore , the representations provided by PrLMs are finegrained ( word or sub-word ) , which can be easily recombined to representations at any granularity , and applied to various downstream tasks without substantial task-specific modifications . Besides fine-grained tokens and sentences , coarse-grained span-level language units such as phrases , name entities are also essential for NLU tasks . Previous works indicate that the capability to capture span-level information can be enhanced by altering pre-training objectives . SpanBERT ( Joshi et al. , 2019 ) extends BERT by masking and predicting text spans rather than a single token for pre-training . ERNIE models ( Sun et al. , 2019 ; Zhang et al. , 2019a ) employ entity level masking as a strategy for pre-training . StructBERT ( Wang et al. , 2019 ) encourages PrLMs to incorporate span-level structural information by adding trigram de-shuffling as a new pre-training objective . The methods mentioned above show that the incorporation of span-level information in the pre-training phase is effective for various downstream NLU tasks . However , since different downstream tasks have different requirements for span-level information , the strategy of incorporating span-level information in pre-training might not be suitable for all downstream tasks . For example , by leveraging entity level masking strategy in pre-training , ERNIE models ( Sun et al. , 2019 ; Zhang et al. , 2019a ) achieve remarkable gain in entity typing and Relation Classification , but when it comes to language inference tasks like MNLI ( Nangia et al. , 2017 ) , its performance is even worse than BERT . Therefore , incorporating span-level information more flexibly and more universally , is imperatively necessary . The representations generated by PrLMs are supposed to be widely applicable for general cases ; meanwhile , they are also expected to be flexibly adapted to various specific downstream tasks . Thus introducing span-level clues in a good timing matters a lot . In this paper , we propose a novel method , Later Span Adaptapan ( LaSA ) , that would enhance the use of span-level information in a task-specific fine-tuning manner , which is lighter and more adaptive compared to existing methods . In this work , based on the fine-grained representation generated by BERT , a computationally motivated segmentation is applied to further enhance the utilization of span-level information . Previous work has used semantic role labeling ( SRL ) ( Zhang et al. , 2019b ) or dependency parsing ( Zhou et al. , 2019 ) as auxiliary segmentation tools . Nevertheless , these methods require extra parsing procedure , which reduces the simplicity of use . In our method , the segmentation is obtained according to a pre-sampled n-gram dictionary . The fine-grained representation in the same span within the segmentation is aggregated to a span-level representation . On this basis , the span-level representations are further integrated to generate a sentence-level representation to make the most of both fine-grained and span-level information . We conduct the experiments and analysis on the GLUE benchmark ( Wang et al. , 2018 ) , which contain various NLU tasks , including natural language inference , semantic similarity , and text classification . Empirical results show that our method can enhance the performance of PrLMs to the same degree as altering the pre-training objectives , but more simply and adaptively . Ablation studies and analysis verify that the introduced method is essential to the further performance improvement . 2 RELATED WORK . 2.1 PRE-TRAINED LANGUAGE MODELS . Learning reliable and broadly applicable word representations has long been a prosperous topic for the NLP community . Language modeling objectives are shown effective for generating satisfying distributed representation ( Mnih & Hinton , 2009 ) . By leveraging neural network and large text corpus , Mikolov et al . ( 2013 ) and Pennington et al . ( 2014 ) achieve to train widely applicable word embeddings in an unsupervised manner . ELMo ( Peters et al. , 2018 ) further advances state of the art for various downstream NLU tasks by generating deep contextualized word representations . Equipped with Transformer ( Vaswani et al. , 2017 ) , GPT ( Radford et al. , 2018 ) and BERT ( Devlin et al. , 2018 ) further explore transfer learning , where models are firstly pre-trained on a large corpus and then applied to downstream tasks in a fine-tuning manner . Recent PrLMs extends BERT in multiple ways , including using permutation language model ( Yang et al. , 2019 ) , training on a larger corpus and using more efficient parameters ( Liu et al. , 2019b ) , leveraging parameter sharing strategy ( Lan et al. , 2019 ) , employing GAN-style architecture ( Clark et al. , 2020 ) . T5 ( Raffel et al. , 2019 ) further explores the limit of transfer learning by conducting exhaustive experiments . 2.2 COARSE-GRAINED PRE-TRAINING METHODS . Previous works indicate that the incorporation of coarse-grained information in pre-training can enhance the performance of the PrLMs . Initially , BERT uses the prediction of single masked tokens as one of the pre-training objectives . Since BERT uses WordPiece embeddings ( Wu et al. , 2016 ) , sentences are tokenized into the sub-word level so that the masked token can be a sub-word token such as ” # # ing ” . Devlin et al . ( 2018 ) then points out that instead of masking a single token , using “ whole word masking ” strategy can further improve BERT ’ s performance . After that , ( Sun et al. , 2019 ; Zhang et al. , 2019a ) verify that PrLMs can benefit from entity-level masking strategy in pretraining . In SpanBERT ( Joshi et al. , 2019 ) , the model can better represent and predict spans of text by masking random contiguous spans in pre-training . Recently , by making use of both fine-grained and coarse-grained tokenization , AMBERT ( Zhang & Li , 2020 ) outperforms its precursor in various NLU tasks . All these works focus on encouraging PrLMs to incorporate coarse-grained information . To the best of our knowledge , incorporating coarse-grained information in fine-tuning is still a white space , which makes our work a valuable attempt . 2.3 INTEGRATION OF FINE-GRAINED REPRESENTATION . Different formats of downstream tasks require sentence-level representations , such as natural language inference ( Bowman et al. , 2015 ; Nangia et al. , 2017 ) , semantic textual similarity ( Cer et al. , 2017 ) and sentiment classification ( Socher et al. , 2013 ) . Besides directly pre-training the representation of coarser granularity ( Le & Mikolov , 2014 ; Logeswaran & Lee , 2018 ) , a lot of methods have been explored to obtain a task-specific sentence-level representation by integrating fine-grained token-level representations ( Conneau et al. , 2017 ) . Kim ( 2014 ) shows that by applying a convolutional neural network ( CNN ) on top of pre-trained word vectors , we can get a sentencelevel representation that is well adapted to classification tasks . Lin et al . ( 2017 ) leverage a selfattentive module over hidden states of a BiLSTM to generate sentence-level representations . Zhang et al . ( 2019b ) use a CNN layer to extract word-level representations form sub-word representations and combine them with word-level semantic role representations . Inspired by these methods , after a series of preliminary attempts , we choose a hierarchical CNN architecture to recombine fine-grained representations to coarse-grained ones . 3 METHODOLOGY . Figure 1 shows the overview of the framework of our method , which is primarily based on BERT and leverages segmentation as an auxiliary tool . We do not exhaustively illustrate the details of BERT , given the ubiquitousness of the architecture . Further information on BERT is available in Devlin et al . ( 2018 ) . An input sentence is tokenized to the sub-word level and passed to BERT to obtain the fine-grained representation . In the meantime , the segmentation components of the very input sentence is generated according to a pre-sampled n-gram dictionary . Then , we incorporate the segmentation into the fine-grained representation provided by BERT and divide the representation into several spans . After passing the spans through a hierarchical CNN module , we can obtain a coarse-grained enhanced representation . Eventually , the fine-grained representation of [ CLS ] token provided by BERT and the coarse-grained information enhanced representation are concatenated to form the final representation that makes the most of multi-grained information for downstream tasks . 3.1 SENTENCE SEGMENTATION . Previous works use semantic role labeling ( SRL ) ( Zhang et al. , 2019b ) and dependency parsing ( Zhou et al. , 2019 ) as auxiliary segmentation tools . Nevertheless , these methods require extra parsing procedure , which reduces the simplicity of use . To get a reasonable segmentation in a simpler and more convenient manner , we sample meaningful n-grams that occurred in the wikitext103 dataset based on frequency1 and obtain a pre-sampled dictionary . For a given input sentence , we use the pre-sampled dictionary to locate matching n-grams from the start of the sentence . Longer n-grams are prioritized during the matching procedure . Unmatched tokens would be kept as they are , by doing so , we can obtain a segmentation of the sentence . Figure 2 shows several segmentation examples of the sentences from the GLUE dataset .
Previous works reveal that span-level information can enhance the performance of PrLMs if they are used in pre-training. However, the existing methods require enormous resources and lack adaptivity. To this end, the paper proposes a method that combines span-level information into the representations generated by PrLMs during the fine-tuning phase. To combine span-level information, the paper first breaks a sentence into various span components. Then, an accumulated representation with enhanced span-level information is built based on the sub-token-level representation provided by PrLMs. The experimental results on the GLUE benchmark show that the proposed method improves the performance of PrLMs. The main contribution of this paper is the introduction of generating the span components via a pre-sampled dictionary. Overall, the proposed method is not novel since similar methods or ideas have been widely used in NPL.
SP:f70037a4e9a9be5eeedca1384b11aeb11ae248f6
On Flat Minima, Large Margins and Generalizability
1 INTRODUCTION . Understanding under which conditions a neural network will generalize from seen to unseen data is crucial , as it motivates design choices and principles which can greatly improve performance . Complexity or generalization measures are used to quantify the properties of a neural network which lead to good generalization . Currently however , established complexity measures such as VC-Dimension ( Vapnik , 1998 ) or Rademacher Complexity ( Bartlett & Mendelson , 2002 ) do not correlate with the generalizability of neural networks ( e.g . see Zhang et al . ( 2016 ) ) . Hence many recommendations , such as reducing model complexity , early stopping , or adding explicit regularization are also not applicable or necessary anymore . Therefore , there is an ongoing effort to devise new complexity measures that may guide recommendations on how to obtain models that generalize well . A popular approach is to consider the flatness of the loss surface around a neural network . Hochreiter & Schmidhuber ( 1997 ) used the minimum description length ( MDL ) argument of Hinton & Van Camp ( 1993 ) to claim that the flatness of a minimum can also be used as a generalization measure . Motivated by this new measure Hochreiter & Schmidhuber ( 1997 ) , and more recently Chaudhari et al . ( 2019 ) , developed algorithms with explicit regularization intended to converge to flat solutions . Keskar et al . ( 2016 ) then presented empirical evidence that flatness relates to improved generalizability and used it to explain the behavior of stochastic gradient descent ( SGD ) with large and small-batch sizes . Other works since have empirically corroborated that flatter minima generalize better ( e.g . Jiang et al . ( 2019 ) ; Li et al . ( 2018 ) ; Bosman et al . ( 2020 ) ) . There are however various issues that are still unresolved , which makes using flatness for constructing practical deep learning recommendations difficult . For one , flatness is computationally expensive to compute . The most common way to compute the flatness is via the Hessian , which grows quadratically in the number of parameters ; this becomes too large when used with modern networks containing millions of parameters . It is also not clear to what extent flatness is a true measure of generalizability , capable of discerning which neural network will or will not generalize . Dinh et al . ( 2017 ) showed that reparametrizations affect flatness and a flat model can be made arbitrarily sharp without changing any of its generalization properties . In addition Probably Approximately Correct ( PAC-Bayes ) bounds that bound the generalizability in terms of the flatness are also either affected by rescaling , impossible to evaluate or loose ( Neyshabur et al. , 2017 ; Arora et al. , 2018 ; Petzka et al. , 2020 ) . While there have been solutions attempting to prevent issues around reparametrization ( Liang et al. , 2019 ; Tsuzuku et al. , 2019 ) , it remains to establish whether flatness is an epiphenomenon of stochastic gradient descent or other complexity measures as Achille et al . ( 2018 ) and Jastrzebski et al . ( 2018 ) are suggesting . This motivates investigating possible correlations to more well-understood measures of generalization that may help alleviate issues surrounding flat minima , while allowing flat minima to be used when appropriate . In this paper we will demonstrate a correlation to classification margins , which are a well-understood generalization measure . Margins represent the linearized distance to the decision boundaries of the classification region ( Elsayed et al. , 2018 ) . An immediate consequence of such a relationship is that to assess generalizability , we could now simply use a computationally cheap and more robust margin based complexity measure . Our contributions will demonstrate further practical implications of the relationship between margins and flatness which open doors to valuable future work such as a better understanding of why and when a model generalizes and more principled algorithm design . • We prove that under certain conditions flatness and margins are strongly correlated . We do so by deriving the Hessian trace for the affine classifier . Based on its form , we derive an expression in terms of classification margins which we show correlates well with the Hessian trace , with increasing training accuracy for various neural network architectures . By being able relate the two complexity measures , we are now able to provide various practical recommendations , and offer different perspectives on phenomena that may not be explainable without such a view . These are shown in the following contributions . • We use our insight to replace the misleading folklore that , unlike large-batch methods , small-batch methods are able to escape sharp minima ( Keskar et al. , 2016 ) . We instead employ a margin perspective and use our empirical results along with recent results by Banburski et al . ( 2019 ) and Hoffer et al . ( 2017 ) to argue that a large batch method was unable to train long enough to maximize the margins . With our explanation , we help reframe the small and large-batch discussion and build further intuition . • We show that once a neural network is able to correctly predict the label of every element in the training set it can be made arbitrarily flat by scaling the last layer . We are motivated by the relationship to margins which suffer from the same issue . We highlight this scaling issue because , in some instances , it may still be beneficial for algorithm design to be guided by convergence to flat regions . Hence , we need to account for scaling issues which make it difficult to use flatness to assess whether a network generalizes better than another . Other works have made connections between flatness and well-behaved classification margins via visualizations ( see Huang et al . ( 2019 ) ; Wang et al . ( 2018 ) ) , but they have not demonstrated a quantifiable relationship . Further work has used both the classification margins and flatness to construct PAC-Bayes bounds ( Neyshabur et al. , 2017 ; Arora et al. , 2018 ) , and have related flatness to increased robustness ( Petzka et al. , 2020 ; Borovykh et al. , 2019 ) however they did not show when and to what extent these quantities are related . We structure the paper as follows . In Section 2 , we discuss both our notation and our motivation choosing the cross-entropy loss and the Hessian trace as the flatness measure and provide further background on the classification margins . In Section 3 , we present our contribution showing a strong correlation between the margins and flatness by deriving . In Section 4 , we combine recent results based on classification margins to offer a different perspective on the misleading folklore on why larger-batch methods generalize worse . In Section 5 , we highlight that networks can be made arbitrarily flat . Lastly , we offer our thoughts and future work in the Section 6 . 2 PROBLEM SETTING . We first define the basic notation that we use for a classification task . We let X represent the input space and Y = { 1 , ... , C } the output space where C are the number of possible classes . The network architecture is given by φ : Θ × X → R|Y| where Θ is the corresponding parameter space . We measure the performance of a parameter vector by defining some loss function ` : RC × Y → R. If we have have a joint probability distribution D relating input and output space then we would like to minimize the expected loss LD ( θ ) = E ( x , y ) ∼D [ ` ( φ ( θ , x ) , y ) ] . Since we usually only have access to some finite dataset D , we denote the empirical loss by L̃D ( θ ) = 1|D| ∑|D| i=1 ` ( φ ( θ , xi ) , yi ) . If LD and L̃D are close , then we would say a model generalizes well , as we were able to train on a finite dataset and extrapolate to the true distribution . We will use the cross-entropy loss which is given by ` ( φ ( θ , x ) , y ) = − log ( Sy ( φ ( θ , x ) ) ) where the softmax function S : RC → RC is given by S ( a ) i = eai∑C j=1 e aj ( see Goodfellow et al . ( 2016 ) ) . The choice of the cross-entropy function as the loss function has a significant impact on how the flatness measure behaves . Unlike the multiclass mean squared error ( MMSE ) , exponential type losses such as the cross-entropy loss on neural networks have been shown to include implicit regularization which leads to margin maximizing solutions for neural networks ( Banburski et al. , 2019 ) . Also , various properties for flat minima which have been proven for the MMSE loss by Mulayoff & Michaeli are not applicable to the cross-entropy loss , further highlighting the fundamental differences between the loss functions . While the MMSE loss has shown some promise for many classification tasks ( Hui & Belkin , 2020 ) the cross-entropy loss is still the loss which is most used and was primarily used for the empirical evidence around flat minima ( Keskar et al. , 2016 ; Chaudhari et al. , 2019 ) , which motivates our choice . The qualitative description of a flat region was given by Hochreiter & Schmidhuber ( 1997 ) as “ a large connected region in parameter space where the error remains approximately constant '' . We measure the flatness by the trace of the Hessian of the loss with respect to the parameters ( in short the Hessian trace ) denoted by Tr ( Hθ ( L̃D ( θ ) ) ( Dinh et al. , 2017 ) . Since the Hessian is symmetric , the Hessian trace is equivalent to the sum of its eigenvalues which for a fixed parameter space is proportional to the expected increase of the second order approximation of the loss around a fixed minimum θ in a random direction θ′ with θ′ ∼ N ( θ , I ) . Since we apply flatness arguments only close to minima , we assume that all eigenvalues are positive and that the Hessian trace is a good measure of flatness Sagun et al . ( 2017 ) . Even though the Hessian is only an approximation of flatness , the Hessian is often preferred as it allows us to reason about various directions in parameter space via its eigenvectors and eigenvalues ( see Sagun et al . ( 2017 ) ; Chaudhari et al . ( 2019 ) ) and alleviates the issue of infinitely long but sharp ridges making a minimum infinitely flat ( Dinh et al. , 2017 ; Freeman & Bruna , 2016 ) . The Hessian has also been linked to feature robustness via its use in the second order approximation of the loss ( e.g . Petzka et al . ( 2020 ) ; Borovykh et al . ( 2019 ) ) and is a promising quantity to relate to the margins . As we are working with non-linear functions it is intractable to compute exact distances to the decision boundary , therefore we use a measure which is related to the linearized distance as described in Elsayed et al . ( 2018 ) . Under this view , larger margins are better because the data is further from the decision boundary . Specifically , we define the margins as in Neyshabur et al . ( 2017 ) : for some vector v ∈ RC and label y we let the margin of v be γ ( v , y ) = |vy − maxj 6=y vj | . Since we use the margin in different contexts we define the output margins γ ( φ ( θ , x ) , y ) and the margins of the model output after the softmax layer γ ( S ( φ ( θ , x ) ) , y ) . Due to the intuition of margins relating to the regularity of the classification regions , they have been proven and shown to be a good generalization measure for linear networks ( Langford & Shawe-Taylor , 2003 ) and later for neural networks ( see Bartlett et al . ( 2017 ) ; Jiang et al . ( 2018 ; 2019 ) ) when correctly adjusted . Due to results by Banburski et al . ( 2019 ) and Soudry et al . ( 2018 ) , Poggio et al . ( 2019 ) claimed that a large part of the mystery around generalizability has been solved , since standard optimization methods are maximizing the margin instead of memorizing data .
The paper presents empirical evidence that the output margin - as a measure of the confidence of a multiclass predictor - is strongly correlated to the Hessian trace when using cross-entropy loss with softmax. Moreover, the paper presents a method for estimating the Hessian trace using the input norm and softmax output. This estimation is inspired by linear classifiers and shows a strong correlation with the Hessian trace.
SP:8bbf8ac04f86085bfff8c946e16ffcece6e4065e
On Flat Minima, Large Margins and Generalizability
1 INTRODUCTION . Understanding under which conditions a neural network will generalize from seen to unseen data is crucial , as it motivates design choices and principles which can greatly improve performance . Complexity or generalization measures are used to quantify the properties of a neural network which lead to good generalization . Currently however , established complexity measures such as VC-Dimension ( Vapnik , 1998 ) or Rademacher Complexity ( Bartlett & Mendelson , 2002 ) do not correlate with the generalizability of neural networks ( e.g . see Zhang et al . ( 2016 ) ) . Hence many recommendations , such as reducing model complexity , early stopping , or adding explicit regularization are also not applicable or necessary anymore . Therefore , there is an ongoing effort to devise new complexity measures that may guide recommendations on how to obtain models that generalize well . A popular approach is to consider the flatness of the loss surface around a neural network . Hochreiter & Schmidhuber ( 1997 ) used the minimum description length ( MDL ) argument of Hinton & Van Camp ( 1993 ) to claim that the flatness of a minimum can also be used as a generalization measure . Motivated by this new measure Hochreiter & Schmidhuber ( 1997 ) , and more recently Chaudhari et al . ( 2019 ) , developed algorithms with explicit regularization intended to converge to flat solutions . Keskar et al . ( 2016 ) then presented empirical evidence that flatness relates to improved generalizability and used it to explain the behavior of stochastic gradient descent ( SGD ) with large and small-batch sizes . Other works since have empirically corroborated that flatter minima generalize better ( e.g . Jiang et al . ( 2019 ) ; Li et al . ( 2018 ) ; Bosman et al . ( 2020 ) ) . There are however various issues that are still unresolved , which makes using flatness for constructing practical deep learning recommendations difficult . For one , flatness is computationally expensive to compute . The most common way to compute the flatness is via the Hessian , which grows quadratically in the number of parameters ; this becomes too large when used with modern networks containing millions of parameters . It is also not clear to what extent flatness is a true measure of generalizability , capable of discerning which neural network will or will not generalize . Dinh et al . ( 2017 ) showed that reparametrizations affect flatness and a flat model can be made arbitrarily sharp without changing any of its generalization properties . In addition Probably Approximately Correct ( PAC-Bayes ) bounds that bound the generalizability in terms of the flatness are also either affected by rescaling , impossible to evaluate or loose ( Neyshabur et al. , 2017 ; Arora et al. , 2018 ; Petzka et al. , 2020 ) . While there have been solutions attempting to prevent issues around reparametrization ( Liang et al. , 2019 ; Tsuzuku et al. , 2019 ) , it remains to establish whether flatness is an epiphenomenon of stochastic gradient descent or other complexity measures as Achille et al . ( 2018 ) and Jastrzebski et al . ( 2018 ) are suggesting . This motivates investigating possible correlations to more well-understood measures of generalization that may help alleviate issues surrounding flat minima , while allowing flat minima to be used when appropriate . In this paper we will demonstrate a correlation to classification margins , which are a well-understood generalization measure . Margins represent the linearized distance to the decision boundaries of the classification region ( Elsayed et al. , 2018 ) . An immediate consequence of such a relationship is that to assess generalizability , we could now simply use a computationally cheap and more robust margin based complexity measure . Our contributions will demonstrate further practical implications of the relationship between margins and flatness which open doors to valuable future work such as a better understanding of why and when a model generalizes and more principled algorithm design . • We prove that under certain conditions flatness and margins are strongly correlated . We do so by deriving the Hessian trace for the affine classifier . Based on its form , we derive an expression in terms of classification margins which we show correlates well with the Hessian trace , with increasing training accuracy for various neural network architectures . By being able relate the two complexity measures , we are now able to provide various practical recommendations , and offer different perspectives on phenomena that may not be explainable without such a view . These are shown in the following contributions . • We use our insight to replace the misleading folklore that , unlike large-batch methods , small-batch methods are able to escape sharp minima ( Keskar et al. , 2016 ) . We instead employ a margin perspective and use our empirical results along with recent results by Banburski et al . ( 2019 ) and Hoffer et al . ( 2017 ) to argue that a large batch method was unable to train long enough to maximize the margins . With our explanation , we help reframe the small and large-batch discussion and build further intuition . • We show that once a neural network is able to correctly predict the label of every element in the training set it can be made arbitrarily flat by scaling the last layer . We are motivated by the relationship to margins which suffer from the same issue . We highlight this scaling issue because , in some instances , it may still be beneficial for algorithm design to be guided by convergence to flat regions . Hence , we need to account for scaling issues which make it difficult to use flatness to assess whether a network generalizes better than another . Other works have made connections between flatness and well-behaved classification margins via visualizations ( see Huang et al . ( 2019 ) ; Wang et al . ( 2018 ) ) , but they have not demonstrated a quantifiable relationship . Further work has used both the classification margins and flatness to construct PAC-Bayes bounds ( Neyshabur et al. , 2017 ; Arora et al. , 2018 ) , and have related flatness to increased robustness ( Petzka et al. , 2020 ; Borovykh et al. , 2019 ) however they did not show when and to what extent these quantities are related . We structure the paper as follows . In Section 2 , we discuss both our notation and our motivation choosing the cross-entropy loss and the Hessian trace as the flatness measure and provide further background on the classification margins . In Section 3 , we present our contribution showing a strong correlation between the margins and flatness by deriving . In Section 4 , we combine recent results based on classification margins to offer a different perspective on the misleading folklore on why larger-batch methods generalize worse . In Section 5 , we highlight that networks can be made arbitrarily flat . Lastly , we offer our thoughts and future work in the Section 6 . 2 PROBLEM SETTING . We first define the basic notation that we use for a classification task . We let X represent the input space and Y = { 1 , ... , C } the output space where C are the number of possible classes . The network architecture is given by φ : Θ × X → R|Y| where Θ is the corresponding parameter space . We measure the performance of a parameter vector by defining some loss function ` : RC × Y → R. If we have have a joint probability distribution D relating input and output space then we would like to minimize the expected loss LD ( θ ) = E ( x , y ) ∼D [ ` ( φ ( θ , x ) , y ) ] . Since we usually only have access to some finite dataset D , we denote the empirical loss by L̃D ( θ ) = 1|D| ∑|D| i=1 ` ( φ ( θ , xi ) , yi ) . If LD and L̃D are close , then we would say a model generalizes well , as we were able to train on a finite dataset and extrapolate to the true distribution . We will use the cross-entropy loss which is given by ` ( φ ( θ , x ) , y ) = − log ( Sy ( φ ( θ , x ) ) ) where the softmax function S : RC → RC is given by S ( a ) i = eai∑C j=1 e aj ( see Goodfellow et al . ( 2016 ) ) . The choice of the cross-entropy function as the loss function has a significant impact on how the flatness measure behaves . Unlike the multiclass mean squared error ( MMSE ) , exponential type losses such as the cross-entropy loss on neural networks have been shown to include implicit regularization which leads to margin maximizing solutions for neural networks ( Banburski et al. , 2019 ) . Also , various properties for flat minima which have been proven for the MMSE loss by Mulayoff & Michaeli are not applicable to the cross-entropy loss , further highlighting the fundamental differences between the loss functions . While the MMSE loss has shown some promise for many classification tasks ( Hui & Belkin , 2020 ) the cross-entropy loss is still the loss which is most used and was primarily used for the empirical evidence around flat minima ( Keskar et al. , 2016 ; Chaudhari et al. , 2019 ) , which motivates our choice . The qualitative description of a flat region was given by Hochreiter & Schmidhuber ( 1997 ) as “ a large connected region in parameter space where the error remains approximately constant '' . We measure the flatness by the trace of the Hessian of the loss with respect to the parameters ( in short the Hessian trace ) denoted by Tr ( Hθ ( L̃D ( θ ) ) ( Dinh et al. , 2017 ) . Since the Hessian is symmetric , the Hessian trace is equivalent to the sum of its eigenvalues which for a fixed parameter space is proportional to the expected increase of the second order approximation of the loss around a fixed minimum θ in a random direction θ′ with θ′ ∼ N ( θ , I ) . Since we apply flatness arguments only close to minima , we assume that all eigenvalues are positive and that the Hessian trace is a good measure of flatness Sagun et al . ( 2017 ) . Even though the Hessian is only an approximation of flatness , the Hessian is often preferred as it allows us to reason about various directions in parameter space via its eigenvectors and eigenvalues ( see Sagun et al . ( 2017 ) ; Chaudhari et al . ( 2019 ) ) and alleviates the issue of infinitely long but sharp ridges making a minimum infinitely flat ( Dinh et al. , 2017 ; Freeman & Bruna , 2016 ) . The Hessian has also been linked to feature robustness via its use in the second order approximation of the loss ( e.g . Petzka et al . ( 2020 ) ; Borovykh et al . ( 2019 ) ) and is a promising quantity to relate to the margins . As we are working with non-linear functions it is intractable to compute exact distances to the decision boundary , therefore we use a measure which is related to the linearized distance as described in Elsayed et al . ( 2018 ) . Under this view , larger margins are better because the data is further from the decision boundary . Specifically , we define the margins as in Neyshabur et al . ( 2017 ) : for some vector v ∈ RC and label y we let the margin of v be γ ( v , y ) = |vy − maxj 6=y vj | . Since we use the margin in different contexts we define the output margins γ ( φ ( θ , x ) , y ) and the margins of the model output after the softmax layer γ ( S ( φ ( θ , x ) ) , y ) . Due to the intuition of margins relating to the regularity of the classification regions , they have been proven and shown to be a good generalization measure for linear networks ( Langford & Shawe-Taylor , 2003 ) and later for neural networks ( see Bartlett et al . ( 2017 ) ; Jiang et al . ( 2018 ; 2019 ) ) when correctly adjusted . Due to results by Banburski et al . ( 2019 ) and Soudry et al . ( 2018 ) , Poggio et al . ( 2019 ) claimed that a large part of the mystery around generalizability has been solved , since standard optimization methods are maximizing the margin instead of memorizing data .
This paper studies the correlation between the flatness of the converged local minimum and the margin. The authors report experimental results that verify the positive correlation. They suggest using margin-based measures to assess the generalizability. Also, the authors argue that large-batch optimization does not have enough time to maximize margins and hence generalize worse and suggest using it to replace the “misleading folklore” that small-batch methods generalize better because they are able to escape sharp minima. In addition, the authors significantly narrowed the margin which would have violated the policy: “Tweaking the style files may be grounds for rejection.”
SP:8bbf8ac04f86085bfff8c946e16ffcece6e4065e
Shape Matters: Understanding the Implicit Bias of the Noise Covariance
The noise in stochastic gradient descent ( SGD ) provides a crucial implicit regularization effect for training overparameterized models . Prior theoretical work largely focuses on spherical Gaussian noise , whereas empirical studies demonstrate the phenomenon that parameter-dependent noise — induced by minibatches or label perturbation — is far more effective than Gaussian noise . This paper theoretically characterizes this phenomenon on a quadratically-parameterized model introduced by Vaskevicius et al . and Woodworth et al . We show that in an over-parameterized setting , SGD with label noise recovers the sparse groundtruth with an arbitrary initialization , whereas SGD with Gaussian noise or gradient descent overfits to dense solutions with large norms . Our analysis reveals that parameter-dependent noise introduces a bias towards local minima with smaller noise variance , whereas spherical Gaussian noise does not . 1 INTRODUCTION . One central mystery of deep artificial neural networks is their capability to generalize when having far more learnable parameters than training examples Zhang et al . ( 2016 ) . To add to the mystery , deep nets can also obtain reasonable performance in the absence of any explicit regularization . This has motivated recent work to study the regularization effect due to the optimization ( rather than objective function ) , also known as implicit bias or implicit regularization Gunasekar et al . ( 2017 ; 2018a ; b ) ; Soudry et al . ( 2018 ) ; Arora et al . ( 2019 ) . The implicit bias is induced by and depends on many factors , such as learning rate and batch size Smith et al . ( 2017 ) ; Goyal et al . ( 2017 ) ; Keskar et al . ( 2016 ) ; Li et al . ( 2019b ) ; Hoffer et al . ( 2017 ) , initialization and momentum Sutskever et al . ( 2013 ) , adaptive stepsize Kingma and Ba ( 2014 ) ; Neyshabur et al . ( 2015 ) ; Wilson et al . ( 2017 ) , batch normalization Ioffe and Szegedy ( 2015 ) and dropout Srivastava et al . ( 2014 ) . Among these sources of implicit regularization , the SGD noise is believed to be a vital one ( LeCun et al. , 2012 ; Keskar et al. , 2016 ) . Previous theoretical works ( e.g. , Li et al . ( 2019b ) ) have studied the implicit regularization effect from the scale of the noise , which is directly influenced by learning rate and batch size . However , people have empirically observed that the shape of the noise also has a strong ( if not stronger ) implicit bias . For example , prior works show that mini-batch noise or label noise ( label smoothing ) – noise in the parameter updates from the perturbation of labels in training – is far more effective than adding spherical Gaussian noise ( e.g. , see ( Shallue et al. , 2018 , Section 4.6 ) and Szegedy et al . ( 2016 ) ; Wen et al . ( 2019 ) ) . We also confirm this phenomenon in Figure 1 ( left ) . Thus , understanding the implicit bias of the noise shape is crucial . Such an understanding may also apply to distributed training because synthetically adding noise may help generalization if parallelism reduces the amount of mini-batch noise ( Shallue et al. , 2018 ) . In this paper , we theoretically study the effect of the shape of the noise , demonstrating that it can provably determine generalization performance at convergence . Our analysis is based on a nonlinear quadratically-parameterized model introduced by ( Woodworth et al. , 2020 ; Vaskevicius et al. , 2019 ) , which is rich enough to exhibit similar empirical phenomena as deep networks . Indeed , Figure 1 ( right ) empirically shows that SGD with mini-batch noise or label noise can generalize with arbitrary initialization without explicit regularization , whereas GD or SGD with spherical Gaussian noise can not . We aim to analyze the implicit bias of label noise and Gaussian noise in the quadraticallyparametrized model and explain these empirical observations . We choose to study label noise because it can replicate the regularization effects of minibatch noise in both real and synthetic data ( Figure 1 ) , and has been used to regularize large-batch parallel training ( Shallue et al. , 2018 ) . Moreover , label noise is less sensitive to the initialization and the optimization history than mini-batch noise , which makes it more amenable to theoretical analysis . For example , in an extreme case , if we happen to reach or initialize at a solution that overfits the data exactly , then mini-batch SGD will stay there forever because both the gradient and the noise vanish ( Vaswani et al. , 2019 ) . In contrast , label noise will not accidentally vanish , so the analysis is more tractable . Understanding label noise may lead to understanding mini-batch noise or replacing it with other more robust choices . In our setting , we prove that with a proper learning rate schedule , SGD with label noise recovers a sparse ground-truth classifier and generalizes well , whereas SGD with spherical Gaussian noise generalizes poorly . Concretely , SGD with label noise biases the parameter towards the low sparsity regime and exactly recovers the sparse ground-truth , even when the initialization is arbitrarily large ( Theorem 2.1 ) . In this same regime , noise-free gradient descent quickly overfits because it trains in the NTK regime ( Jacot et al. , 2018 ; Chizat and Bach , 2018 ) . Adding Gaussian noise is insufficient to fix this , as this algorithm would end up sampling from a Gibbs distribution with infinite partition function and fail to converge to the ground-truth ( Theorem 2.2 ) . In summary , with not too small learning rate or noise level , label noise suffices to bias the parameter towards sparse solutions without relying on a small initialization , whereas Gaussian noise can not . Our analysis suggests that the fundamental difference between label or mini-batch noise and Gaussian noise is that the former is parameter-dependent , and therefore introduces stronger biases than the latter . The conceptual message highlighted by our analysis is that there are two possible implicit biases induced by the noise : 1. prior work ( Keskar et al. , 2016 ) shows that by escaping sharp local minima , noisy gradient descent biases the parameter towards more robust solutions ( i.e , solutions with low curvature , or “ flat ” minima ) , and 2. when the noise covariance varies across the parameter space , there is another ( potentially stronger ) implicit bias effect toward parameters where the noise covariance is smaller . Label or mini-batch noise benefits from both biases , whereas Gaussian noise is independent of the parameter , so it benefits from the first bias but not the second . For the quadratically-parameterized model , this first bias is not sufficient for finding solutions with good generalization because there is a large set of overfitting global minima of the training loss with reasonable curvature . In contrast , the covariance of label noise is proportional to the scale of the parameter , inducing a much stronger bias towards low norm solutions which generalize well . 1.1 ADDITIONAL RELATED WORKS . Closely related to our work , Blanc et al . ( 2019 ) and Zhu et al . ( 2019 ) also theoretically studied implicit regularization effects that arise due to shape , rather than scale , of the noise . However , they only considered the local effect of the noise near some local minimum of the loss . In contrast , our work analyzes the global effect of noise . For a more detailed comparison with ( Blanc et al. , 2019 ) , see Section 2.2 . Woodworth et al . ( 2020 ) ; Vaskevicius et al . ( 2019 ) analyze the effect of initialization for the same model that we study , showing that large initialization trains in the NTK regime ( shown to generalize poorly ( Wei et al. , 2019 ; Ghorbani et al. , 2019 ) ) whereas small initialization does not . We show that when the initialization is large , adding noise helps avoid the NTK regime ( Li and Liang , 2018 ; Jacot et al. , 2018 ; Du et al. , 2018b ; Woodworth et al. , 2020 ) without explicit regularization . Several previous works have studied generalization bounds and training dynamics of SGD with statedependent noises for more general models . Hardt et al . ( 2015 ) derived stability-based generalization bounds for mini-batch SGD based on training speed . Cheng et al . ( 2019 ) proved that SGD with statedependent noises has iterate distribution close to the corresponding continuous stochastic differential equation with the same noise covariance . Meng et al . ( 2020 ) ; Xie et al . ( 2020 ) showed that SGD with state-dependent noises escapes local minimum faster than SGD with spherical Gaussian noise . There has been a line of work empirically studying how noise influences generalization . Keskar et al . ( 2016 ) argued that large batch training will converge to “ sharp ” local minima which do not generalize well . Hoffer et al . ( 2017 ) argued that large batch size doesn ’ t hurt generalization much if training goes on long enough and additional noise is added with a larger learning rate . Goyal et al . ( 2017 ) and Shallue et al . ( 2018 ) showed large batch training with proper learning rate and additional label noise can achieve similar generalization as small batch . Wei and Schwab ( 2019 ) ; Chaudhari and Soatto ( 2018 ) ; Yaida ( 2018 ) ( heuristically ) suggested that SGD may encourage solutions with smaller noise covariance . Martin and Mahoney ( 2018 ) used random matrix theory to analyze implicit regularization effects of noises . The noise induced by dropout has been shown to change the expected training objective , hence provides a regularization effect ( Mianjy et al. , 2018 ; Mianjy and Arora , 2019 ; Wei et al. , 2020 ; Arora et al. , 2020 ) . Wei et al . ( 2020 ) showed that there also exists an implicit bias induced by dropout noise . Langevin dynamics or the closely-related stochastic gradient descent with spherical Gaussian noise has been studied in previous works Welling and Teh ( 2011 ) ; Teh et al . ( 2016 ) ; Raginsky et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Mou et al . ( 2017 ) ; Roberts et al . ( 1996 ) ; Ge et al . ( 2015 ) ; Negrea et al . ( 2019 ) ; Neelakantan et al . ( 2015 ) ; Mou et al . ( 2018 ) . In particular , Raginsky et al . ( 2017 ) and Li et al . ( 2019a ) provided generalization bounds for SGLD using algorithmic stability . Several works have theoretically analyzed other types of implicit biases in simplified settings ( Soudry et al. , 2018 ; Gunasekar et al. , 2018b ; Ji and Telgarsky , 2018a ) . Gunasekar et al . ( 2017 ) and Li et al . ( 2017 ) showed that gradient descent finds low rank solutions in matrix completion . Gradient descent has also been shown to maximize the margin in linear and homogeneous models ( Soudry et al. , 2018 ; Ji and Telgarsky , 2018b ; Nacson et al. , 2018 ; Lyu and Li , 2019 ; Gunasekar et al. , 2018a ; Nacson et al. , 2019 ; Poggio et al. , 2017 ) . Du et al . ( 2018a ) showed that gradient descent implicitly balances the layers of deep homogeneous models . Other works showed that it may not always be possible to characterize implicit biases in terms of norm ( Arora et al. , 2019 ; Razin and Cohen , 2020 ) . Gissin et al . ( 2019 ) showed that gradient descent dynamics exhibit different implicit biases based on depth . Li et al . ( 2019b ) studied the implicit regularization effect of a large initial learning rate . Guo et al . ( 2018 ) studies the notion of “ elimination singularities ” in RBF networks , where optimization runs into a regime with small weight and small gradient , therefore the training can be slowed down . Our paper also involves training trajectory with small weight norm , but instead focuses on its influnece on the generalization performance .
This paper considers the effect of label noise on stochastic gradient descent. The setup is that there is a vector $v \in R^d$. We observe samples from $v^2\cdot x$. We only have $n < d$ samples but $v$ is $r$-sparse for $r < n < d$ which makes recovery possible information theoretically. The main result is that stochastic gradient descent with label noise, and without any explicit regularization will recover the ground truth. whereas adding spherical Gaussian noise does not.
SP:0b31a46fda77a01e02a6a94c52381af4aa759743
Shape Matters: Understanding the Implicit Bias of the Noise Covariance
The noise in stochastic gradient descent ( SGD ) provides a crucial implicit regularization effect for training overparameterized models . Prior theoretical work largely focuses on spherical Gaussian noise , whereas empirical studies demonstrate the phenomenon that parameter-dependent noise — induced by minibatches or label perturbation — is far more effective than Gaussian noise . This paper theoretically characterizes this phenomenon on a quadratically-parameterized model introduced by Vaskevicius et al . and Woodworth et al . We show that in an over-parameterized setting , SGD with label noise recovers the sparse groundtruth with an arbitrary initialization , whereas SGD with Gaussian noise or gradient descent overfits to dense solutions with large norms . Our analysis reveals that parameter-dependent noise introduces a bias towards local minima with smaller noise variance , whereas spherical Gaussian noise does not . 1 INTRODUCTION . One central mystery of deep artificial neural networks is their capability to generalize when having far more learnable parameters than training examples Zhang et al . ( 2016 ) . To add to the mystery , deep nets can also obtain reasonable performance in the absence of any explicit regularization . This has motivated recent work to study the regularization effect due to the optimization ( rather than objective function ) , also known as implicit bias or implicit regularization Gunasekar et al . ( 2017 ; 2018a ; b ) ; Soudry et al . ( 2018 ) ; Arora et al . ( 2019 ) . The implicit bias is induced by and depends on many factors , such as learning rate and batch size Smith et al . ( 2017 ) ; Goyal et al . ( 2017 ) ; Keskar et al . ( 2016 ) ; Li et al . ( 2019b ) ; Hoffer et al . ( 2017 ) , initialization and momentum Sutskever et al . ( 2013 ) , adaptive stepsize Kingma and Ba ( 2014 ) ; Neyshabur et al . ( 2015 ) ; Wilson et al . ( 2017 ) , batch normalization Ioffe and Szegedy ( 2015 ) and dropout Srivastava et al . ( 2014 ) . Among these sources of implicit regularization , the SGD noise is believed to be a vital one ( LeCun et al. , 2012 ; Keskar et al. , 2016 ) . Previous theoretical works ( e.g. , Li et al . ( 2019b ) ) have studied the implicit regularization effect from the scale of the noise , which is directly influenced by learning rate and batch size . However , people have empirically observed that the shape of the noise also has a strong ( if not stronger ) implicit bias . For example , prior works show that mini-batch noise or label noise ( label smoothing ) – noise in the parameter updates from the perturbation of labels in training – is far more effective than adding spherical Gaussian noise ( e.g. , see ( Shallue et al. , 2018 , Section 4.6 ) and Szegedy et al . ( 2016 ) ; Wen et al . ( 2019 ) ) . We also confirm this phenomenon in Figure 1 ( left ) . Thus , understanding the implicit bias of the noise shape is crucial . Such an understanding may also apply to distributed training because synthetically adding noise may help generalization if parallelism reduces the amount of mini-batch noise ( Shallue et al. , 2018 ) . In this paper , we theoretically study the effect of the shape of the noise , demonstrating that it can provably determine generalization performance at convergence . Our analysis is based on a nonlinear quadratically-parameterized model introduced by ( Woodworth et al. , 2020 ; Vaskevicius et al. , 2019 ) , which is rich enough to exhibit similar empirical phenomena as deep networks . Indeed , Figure 1 ( right ) empirically shows that SGD with mini-batch noise or label noise can generalize with arbitrary initialization without explicit regularization , whereas GD or SGD with spherical Gaussian noise can not . We aim to analyze the implicit bias of label noise and Gaussian noise in the quadraticallyparametrized model and explain these empirical observations . We choose to study label noise because it can replicate the regularization effects of minibatch noise in both real and synthetic data ( Figure 1 ) , and has been used to regularize large-batch parallel training ( Shallue et al. , 2018 ) . Moreover , label noise is less sensitive to the initialization and the optimization history than mini-batch noise , which makes it more amenable to theoretical analysis . For example , in an extreme case , if we happen to reach or initialize at a solution that overfits the data exactly , then mini-batch SGD will stay there forever because both the gradient and the noise vanish ( Vaswani et al. , 2019 ) . In contrast , label noise will not accidentally vanish , so the analysis is more tractable . Understanding label noise may lead to understanding mini-batch noise or replacing it with other more robust choices . In our setting , we prove that with a proper learning rate schedule , SGD with label noise recovers a sparse ground-truth classifier and generalizes well , whereas SGD with spherical Gaussian noise generalizes poorly . Concretely , SGD with label noise biases the parameter towards the low sparsity regime and exactly recovers the sparse ground-truth , even when the initialization is arbitrarily large ( Theorem 2.1 ) . In this same regime , noise-free gradient descent quickly overfits because it trains in the NTK regime ( Jacot et al. , 2018 ; Chizat and Bach , 2018 ) . Adding Gaussian noise is insufficient to fix this , as this algorithm would end up sampling from a Gibbs distribution with infinite partition function and fail to converge to the ground-truth ( Theorem 2.2 ) . In summary , with not too small learning rate or noise level , label noise suffices to bias the parameter towards sparse solutions without relying on a small initialization , whereas Gaussian noise can not . Our analysis suggests that the fundamental difference between label or mini-batch noise and Gaussian noise is that the former is parameter-dependent , and therefore introduces stronger biases than the latter . The conceptual message highlighted by our analysis is that there are two possible implicit biases induced by the noise : 1. prior work ( Keskar et al. , 2016 ) shows that by escaping sharp local minima , noisy gradient descent biases the parameter towards more robust solutions ( i.e , solutions with low curvature , or “ flat ” minima ) , and 2. when the noise covariance varies across the parameter space , there is another ( potentially stronger ) implicit bias effect toward parameters where the noise covariance is smaller . Label or mini-batch noise benefits from both biases , whereas Gaussian noise is independent of the parameter , so it benefits from the first bias but not the second . For the quadratically-parameterized model , this first bias is not sufficient for finding solutions with good generalization because there is a large set of overfitting global minima of the training loss with reasonable curvature . In contrast , the covariance of label noise is proportional to the scale of the parameter , inducing a much stronger bias towards low norm solutions which generalize well . 1.1 ADDITIONAL RELATED WORKS . Closely related to our work , Blanc et al . ( 2019 ) and Zhu et al . ( 2019 ) also theoretically studied implicit regularization effects that arise due to shape , rather than scale , of the noise . However , they only considered the local effect of the noise near some local minimum of the loss . In contrast , our work analyzes the global effect of noise . For a more detailed comparison with ( Blanc et al. , 2019 ) , see Section 2.2 . Woodworth et al . ( 2020 ) ; Vaskevicius et al . ( 2019 ) analyze the effect of initialization for the same model that we study , showing that large initialization trains in the NTK regime ( shown to generalize poorly ( Wei et al. , 2019 ; Ghorbani et al. , 2019 ) ) whereas small initialization does not . We show that when the initialization is large , adding noise helps avoid the NTK regime ( Li and Liang , 2018 ; Jacot et al. , 2018 ; Du et al. , 2018b ; Woodworth et al. , 2020 ) without explicit regularization . Several previous works have studied generalization bounds and training dynamics of SGD with statedependent noises for more general models . Hardt et al . ( 2015 ) derived stability-based generalization bounds for mini-batch SGD based on training speed . Cheng et al . ( 2019 ) proved that SGD with statedependent noises has iterate distribution close to the corresponding continuous stochastic differential equation with the same noise covariance . Meng et al . ( 2020 ) ; Xie et al . ( 2020 ) showed that SGD with state-dependent noises escapes local minimum faster than SGD with spherical Gaussian noise . There has been a line of work empirically studying how noise influences generalization . Keskar et al . ( 2016 ) argued that large batch training will converge to “ sharp ” local minima which do not generalize well . Hoffer et al . ( 2017 ) argued that large batch size doesn ’ t hurt generalization much if training goes on long enough and additional noise is added with a larger learning rate . Goyal et al . ( 2017 ) and Shallue et al . ( 2018 ) showed large batch training with proper learning rate and additional label noise can achieve similar generalization as small batch . Wei and Schwab ( 2019 ) ; Chaudhari and Soatto ( 2018 ) ; Yaida ( 2018 ) ( heuristically ) suggested that SGD may encourage solutions with smaller noise covariance . Martin and Mahoney ( 2018 ) used random matrix theory to analyze implicit regularization effects of noises . The noise induced by dropout has been shown to change the expected training objective , hence provides a regularization effect ( Mianjy et al. , 2018 ; Mianjy and Arora , 2019 ; Wei et al. , 2020 ; Arora et al. , 2020 ) . Wei et al . ( 2020 ) showed that there also exists an implicit bias induced by dropout noise . Langevin dynamics or the closely-related stochastic gradient descent with spherical Gaussian noise has been studied in previous works Welling and Teh ( 2011 ) ; Teh et al . ( 2016 ) ; Raginsky et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Mou et al . ( 2017 ) ; Roberts et al . ( 1996 ) ; Ge et al . ( 2015 ) ; Negrea et al . ( 2019 ) ; Neelakantan et al . ( 2015 ) ; Mou et al . ( 2018 ) . In particular , Raginsky et al . ( 2017 ) and Li et al . ( 2019a ) provided generalization bounds for SGLD using algorithmic stability . Several works have theoretically analyzed other types of implicit biases in simplified settings ( Soudry et al. , 2018 ; Gunasekar et al. , 2018b ; Ji and Telgarsky , 2018a ) . Gunasekar et al . ( 2017 ) and Li et al . ( 2017 ) showed that gradient descent finds low rank solutions in matrix completion . Gradient descent has also been shown to maximize the margin in linear and homogeneous models ( Soudry et al. , 2018 ; Ji and Telgarsky , 2018b ; Nacson et al. , 2018 ; Lyu and Li , 2019 ; Gunasekar et al. , 2018a ; Nacson et al. , 2019 ; Poggio et al. , 2017 ) . Du et al . ( 2018a ) showed that gradient descent implicitly balances the layers of deep homogeneous models . Other works showed that it may not always be possible to characterize implicit biases in terms of norm ( Arora et al. , 2019 ; Razin and Cohen , 2020 ) . Gissin et al . ( 2019 ) showed that gradient descent dynamics exhibit different implicit biases based on depth . Li et al . ( 2019b ) studied the implicit regularization effect of a large initial learning rate . Guo et al . ( 2018 ) studies the notion of “ elimination singularities ” in RBF networks , where optimization runs into a regime with small weight and small gradient , therefore the training can be slowed down . Our paper also involves training trajectory with small weight norm , but instead focuses on its influnece on the generalization performance .
This paper considers the implicit regularization of stochastic gradient decent (SGD). The authors analyze SGD with label nose in the quadratically-parameterized model and prove that it converges to the sparse ground-truth even if started with large initialization. The authors also prove that SGD with Gaussian noise (Langevin dynamics) does not converge to the ground truth at zero under the overparameterized regime.
SP:0b31a46fda77a01e02a6a94c52381af4aa759743
QPLEX: Duplex Dueling Multi-Agent Q-Learning
1 INTRODUCTION . Cooperative multi-agent reinforcement learning ( MARL ) has broad prospects for addressing many complex real-world problems , such as sensor networks ( Zhang & Lesser , 2011 ) , coordination of robot swarms ( Hüttenrauch et al. , 2017 ) , and autonomous cars ( Cao et al. , 2012 ) . However , cooperative MARL encounters two major challenges of scalability and partial observability in practical applications . The joint state-action space grows exponentially as the number of agents increases . The partial observability and communication constraints of the environment require each agent to make its individual decisions based on local action-observation histories . To address these challenges , a popular MARL paradigm , called centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Kraemer & Banerjee , 2016 ) , has recently attracted great attention , where agents ’ policies are trained with access to global information in a centralized way and executed only based on local histories in a decentralized way . Many CTDE learning approaches have been proposed recently , among which value-based MARL algorithms ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Son et al. , 2019 ; Wang et al. , 2019b ) have shown state-of-the-art performance on challenging tasks , e.g. , unit micromanagement in StarCraft II ( Samvelyan et al. , 2019 ) . To enable effective CTDE for multi-agent Q-learning , it is critical that the joint greedy action should be equivalent to the collection of individual greedy actions of agents , which is called the IGM ( Individual-Global-Max ) principle ( Son et al. , 2019 ) . This IGM principle provides two advantages : 1 ) ensuring the policy consistency during centralized training ( learning the joint Q-function ) and decentralized execution ( using individual Q-functions ) and 2 ) enabling ∗Equal contribution . 1Videos available at https : //sites.google.com/view/qplex-marl/ . scalable centralized training of computing one-step TD target of the joint Q-function ( deriving joint greedy action selection from individual Q-functions ) . To realize this principle , VDN ( Sunehag et al. , 2018 ) and QMIX ( Rashid et al. , 2018 ) propose two sufficient conditions of IGM to factorize the joint action-value function . However , these two decomposition methods suffer from structural constraints and limit the joint action-value function class they can represent . As shown by Wang et al . ( 2020a ) , the incompleteness of the joint value function class may lead to poor performance or potential risk of training instability in the offline setting ( Levine et al. , 2020 ) . Several methods have been proposed to address this structural limitation . QTRAN ( Son et al. , 2019 ) constructs two soft regularizations to align the greedy action selections between the joint and individual value functions . WQMIX ( Rashid et al. , 2020 ) considers a weighted projection that places more importance on better joint actions . However , due to computational considerations , both their implementations are approximate and based on heuristics , which can not guarantee the IGM consistency exactly . Therefore , achieving the complete expressiveness of the IGM function class with effective scalability remains an open problem for cooperative MARL . To address this challenge , this paper presents a novel MARL approach , called duPLEX dueling multiagent Q-learning ( QPLEX ) , that takes a duplex dueling network architecture to factorize the joint action-value function into individual action-value functions . QPLEX introduces the dueling structure Q = V + A ( Wang et al. , 2016 ) for representing both joint and individual ( duplex ) action-value functions and then reformalizes the IGM principle as an advantage-based IGM . This reformulation transforms the IGM consistency into the constraints on the value range of the advantage functions and thus facilitates the action-value function learning with linear decomposition structure . Different from QTRAN and WQMIX ( Son et al. , 2019 ; Rashid et al. , 2020 ) losing the guarantee of exact IGM consistency due to approximation , QPLEX takes advantage of a duplex dueling architecture to encode it into the neural network structure and provide a guaranteed IGM consistency . To our best knowledge , QPLEX is the first multi-agent Q-learning algorithm that effectively achieves high scalability with a full realization of the IGM principle . We evaluate the performance of QPLEX in both didactic problems proposed by prior work ( Son et al. , 2019 ; Wang et al. , 2020a ) and a range of unit micromanagement benchmark tasks in StarCraft II ( Samvelyan et al. , 2019 ) . In these didactic problems , QPLEX demonstrates its full representation expressiveness , thereby learning the optimal policy and avoiding the potential risk of training instability . Empirical results on more challenging StarCraft II tasks show that QPLEX significantly outperforms other multi-agent Q-learning baselines in online and offline data collections . It is particularly interesting that QPLEX shows the ability to support offline training , which is not possessed by other baselines . This ability not only provides QPLEX with high stability and sample efficiency but also with opportunities to efficiently utilize multi-source offline data without additional online exploration ( Fujimoto et al. , 2019 ; Fu et al. , 2020 ; Levine et al. , 2020 ; Yu et al. , 2020 ) . 2 PRELIMINARIES . 2.1 DECENTRALIZED PARTIALLY OBSERVABLE MDP ( DEC-POMDP ) . We model a fully cooperative multi-agent task as a Dec-POMDP ( Oliehoek et al. , 2016 ) defined by a tuple M = 〈N , S , A , P , Ω , O , r , γ〉 , where N ≡ { 1 , 2 , . . . , n } is a finite set of agents and s ∈ S is a finite set of global states . At each time step , every agent i ∈ N chooses an action ai ∈ A ≡ { A ( 1 ) , . . . , A ( |A| ) } on a global state s , which forms a joint action a ≡ [ ai ] ni=1 ∈ A ≡ An . It results in a joint reward r ( s , a ) and a transition to the next global state s′ ∼ P ( ·|s , a ) . γ ∈ [ 0 , 1 ) is a discount factor . We consider a partially observable setting , where each agent i receives an individual partial observation oi ∈ Ω according to the observation probability function O ( oi|s , ai ) . Each agent i has an action-observation history τi ∈ T ≡ ( Ω ×A ) ∗ and constructs its individual policy πi ( a|τi ) to jointly maximize team performance . We use τ ∈ T ≡ T n to denote joint action-observation history . The formal objective function is to find a joint policy π = 〈π1 , . . . , πn〉 that maximizes a joint value function V π ( s ) = E [ ∑∞ t=0 γ trt|s0 = s , π ] . Another quantity of interest in policy search is the joint action-value function Qπ ( s , a ) = r ( s , a ) + γEs′ [ V π ( s′ ) ] . 2.2 DEEP MULTI-AGENT Q-LEARNING IN DEC-POMDP . Q-learning algorithms is a popular algorithm to find the optimal joint action-value function Q∗ ( s , a ) = r ( s , a ) +γEs′ [ maxa′ Q∗ ( s′ , a′ ) ] . Deep Q-learning represents the action-value function with a deep neural network parameterized by θ. Mutli-agent Q-learning algorithms ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Son et al. , 2019 ; Yang et al. , 2020 ) use a replay memory D to store the transition tuple ( τ , a , r , τ ′ ) , where r is the reward for taking action a at joint action-observation history τ with a transition to τ ′ . Due to partial observability , Q ( τ , a ; θ ) is used in place of Q ( s , a ; θ ) . Thus , parameters θ are learnt by minimizing the following expected TD error : L ( θ ) = E ( τ , a , r , τ ′ ) ∈D [ ( r + γV ( τ ′ ; θ− ) −Q ( τ , a ; θ ) ) 2 ] , ( 1 ) where V ( τ ′ ; θ− ) = maxa′ Q ( τ ′ , a′ ; θ− ) is the one-step expected future return of the TD target and θ− are the parameters of the target network , which will be periodically updated with θ . 2.3 CENTRALIZED TRAINING WITH DECENTRALIZED EXECUTION ( CTDE ) . CTDE is a popular paradigm of cooperative multi-agent deep reinforcement learning ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Wang et al. , 2019a ; 2020b ; c ; d ) . Agents are trained in a centralized way and granted access to other agents ’ information or the global states during the centralized training process . However , due to partial observability and communication constraints , each agent makes its own decision based on its local action-observation history during the decentralized execution phase . IGM ( Individual-Global-Max ; Son et al. , 2019 ) is a popular principle to realize effective value-based CTDE , which asserts the consistency between joint and local greedy action selections in the joint action-value Qtot ( τ , a ) and individual action-values [ Qi ( τi , ai ) ] n i=1 : ∀τ ∈ T , argmax a∈A Qtot ( τ , a ) = ( argmax a1∈A Q1 ( τ1 , a1 ) , . . . , argmax an∈A Qn ( τn , an ) ) . ( 2 ) Two factorization structures , additivity and monotonicity , has been proposed by VDN ( Sunehag et al. , 2018 ) and QMIX ( Rashid et al. , 2018 ) , respectively , as shown below : QVDNtot ( τ , a ) = n∑ i=1 Qi ( τi , ai ) and ∀i ∈ N , ∂QQMIXtot ( τ , a ) ∂Qi ( τi , ai ) > 0 . Qatten ( Yang et al. , 2020 ) is a variant of VDN , which supplements global information through a multi-head attention structure . It is known that , these structures implement sufficient but not necessary conditions for the IGM constraint , which limit the representation expressiveness of joint action-value functions ( Mahajan et al. , 2019 ) . There exist tasks whose factorizable joint action-value functions can not be represented by these decomposition methods , as shown in Section 4 . In contrast , QTRAN ( Son et al. , 2019 ) transforms IGM into a linear constraint and uses it as soft regularization constraints . WQMIX ( Rashid et al. , 2020 ) introduces a weighting mechanism into the projection of monotonic value factorization , in order to place more importance on better joint actions . However , these relaxations may violate the exact IGM consistency and may not perform well in complex problems . 3 QPLEX : DUPLEX DUELING MULTI-AGENT Q-LEARNING . In this section , we will first introduce advantage-based IGM , equivalent to the regular IGM principle , and , with this new definition , convert the IGM consistency of greedy action selection to simple constraints on advantage functions . We then present a novel deep MARL model , called duPLEX dueling multi-agent Q-learning algorithm ( QPLEX ) , that directly realizes these constraints by a scalable neural network architecture .
The paper proposed a multi-agent Q Learning algorithm with an entire IGM function class for cooperative games. The key idea is to leverage a duplex dueling network architecture to factorize the joint action-value function into individual action-value functions. The main contributions of the work lie in that the proposed method offered an highly scalable algorithms for cooperative tasks. Empirical results show that the method could achieve significant improvement in StarCraftII tasks.
SP:ad5a9c6598151e60f84bf54984621a3832276c14
QPLEX: Duplex Dueling Multi-Agent Q-Learning
1 INTRODUCTION . Cooperative multi-agent reinforcement learning ( MARL ) has broad prospects for addressing many complex real-world problems , such as sensor networks ( Zhang & Lesser , 2011 ) , coordination of robot swarms ( Hüttenrauch et al. , 2017 ) , and autonomous cars ( Cao et al. , 2012 ) . However , cooperative MARL encounters two major challenges of scalability and partial observability in practical applications . The joint state-action space grows exponentially as the number of agents increases . The partial observability and communication constraints of the environment require each agent to make its individual decisions based on local action-observation histories . To address these challenges , a popular MARL paradigm , called centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Kraemer & Banerjee , 2016 ) , has recently attracted great attention , where agents ’ policies are trained with access to global information in a centralized way and executed only based on local histories in a decentralized way . Many CTDE learning approaches have been proposed recently , among which value-based MARL algorithms ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Son et al. , 2019 ; Wang et al. , 2019b ) have shown state-of-the-art performance on challenging tasks , e.g. , unit micromanagement in StarCraft II ( Samvelyan et al. , 2019 ) . To enable effective CTDE for multi-agent Q-learning , it is critical that the joint greedy action should be equivalent to the collection of individual greedy actions of agents , which is called the IGM ( Individual-Global-Max ) principle ( Son et al. , 2019 ) . This IGM principle provides two advantages : 1 ) ensuring the policy consistency during centralized training ( learning the joint Q-function ) and decentralized execution ( using individual Q-functions ) and 2 ) enabling ∗Equal contribution . 1Videos available at https : //sites.google.com/view/qplex-marl/ . scalable centralized training of computing one-step TD target of the joint Q-function ( deriving joint greedy action selection from individual Q-functions ) . To realize this principle , VDN ( Sunehag et al. , 2018 ) and QMIX ( Rashid et al. , 2018 ) propose two sufficient conditions of IGM to factorize the joint action-value function . However , these two decomposition methods suffer from structural constraints and limit the joint action-value function class they can represent . As shown by Wang et al . ( 2020a ) , the incompleteness of the joint value function class may lead to poor performance or potential risk of training instability in the offline setting ( Levine et al. , 2020 ) . Several methods have been proposed to address this structural limitation . QTRAN ( Son et al. , 2019 ) constructs two soft regularizations to align the greedy action selections between the joint and individual value functions . WQMIX ( Rashid et al. , 2020 ) considers a weighted projection that places more importance on better joint actions . However , due to computational considerations , both their implementations are approximate and based on heuristics , which can not guarantee the IGM consistency exactly . Therefore , achieving the complete expressiveness of the IGM function class with effective scalability remains an open problem for cooperative MARL . To address this challenge , this paper presents a novel MARL approach , called duPLEX dueling multiagent Q-learning ( QPLEX ) , that takes a duplex dueling network architecture to factorize the joint action-value function into individual action-value functions . QPLEX introduces the dueling structure Q = V + A ( Wang et al. , 2016 ) for representing both joint and individual ( duplex ) action-value functions and then reformalizes the IGM principle as an advantage-based IGM . This reformulation transforms the IGM consistency into the constraints on the value range of the advantage functions and thus facilitates the action-value function learning with linear decomposition structure . Different from QTRAN and WQMIX ( Son et al. , 2019 ; Rashid et al. , 2020 ) losing the guarantee of exact IGM consistency due to approximation , QPLEX takes advantage of a duplex dueling architecture to encode it into the neural network structure and provide a guaranteed IGM consistency . To our best knowledge , QPLEX is the first multi-agent Q-learning algorithm that effectively achieves high scalability with a full realization of the IGM principle . We evaluate the performance of QPLEX in both didactic problems proposed by prior work ( Son et al. , 2019 ; Wang et al. , 2020a ) and a range of unit micromanagement benchmark tasks in StarCraft II ( Samvelyan et al. , 2019 ) . In these didactic problems , QPLEX demonstrates its full representation expressiveness , thereby learning the optimal policy and avoiding the potential risk of training instability . Empirical results on more challenging StarCraft II tasks show that QPLEX significantly outperforms other multi-agent Q-learning baselines in online and offline data collections . It is particularly interesting that QPLEX shows the ability to support offline training , which is not possessed by other baselines . This ability not only provides QPLEX with high stability and sample efficiency but also with opportunities to efficiently utilize multi-source offline data without additional online exploration ( Fujimoto et al. , 2019 ; Fu et al. , 2020 ; Levine et al. , 2020 ; Yu et al. , 2020 ) . 2 PRELIMINARIES . 2.1 DECENTRALIZED PARTIALLY OBSERVABLE MDP ( DEC-POMDP ) . We model a fully cooperative multi-agent task as a Dec-POMDP ( Oliehoek et al. , 2016 ) defined by a tuple M = 〈N , S , A , P , Ω , O , r , γ〉 , where N ≡ { 1 , 2 , . . . , n } is a finite set of agents and s ∈ S is a finite set of global states . At each time step , every agent i ∈ N chooses an action ai ∈ A ≡ { A ( 1 ) , . . . , A ( |A| ) } on a global state s , which forms a joint action a ≡ [ ai ] ni=1 ∈ A ≡ An . It results in a joint reward r ( s , a ) and a transition to the next global state s′ ∼ P ( ·|s , a ) . γ ∈ [ 0 , 1 ) is a discount factor . We consider a partially observable setting , where each agent i receives an individual partial observation oi ∈ Ω according to the observation probability function O ( oi|s , ai ) . Each agent i has an action-observation history τi ∈ T ≡ ( Ω ×A ) ∗ and constructs its individual policy πi ( a|τi ) to jointly maximize team performance . We use τ ∈ T ≡ T n to denote joint action-observation history . The formal objective function is to find a joint policy π = 〈π1 , . . . , πn〉 that maximizes a joint value function V π ( s ) = E [ ∑∞ t=0 γ trt|s0 = s , π ] . Another quantity of interest in policy search is the joint action-value function Qπ ( s , a ) = r ( s , a ) + γEs′ [ V π ( s′ ) ] . 2.2 DEEP MULTI-AGENT Q-LEARNING IN DEC-POMDP . Q-learning algorithms is a popular algorithm to find the optimal joint action-value function Q∗ ( s , a ) = r ( s , a ) +γEs′ [ maxa′ Q∗ ( s′ , a′ ) ] . Deep Q-learning represents the action-value function with a deep neural network parameterized by θ. Mutli-agent Q-learning algorithms ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Son et al. , 2019 ; Yang et al. , 2020 ) use a replay memory D to store the transition tuple ( τ , a , r , τ ′ ) , where r is the reward for taking action a at joint action-observation history τ with a transition to τ ′ . Due to partial observability , Q ( τ , a ; θ ) is used in place of Q ( s , a ; θ ) . Thus , parameters θ are learnt by minimizing the following expected TD error : L ( θ ) = E ( τ , a , r , τ ′ ) ∈D [ ( r + γV ( τ ′ ; θ− ) −Q ( τ , a ; θ ) ) 2 ] , ( 1 ) where V ( τ ′ ; θ− ) = maxa′ Q ( τ ′ , a′ ; θ− ) is the one-step expected future return of the TD target and θ− are the parameters of the target network , which will be periodically updated with θ . 2.3 CENTRALIZED TRAINING WITH DECENTRALIZED EXECUTION ( CTDE ) . CTDE is a popular paradigm of cooperative multi-agent deep reinforcement learning ( Sunehag et al. , 2018 ; Rashid et al. , 2018 ; Wang et al. , 2019a ; 2020b ; c ; d ) . Agents are trained in a centralized way and granted access to other agents ’ information or the global states during the centralized training process . However , due to partial observability and communication constraints , each agent makes its own decision based on its local action-observation history during the decentralized execution phase . IGM ( Individual-Global-Max ; Son et al. , 2019 ) is a popular principle to realize effective value-based CTDE , which asserts the consistency between joint and local greedy action selections in the joint action-value Qtot ( τ , a ) and individual action-values [ Qi ( τi , ai ) ] n i=1 : ∀τ ∈ T , argmax a∈A Qtot ( τ , a ) = ( argmax a1∈A Q1 ( τ1 , a1 ) , . . . , argmax an∈A Qn ( τn , an ) ) . ( 2 ) Two factorization structures , additivity and monotonicity , has been proposed by VDN ( Sunehag et al. , 2018 ) and QMIX ( Rashid et al. , 2018 ) , respectively , as shown below : QVDNtot ( τ , a ) = n∑ i=1 Qi ( τi , ai ) and ∀i ∈ N , ∂QQMIXtot ( τ , a ) ∂Qi ( τi , ai ) > 0 . Qatten ( Yang et al. , 2020 ) is a variant of VDN , which supplements global information through a multi-head attention structure . It is known that , these structures implement sufficient but not necessary conditions for the IGM constraint , which limit the representation expressiveness of joint action-value functions ( Mahajan et al. , 2019 ) . There exist tasks whose factorizable joint action-value functions can not be represented by these decomposition methods , as shown in Section 4 . In contrast , QTRAN ( Son et al. , 2019 ) transforms IGM into a linear constraint and uses it as soft regularization constraints . WQMIX ( Rashid et al. , 2020 ) introduces a weighting mechanism into the projection of monotonic value factorization , in order to place more importance on better joint actions . However , these relaxations may violate the exact IGM consistency and may not perform well in complex problems . 3 QPLEX : DUPLEX DUELING MULTI-AGENT Q-LEARNING . In this section , we will first introduce advantage-based IGM , equivalent to the regular IGM principle , and , with this new definition , convert the IGM consistency of greedy action selection to simple constraints on advantage functions . We then present a novel deep MARL model , called duPLEX dueling multi-agent Q-learning algorithm ( QPLEX ) , that directly realizes these constraints by a scalable neural network architecture .
This paper proposes a novel value decomposition approach to learn decentralized Q function in multi-agent setting. This idea is to follow Individual-Global-Max (IGM) principle. The main contribution is to use dueling structure (Q_i = V_i+A_i) for each agent i, and separately combining advantage/value terms respectively to form a centralized Q and A terms for training. Such combinations keep the positive correlation constraint between Q_tot and individual agent Q_i in QMix (i.e,. \partial Q_{tot} / \partial Q_i > 0) via positive trainable module in neural network, implemented by multi-head attention, etc.
SP:ad5a9c6598151e60f84bf54984621a3832276c14
Model-Agnostic Round-Optimal Federated Learning via Knowledge Transfer
1 INTRODUCTION . While the size of training data can influence the machine learning model quality a lot , the data are often dispersed over different parties in reality . Due to regulations on data privacy , the data can not be centralized to a single party for training . To address these issues , federated learning ( Kairouz et al. , 2019 ; Li et al. , 2019a ; b ; Yang et al. , 2019 ) enables multiple parties to collaboratively learn a model without exchanging their local data . It has become a hot research topic and shown promising results in the real world ( Bonawitz et al. , 2019 ; Hard et al. , 2018 ; Li et al. , 2020a ; Peng et al. , 2020 ) . Currently , federated averaging ( FedAvg ) ( McMahan et al. , 2016 ) is a widely used federated learning algorithm . Its training is an iterative process with four steps in each iteration . First , the server sends the global model to the selected parties . Second , each of the selected parties updates its model with their local data . Third , the updated models are sent to the server . Last , the server averages all the received models to update the global model . There are also many variants of FedAvg ( Li et al. , 2020c ; Karimireddy et al. , 2020 ) . For example , to handle the heterogeneous data setting , FedProx ( Li et al. , 2020c ) introduces an additional proximal term to limit the local updates , while SCAFFOLD ( Karimireddy et al. , 2020 ) introduces control variates to correct the local updates . The overall frameworks of these studies are still similar to FedAvg . FedAvg or its variants have the following limitations . First , they rely on the gradient descent for optimization . Thus , they can not be applied to train non-differentiable models such as decision trees in the federated setting . Second , the algorithm usually needs many communication rounds to finally achieve a good model , which causes massive communication traffic and fault tolerance requirements among rounds . Last , FedAvg is originally designed for the cross-device setting ( Kairouz et al. , 2019 ) , where the parties are mobile devices and the number of parties is large . In the cross-silo setting where the parties are organizations or data centers and the number of parties is relatively small , it is possible to take better advantage of the computation resources of the parties with relatively high computation power . In order to address the above-mentioned limitations , we propose a novel federated learning algorithm called FedKT ( Federated learning via Knowledge Transfer ) focusing on the cross-silo setting . With the round-optimal design goal , FedKT extends the idea of ensemble learning in a novel 2-tier design to federated setting . Inspired by the success of the usage of unlabelled public data in many studies ( Papernot et al. , 2017 ; 2018 ; Jordon et al. , 2019 ; Chang et al. , 2019 ) , which often exists such as text and images , we adopt the knowledge transfer method to reduce the inference and storage costs of ensemble learning . As such , FedKT is able to learn any classification model including differentiable models and non-differentiable models . Moreover , we develop differentially private versions and theoretically analyze the privacy loss of FedKT in order to provide different differential privacy guarantees . Our experiments on four tasks show that FedKT has quite good performance compared with the other state-of-the-art algorithms . Our main contributions are as follows . • We propose a new federated learning algorithm named FedKT . To the best of our knowledge , FedKT is the first algorithm which does not have any limitations on the model architecture and needs only a single communication round . • We show that FedKT is easy to achieve both example-level and party-level differential privacy and theoretically analyze the bound of its privacy cost . • We conduct experiments on various models and tasks and show that FedKT can achieve comparable accuracy compared with the other iterative algorithms . Moreover , FedKT can be used as an initialization step to achieve a better accuracy combined with the other approaches . 2 BACKGROUND AND RELATED WORK . 2.1 ENSEMBLE LEARNING . Instead of using a single model for prediction , ensemble learning ( Zhang & Ma , 2012 ) combines the predictions of multiple models to obtain better predictive performance . There are many widely used ensemble learning algorithms such as boosting ( Rätsch et al. , 2001 ) and bagging ( Prasad et al. , 2006 ) . One important factor in ensemble learning is the model diversity . The increased model diversity can usually improve the performance of the ensemble learning . In federated learning , since different parties have their own local data , there is natural diversity among the local models . Thus , the local models can be used as an ensemble for prediction . Previous works ( Yurochkin et al. , 2019 ; Guha et al. , 2019 ) have studied ensemble learning for federated learning and demonstrated promising predictive accuracy . As mentioned in their studies , since the prediction involves all the local models , the inference and the storage costs are prohibitively high especially when the number of models is large . In our study , we also use the local models as an ensemble and further use knowledge transfer to learn a single model in order to reduce the inference and the storage costs . 2.2 KNOWLEDGE TRANSFER OF THE TEACHER ENSEMBLE . Knowledge transfer has been successfully used in previous studies ( Hinton et al. , 2015 ; Papernot et al. , 2017 ; 2018 ; Jordon et al. , 2019 ) . Through knowledge transfer , an ensemble of models can be compressed into a single model . A typical example is the PATE ( Private Aggregation of Teacher Ensembles ) ( Papernot et al. , 2017 ) framework . In this framework , PATE first divides the original dataset into multiple disjoint subsets . A teacher model is trained separately on each subset . Then , the max voting method is used to make predictions on the public unlabelled datasets with the teacher ensemble , i.e. , choosing the majority class among the teachers as the label . Last , a student model is trained on the public dataset . A good feature of PATE is that it can easily satisfy differential privacy guarantees by adding noises to the vote counts . Moreover , PATE can be applied to any classification model regardless of the training algorithm . PATE is not designed for federated learning . Inspired by PATE , we propose FedKT , which adopts the knowledge transfer approach in the federated setting to address the limitations of FedAvg . 2.3 FEDERATED LEARNING WITH A SINGLE COMMUNICATION ROUND . There are several preliminary studies on federated learning algorithms with a single communication round . Guha et al . ( 2019 ) propose an one-shot federated learning algorithm to train support vector machines ( SVMs ) in both supervised and semi-supervised settings . Instead of simply averaging all the model weights in FedAvg , Yurochkin et al . ( 2019 ) propose PFNM by adopting a Bayesian nonparametric model to aggregate the local models when they are multilayer perceptrons ( MLPs ) . Their method shows a good performance in a single communication round and can also be applied in multiple communication rounds . While the above two methods are designed for specific models ( i.e. , SVMs in Guha et al . ( 2019 ) and MLPs in Yurochkin et al . ( 2019 ) ) , we propose a general federated learning framework which is applicable to any classification model . 2.4 FEDERATED LEARNING WITH KNOWLEDGE TRANSFER . There are some related studies ( Li & Wang , 2019 ; Chang et al. , 2019 ) using knowledge transfer in federated learning . However , Li & Wang ( 2019 ) has a different setting with us while Chang et al . ( 2019 ) has a different objective with us . In ( Li & Wang , 2019 ) , a public labeled dataset is needed to conduct initial transfer learning , while FedKT only needs a public unlabelled dataset . Chang et al . ( 2019 ) designs a robust federated learning algorithm to protect against poisoning attacks . The performance of their approach is slightly worse than FedAvg . We notice that there are some recently published contemporaneous work ( He et al. , 2020 ; Lin et al. , 2020 ) . He et al . ( 2020 ) considers cross-device setting and uses group knowledge transfer to reduce the overload of each edge device . Lin et al . ( 2020 ) utilizes knowledge transfer only in the server side to further update the averaged global model . All existing approaches transfer the prediction vectors ( i.g. , logits ) on the public dataset between clients and the server . FedKT transfers the voting counts and thus can easily satisfy differential privacy guarantees with a tight theoretical bound on the privacy loss . Moreover , FedKT is designed with a round-optimal goal , while the other approaches use iterative learning algorithms that needs many communication rounds to converge . 2.5 DIFFERENTIAL PRIVACY . Differential privacy ( Dwork , 2011 ; Dwork et al. , 2014 ) is a popular standard of privacy protection . It guarantees that the probability of producing a given output does not depend much on whether a particular data record is included in the input dataset or not . It has been widely used to protect the machine learning models ( Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ; Li et al. , 2020b ) . Definition 1 . ( ( ε , δ ) -Differential Privacy ) LetM : D → R be a randomized mechanism with domain D and range R. M satisifes ( , δ ) -differential privacy if for any two adjacent inputs d , d′ ∈ D and any subset of outputs S ⊆ R it holds that : Pr [ M ( d ) ∈ S ] ≤ e Pr [ M ( d′ ) ∈ S ] + δ . ( 1 ) The moments accountant method ( Abadi et al. , 2016 ) is a state-of-the-art approach to track the privacy loss . We briefly introduce the key concept , and refer readers to the previous paper ( Abadi et al. , 2016 ) for more details . Definition 2 . ( Privacy Loss ) Let M : D → R be a randomized mechanism . Let aux denote an auxiliary input . For two adjacent inputs d , d′ ∈ D , an outcome o ∈ R , the privacy loss at o is defined as : c ( o ; M , aux , d , d′ ) ∆= log Pr [ M ( aux , d ) = o ] Pr [ M ( aux , d′ ) = o ] . ( 2 ) Definition 3 . ( Moments Accountant ) LetM : D → R be a randomized mechanism . Let aux denote an auxiliary input . For two adjacent inputs d , d′ , the moments accountant is defined as : αM ( λ ) ∆ = max aux , d , d′ αM ( λ ; aux , d , d′ ) ( 3 ) where αM ( λ ; aux , d , d′ ) ∆ = logEo [ exp ( λc ( o ; M , aux , d , d′ ) ) ] is the log of moment generating function . The moments have good composability and can be easily converted to ( ε , δ ) -differential privacy Abadi et al . ( 2016 ) . Party-level Differential Privacy In addition to the standard example-level differential privacy , party-level differential privacy ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) is more strict and attractive in the federated setting . Instead of aiming to protect a single record , party-level differential privacy ensures that the model does not reveal whether a party participated in federated learning or not . Definition 4 . ( Party-adjacent Datasets ) Let d , d′ be two datasets of training examples , where each example is associated with a party . Then , d and d′ are party-adjacent if d′ can be formed by changing the examples associated with a single party from d .
This submission proposes a new federated learning framework based on knowledge transfer. Local dataset at each party are partitioned and each partition is used to train a teacher model. All teacher models at each party are used to train a student model using pseudo labels based on voting on public dataset. Student model from each party is then uploaded to server and used to train the final model based on voting on unlabeled data. Differential privacy analysis is conducted and experimental evaluations comparing to other mainstream federated learning methods are presented. The advantages of the proposed method include privacy preservation, lower communication traffic, as well as applicability to non-differentiable models. While the proposed framework is technically sound, the reviewer is not convinced by its technical contributions. The design of the framework is integration of existing technics such as PATE, and the mechanism of protecting privacy as well as reduction of communication traffic is also not new (see FedMD: Heterogenous Federated Learning via Model Distillation, Neurips 2019 Workshop and Ensemble Distillation for Robust Model Fusion in Federated Learning, Neurips 2020). There is no clear advantage in the proposed method over these existing methods from the reviewer’s point of view. Plus the overall performance on benchmark dataset seems to be degraded compared to other mainstream methods like FedAvg. The reviewer would like the authors to explain and discuss the technical contributions of the submission and compare the proposed framework to these similar existing methods based on knowledge transfer.
SP:c126dc4e6625a18fdeecbd54f61abeff7e38f796
Model-Agnostic Round-Optimal Federated Learning via Knowledge Transfer
1 INTRODUCTION . While the size of training data can influence the machine learning model quality a lot , the data are often dispersed over different parties in reality . Due to regulations on data privacy , the data can not be centralized to a single party for training . To address these issues , federated learning ( Kairouz et al. , 2019 ; Li et al. , 2019a ; b ; Yang et al. , 2019 ) enables multiple parties to collaboratively learn a model without exchanging their local data . It has become a hot research topic and shown promising results in the real world ( Bonawitz et al. , 2019 ; Hard et al. , 2018 ; Li et al. , 2020a ; Peng et al. , 2020 ) . Currently , federated averaging ( FedAvg ) ( McMahan et al. , 2016 ) is a widely used federated learning algorithm . Its training is an iterative process with four steps in each iteration . First , the server sends the global model to the selected parties . Second , each of the selected parties updates its model with their local data . Third , the updated models are sent to the server . Last , the server averages all the received models to update the global model . There are also many variants of FedAvg ( Li et al. , 2020c ; Karimireddy et al. , 2020 ) . For example , to handle the heterogeneous data setting , FedProx ( Li et al. , 2020c ) introduces an additional proximal term to limit the local updates , while SCAFFOLD ( Karimireddy et al. , 2020 ) introduces control variates to correct the local updates . The overall frameworks of these studies are still similar to FedAvg . FedAvg or its variants have the following limitations . First , they rely on the gradient descent for optimization . Thus , they can not be applied to train non-differentiable models such as decision trees in the federated setting . Second , the algorithm usually needs many communication rounds to finally achieve a good model , which causes massive communication traffic and fault tolerance requirements among rounds . Last , FedAvg is originally designed for the cross-device setting ( Kairouz et al. , 2019 ) , where the parties are mobile devices and the number of parties is large . In the cross-silo setting where the parties are organizations or data centers and the number of parties is relatively small , it is possible to take better advantage of the computation resources of the parties with relatively high computation power . In order to address the above-mentioned limitations , we propose a novel federated learning algorithm called FedKT ( Federated learning via Knowledge Transfer ) focusing on the cross-silo setting . With the round-optimal design goal , FedKT extends the idea of ensemble learning in a novel 2-tier design to federated setting . Inspired by the success of the usage of unlabelled public data in many studies ( Papernot et al. , 2017 ; 2018 ; Jordon et al. , 2019 ; Chang et al. , 2019 ) , which often exists such as text and images , we adopt the knowledge transfer method to reduce the inference and storage costs of ensemble learning . As such , FedKT is able to learn any classification model including differentiable models and non-differentiable models . Moreover , we develop differentially private versions and theoretically analyze the privacy loss of FedKT in order to provide different differential privacy guarantees . Our experiments on four tasks show that FedKT has quite good performance compared with the other state-of-the-art algorithms . Our main contributions are as follows . • We propose a new federated learning algorithm named FedKT . To the best of our knowledge , FedKT is the first algorithm which does not have any limitations on the model architecture and needs only a single communication round . • We show that FedKT is easy to achieve both example-level and party-level differential privacy and theoretically analyze the bound of its privacy cost . • We conduct experiments on various models and tasks and show that FedKT can achieve comparable accuracy compared with the other iterative algorithms . Moreover , FedKT can be used as an initialization step to achieve a better accuracy combined with the other approaches . 2 BACKGROUND AND RELATED WORK . 2.1 ENSEMBLE LEARNING . Instead of using a single model for prediction , ensemble learning ( Zhang & Ma , 2012 ) combines the predictions of multiple models to obtain better predictive performance . There are many widely used ensemble learning algorithms such as boosting ( Rätsch et al. , 2001 ) and bagging ( Prasad et al. , 2006 ) . One important factor in ensemble learning is the model diversity . The increased model diversity can usually improve the performance of the ensemble learning . In federated learning , since different parties have their own local data , there is natural diversity among the local models . Thus , the local models can be used as an ensemble for prediction . Previous works ( Yurochkin et al. , 2019 ; Guha et al. , 2019 ) have studied ensemble learning for federated learning and demonstrated promising predictive accuracy . As mentioned in their studies , since the prediction involves all the local models , the inference and the storage costs are prohibitively high especially when the number of models is large . In our study , we also use the local models as an ensemble and further use knowledge transfer to learn a single model in order to reduce the inference and the storage costs . 2.2 KNOWLEDGE TRANSFER OF THE TEACHER ENSEMBLE . Knowledge transfer has been successfully used in previous studies ( Hinton et al. , 2015 ; Papernot et al. , 2017 ; 2018 ; Jordon et al. , 2019 ) . Through knowledge transfer , an ensemble of models can be compressed into a single model . A typical example is the PATE ( Private Aggregation of Teacher Ensembles ) ( Papernot et al. , 2017 ) framework . In this framework , PATE first divides the original dataset into multiple disjoint subsets . A teacher model is trained separately on each subset . Then , the max voting method is used to make predictions on the public unlabelled datasets with the teacher ensemble , i.e. , choosing the majority class among the teachers as the label . Last , a student model is trained on the public dataset . A good feature of PATE is that it can easily satisfy differential privacy guarantees by adding noises to the vote counts . Moreover , PATE can be applied to any classification model regardless of the training algorithm . PATE is not designed for federated learning . Inspired by PATE , we propose FedKT , which adopts the knowledge transfer approach in the federated setting to address the limitations of FedAvg . 2.3 FEDERATED LEARNING WITH A SINGLE COMMUNICATION ROUND . There are several preliminary studies on federated learning algorithms with a single communication round . Guha et al . ( 2019 ) propose an one-shot federated learning algorithm to train support vector machines ( SVMs ) in both supervised and semi-supervised settings . Instead of simply averaging all the model weights in FedAvg , Yurochkin et al . ( 2019 ) propose PFNM by adopting a Bayesian nonparametric model to aggregate the local models when they are multilayer perceptrons ( MLPs ) . Their method shows a good performance in a single communication round and can also be applied in multiple communication rounds . While the above two methods are designed for specific models ( i.e. , SVMs in Guha et al . ( 2019 ) and MLPs in Yurochkin et al . ( 2019 ) ) , we propose a general federated learning framework which is applicable to any classification model . 2.4 FEDERATED LEARNING WITH KNOWLEDGE TRANSFER . There are some related studies ( Li & Wang , 2019 ; Chang et al. , 2019 ) using knowledge transfer in federated learning . However , Li & Wang ( 2019 ) has a different setting with us while Chang et al . ( 2019 ) has a different objective with us . In ( Li & Wang , 2019 ) , a public labeled dataset is needed to conduct initial transfer learning , while FedKT only needs a public unlabelled dataset . Chang et al . ( 2019 ) designs a robust federated learning algorithm to protect against poisoning attacks . The performance of their approach is slightly worse than FedAvg . We notice that there are some recently published contemporaneous work ( He et al. , 2020 ; Lin et al. , 2020 ) . He et al . ( 2020 ) considers cross-device setting and uses group knowledge transfer to reduce the overload of each edge device . Lin et al . ( 2020 ) utilizes knowledge transfer only in the server side to further update the averaged global model . All existing approaches transfer the prediction vectors ( i.g. , logits ) on the public dataset between clients and the server . FedKT transfers the voting counts and thus can easily satisfy differential privacy guarantees with a tight theoretical bound on the privacy loss . Moreover , FedKT is designed with a round-optimal goal , while the other approaches use iterative learning algorithms that needs many communication rounds to converge . 2.5 DIFFERENTIAL PRIVACY . Differential privacy ( Dwork , 2011 ; Dwork et al. , 2014 ) is a popular standard of privacy protection . It guarantees that the probability of producing a given output does not depend much on whether a particular data record is included in the input dataset or not . It has been widely used to protect the machine learning models ( Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ; Li et al. , 2020b ) . Definition 1 . ( ( ε , δ ) -Differential Privacy ) LetM : D → R be a randomized mechanism with domain D and range R. M satisifes ( , δ ) -differential privacy if for any two adjacent inputs d , d′ ∈ D and any subset of outputs S ⊆ R it holds that : Pr [ M ( d ) ∈ S ] ≤ e Pr [ M ( d′ ) ∈ S ] + δ . ( 1 ) The moments accountant method ( Abadi et al. , 2016 ) is a state-of-the-art approach to track the privacy loss . We briefly introduce the key concept , and refer readers to the previous paper ( Abadi et al. , 2016 ) for more details . Definition 2 . ( Privacy Loss ) Let M : D → R be a randomized mechanism . Let aux denote an auxiliary input . For two adjacent inputs d , d′ ∈ D , an outcome o ∈ R , the privacy loss at o is defined as : c ( o ; M , aux , d , d′ ) ∆= log Pr [ M ( aux , d ) = o ] Pr [ M ( aux , d′ ) = o ] . ( 2 ) Definition 3 . ( Moments Accountant ) LetM : D → R be a randomized mechanism . Let aux denote an auxiliary input . For two adjacent inputs d , d′ , the moments accountant is defined as : αM ( λ ) ∆ = max aux , d , d′ αM ( λ ; aux , d , d′ ) ( 3 ) where αM ( λ ; aux , d , d′ ) ∆ = logEo [ exp ( λc ( o ; M , aux , d , d′ ) ) ] is the log of moment generating function . The moments have good composability and can be easily converted to ( ε , δ ) -differential privacy Abadi et al . ( 2016 ) . Party-level Differential Privacy In addition to the standard example-level differential privacy , party-level differential privacy ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) is more strict and attractive in the federated setting . Instead of aiming to protect a single record , party-level differential privacy ensures that the model does not reveal whether a party participated in federated learning or not . Definition 4 . ( Party-adjacent Datasets ) Let d , d′ be two datasets of training examples , where each example is associated with a party . Then , d and d′ are party-adjacent if d′ can be formed by changing the examples associated with a single party from d .
The paper considers classification tasks in the federated learning scenario when each device/worker is powerful in terms of computational power and storage space, but, the communication between devices is constrained. The paper proposes a novel algorithm for federated learning that reduces the number of communication rounds to one. The algorithm constructs an ensembled model with the majority voting out of the locally trained models and then on the server side learns a final model by mimicking the performance of the ensembled model on a public dataset.
SP:c126dc4e6625a18fdeecbd54f61abeff7e38f796
Numeric Encoding Options with Automunge
1 INTRODUCTION . Of the various modalities of machine learning application ( e.g . images , language , audio , etc . ) tabular data , aka structured data , as may comprise tables of feature set columns and collected sample rows , in my experience does not command as much attention from the research community , for which I speculate may be partly attributed to the general non-uniformity across manifestations precluding the conventions of most other modalities for representative benchmarks and availability of pre-trained architectures as could be adapted with fine-tuning to practical applications . That is not to say that tabular data lacks points of uniformity across data sets , for at its core the various feature sets can at a high level be grouped into just two primary types : numeric and categoric . It was the focus of a recent paper by this author ( Author , 2020 ) to explore methods of preparing categoric sets for machine learning as are available in the Automunge open source python library platform for tabular data pipelines . This paper will give similar treatment for methods to prepare numeric feature sets for machine learning . Of course it would be an oversimplification to characterize “ numeric feature sets ” as a sufficient descriptor alone to represent the wide amount of diversity as may be found between different such instances . Numeric could be referring to integers , floats , or combinations thereof . The set of entries could be bounded , the potential range of entries could be bounded on the left , right , or both sides , the distribution of values could be thin or fat tailed , single or multi-modal . The order of samples could be independent or sequential . In some cases the values could themselves be an encoded representation of a categoric feature . Beyond the potential diversity found within our numeric features , another source of diversity could be considered based on relationships between multiple feature sets . For example one feature could be independent of the others , could contain full or partial redundancy with one or more other variables by correlation , or in the case of sequential data there could even be causal relationships between variables across time steps . The primary focus of transformations to be discussed in this paper will not take into account variable interdependencies , and will instead operate under the assumption that the training operation of a downstream learning algorithm may be more suitable for the efficient interpretation of such interdependencies , as the convention for Automunge is that data transformations ( and in some cases sets of transformations ) are to be directed for application to a distinct feature set as input . In many cases the basis for these transformations will be properties derived from the received feature in a designated “ train ” set ( as may be passed to the automunge ( . ) function ) for subsequent application on a consistent basis to a designated “ test ” set ( as may be passed to the postmunge ( . ) function ) . 2 NORMALIZATIONS . A common practice for preprocessing numeric feature sets for the application of neural networks is to apply a normalization operation in which received values are centered and scaled based on properties of the data . By conversion to comparable scale between features , backpropagation may have an easier time navigating the fitness landscape rather than overweighting to higher magnitude inputs ( Ng , 2011 ) . Table 1 surveys a few normalization operations as available in Automunge . Upon inspection a few points of differentiation become evident . The choice of denominator can be material to the result , for while both ( max - min ) and standard deviation can have the result of shrinking or enlarging the values to fall within a more uniform range , the ( max - min ) variety has more of a known returned range for the output that is independent of the feature set distribution properties , thus allowing us to ensure all of the min-max returned values are non-negative for instance , as may be a pre-requisite for some kinds of algorithms . Of course this known range of output relies on the assumption that the range of values in subsequent test sets will correspond to the train set properties that serve as a basis - to allow a user to prevent these type of outliers from interfering with downstream applications , Automunge allows a user to pass parameters to the transformation functions , such as to activate floors or caps on the returned range . An easy to overlook outcome of the shifting and/or centering of the returned range by way of the subtraction operation in the numerator is a loss of the original zero point , as for example with z-score normalization the returned zero point is shifted to coincide with the original mean . It is the opinion of this author that such re-centering of the data may not always be a trivial trade-off . Consider the special properties of the number 0 in mathematics , including multiplicative properties at/above/below . By shifting the original zero point we are presenting a ( small ) obstacle to the training operation in order to relearn this point . Perhaps more importantly , further trade-offs include the interpretability of the returned data . Automunge thus offers a novel form of normalization , available in our library as ‘ retn ’ ( standing for “ retain ” ) , that bases the formula applied to scale data on the range of values found within the train set , with the result of scaling the data within a similar range as some of those demonstrated above while also retaining the zero point and thus the +/- sign of all received data . 3 TRANSFORMATIONS . In many cases the application of a normalization procedure may be preceded by one or more types of data transformations applied to the received numeric set . Examples of data transformations could include basic mathematic operators like + - * / , log transforms , raising to a power , absolute values , etc . In some cases the transformations may also be tailored to the properties of the train set , for example with a Box-Cox power law transformation ( Box & Cox , 1964 ) . In the Automunge library , the order of such sets of transformations , as may be applied to a distinct source column , and in some cases which may include generations and branches of derivations , are specified by way of transformation category entries to a set of “ family tree ” primitives [ Table 3 ] ( Author , 2020 ) for a root transformation category , and where a transformation category entry may be associated with one or more transformation functions intended for application to corresponding train and/or test set feature columns , potentially including custom transformation functions which may be defined with minimal requirements of simple data structures . Such root categories may be pre-defined in the Automunge library of transformations or may be custom configured by a user in entries to a “ transformdict ” data structure . The convention for transformation functions in the Automunge library is that any kind of function accepts any kind of data , and in cases where an invalid entry is returned , for example when dividing by zero or taking a square root of a negative number , such entry may serve as a target for missing data infill , with infill methods that may be applied to a column from a library of infill options - including “ ML infill ” in which random forest models ( Breiman , 2001 ) are used to predict infill based on properties of the train set . To facilitate the application of infill , transformation categories used as root categories are specified with a classification for the types of data that will be considered valid input , as for example may be non-negative numeric , non-zero numeric , integer numeric , etc . These “ NArowtype ” classifications are populated in the same “ processdict ” data structure used to assign transformation functions to a transformation category . 4 BINS AND GRAININGS . In most cases the transformations considered in the preceding section maintained full information retention of the received data , such that with returned sets the form of the input data can be recovered with an inversion operation ( as is available in the Automunge library ) . For binning transformations , there may instead be a type of coarse graining of the feature set to aggregate buckets of entries into a categoric representation . Automunge offers a wide range of options for numeric binning [ Table 4 ] . Bins may be aggregated to either supplement or replace received numeric sets . For each binning operation , transformation category options are available to return the categoric encoding as a one-hot encoding , ordinal integer encoding , or binary encoding in which distinct categories may be represented by multiple simultaneous activations . This is partly motivated by different conventions of various libraries for accepting input to an entity embedding layer ( Guo & Berkhahn , 2016 ) as may be applied to the returned categoric encoding in a downstream training operation . 5 NOISE INJECTION . For most cases in the Automunge library , transformations applied to a train set feature set are applied to the corresponding test set feature set using the same basis , such that if the same data is received for both train and test sets , the same form will be returned ( a useful point for validations ) . The noise injection options are a little different in that such injections may be intended just for the train data but not the corresponding test data . The rationale behind noise injections were first to support differential privacy considerations ( Dwork et al. , 2006 ) . Other potential uses of noise injections could be to perturb the model training , facilitating diversity between models as may be beneficial in the aggregation of ensembles ( Dietterich , 2000 ) or as a source of training data augmentation ( Perez & Wang , 2017 ) . The experiments detailed below will suggest a material model performance benefit from data augmentation by noise injection in cases of underserved training data , which we believe is a novel innovation for tabular learning . The options available for noise injection are generally derived by way of aggregations of transformation category entries to family tree primitives , as noise injection may be applied downstream to a normalization or categoric encoding . ( The convention for transformation functions is that they receive input of a single target column , so transformations performed downstream of a categoric encoding should be fed an ordinal input . ) The library includes distinct noise injection family tree aggregations tailored to operation of several different types of received normalizations , as may rely on a known range or scale of input , or applied preceding different types of categoric encodings . Numeric noise injections [ Table 5 , Fig 1 ] are derived from a Gaussian source with configurable parameters . For noise intended to sets with a fixed range of values such as DPmm , although the noise source as implemented is Gaussian , the application is capped from extreme outliers at half of range ( e.g . +/- 0.5 ) and based on whether an input entry is above or below the midpoint , positive or negative noise respectively is scaled to ensure maintained original range in returned data based on values of input entry . Parameters are also accepted to indicate what ratio of input will receive injection . Similar options are available for Laplace distribution noise profiles . To clarify how family tree primitives come into play , for the ‘ DPmm ’ root category in Fig 1 , when ‘ DPmm ’ is applied as a root category to a source column with header ‘ column ’ , the upstream primitive entries are inspected , which include a parents entry of the ‘ DPm2 ’ transformation category and a cousins entry of the ‘ NArw ’ transformation category . For the ‘ NArw ’ upstream entry to the cousins primitive , the ‘ NArw ’ transformation category is associated with a NArw transformation function ( a function aggregating boolean activations indicating presence of infill ) per the processdict entry associated with the ‘ NArw ’ root category , which transformation function returns the column ‘ column NArw ’ with the suffix appender ‘ NArw ’ logging the transformation function applied . Because cousins is a primitive without offspring no further generations are inspected in the ‘ NArw ’ family tree downstream primitives . For the upstream parents primitive entry ‘ DPm2 ’ , the ‘ DPm2 ’ processdict entry has a transformation function of mnmx ( min-max scaling ) , which is applied and logged by the ‘ mnmx ’ suffix appender , and since parents is a primitive with offspring the downstream primitives in the ‘ DPm2 ’ family tree are inspected where a coworkers entry of ‘ DPmm ’ transformation category is found which is associated with a DPmm transformation function ( noise injection corresponding to range 0-1 ) based on the ‘ DPmm ’ root category processdict entry . Because coworkers is a replacement primitive the column configuration with header ‘ column mnmx ’ is not retained for the returned set . The returned column originating from the DPmm transformation function has header logging the two applied transformation functions as ‘ column mnmx DPmm ’ . Please note that column retention , as may be impacted by the application of downstream replacement primitive entries , is signaled in these diagrams by the color coding between orange and blue , and applied transformation functions are shaded as green . Transformation category entries of primitives that are not inspected are left without shading . Also please note that the processdict entries here are an abstraction for the set of corresponding transformation functions that may be directed to train and/or test set feature sets . The application of noise to categoric encodings [ Table 6 , Fig 2 ] is a little simpler , where a given ratio of entries in a categoric feature set are flipped to one of the other activations , between which have a uniform probability of replacement ( including possibility of original entry retention ) . For the ‘ DP10 ’ root category example shown in Fig 2 , this is achieved by first applying an ordinal encoding by ord3 transformation function associated with a ‘ DPo6 ’ transformation category entry to the parents upstream primitive of the ‘ DP10 ’ root category , then a noise injection by the DPod transformation function associated with a ‘ DPo3 ’ transformation category to the downstream children primitive associated with the ‘ DPo6 ’ root category ( applied since parents is a primitive with offspring ) , followed by a binary encoding by the 1010 transformation function associated with the ‘ 1010 ’ transformation category entry to the downstream coworkers primitive associated with the ‘ DPo3 ’ root category ( applied since children is a primitive with offspring ) . Here the intermediate stages of derivations associated with columns ‘ column ord3 ’ and ‘ column ord3 DPod ’ are not retained in the returned set since children and coworkers are replacement primitives .
This paper introduces a number of data preprocessing options for numeric features provided by an open source library automunge. The most of the paper focuses on explaining the specific transformations offered under each option, including normalization, binning, and noise injection. For normalization, a new transformation 'retain' is offered in addition to traditional z-score, min-max etc. The paper uses one section between normalization and binning to explain a notion 'family tree primitives' which is used in the composition of multiple transformations. In experiments, the paper uses the higgs dataset. Three settings of the dataset are used: full data, 5% data and 0.25% data. 6 settings of transformations are used: raw data, z-score, retain, retain with bins, retain with noise injection, and retain with partial noise injection. When averaged over the three settings of the dataset, using raw data leads to suboptimal auc score compared with the other five. It is acknowledged that "the metrics for normalized data were slightly better than raw on average, it is not clear if they were sufficiently statistically significant to draw firm conclusions. " The paper concludes that "any consideration around benefits of feature engineering should distinguish
SP:af32b11ab09c21c2732a744bf8c694cd80acf309
Numeric Encoding Options with Automunge
1 INTRODUCTION . Of the various modalities of machine learning application ( e.g . images , language , audio , etc . ) tabular data , aka structured data , as may comprise tables of feature set columns and collected sample rows , in my experience does not command as much attention from the research community , for which I speculate may be partly attributed to the general non-uniformity across manifestations precluding the conventions of most other modalities for representative benchmarks and availability of pre-trained architectures as could be adapted with fine-tuning to practical applications . That is not to say that tabular data lacks points of uniformity across data sets , for at its core the various feature sets can at a high level be grouped into just two primary types : numeric and categoric . It was the focus of a recent paper by this author ( Author , 2020 ) to explore methods of preparing categoric sets for machine learning as are available in the Automunge open source python library platform for tabular data pipelines . This paper will give similar treatment for methods to prepare numeric feature sets for machine learning . Of course it would be an oversimplification to characterize “ numeric feature sets ” as a sufficient descriptor alone to represent the wide amount of diversity as may be found between different such instances . Numeric could be referring to integers , floats , or combinations thereof . The set of entries could be bounded , the potential range of entries could be bounded on the left , right , or both sides , the distribution of values could be thin or fat tailed , single or multi-modal . The order of samples could be independent or sequential . In some cases the values could themselves be an encoded representation of a categoric feature . Beyond the potential diversity found within our numeric features , another source of diversity could be considered based on relationships between multiple feature sets . For example one feature could be independent of the others , could contain full or partial redundancy with one or more other variables by correlation , or in the case of sequential data there could even be causal relationships between variables across time steps . The primary focus of transformations to be discussed in this paper will not take into account variable interdependencies , and will instead operate under the assumption that the training operation of a downstream learning algorithm may be more suitable for the efficient interpretation of such interdependencies , as the convention for Automunge is that data transformations ( and in some cases sets of transformations ) are to be directed for application to a distinct feature set as input . In many cases the basis for these transformations will be properties derived from the received feature in a designated “ train ” set ( as may be passed to the automunge ( . ) function ) for subsequent application on a consistent basis to a designated “ test ” set ( as may be passed to the postmunge ( . ) function ) . 2 NORMALIZATIONS . A common practice for preprocessing numeric feature sets for the application of neural networks is to apply a normalization operation in which received values are centered and scaled based on properties of the data . By conversion to comparable scale between features , backpropagation may have an easier time navigating the fitness landscape rather than overweighting to higher magnitude inputs ( Ng , 2011 ) . Table 1 surveys a few normalization operations as available in Automunge . Upon inspection a few points of differentiation become evident . The choice of denominator can be material to the result , for while both ( max - min ) and standard deviation can have the result of shrinking or enlarging the values to fall within a more uniform range , the ( max - min ) variety has more of a known returned range for the output that is independent of the feature set distribution properties , thus allowing us to ensure all of the min-max returned values are non-negative for instance , as may be a pre-requisite for some kinds of algorithms . Of course this known range of output relies on the assumption that the range of values in subsequent test sets will correspond to the train set properties that serve as a basis - to allow a user to prevent these type of outliers from interfering with downstream applications , Automunge allows a user to pass parameters to the transformation functions , such as to activate floors or caps on the returned range . An easy to overlook outcome of the shifting and/or centering of the returned range by way of the subtraction operation in the numerator is a loss of the original zero point , as for example with z-score normalization the returned zero point is shifted to coincide with the original mean . It is the opinion of this author that such re-centering of the data may not always be a trivial trade-off . Consider the special properties of the number 0 in mathematics , including multiplicative properties at/above/below . By shifting the original zero point we are presenting a ( small ) obstacle to the training operation in order to relearn this point . Perhaps more importantly , further trade-offs include the interpretability of the returned data . Automunge thus offers a novel form of normalization , available in our library as ‘ retn ’ ( standing for “ retain ” ) , that bases the formula applied to scale data on the range of values found within the train set , with the result of scaling the data within a similar range as some of those demonstrated above while also retaining the zero point and thus the +/- sign of all received data . 3 TRANSFORMATIONS . In many cases the application of a normalization procedure may be preceded by one or more types of data transformations applied to the received numeric set . Examples of data transformations could include basic mathematic operators like + - * / , log transforms , raising to a power , absolute values , etc . In some cases the transformations may also be tailored to the properties of the train set , for example with a Box-Cox power law transformation ( Box & Cox , 1964 ) . In the Automunge library , the order of such sets of transformations , as may be applied to a distinct source column , and in some cases which may include generations and branches of derivations , are specified by way of transformation category entries to a set of “ family tree ” primitives [ Table 3 ] ( Author , 2020 ) for a root transformation category , and where a transformation category entry may be associated with one or more transformation functions intended for application to corresponding train and/or test set feature columns , potentially including custom transformation functions which may be defined with minimal requirements of simple data structures . Such root categories may be pre-defined in the Automunge library of transformations or may be custom configured by a user in entries to a “ transformdict ” data structure . The convention for transformation functions in the Automunge library is that any kind of function accepts any kind of data , and in cases where an invalid entry is returned , for example when dividing by zero or taking a square root of a negative number , such entry may serve as a target for missing data infill , with infill methods that may be applied to a column from a library of infill options - including “ ML infill ” in which random forest models ( Breiman , 2001 ) are used to predict infill based on properties of the train set . To facilitate the application of infill , transformation categories used as root categories are specified with a classification for the types of data that will be considered valid input , as for example may be non-negative numeric , non-zero numeric , integer numeric , etc . These “ NArowtype ” classifications are populated in the same “ processdict ” data structure used to assign transformation functions to a transformation category . 4 BINS AND GRAININGS . In most cases the transformations considered in the preceding section maintained full information retention of the received data , such that with returned sets the form of the input data can be recovered with an inversion operation ( as is available in the Automunge library ) . For binning transformations , there may instead be a type of coarse graining of the feature set to aggregate buckets of entries into a categoric representation . Automunge offers a wide range of options for numeric binning [ Table 4 ] . Bins may be aggregated to either supplement or replace received numeric sets . For each binning operation , transformation category options are available to return the categoric encoding as a one-hot encoding , ordinal integer encoding , or binary encoding in which distinct categories may be represented by multiple simultaneous activations . This is partly motivated by different conventions of various libraries for accepting input to an entity embedding layer ( Guo & Berkhahn , 2016 ) as may be applied to the returned categoric encoding in a downstream training operation . 5 NOISE INJECTION . For most cases in the Automunge library , transformations applied to a train set feature set are applied to the corresponding test set feature set using the same basis , such that if the same data is received for both train and test sets , the same form will be returned ( a useful point for validations ) . The noise injection options are a little different in that such injections may be intended just for the train data but not the corresponding test data . The rationale behind noise injections were first to support differential privacy considerations ( Dwork et al. , 2006 ) . Other potential uses of noise injections could be to perturb the model training , facilitating diversity between models as may be beneficial in the aggregation of ensembles ( Dietterich , 2000 ) or as a source of training data augmentation ( Perez & Wang , 2017 ) . The experiments detailed below will suggest a material model performance benefit from data augmentation by noise injection in cases of underserved training data , which we believe is a novel innovation for tabular learning . The options available for noise injection are generally derived by way of aggregations of transformation category entries to family tree primitives , as noise injection may be applied downstream to a normalization or categoric encoding . ( The convention for transformation functions is that they receive input of a single target column , so transformations performed downstream of a categoric encoding should be fed an ordinal input . ) The library includes distinct noise injection family tree aggregations tailored to operation of several different types of received normalizations , as may rely on a known range or scale of input , or applied preceding different types of categoric encodings . Numeric noise injections [ Table 5 , Fig 1 ] are derived from a Gaussian source with configurable parameters . For noise intended to sets with a fixed range of values such as DPmm , although the noise source as implemented is Gaussian , the application is capped from extreme outliers at half of range ( e.g . +/- 0.5 ) and based on whether an input entry is above or below the midpoint , positive or negative noise respectively is scaled to ensure maintained original range in returned data based on values of input entry . Parameters are also accepted to indicate what ratio of input will receive injection . Similar options are available for Laplace distribution noise profiles . To clarify how family tree primitives come into play , for the ‘ DPmm ’ root category in Fig 1 , when ‘ DPmm ’ is applied as a root category to a source column with header ‘ column ’ , the upstream primitive entries are inspected , which include a parents entry of the ‘ DPm2 ’ transformation category and a cousins entry of the ‘ NArw ’ transformation category . For the ‘ NArw ’ upstream entry to the cousins primitive , the ‘ NArw ’ transformation category is associated with a NArw transformation function ( a function aggregating boolean activations indicating presence of infill ) per the processdict entry associated with the ‘ NArw ’ root category , which transformation function returns the column ‘ column NArw ’ with the suffix appender ‘ NArw ’ logging the transformation function applied . Because cousins is a primitive without offspring no further generations are inspected in the ‘ NArw ’ family tree downstream primitives . For the upstream parents primitive entry ‘ DPm2 ’ , the ‘ DPm2 ’ processdict entry has a transformation function of mnmx ( min-max scaling ) , which is applied and logged by the ‘ mnmx ’ suffix appender , and since parents is a primitive with offspring the downstream primitives in the ‘ DPm2 ’ family tree are inspected where a coworkers entry of ‘ DPmm ’ transformation category is found which is associated with a DPmm transformation function ( noise injection corresponding to range 0-1 ) based on the ‘ DPmm ’ root category processdict entry . Because coworkers is a replacement primitive the column configuration with header ‘ column mnmx ’ is not retained for the returned set . The returned column originating from the DPmm transformation function has header logging the two applied transformation functions as ‘ column mnmx DPmm ’ . Please note that column retention , as may be impacted by the application of downstream replacement primitive entries , is signaled in these diagrams by the color coding between orange and blue , and applied transformation functions are shaded as green . Transformation category entries of primitives that are not inspected are left without shading . Also please note that the processdict entries here are an abstraction for the set of corresponding transformation functions that may be directed to train and/or test set feature sets . The application of noise to categoric encodings [ Table 6 , Fig 2 ] is a little simpler , where a given ratio of entries in a categoric feature set are flipped to one of the other activations , between which have a uniform probability of replacement ( including possibility of original entry retention ) . For the ‘ DP10 ’ root category example shown in Fig 2 , this is achieved by first applying an ordinal encoding by ord3 transformation function associated with a ‘ DPo6 ’ transformation category entry to the parents upstream primitive of the ‘ DP10 ’ root category , then a noise injection by the DPod transformation function associated with a ‘ DPo3 ’ transformation category to the downstream children primitive associated with the ‘ DPo6 ’ root category ( applied since parents is a primitive with offspring ) , followed by a binary encoding by the 1010 transformation function associated with the ‘ 1010 ’ transformation category entry to the downstream coworkers primitive associated with the ‘ DPo3 ’ root category ( applied since children is a primitive with offspring ) . Here the intermediate stages of derivations associated with columns ‘ column ord3 ’ and ‘ column ord3 DPod ’ are not retained in the returned set since children and coworkers are replacement primitives .
The paper describes a library (Automunge) for pre-processing tabular data to prepare the data for downstream machine learning tasks. The paper also describes how to use the said library and the various options (including some new forms of normalization) available in the library. Experimental evaluation on Higgs Boson interaction dataset is provided, following the experimentation in Baldi, Sadowski and Whiteson 2014. Some improvements over the published results in Baldi 2014 are shown.
SP:af32b11ab09c21c2732a744bf8c694cd80acf309
Differentiable Spatial Planning using Transformers
We consider the problem of spatial path planning . In contrast to the classical solutions which optimize a new plan from scratch and assume access to the full map with ground truth obstacle locations , we learn a planner from the data in a differentiable manner that allows us to leverage statistical regularities from past data . We propose Spatial Planning Transformers ( SPT ) , which given an obstacle map learns to generate actions by planning over long-range spatial dependencies , unlike prior data-driven planners that propagate information locally via convolutional structure in an iterative manner . In the setting where the ground truth map is not known to the agent , we leverage pre-trained SPTs to in an end-to-end framework that has the structure of mapper and planner built into it which allows seamless generalization to out-of-distribution maps and goals . SPTs outperform prior stateof-the-art across all the setups for both manipulation and navigation tasks , leading to an absolute improvement of 7-19 % . 1 INTRODUCTION ! '' ! # Why learn to plan ( explicitly ) ? • More effective than • reactive CNNs • implicit planning LSTMs • Differentiable : can learn perception end-to-end using only action supervision • Faster than analytical planning 3 Observations CNN+LSTM Actions Observations Perception Model Planning Model ActionsMap Reactive or Implicit Planning Explicit Planning Decomposing Perception and Planning ( a ) Navigation ( b ) Manipulation Figure 1 : Spatial Path Planning : The raw observations ( top left ) and obstacles can be represented spatially via top-down map in navigation ( left ) and via configuration space in manipulation ( right ) . The problem of path planning has been a bedrock of robotics . Given an obstacle map of an environment and a goal location in the map , the task is to output a shortest path to the goal location starting from any position in the map . We consider path planning with spatial maps . Building a top-down spatial map is common practice in robotic navigation as it provides a natural representation of physical space ( Durrant-Whyte & Bailey , 2006 ) . In fact , even robotic manipulation can also be naturally phrased via spatial map using the formalism of configuration spaces ( Lozano-Perez , 1990 ) , as shown in Figure 1 . This problem has been studied in robotics for several decades , and classic goto planning algorithms involve Dijkstra et al . ( 1959 ) , PRM ( Kavraki et al. , 1996 ) , RRT ( LaValle & Kuffner Jr , 2001 ) , RRT * ( Karaman & Frazzoli , 2011 ) , etc . Our objective is to develop methods that can learn to plan from data . However , a natural question is why do we need learning for a problem which has stable classical solutions ? There are two key reasons . First , classical methods do not capture statistical regularities present in the natural world , ( for e.g. , walls are mostly parallel or perpendicular to each other ) , because they optimize a plan from scratch for each new setup . This also makes analytical planning methods to be often slow at inference time which is an issue in dynamic scenarios where a more reactive policy might be required for fast adaptation from failures . A learned planner represented via a neural network can not only capture regularities but is also efficient at inference as the plan is just a result of forward-pass through the network . Second , a critical assumption of classical algorithms is that a global ground-truth obstacle space must be known to the agent ahead of time . This is in stark contrast to biological agents where cognitive maps are not pixel-accurate ground truth location of agents , but built through actions in the environment , e.g. , rats build an implicit map of the environment incrementally through trajectories enabling them to take shortcuts ( Tolman , 1948 ) . A learned solution could not only provides the ability to deal with partial , noisy maps and but also help build maps on the fly while acting in the environment by backpropagating through the generated long-range plans . Several recent works have proposed data-driven path planning models ( Tamar et al. , 2016 ; Karkus et al. , 2017 ; Nardelli et al. , 2018 ; Lee et al. , 2018 ) . Similar to how classical algorithms , like Dijkstra et al . ( 1959 ) , move outward from the goal one cell at a time to predict distances iteratively based on the obstacles in the map , current learning-based spatial planning models propagate distance values in only a local neighborhood using convolutional networks . This kind of local value propagation requires O ( M ) iterations , where M is the map dimension . In theory , however , the optimal paths can be computed much more efficiently with total iterations that are on the order of number of obstacles rather than the map size . For instance , consider two points with no obstacle between , an efficient planner could directly connect them with interpolated distance . Nonetheless , this is possible only if the model can perform long-range reasoning in the obstacle space which is a challenge . In this work , our goal is to capture this long-range spatial relationship . Transformers ( Vaswani et al. , 2017 ) are well suited for this kind of computation as they treat the inputs as sets and propagate information across all the points within the set . Building on this , we propose Spatial Planning Transformers ( SPT ) which consists of attention heads that can attend to any part of the input . The key idea behind the design of the proposed model is that value can be propagated between distant points if there are no obstacles between them . This would reduce the number of required iterations to O ( nO ) where nO is the number of obstacles in the map . Figure 2 shows a simple example where long-distance value propagation can cover the entire map within 3 iterations while local value propagation takes more than 5 iterations – this difference grows with the complexity of the obstacle space and map size . We compare the performance of SPTs with prior state-of-the-art learned planning approaches , VIN ( Tamar et al. , 2016 ) and GPPN ( Lee et al. , 2018 ) , across both navigation as well as manipulation setups . SPTs achieve significantly higher accuracy than these prior methods for the same inference time and show over 10 % absolute improvement when the maps are large . Next , we turn to the case when the map is not known apriori . This is a practical setting when the agent either has access to a partially known map or just know it through the trajectories . In psychology , this is known as going from route knowledge to survey knowledege ( Golledge et al. , 1995 ) where animals aggregate the knowledge from trajectories into a cognitive map . We operationalize this setup by formulating an end-to-end differentiable framework , which in contrast to having a generic parametric policy learning ( Glasmachers , 2017 ) , has the structure of mapper and planner built into it . We first pre-train the SPT planner to capture a generic data-driven prior , and then backpropagate through it to learn a mapper that maps raw observations to obstacle map . This allows us to learn without requiring map supervision or interaction . Learned mapper and planner not only allow us to plan for new goal locations at inference but also generalize to unseen maps . Our end-to-end mapping and planning approach provides a unified solution for both navigation and manipulation . We perform thorough experiments in both manipulation and real-world navigation maps as well as manipulation . Our approach outperforms prior state-of-the-art by a margin on both mapping and planning accuracy without assuming access to the map at training or inference . 2 PRELIMINARIES AND PROBLEM DEFINITION . We represent the input spatial map as a matrix , m , of size M ×M with each element being 1 , denoting obstacles , or 0 , denoting free space . The goal location is also represented as a matrix , g , of size M ×M with exactly one element being 1 , denoting the goal location , and rest 0s . The input to the spatial planning model , x , consists of matrices m and g stacked , x = [ m , g ] , where x is of size 2×M ×M . The objective of the planning model is to predict y which is of size M ×M , consisting of action distances of corresponding locations from the goal . Here , action distance is defined to be the minimum number of actions required to reach the goal . For navigation , m is a top-down obstacle map , and g represents the goal position on this map . For manipulation , m represents the obstacles in the configuration space of 2-dof planar arm with joint angles denoted by θ1 and θ2 . Each element ( i , j ) in m indicate whether the configuration of the arm with joint angles θ1 = i and θ2 = j , would lead to a collision . g represents the goal configuration of the arm . In the first set of experiments , we will assume that m is known and in the second set of experiments , m is not known and the agent receives observations , o , from its sensors instead . 3 METHODS . We design a spatial planning model capable of long-distance information propagation . We first describe the design of this spatial planning module , called Spatial Planning Transformer ( SPT ) , shown in Figure 3 , which takes in a map and a goal as input and predict the distance to the goal from all locations . We then describe how the SPT model can be used as a planning module to train end-to-end learning models , which take in raw sensory observations and goal location as input and predict action distances without having access to the map . 3.1 SPT : SPATIAL PLANNING TRANSFORMERS . To propogate information over distant points , we use the Transformer ( Vaswani et al. , 2017 ) architecture . The self-attention mechanism in a Transformer can learn to attend to any element of the input . The allows the model to learn spatial reasoning over the whole map concurrently . Figure 3 shows an overview of the SPT model , which consists of three modules , an Encoder E to encode the input , a Transformer network T responsible for spatial planning , and a Decoder D decoding the output of the Transformer into action distances . Encoder . The Encoder E computes the encoding of the input x : xI = E ( x ) . The input x ∈ { 0 , 1 } 2×M×M consisting of the map and goal is first passed through a 2-layer convolutional network ( LeCun et al. , 1998 ) with ReLU activations to compute an embedding for each input element . Both layers have a kernel size of 1 × 1 , which ensures that the embedding of all the obstacles is identical to each other , and the same holds true for free space and the goal location . The output of this convolutional network is of size d×M ×M , where d is the embedding size . This output is then flattened to get xI of size d×M2 and passed into the Transformer network . Transformer . The Transformer network T converts the input encoding into the output encoding : xO = T ( xI ) . It first adds the positional encoding to the input encoding . The positional encoding enables the Transformer model to distinguish between the obstacles at different locations . We use a constant sinusoidal positional encoding ( Vaswani et al. , 2017 ) : p ( 2i , j ) = sin ( j/C 2i/d ) , p ( 2i+1 , j ) = cos ( j/C 2i/d ) where p ∈ Rd×M2 is the positional encoding , j ∈ { 1 , 2 , . . . , M2 } is the position of the input , i ∈ { 1 , 2 , . . . , d/2 } , and C =M2 is a constant . The positional encoding of each element is added to their corresponding input encoding to get Z = xI + p . Z is then passed through N = 5 identical Transformer layers ( fTL ) to get xO . Decoder . The Decoder D computes the distance prediction ŷ from xO using a position-wise fully connected layer : ŷi =W T DxT , i + bD where xT , i ∈ Rd×1 is the input at position i ∈ 1 , 2 , . . . , M2 , WD ∈ Rd×1 , bD ∈ R are parameters of the Decoder shared across all positions i and ŷi ∈ R is the distance prediction at position i . The distance prediction at all position are reshaped into a matrix to get the final prediction ŷ ∈ RM , M . The entire model is trained using pairs of input x and output y datapoints with mean-squared error as the loss function .
This paper presents Spatial Planning Transformers (SPTs); neural network modules that perform spatial planning over grid-like state spaces. The paper also goes on to present the idea that differentiable mapping and differntiable planning modules could be trained end-to-end, for better performance. This is evaluated against two baselines (value iteration networks (VINs) and generative path planning networks (GPPNs)) on small-scale navigation and manipulation tasks.
SP:9ca7082f4aa0970c3c35409c9f259e5ad844c553
Differentiable Spatial Planning using Transformers
We consider the problem of spatial path planning . In contrast to the classical solutions which optimize a new plan from scratch and assume access to the full map with ground truth obstacle locations , we learn a planner from the data in a differentiable manner that allows us to leverage statistical regularities from past data . We propose Spatial Planning Transformers ( SPT ) , which given an obstacle map learns to generate actions by planning over long-range spatial dependencies , unlike prior data-driven planners that propagate information locally via convolutional structure in an iterative manner . In the setting where the ground truth map is not known to the agent , we leverage pre-trained SPTs to in an end-to-end framework that has the structure of mapper and planner built into it which allows seamless generalization to out-of-distribution maps and goals . SPTs outperform prior stateof-the-art across all the setups for both manipulation and navigation tasks , leading to an absolute improvement of 7-19 % . 1 INTRODUCTION ! '' ! # Why learn to plan ( explicitly ) ? • More effective than • reactive CNNs • implicit planning LSTMs • Differentiable : can learn perception end-to-end using only action supervision • Faster than analytical planning 3 Observations CNN+LSTM Actions Observations Perception Model Planning Model ActionsMap Reactive or Implicit Planning Explicit Planning Decomposing Perception and Planning ( a ) Navigation ( b ) Manipulation Figure 1 : Spatial Path Planning : The raw observations ( top left ) and obstacles can be represented spatially via top-down map in navigation ( left ) and via configuration space in manipulation ( right ) . The problem of path planning has been a bedrock of robotics . Given an obstacle map of an environment and a goal location in the map , the task is to output a shortest path to the goal location starting from any position in the map . We consider path planning with spatial maps . Building a top-down spatial map is common practice in robotic navigation as it provides a natural representation of physical space ( Durrant-Whyte & Bailey , 2006 ) . In fact , even robotic manipulation can also be naturally phrased via spatial map using the formalism of configuration spaces ( Lozano-Perez , 1990 ) , as shown in Figure 1 . This problem has been studied in robotics for several decades , and classic goto planning algorithms involve Dijkstra et al . ( 1959 ) , PRM ( Kavraki et al. , 1996 ) , RRT ( LaValle & Kuffner Jr , 2001 ) , RRT * ( Karaman & Frazzoli , 2011 ) , etc . Our objective is to develop methods that can learn to plan from data . However , a natural question is why do we need learning for a problem which has stable classical solutions ? There are two key reasons . First , classical methods do not capture statistical regularities present in the natural world , ( for e.g. , walls are mostly parallel or perpendicular to each other ) , because they optimize a plan from scratch for each new setup . This also makes analytical planning methods to be often slow at inference time which is an issue in dynamic scenarios where a more reactive policy might be required for fast adaptation from failures . A learned planner represented via a neural network can not only capture regularities but is also efficient at inference as the plan is just a result of forward-pass through the network . Second , a critical assumption of classical algorithms is that a global ground-truth obstacle space must be known to the agent ahead of time . This is in stark contrast to biological agents where cognitive maps are not pixel-accurate ground truth location of agents , but built through actions in the environment , e.g. , rats build an implicit map of the environment incrementally through trajectories enabling them to take shortcuts ( Tolman , 1948 ) . A learned solution could not only provides the ability to deal with partial , noisy maps and but also help build maps on the fly while acting in the environment by backpropagating through the generated long-range plans . Several recent works have proposed data-driven path planning models ( Tamar et al. , 2016 ; Karkus et al. , 2017 ; Nardelli et al. , 2018 ; Lee et al. , 2018 ) . Similar to how classical algorithms , like Dijkstra et al . ( 1959 ) , move outward from the goal one cell at a time to predict distances iteratively based on the obstacles in the map , current learning-based spatial planning models propagate distance values in only a local neighborhood using convolutional networks . This kind of local value propagation requires O ( M ) iterations , where M is the map dimension . In theory , however , the optimal paths can be computed much more efficiently with total iterations that are on the order of number of obstacles rather than the map size . For instance , consider two points with no obstacle between , an efficient planner could directly connect them with interpolated distance . Nonetheless , this is possible only if the model can perform long-range reasoning in the obstacle space which is a challenge . In this work , our goal is to capture this long-range spatial relationship . Transformers ( Vaswani et al. , 2017 ) are well suited for this kind of computation as they treat the inputs as sets and propagate information across all the points within the set . Building on this , we propose Spatial Planning Transformers ( SPT ) which consists of attention heads that can attend to any part of the input . The key idea behind the design of the proposed model is that value can be propagated between distant points if there are no obstacles between them . This would reduce the number of required iterations to O ( nO ) where nO is the number of obstacles in the map . Figure 2 shows a simple example where long-distance value propagation can cover the entire map within 3 iterations while local value propagation takes more than 5 iterations – this difference grows with the complexity of the obstacle space and map size . We compare the performance of SPTs with prior state-of-the-art learned planning approaches , VIN ( Tamar et al. , 2016 ) and GPPN ( Lee et al. , 2018 ) , across both navigation as well as manipulation setups . SPTs achieve significantly higher accuracy than these prior methods for the same inference time and show over 10 % absolute improvement when the maps are large . Next , we turn to the case when the map is not known apriori . This is a practical setting when the agent either has access to a partially known map or just know it through the trajectories . In psychology , this is known as going from route knowledge to survey knowledege ( Golledge et al. , 1995 ) where animals aggregate the knowledge from trajectories into a cognitive map . We operationalize this setup by formulating an end-to-end differentiable framework , which in contrast to having a generic parametric policy learning ( Glasmachers , 2017 ) , has the structure of mapper and planner built into it . We first pre-train the SPT planner to capture a generic data-driven prior , and then backpropagate through it to learn a mapper that maps raw observations to obstacle map . This allows us to learn without requiring map supervision or interaction . Learned mapper and planner not only allow us to plan for new goal locations at inference but also generalize to unseen maps . Our end-to-end mapping and planning approach provides a unified solution for both navigation and manipulation . We perform thorough experiments in both manipulation and real-world navigation maps as well as manipulation . Our approach outperforms prior state-of-the-art by a margin on both mapping and planning accuracy without assuming access to the map at training or inference . 2 PRELIMINARIES AND PROBLEM DEFINITION . We represent the input spatial map as a matrix , m , of size M ×M with each element being 1 , denoting obstacles , or 0 , denoting free space . The goal location is also represented as a matrix , g , of size M ×M with exactly one element being 1 , denoting the goal location , and rest 0s . The input to the spatial planning model , x , consists of matrices m and g stacked , x = [ m , g ] , where x is of size 2×M ×M . The objective of the planning model is to predict y which is of size M ×M , consisting of action distances of corresponding locations from the goal . Here , action distance is defined to be the minimum number of actions required to reach the goal . For navigation , m is a top-down obstacle map , and g represents the goal position on this map . For manipulation , m represents the obstacles in the configuration space of 2-dof planar arm with joint angles denoted by θ1 and θ2 . Each element ( i , j ) in m indicate whether the configuration of the arm with joint angles θ1 = i and θ2 = j , would lead to a collision . g represents the goal configuration of the arm . In the first set of experiments , we will assume that m is known and in the second set of experiments , m is not known and the agent receives observations , o , from its sensors instead . 3 METHODS . We design a spatial planning model capable of long-distance information propagation . We first describe the design of this spatial planning module , called Spatial Planning Transformer ( SPT ) , shown in Figure 3 , which takes in a map and a goal as input and predict the distance to the goal from all locations . We then describe how the SPT model can be used as a planning module to train end-to-end learning models , which take in raw sensory observations and goal location as input and predict action distances without having access to the map . 3.1 SPT : SPATIAL PLANNING TRANSFORMERS . To propogate information over distant points , we use the Transformer ( Vaswani et al. , 2017 ) architecture . The self-attention mechanism in a Transformer can learn to attend to any element of the input . The allows the model to learn spatial reasoning over the whole map concurrently . Figure 3 shows an overview of the SPT model , which consists of three modules , an Encoder E to encode the input , a Transformer network T responsible for spatial planning , and a Decoder D decoding the output of the Transformer into action distances . Encoder . The Encoder E computes the encoding of the input x : xI = E ( x ) . The input x ∈ { 0 , 1 } 2×M×M consisting of the map and goal is first passed through a 2-layer convolutional network ( LeCun et al. , 1998 ) with ReLU activations to compute an embedding for each input element . Both layers have a kernel size of 1 × 1 , which ensures that the embedding of all the obstacles is identical to each other , and the same holds true for free space and the goal location . The output of this convolutional network is of size d×M ×M , where d is the embedding size . This output is then flattened to get xI of size d×M2 and passed into the Transformer network . Transformer . The Transformer network T converts the input encoding into the output encoding : xO = T ( xI ) . It first adds the positional encoding to the input encoding . The positional encoding enables the Transformer model to distinguish between the obstacles at different locations . We use a constant sinusoidal positional encoding ( Vaswani et al. , 2017 ) : p ( 2i , j ) = sin ( j/C 2i/d ) , p ( 2i+1 , j ) = cos ( j/C 2i/d ) where p ∈ Rd×M2 is the positional encoding , j ∈ { 1 , 2 , . . . , M2 } is the position of the input , i ∈ { 1 , 2 , . . . , d/2 } , and C =M2 is a constant . The positional encoding of each element is added to their corresponding input encoding to get Z = xI + p . Z is then passed through N = 5 identical Transformer layers ( fTL ) to get xO . Decoder . The Decoder D computes the distance prediction ŷ from xO using a position-wise fully connected layer : ŷi =W T DxT , i + bD where xT , i ∈ Rd×1 is the input at position i ∈ 1 , 2 , . . . , M2 , WD ∈ Rd×1 , bD ∈ R are parameters of the Decoder shared across all positions i and ŷi ∈ R is the distance prediction at position i . The distance prediction at all position are reshaped into a matrix to get the final prediction ŷ ∈ RM , M . The entire model is trained using pairs of input x and output y datapoints with mean-squared error as the loss function .
The paper provides an interesting direction in the field of spatial path planning. The method is interesting as it is fully learnt in an end to end fashion. The key idea is to use a transformer like architecture to model long range dependencies. Also the paper extend its findings to out of distribution maps and the cases where the ground truth map is not known to the agent.
SP:9ca7082f4aa0970c3c35409c9f259e5ad844c553
Deep Learning Solution of the Eigenvalue Problem for Differential Operators
1 INTRODUCTION . Eigenfunctions and eigenvalues of the Laplacian ( among other operators ) are important in various applications ranging , inter alia , from image processing to computer vision , shape analysis and quantum mechanics . It is also of major importance in various engineering applications where resonance is crucial for design and safety [ Benouhiba & Belyacine ( 2013 ) ] . Laplacian eigenfunctions allow us to perform spectral analysis of data measured at more general domains or even on graphs and networks [ Shi & Malik ( 2000 ) ] . Additionally , the M -smallest eigenvalues of the Laplace-Beltrami operator are fundamental features for comparing geometric objects such as 3D shapes , images or point clouds via the functional maps method in statistical shape analysis [ Ovsjanikov et al . ( 2012 ) ] . Moreover , in quantum mechanics , the smallest eigenvalues and eigenfunction of the Hamiltonian are of great physical significance [ Han et al . ( 2019 ) ] . In this paper we present a novel numerical method for the computation of these eigenfunctions ( efs ) and eigenvalues ( evs ) , where the efs are parameterized by NNs with continuous activation functions , and the evs are directly calculated via the Rayleigh quotient . The resulting efs are therefore smooth functions defined in a parametric way . This is in contrast to the finite element [ Pradhan & Chakraverty ( 2019 ) ] and finite difference [ Saad ( 2005 ) ; Knyazev ( 2000 ) ] methods in which the efs are defined on either a grid or as piecewise linear/polynomial functions with limited smoothness . In these matrix-based approaches one has to discretize first the problem and to represent it as an eigenvalue problem for a matrix . This in itself is prone to numerical errors . Following [ Bar & Sochen ( 2019 ) ] , we suggest an unsupervised approach to learn the eigenpairs of a differential operator on a specified domain with boundary conditions , where the network simultaneously approximates the eigenfunctions at every entry x . The method is based on a uniformly distributed point set which is trained to satisfy two fidelity terms of the eigenvalue problem formulated as theL2 andL∞-like norms , boundary conditions , orthogonality constraint and regularization . There are several advantages of the proposed setting : ( i ) the framework is general in the sense that it can be used for non linear differential operators with high order derivatives as well . ( ii ) Since we sample the domain with a point cloud , we are not limited to standard domains . The problem can be therefore solved in an arbitrary regular domain . ( iii ) The framework is generic such that additional constraints and regularizers can be naturally integrated in the cost function . ( iv ) Unlike previous methods , the suggested framework solves simultaneously multiple eigenpairs . This means that we handle a family of PDEs ( one for each eigenvalue and finding the eigenvalues themselves ) in one network that solves these multiple PDEs together . The method is applied in 1D and 2D for both known and multiple unknown eigenvalues of the Laplacian operator . Quantitative analysis demonstrates the robustness of the method compared with the classical matrix-based methods . 2 RELATED WORK . Many recent approaches have shown promise in using the power of NNs to approximate solutions of differential equations . Classical methods are often prone to weakness due to the discretization of the domain Ω . In [ Bar & Sochen ( 2019 ) ] , the authors propose a solver for both forward and inverse problems , using NNs to model the solution , and penalizing using both the automatic differentiation , and boundary conditions . In [ Raissi et al . ( 2017 ) ] , a similar approach was taken to solve both continuous and discrete time models . In [ Chen et al . ( 2018 ) ] , differential equation solvers are used as part of the network architecture , and are shown to enhance the smoothness and convergence of the solutions . In order to properly solve differential equations , a representation that captures highorder derivatives is desired . Recently , [ Sitzmann et al . ( 2020 ) ] proposed a network architecture that illustrates these requirements using periodic activation functions with the proper initialization . Additionally , [ Rippel et al . ( 2015 ) ] proposed leveraging Discrete Fourier Transform ( DFT ) to represent the network in spectral space . The well-known power method and its variants [ Eastman & Estep ( 2007 ) ] has been the main method for addressing the eigenvalue problem . The method works on specific Linear operators , L : L2 ( Rd ) → L2 ( Rd ) . It is done after the continuous equation is reduced numerically to an eigenpair equation for matrices . This process introduces numerical errors even before the solution of the eigen problem . The usage of the power method for spectral operators on Hilbert Spaces was recently shown inn [ Erickson et al . ( 1995 ) ] . In [ Hait-Fraenkel & Gilboa ( 2019 ) ] a modified method for nonlinear differential operators was proposed . Furthermore , most power method variants for operators , converge to a single eigenpair . Finding the M smallest eigenpairs can be both computationally and algorithmically challenging . Advanced methods addressing the eigenvalue problem via deep networks were recently introduced . These methods are based on variational Monte Carlo ( VMC ) and diffusion Monte Carlo ( DMC ) methods . VMC relies on leveraging physical knowledge to propose an ansatz of the eigenfunction and incorporates the essential physics [ Han et al . ( 2019 ) ; Hermann et al . ( 2019 ) ; Pfau et al . ( 2019 ) ; Choo et al . ( 2019 ) ] . Recently , [ Han et al . ( 2020 ) ] formulated the eigenvalue problem by the stochastic backward equation using the DMC method , where the loss function optimizes the eigenvalue , eigenfunction and the scaled gradient of the eigenfunction . The loss function consists of L2 norm of two fidelity terms with additional normalization . The algorithm yields the first eigenpair with an optional second eigenpair given some mild prior estimate of the eigenvalue . In the suggested work , we formulate the eigenvalue problem in a direct setting with flexible number of eigenpairs . Additionally , we use L∞ norms for fidelity and boundary condition terms to accomplish a strong ( pointwise ) solution . 3 PRELIMINARIES . Let H be a Hilbert space where the inner product for u , v ∈ H is 〈u , v〉 . Let A ∈ O ( H ) be an operator . Let A∗ be the adjoined operator defined by 〈A∗u , v〉 = 〈u , Av〉 ∀u , v ∈ H. Then A is said to be self-adjoint if A = A∗ . We start with a short Lemma on self-adjoint operators [ Conway ( 1985 ) ] . Lemma 3.1 LetH be a Hilbert space . Let A ∈ O ( H ) be a self-adjoint operator . Then all eigenvalues of A are real . In this work we focus on self-adjoint operators . An eigenpair of an operator L is defined as : ( u , λ ) s.t . λ ∈ R , where u is the eigenfunction of L and λ is the corresponding eigenvalue . Let L be a self-adjoint operator L : L2 ( Rd ) → L2 ( Rk ) . Our objective is to search for eigenpairs { ui , λi } such that Lui + λiui = 0 ∀i . ( 1 ) The proposed algorithm approximates the eigenfunction set ui ( x ) by a NN ui ( x ; θui ) parameterized by θui which denotes the network weights and biases . The network consists of few fully connected layers with smooth activation function ϕ and linear sum in the last layer . For example , four layers architecture is given by u ( x ) = W5ϕ ( W4ϕ ( W3ϕ ( W2ϕ ( W1x+ b1 ) + b2 ) + b3 ) + b4 ) + b5 , ( 2 ) and ϕ ( · ) = tanh ( · ) or SIREN . The input to the network is x ∈ Rd , one input node for each dimension . The network is trained to satisfy the PDE with boundary conditions by minimizing a cost function . 4 SINGLE KNOWN EIGENVALUE . We first address the problem of finding a single eigenfunction u ( x ) given its corresponding eigenvalue λ . We approximate u ( x ) by a NN and optimize the following cost function F1 ( u ( x , θu ) ) = α‖T u‖22 + µ‖T u‖∞ + δ‖u− u0‖1 , ∂Ω + β ∣∣∣‖u‖22 − c∣∣∣+ ρ‖θu‖22 , ( 3 ) where T u : = Lu+ λu , with the Laplacian operator L = ∆ . The first two terms in equation 3 are the L2 and L∞ fidelity terms where the latter promotes a pointwise solution such that the equation is satisfied for isolated points as well [ Bar & Sochen ( 2019 ) ] . The third term imposes boundary conditions and the forth normalizes the squared length of u to c = 1 due to scale invariance of the eigenfunction ( since ( αu , λ ) is a valid eigenpair for α 6= 0 ) . The final term is the standard weight decay term which stabilizes the network weights . The L2 norm ‖.‖22 is defined as the Monte-Carlo Integral approximation norm : ‖u‖22 = Vol ( Ω ) N xN∑ x=x1 |u ( x ) |2 ∼ ∫ Ω |u ( x ) |2dx . ( 4 ) In the first example we apply the Laplacian operator in 1D where λ = 4 and u ( 0 ) = u ( π/2 ) = 0 . Then , T u = u′′ ( x ) + 4u ( x ) . The normalized analytical solution is therefore u ( x ) = 2√ π sin ( 2x ) . Figure 1 demonstrates the outcome of the algorithm at iterations 1 , 100 and 2500 . As can be seen , the approximated solution approaches the sin function with Relative Mean Square Error ( RMSE ) = 6.52e−4 and peak signal-to-noise ratio ( PSNR ) = 28.84 . 5 SINGLE EIGENPAIR WITH THE SMALLEST EIGENVALUE . Next , we address the case where the eigenvalue is not known in advance . We therefore limit ourselves to the smallest nontrivial eigenpair . This approach is analogue to power method approach , where only one dominant eigenpair is found . Recall the Rayleigh quotient defined as [ Miller ( 2016 ) ; Feld et al . ( 2019 ) ] R ( u ) : = −〈Lu , u〉 〈u , u〉 . ( 5 ) It can be shown that the eigenfunction u is a critical point of R ( u ) , where R ( u ) is its corresponding ( nontrivial ) eigenvalue λ . Furthermore , if ũ is a function which is close to u thenR ( ũ ) approximates λ . In the following cost function we replace λ by R ( u ) . Then equation 3 is modified to F2 ( u ( x , θu ) ) = α‖T u‖22 +µ‖T u‖∞+ δ‖u−u0‖1 , ∂Ω +β ∣∣∣‖u‖22− c∣∣∣+ ρ‖θu‖22 + γ‖R ( u ) ‖22 , ( 6 ) where T u = Lu+R ( u ) u . The last term minimizes R ( u ) and therefore attracts the solution to the lowest nontrivial eigenvalue . The ground truth eigenpair is given by ( √ 2 π sin ( x ) , 1 ) for Ω = [ 0 , π ] . Figure 2 shows the outcome of the proposed method at three iterations . The approximated eigenfunction is obtained up to a sign . The eigenvalue which is the value of the Rayleigh quotient converges to the true value λ = 1 with decreasing standard deviation along the mini-batches . Quantitative results are shown in row 1 of tables 1 and 2 where MAE stands for Mean Absolute Error and MRE for Mean Relative Error .
The manuscript proposes a deep learning solver for the eigenvalue problem of differential self-adjoint operators. Specifically, the aim is to calculate M lowest eigenvalues and their corresponding eigenfunctions. This work is a natural follow up of the work by Bar and Sochen (2019) for solving PDE-based problems. The unsupervised loss resembles the loss suggested in Bar and Sochen (2019), with addition of mainly two terms: (a) The Rayleigh Quotient term and (b) the orthogonality constraint. In practice, the proposed framework is tested on the 1D and 2D Laplace operators on regular domains.
SP:32047b62ffb4a15e2ff7d757d8506abeb8770dde
Deep Learning Solution of the Eigenvalue Problem for Differential Operators
1 INTRODUCTION . Eigenfunctions and eigenvalues of the Laplacian ( among other operators ) are important in various applications ranging , inter alia , from image processing to computer vision , shape analysis and quantum mechanics . It is also of major importance in various engineering applications where resonance is crucial for design and safety [ Benouhiba & Belyacine ( 2013 ) ] . Laplacian eigenfunctions allow us to perform spectral analysis of data measured at more general domains or even on graphs and networks [ Shi & Malik ( 2000 ) ] . Additionally , the M -smallest eigenvalues of the Laplace-Beltrami operator are fundamental features for comparing geometric objects such as 3D shapes , images or point clouds via the functional maps method in statistical shape analysis [ Ovsjanikov et al . ( 2012 ) ] . Moreover , in quantum mechanics , the smallest eigenvalues and eigenfunction of the Hamiltonian are of great physical significance [ Han et al . ( 2019 ) ] . In this paper we present a novel numerical method for the computation of these eigenfunctions ( efs ) and eigenvalues ( evs ) , where the efs are parameterized by NNs with continuous activation functions , and the evs are directly calculated via the Rayleigh quotient . The resulting efs are therefore smooth functions defined in a parametric way . This is in contrast to the finite element [ Pradhan & Chakraverty ( 2019 ) ] and finite difference [ Saad ( 2005 ) ; Knyazev ( 2000 ) ] methods in which the efs are defined on either a grid or as piecewise linear/polynomial functions with limited smoothness . In these matrix-based approaches one has to discretize first the problem and to represent it as an eigenvalue problem for a matrix . This in itself is prone to numerical errors . Following [ Bar & Sochen ( 2019 ) ] , we suggest an unsupervised approach to learn the eigenpairs of a differential operator on a specified domain with boundary conditions , where the network simultaneously approximates the eigenfunctions at every entry x . The method is based on a uniformly distributed point set which is trained to satisfy two fidelity terms of the eigenvalue problem formulated as theL2 andL∞-like norms , boundary conditions , orthogonality constraint and regularization . There are several advantages of the proposed setting : ( i ) the framework is general in the sense that it can be used for non linear differential operators with high order derivatives as well . ( ii ) Since we sample the domain with a point cloud , we are not limited to standard domains . The problem can be therefore solved in an arbitrary regular domain . ( iii ) The framework is generic such that additional constraints and regularizers can be naturally integrated in the cost function . ( iv ) Unlike previous methods , the suggested framework solves simultaneously multiple eigenpairs . This means that we handle a family of PDEs ( one for each eigenvalue and finding the eigenvalues themselves ) in one network that solves these multiple PDEs together . The method is applied in 1D and 2D for both known and multiple unknown eigenvalues of the Laplacian operator . Quantitative analysis demonstrates the robustness of the method compared with the classical matrix-based methods . 2 RELATED WORK . Many recent approaches have shown promise in using the power of NNs to approximate solutions of differential equations . Classical methods are often prone to weakness due to the discretization of the domain Ω . In [ Bar & Sochen ( 2019 ) ] , the authors propose a solver for both forward and inverse problems , using NNs to model the solution , and penalizing using both the automatic differentiation , and boundary conditions . In [ Raissi et al . ( 2017 ) ] , a similar approach was taken to solve both continuous and discrete time models . In [ Chen et al . ( 2018 ) ] , differential equation solvers are used as part of the network architecture , and are shown to enhance the smoothness and convergence of the solutions . In order to properly solve differential equations , a representation that captures highorder derivatives is desired . Recently , [ Sitzmann et al . ( 2020 ) ] proposed a network architecture that illustrates these requirements using periodic activation functions with the proper initialization . Additionally , [ Rippel et al . ( 2015 ) ] proposed leveraging Discrete Fourier Transform ( DFT ) to represent the network in spectral space . The well-known power method and its variants [ Eastman & Estep ( 2007 ) ] has been the main method for addressing the eigenvalue problem . The method works on specific Linear operators , L : L2 ( Rd ) → L2 ( Rd ) . It is done after the continuous equation is reduced numerically to an eigenpair equation for matrices . This process introduces numerical errors even before the solution of the eigen problem . The usage of the power method for spectral operators on Hilbert Spaces was recently shown inn [ Erickson et al . ( 1995 ) ] . In [ Hait-Fraenkel & Gilboa ( 2019 ) ] a modified method for nonlinear differential operators was proposed . Furthermore , most power method variants for operators , converge to a single eigenpair . Finding the M smallest eigenpairs can be both computationally and algorithmically challenging . Advanced methods addressing the eigenvalue problem via deep networks were recently introduced . These methods are based on variational Monte Carlo ( VMC ) and diffusion Monte Carlo ( DMC ) methods . VMC relies on leveraging physical knowledge to propose an ansatz of the eigenfunction and incorporates the essential physics [ Han et al . ( 2019 ) ; Hermann et al . ( 2019 ) ; Pfau et al . ( 2019 ) ; Choo et al . ( 2019 ) ] . Recently , [ Han et al . ( 2020 ) ] formulated the eigenvalue problem by the stochastic backward equation using the DMC method , where the loss function optimizes the eigenvalue , eigenfunction and the scaled gradient of the eigenfunction . The loss function consists of L2 norm of two fidelity terms with additional normalization . The algorithm yields the first eigenpair with an optional second eigenpair given some mild prior estimate of the eigenvalue . In the suggested work , we formulate the eigenvalue problem in a direct setting with flexible number of eigenpairs . Additionally , we use L∞ norms for fidelity and boundary condition terms to accomplish a strong ( pointwise ) solution . 3 PRELIMINARIES . Let H be a Hilbert space where the inner product for u , v ∈ H is 〈u , v〉 . Let A ∈ O ( H ) be an operator . Let A∗ be the adjoined operator defined by 〈A∗u , v〉 = 〈u , Av〉 ∀u , v ∈ H. Then A is said to be self-adjoint if A = A∗ . We start with a short Lemma on self-adjoint operators [ Conway ( 1985 ) ] . Lemma 3.1 LetH be a Hilbert space . Let A ∈ O ( H ) be a self-adjoint operator . Then all eigenvalues of A are real . In this work we focus on self-adjoint operators . An eigenpair of an operator L is defined as : ( u , λ ) s.t . λ ∈ R , where u is the eigenfunction of L and λ is the corresponding eigenvalue . Let L be a self-adjoint operator L : L2 ( Rd ) → L2 ( Rk ) . Our objective is to search for eigenpairs { ui , λi } such that Lui + λiui = 0 ∀i . ( 1 ) The proposed algorithm approximates the eigenfunction set ui ( x ) by a NN ui ( x ; θui ) parameterized by θui which denotes the network weights and biases . The network consists of few fully connected layers with smooth activation function ϕ and linear sum in the last layer . For example , four layers architecture is given by u ( x ) = W5ϕ ( W4ϕ ( W3ϕ ( W2ϕ ( W1x+ b1 ) + b2 ) + b3 ) + b4 ) + b5 , ( 2 ) and ϕ ( · ) = tanh ( · ) or SIREN . The input to the network is x ∈ Rd , one input node for each dimension . The network is trained to satisfy the PDE with boundary conditions by minimizing a cost function . 4 SINGLE KNOWN EIGENVALUE . We first address the problem of finding a single eigenfunction u ( x ) given its corresponding eigenvalue λ . We approximate u ( x ) by a NN and optimize the following cost function F1 ( u ( x , θu ) ) = α‖T u‖22 + µ‖T u‖∞ + δ‖u− u0‖1 , ∂Ω + β ∣∣∣‖u‖22 − c∣∣∣+ ρ‖θu‖22 , ( 3 ) where T u : = Lu+ λu , with the Laplacian operator L = ∆ . The first two terms in equation 3 are the L2 and L∞ fidelity terms where the latter promotes a pointwise solution such that the equation is satisfied for isolated points as well [ Bar & Sochen ( 2019 ) ] . The third term imposes boundary conditions and the forth normalizes the squared length of u to c = 1 due to scale invariance of the eigenfunction ( since ( αu , λ ) is a valid eigenpair for α 6= 0 ) . The final term is the standard weight decay term which stabilizes the network weights . The L2 norm ‖.‖22 is defined as the Monte-Carlo Integral approximation norm : ‖u‖22 = Vol ( Ω ) N xN∑ x=x1 |u ( x ) |2 ∼ ∫ Ω |u ( x ) |2dx . ( 4 ) In the first example we apply the Laplacian operator in 1D where λ = 4 and u ( 0 ) = u ( π/2 ) = 0 . Then , T u = u′′ ( x ) + 4u ( x ) . The normalized analytical solution is therefore u ( x ) = 2√ π sin ( 2x ) . Figure 1 demonstrates the outcome of the algorithm at iterations 1 , 100 and 2500 . As can be seen , the approximated solution approaches the sin function with Relative Mean Square Error ( RMSE ) = 6.52e−4 and peak signal-to-noise ratio ( PSNR ) = 28.84 . 5 SINGLE EIGENPAIR WITH THE SMALLEST EIGENVALUE . Next , we address the case where the eigenvalue is not known in advance . We therefore limit ourselves to the smallest nontrivial eigenpair . This approach is analogue to power method approach , where only one dominant eigenpair is found . Recall the Rayleigh quotient defined as [ Miller ( 2016 ) ; Feld et al . ( 2019 ) ] R ( u ) : = −〈Lu , u〉 〈u , u〉 . ( 5 ) It can be shown that the eigenfunction u is a critical point of R ( u ) , where R ( u ) is its corresponding ( nontrivial ) eigenvalue λ . Furthermore , if ũ is a function which is close to u thenR ( ũ ) approximates λ . In the following cost function we replace λ by R ( u ) . Then equation 3 is modified to F2 ( u ( x , θu ) ) = α‖T u‖22 +µ‖T u‖∞+ δ‖u−u0‖1 , ∂Ω +β ∣∣∣‖u‖22− c∣∣∣+ ρ‖θu‖22 + γ‖R ( u ) ‖22 , ( 6 ) where T u = Lu+R ( u ) u . The last term minimizes R ( u ) and therefore attracts the solution to the lowest nontrivial eigenvalue . The ground truth eigenpair is given by ( √ 2 π sin ( x ) , 1 ) for Ω = [ 0 , π ] . Figure 2 shows the outcome of the proposed method at three iterations . The approximated eigenfunction is obtained up to a sign . The eigenvalue which is the value of the Rayleigh quotient converges to the true value λ = 1 with decreasing standard deviation along the mini-batches . Quantitative results are shown in row 1 of tables 1 and 2 where MAE stands for Mean Absolute Error and MRE for Mean Relative Error .
The authors frame the decomposition of the Laplacian equation as an unsupervised regression problem that is using a 5-level (and fully connected?) neural network as regression function. A cost function to be used in the optimization is proposed that is expanded to eigendecomposition problems of increasing complexity. A comparison with a classical method indicates that the proposed approach is comparable to or better than the former for the given task.
SP:32047b62ffb4a15e2ff7d757d8506abeb8770dde
Oblivious Sketching-based Central Path Method for Solving Linear Programming Problems
1 Introduction . Linear programming is one of the fundamental models widely used in both theory and practice . It has been extensively applied in many fields such as economics Tintner ( 1955 ) ; Dorfman et al . ( 1987 ) , operations research Delson & Shahidehpour ( 1992 ) , compressed sensing Donoho ( 2006 ) ; Candes et al . ( 2006 ) , medical studies Mangasarian et al . ( 1990 ; 1995 ) , adversarial deep learning Wong & Kolter ( 2018 ) ; Weng et al . ( 2018 ) , etc. , due to its simple and intuitive structure . The problem of solving linear programmings has been studied since the 19-th century Sierksma & Zwols ( 2015 ) . Consider solving a general linear program in standard form minAx=b , x≥0 c > x of size A ∈ Rd×n without redundant constraints . For the generic case d = Ω ( n ) we considered in this paper , the state of art results take a total running time of O∗ ( nω + n2.5−α/2 + n2+1/6 ) 1 to obtain a solution of δ accuracy in current matrix multiplication time Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) , where ω is the exponent of matrix multiplication whose current value is roughly 2.373 Williams ( 2012 ) ; Le Gall ( 2014 ) , and α is the dual exponent of matrix multiplication whose current value is 0.31 Le Gall & Urrutia ( 2018 ) . The breakthrough work due to Cohen , Lee , and Song Cohen et al . ( 2019b ) improves the long standing running time of O∗ ( n2.5 ) since 1989 Vaidya ( 1989 ) . For the current ω and α , Cohen et al . ( 2019b ) algorithm takes O∗ ( n2.373 ) time . For the current state-of-art results , the work Cohen et al . ( 2019b ) involves a non-oblivious sampling technique , whose sampling set and size changes along the iterations . It avoids the possibilities of implementing expensive calculations in the preprocessing stage and also makes it harder to extend to other classical optimization problems . On the other hand , the work Lee et al . ( 2019 ) only maintains an infeasible update in each iteration and requires the usage of dense sketching matrices , which will ruin the potential sparsity structure of the original linear programs . Thus , a natural question to ask is : 1We use O∗ hides no ( 1 ) and logO ( 1 ) ( 1/δ ) factors . Is there an oblivious and feasible algorithm for solving linear programming programs in fast running time ( i.e . current matrix multiplication time ) ? In this work , we propose a both oblivious and feasible ( per iteration ) 2 method that solves linear programs in the same running time as the state of art . The algorithm we propose is a sketching-based short step central path method . The classical short step method follows the central path in the interior of the feasible region . It decreases the complementarity gap uniformly by roughly a 1− 1/√n factor in each iteration and takes O∗ ( √ n ) iterations to converge . This results in O∗ ( √ n ) × n = O∗ ( n1.5 ) coordinate updates throughout the algorithm Vaidya ( 1989 ) . Compared to Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) , our randomized algorithm improves this amount ( in Vaidya ( 1989 ) ) of updates via a different approach . We only updating a O∗ ( √ n ) -dimensional subspace in each iteration while keeping the same number of iterations √ n through an Oblivious Coordinate-wise Embedding ( OCE ) technique . Thus , our method updates O∗ ( n ) dimensions in total , which is nearly optimal . The coordinate-wise embedding we introduce in this work is a distribution of matrices R ∈ Rbsketch×n with bsketch n such that , for any inner product g > h between two ndimensional vector g , h ∈ Rn , with ” high ” probability g > R > Rh approximates g > h well . In the case of solving linear programmings , we approximate the calculation of matrix-vector multiplication Ph in each iteration by PR > Rh through OCE , such that the resulting random vector is close to previous one in each coordinate , i.e. , ( PR > Rh ) i ≈ ( Ph ) i for all i ∈ [ n ] . Combining with lazy update and low-rank update techniques to maintain the query structure PR > Rh for any input vector h ∈ Rn , we can ensure the new random path is still close to the central path throughout the iterations . Therefore , our method decrease the average running time per iteration while keeping the same number of iterations . Furthermore , the sketching matrix R in our approach can be chosen in an oblivious way since it does not depend on the algorithm updates . Compare to previous work Lee et al . ( 2019 ) , our approximation form PR > Rh also helps admit a closed form solution in each iteration for solving LP . Thus , our approach takes the advantages of being oblivious and feasible , compared to other state of art results Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) . We state our main result as follows : Theorem 1.1 ( Main result , informal ) . Given a linear program minAx=b , x≥0 c > x with no redundant constraints . Let δlp denotes precision . Our algorithm takes O ( n 2.373 log ( n/δlp ) ) time to solve this LP . 1.1 Related works . Linear programming . Linear programmings have been studied for nearly a century . One of the first and most popular LP algorithm is the simplex algorithm Dantzig ( 1947 ) . Despite it works well in practical small size problems , the simplex algorithm is known to be an exponential time algorithm in the worst case of Klee-Minty cube Klee & Minty ( 1972 ) . The first polynomial time algorithm for solving LP is the ellipsoid method Khachiyan ( 1980 ) proposed by Khachiyan . Although this algorithm runs in polynomial time in theory , but in practice this algorithm runs much slower than the simplex algorithm . The interior point type of methods Karmarkar ( 1984 ) have both polynomial running time in theory and fast and stable performance in practice . In the case of d = Ω ( n ) considered in this work , Karmarkar ’ s algorithm Karmarkar ( 1984 ) takes O∗ ( n3.5 ) running time . Then it was improved to O∗ ( n3 ) in the work Renegar ( 1988 ) ; Vaidya ( 1987 ) . In 1989 , Vaidya further proposed an algorithm that takes a running of O∗ ( n2.5 ) . This result hasn ’ t been improved until recent work due to Cohen , Lee and Song Cohen et al . ( 2019b ) . Sketching . Classical sketching methodology proposed by Clarkson & Woodruff ( 2013 ) is the so-called ” sketch and solve ” . The most standard and well-known applications are 2In each iteration , we approximate the central path by solving a linear system . Our approach constructs a randomized oblivious system equation which can be solved exactly . While previous work Cohen et al . ( 2019b ) constructs a non-oblivious one , and Lee et al . ( 2019 ) doesn ’ t solve the system exactly . linear regression Clarkson & Woodruff ( 2013 ) ; Nelson & Nguyên ( 2013 ) ; Andoni et al . ( 2018 ) ; Clarkson et al . ( 2019 ) ; Song et al . ( 2019a ) and low-rank approximation Clarkson & Woodruff ( 2013 ) ; Nelson & Nguyên ( 2013 ) ; Boutsidis & Woodruff ( 2014 ) ; Clarkson & Woodruff ( 2015b ; a ) ; Razenshteyn et al . ( 2016 ) ; Song et al . ( 2017 ; 2019b ; c ) . It further generalizes to subspace Wang & Woodruff ( 2019 ) ; Li et al . ( 2020a ) , positive semi-definite matrices Clarkson & Woodruff ( 2017 ) , total least regression Diao et al . ( 2019 ) , quantile regression Li et al . ( 2020b ) , tensor regression Li et al . ( 2017 ) ; Diao et al . ( 2018 ) , tensor decomposition Song et al . ( 2019d ) . The sketching method we deploy in this work is called ” ‘ iterate and sketch ” Song ( 2019 ) . The major difference between classical “ sketch and solve “ , and “ iterating and sketch “ is : the first one only applied the sketch once at very beginning to reduce the dimension of problem , while does not modify the solver ; the second one opens up and modifies the solver by applying sketching techniques iteratively in each iteration . The idea of “ iterate and sketch ” has been applied to a number of problems , e.g . computing John Ellipsoid Cohen et al . ( 2019a ) , Newton method Pilanci & Wainwright ( 2016 ; 2017 ) , tensor decomposition Wang et al . ( 2015 ) ; Song et al . ( 2016 ) , training deep neural network Brand et al . ( 2020 ) . Empirical risk minimization Empirical risk minimization ( ERM ) problem is a fundamental question in statistical machine learning . Extensive literature has been devoted to study this topic Nesterov ( 1983 ) ; Vapnik ( 1992 ) ; Nesterov ( 1998 ) ; Polyak & Juditsky ( 1992 ) ; Nemirovski et al . ( 2009 ) ; Nesterov ( 2013 ) ; Vapnik ( 2013 ) . First-order methods and a series of accelerated gradient descent algorithms for ERM are well-developed and studied Jin et al . ( 2018 ) ; Johnson & Zhang ( 2013 ) ; Nesterov & Stich ( 2017 ) ; Xiao & Zhang ( 2014 ) ; Allen-Zhu ( 2018 ) . These rates depend polynomially on the smoothness/strong convexity of the objective in order to achieve a log ( 1/ ) dependence on the error parameter . Notations For a positive integer n , we use [ n ] to denote set { 1 , 2 , · · · , n } . For vectors x , z ∈ Rn and parameter ∈ ( 0 , 1 ) , we use x ≈ z to denote ( 1− ) zi ≤ xi ≤ ( 1+ ) zi , ∀i ∈ [ n ] . For any scalar t , we use a ≈ t to denote ( 1− ) t ≤ ai ≤ ( 1 + ) t , ∀i ∈ [ n ] . Given diagonal matrices X = diag ( x ) ∈ Rn×n , S = diag ( s ) ∈ Rn×n , we use XS to denote the diagonal matrix with ( XS ) i , i = xi/si , ∀i ∈ [ n ] . 2 Technique overview . In this section , we discuss the key ideas of our approach based on the central path method . 2.1 Short Step Central Path Method . Consider the following standard primal and dual problems of linear programmings : min Ax=b , x≥0 c > x ( primal ) and max A > y+s=c , x , s≥0 b > y ( dual ) where A ∈ Rd×n is full rank with d = O ( n ) . Then ( x , y , s ) is an optimal solution if and only if it satisfies the following optimality conditions Vanderbei et al . ( 2015 ) : Ax = b , x ≥ 0 ( primal feasibility ) A > y + s = c , s ≥ 0 ( dual feasibility ) xisi = 0 for all i ( complementary slackness ) The classical interior point method finds an optimal solution by following the central path in the interior of the feasible region , which is defined as the tuple ( x , y , s , t ) that satisfies : Ax = b , x > 0 A > y + s = c , s > 0 ( 1 ) xisi = t for all i where t > 0 is called the complementarity gap . It has been shown we can obtain an initialization point on the central path with t = 1 according to Ye et al . ( 1994 ) . Then in each iteration , the classical algorithm deceases the complementarity gap uniformly from t to ηt with η < 1 , and solves Eq . ( 1 ) . As t approaches 0 , the central path will converge to an optimal solution . The short step central path method approximately solves Eq . ( 1 ) by the following linear system : Xδs + Sδx = δµ , Aδx = 0 , ( 2 ) A > δy + δs = 0 , where X = diag ( x ) , S = diag ( s ) and we update the solution by x = x + δx , s = s + δs and y = y + δy . Denote the actual complementarity gap µ ∈ Rn defined under Eq . ( 2 ) as µi = xisi for i ∈ [ n ] . Then Eq . ( 2 ) maintains the feasibility conditions while approximately moving the gap from µ to µ+ δµ . As long as the actual complementarity gap µ is always close to the aiming complementarity gap t during the algorithm , we can assure the actual complementarity gap µ will converge to 0 as t goes to 0 , which leads us to an optimal solution . To solve the linear system ( 2 ) , note when A is full-rank , it has an unique solution explicitly given by : δx = X√ XS ( I − P ) 1√ XS δµ and δs = S√ XS P 1√ XS δµ , ( 3 ) where P = √ X S A > ( AXS A > ) −1 A √ X S is an orthogonal projection matrix . Literature Vaidya ( 1989 ) shows we can choose η to be roughly 1− 1√ n , and the algorithm converges in O∗ ( √ n ) iterations . Therefore , the total running time needed of solving LP by explicit solution Eq . ( 3 ) is O∗ ( nω+1/2 ) .
The paper studies the problem of solving LP and more generally convex programming via sketching based approaches. In particular, the running time of proposed algorithm in this paper matches the running time of the best known algorithms [Cohen et al(19b) and Lee et al(19)]. However, this paper provides some further useful properties: 1) oblivious sketching, 2) sparse sketching which can be of interest in many applications. The paper has provided theoretical guarantees of their proposed algorithm. The problem that is studied in this paper is very important and the sketching based approach is also very practical. The paper would benefit from an empirical comparison of the proposed algorithm with the existing methods for solving LPs.
SP:dbabb260baf9daed8066d80ef49ec0cfa9f70ae6
Oblivious Sketching-based Central Path Method for Solving Linear Programming Problems
1 Introduction . Linear programming is one of the fundamental models widely used in both theory and practice . It has been extensively applied in many fields such as economics Tintner ( 1955 ) ; Dorfman et al . ( 1987 ) , operations research Delson & Shahidehpour ( 1992 ) , compressed sensing Donoho ( 2006 ) ; Candes et al . ( 2006 ) , medical studies Mangasarian et al . ( 1990 ; 1995 ) , adversarial deep learning Wong & Kolter ( 2018 ) ; Weng et al . ( 2018 ) , etc. , due to its simple and intuitive structure . The problem of solving linear programmings has been studied since the 19-th century Sierksma & Zwols ( 2015 ) . Consider solving a general linear program in standard form minAx=b , x≥0 c > x of size A ∈ Rd×n without redundant constraints . For the generic case d = Ω ( n ) we considered in this paper , the state of art results take a total running time of O∗ ( nω + n2.5−α/2 + n2+1/6 ) 1 to obtain a solution of δ accuracy in current matrix multiplication time Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) , where ω is the exponent of matrix multiplication whose current value is roughly 2.373 Williams ( 2012 ) ; Le Gall ( 2014 ) , and α is the dual exponent of matrix multiplication whose current value is 0.31 Le Gall & Urrutia ( 2018 ) . The breakthrough work due to Cohen , Lee , and Song Cohen et al . ( 2019b ) improves the long standing running time of O∗ ( n2.5 ) since 1989 Vaidya ( 1989 ) . For the current ω and α , Cohen et al . ( 2019b ) algorithm takes O∗ ( n2.373 ) time . For the current state-of-art results , the work Cohen et al . ( 2019b ) involves a non-oblivious sampling technique , whose sampling set and size changes along the iterations . It avoids the possibilities of implementing expensive calculations in the preprocessing stage and also makes it harder to extend to other classical optimization problems . On the other hand , the work Lee et al . ( 2019 ) only maintains an infeasible update in each iteration and requires the usage of dense sketching matrices , which will ruin the potential sparsity structure of the original linear programs . Thus , a natural question to ask is : 1We use O∗ hides no ( 1 ) and logO ( 1 ) ( 1/δ ) factors . Is there an oblivious and feasible algorithm for solving linear programming programs in fast running time ( i.e . current matrix multiplication time ) ? In this work , we propose a both oblivious and feasible ( per iteration ) 2 method that solves linear programs in the same running time as the state of art . The algorithm we propose is a sketching-based short step central path method . The classical short step method follows the central path in the interior of the feasible region . It decreases the complementarity gap uniformly by roughly a 1− 1/√n factor in each iteration and takes O∗ ( √ n ) iterations to converge . This results in O∗ ( √ n ) × n = O∗ ( n1.5 ) coordinate updates throughout the algorithm Vaidya ( 1989 ) . Compared to Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) , our randomized algorithm improves this amount ( in Vaidya ( 1989 ) ) of updates via a different approach . We only updating a O∗ ( √ n ) -dimensional subspace in each iteration while keeping the same number of iterations √ n through an Oblivious Coordinate-wise Embedding ( OCE ) technique . Thus , our method updates O∗ ( n ) dimensions in total , which is nearly optimal . The coordinate-wise embedding we introduce in this work is a distribution of matrices R ∈ Rbsketch×n with bsketch n such that , for any inner product g > h between two ndimensional vector g , h ∈ Rn , with ” high ” probability g > R > Rh approximates g > h well . In the case of solving linear programmings , we approximate the calculation of matrix-vector multiplication Ph in each iteration by PR > Rh through OCE , such that the resulting random vector is close to previous one in each coordinate , i.e. , ( PR > Rh ) i ≈ ( Ph ) i for all i ∈ [ n ] . Combining with lazy update and low-rank update techniques to maintain the query structure PR > Rh for any input vector h ∈ Rn , we can ensure the new random path is still close to the central path throughout the iterations . Therefore , our method decrease the average running time per iteration while keeping the same number of iterations . Furthermore , the sketching matrix R in our approach can be chosen in an oblivious way since it does not depend on the algorithm updates . Compare to previous work Lee et al . ( 2019 ) , our approximation form PR > Rh also helps admit a closed form solution in each iteration for solving LP . Thus , our approach takes the advantages of being oblivious and feasible , compared to other state of art results Cohen et al . ( 2019b ) ; Lee et al . ( 2019 ) . We state our main result as follows : Theorem 1.1 ( Main result , informal ) . Given a linear program minAx=b , x≥0 c > x with no redundant constraints . Let δlp denotes precision . Our algorithm takes O ( n 2.373 log ( n/δlp ) ) time to solve this LP . 1.1 Related works . Linear programming . Linear programmings have been studied for nearly a century . One of the first and most popular LP algorithm is the simplex algorithm Dantzig ( 1947 ) . Despite it works well in practical small size problems , the simplex algorithm is known to be an exponential time algorithm in the worst case of Klee-Minty cube Klee & Minty ( 1972 ) . The first polynomial time algorithm for solving LP is the ellipsoid method Khachiyan ( 1980 ) proposed by Khachiyan . Although this algorithm runs in polynomial time in theory , but in practice this algorithm runs much slower than the simplex algorithm . The interior point type of methods Karmarkar ( 1984 ) have both polynomial running time in theory and fast and stable performance in practice . In the case of d = Ω ( n ) considered in this work , Karmarkar ’ s algorithm Karmarkar ( 1984 ) takes O∗ ( n3.5 ) running time . Then it was improved to O∗ ( n3 ) in the work Renegar ( 1988 ) ; Vaidya ( 1987 ) . In 1989 , Vaidya further proposed an algorithm that takes a running of O∗ ( n2.5 ) . This result hasn ’ t been improved until recent work due to Cohen , Lee and Song Cohen et al . ( 2019b ) . Sketching . Classical sketching methodology proposed by Clarkson & Woodruff ( 2013 ) is the so-called ” sketch and solve ” . The most standard and well-known applications are 2In each iteration , we approximate the central path by solving a linear system . Our approach constructs a randomized oblivious system equation which can be solved exactly . While previous work Cohen et al . ( 2019b ) constructs a non-oblivious one , and Lee et al . ( 2019 ) doesn ’ t solve the system exactly . linear regression Clarkson & Woodruff ( 2013 ) ; Nelson & Nguyên ( 2013 ) ; Andoni et al . ( 2018 ) ; Clarkson et al . ( 2019 ) ; Song et al . ( 2019a ) and low-rank approximation Clarkson & Woodruff ( 2013 ) ; Nelson & Nguyên ( 2013 ) ; Boutsidis & Woodruff ( 2014 ) ; Clarkson & Woodruff ( 2015b ; a ) ; Razenshteyn et al . ( 2016 ) ; Song et al . ( 2017 ; 2019b ; c ) . It further generalizes to subspace Wang & Woodruff ( 2019 ) ; Li et al . ( 2020a ) , positive semi-definite matrices Clarkson & Woodruff ( 2017 ) , total least regression Diao et al . ( 2019 ) , quantile regression Li et al . ( 2020b ) , tensor regression Li et al . ( 2017 ) ; Diao et al . ( 2018 ) , tensor decomposition Song et al . ( 2019d ) . The sketching method we deploy in this work is called ” ‘ iterate and sketch ” Song ( 2019 ) . The major difference between classical “ sketch and solve “ , and “ iterating and sketch “ is : the first one only applied the sketch once at very beginning to reduce the dimension of problem , while does not modify the solver ; the second one opens up and modifies the solver by applying sketching techniques iteratively in each iteration . The idea of “ iterate and sketch ” has been applied to a number of problems , e.g . computing John Ellipsoid Cohen et al . ( 2019a ) , Newton method Pilanci & Wainwright ( 2016 ; 2017 ) , tensor decomposition Wang et al . ( 2015 ) ; Song et al . ( 2016 ) , training deep neural network Brand et al . ( 2020 ) . Empirical risk minimization Empirical risk minimization ( ERM ) problem is a fundamental question in statistical machine learning . Extensive literature has been devoted to study this topic Nesterov ( 1983 ) ; Vapnik ( 1992 ) ; Nesterov ( 1998 ) ; Polyak & Juditsky ( 1992 ) ; Nemirovski et al . ( 2009 ) ; Nesterov ( 2013 ) ; Vapnik ( 2013 ) . First-order methods and a series of accelerated gradient descent algorithms for ERM are well-developed and studied Jin et al . ( 2018 ) ; Johnson & Zhang ( 2013 ) ; Nesterov & Stich ( 2017 ) ; Xiao & Zhang ( 2014 ) ; Allen-Zhu ( 2018 ) . These rates depend polynomially on the smoothness/strong convexity of the objective in order to achieve a log ( 1/ ) dependence on the error parameter . Notations For a positive integer n , we use [ n ] to denote set { 1 , 2 , · · · , n } . For vectors x , z ∈ Rn and parameter ∈ ( 0 , 1 ) , we use x ≈ z to denote ( 1− ) zi ≤ xi ≤ ( 1+ ) zi , ∀i ∈ [ n ] . For any scalar t , we use a ≈ t to denote ( 1− ) t ≤ ai ≤ ( 1 + ) t , ∀i ∈ [ n ] . Given diagonal matrices X = diag ( x ) ∈ Rn×n , S = diag ( s ) ∈ Rn×n , we use XS to denote the diagonal matrix with ( XS ) i , i = xi/si , ∀i ∈ [ n ] . 2 Technique overview . In this section , we discuss the key ideas of our approach based on the central path method . 2.1 Short Step Central Path Method . Consider the following standard primal and dual problems of linear programmings : min Ax=b , x≥0 c > x ( primal ) and max A > y+s=c , x , s≥0 b > y ( dual ) where A ∈ Rd×n is full rank with d = O ( n ) . Then ( x , y , s ) is an optimal solution if and only if it satisfies the following optimality conditions Vanderbei et al . ( 2015 ) : Ax = b , x ≥ 0 ( primal feasibility ) A > y + s = c , s ≥ 0 ( dual feasibility ) xisi = 0 for all i ( complementary slackness ) The classical interior point method finds an optimal solution by following the central path in the interior of the feasible region , which is defined as the tuple ( x , y , s , t ) that satisfies : Ax = b , x > 0 A > y + s = c , s > 0 ( 1 ) xisi = t for all i where t > 0 is called the complementarity gap . It has been shown we can obtain an initialization point on the central path with t = 1 according to Ye et al . ( 1994 ) . Then in each iteration , the classical algorithm deceases the complementarity gap uniformly from t to ηt with η < 1 , and solves Eq . ( 1 ) . As t approaches 0 , the central path will converge to an optimal solution . The short step central path method approximately solves Eq . ( 1 ) by the following linear system : Xδs + Sδx = δµ , Aδx = 0 , ( 2 ) A > δy + δs = 0 , where X = diag ( x ) , S = diag ( s ) and we update the solution by x = x + δx , s = s + δs and y = y + δy . Denote the actual complementarity gap µ ∈ Rn defined under Eq . ( 2 ) as µi = xisi for i ∈ [ n ] . Then Eq . ( 2 ) maintains the feasibility conditions while approximately moving the gap from µ to µ+ δµ . As long as the actual complementarity gap µ is always close to the aiming complementarity gap t during the algorithm , we can assure the actual complementarity gap µ will converge to 0 as t goes to 0 , which leads us to an optimal solution . To solve the linear system ( 2 ) , note when A is full-rank , it has an unique solution explicitly given by : δx = X√ XS ( I − P ) 1√ XS δµ and δs = S√ XS P 1√ XS δµ , ( 3 ) where P = √ X S A > ( AXS A > ) −1 A √ X S is an orthogonal projection matrix . Literature Vaidya ( 1989 ) shows we can choose η to be roughly 1− 1√ n , and the algorithm converges in O∗ ( √ n ) iterations . Therefore , the total running time needed of solving LP by explicit solution Eq . ( 3 ) is O∗ ( nω+1/2 ) .
The paper is based on the works of Lee et al and Cohen et al. Building upon these works, the paper comes up with an interior point method that matches the state-of-the-art in LPs. The paper's contribution is in a new type of sketching used inside the interior point method, that demonstrates some advantages over those of Lee et al and Cohen et al. Notable among these advantages are (1) the ability to preserve sparsity of an LP, and (2) exact solutions to the system of linear equations obtained from optimality conditions.
SP:dbabb260baf9daed8066d80ef49ec0cfa9f70ae6
TimeAutoML: Autonomous Representation Learning for Multivariate Irregularly Sampled Time Series
1 INTRODUCTION . The past decade has witnessed a rising proliferation in Multivariate Time Series ( MTS ) data , along with a plethora of applications in domains as diverse as IoT data analysis , medical informatics , and network security . Given the huge amount of MTS data , it is crucial to learn their representations effectively so as to facilitate underlying applications such as clustering and anomaly detection . For this purpose , different types of methods have been developed to represent time series data . Traditional time series representation techniques , e.g. , Discrete Fourier Transform ( DCT ) ( Faloutsos et al. , 1994 ) , Discrete Wavelet Transform ( DWT ) ( Chan & Fu , 1999 ) , Piecewise Aggregate Approximation ( PAA ) ( Keogh et al. , 2001 ) , etc. , represent raw time series data based on specific domain knowledge/data properties and hence could be suboptimal for subsequent tasks given the fact that their objectives and feature extraction are decoupled . More recent time series representation approaches , e.g. , Deep Temporal Clustering Representation ( DTCR ) ( Ma et al. , 2019 ) , Self-Organizing Map based Variational Auto Encoder ( SOM-VAE ) ( Fortuin et al. , 2018 ) , etc. , optimize the representation and the underlying task such as clustering in an end-to-end manner . These methods usually assume that time series under investigation are uniformly sampled with a fixed interval . This assumption , however , does not always hold in many applications . For example , within a multimodal IoT system , the sampling rates could vary for different types of sensors . Unsupervised representation learning for irregularly sampled multivariate time series is a challenging task and there are several major hurdles preventing us from building effective models : i ) the design of neural network architecture often employs a trial and error procedure which is time consuming and could cost a substantial amount of labor effort ; ii ) the irregularity in the sampling rates constitutes a major challenge against effective learning of time series representations and render most existing methods not directly applicable ; iii ) traditional unsupervised time series representation learning approach does not consider contrastive loss functions and consequently only can achieve suboptimal performance . To tackle the aforementioned challenges , we propose an autonomous unsupervised representation learning approach for multivariate time series to represent irregularly sampled multivariate time series . TimeAutoML differs from traditional time series representation approaches in three aspects . First , the representation learning pipeline configuration and hyperparameter optimization are carried out automatically . Second , a negative sample generation approach is proposed to generate negative samples for contrastive learning . Finally , an auxiliary classification task is developed to distinguish normal time series from negative samples . In this way , the representation capability of TimeAutoML is greatly enhanced . We conduct extensive experiments on UCR time series datasets and UEA multivariate time series datasets . Our experiments demonstrate that the proposed TimeAutoML outperforms comparison algorithms on both clustering and anomaly detection tasks by a large margin , especially when time series data is irregularly sampled . 2 RELATED WORK . Unsupervised Time Series Representation Learning Time series representation learning plays an essential role in a multitude of downstream analysis such as classification , clustering , anomaly detection . There is a growing interest in unsupervised time series representation learning , partially because no labels are required in the learning process , which suits very well many practical applications . Unsupervised time series representation learning can be broadly divided into two categories , namely 1 ) multi-stage methods and 2 ) end-to-end methods . Multi-stage methods first learn a distance metric from a set of time series , or extract the features from the time series , and then perform downstream machine learning tasks based on the learned or the extracted features . Euclidean distance ( ED ) and Dynamic Time Warping ( DTW ) are the most commonly used traditional time series distance metrics . Although the ED is competitive , it is very sensitive to outliers in the time series . The main drawback of DTW is its heavy computational burden . Traditional time series feature extraction methods include Singular Value Decomposition ( SVD ) , Symbolic Aggregate Approximation ( SAX ) , Discrete Wavelet Transform ( DWT ) ( Chan & Fu , 1999 ) , Piecewise Aggregate Approximation ( PAA ) ( Keogh et al. , 2001 ) , etc . Nevertheless , most of these traditional methods are for regularly sampled time series , so they may not perform well on irregularly sampled time series . In recent years , many new feature extraction methods and distance metrics are proposed to overcome the drawbacks mentioned above . For instance , Paparrizos & Gravano ( 2015 ) ; Petitjean et al . ( 2011 ) combine the proposed distance metrics and K-Means algorithm to achieve clustering . Lei et al . ( 2017 ) first extracts sparse features of time series , which is not sensitive to outliers and irregular sampling rate , and then carries out the K-Means clustering . In contrast , end-to-end approaches learn the representation of the time series in an end-to-end manner without explicit feature extraction or distance learning ( Fortuin et al. , 2018 ; Ma et al. , 2019 ) . However , the aforementioned methods need to manually design the network architecture based on human experience which is time-consuming and costly . Instead , we propose in this paper a representation learning method which optimizes an AutoML pipeline and their hyperparameters in a fully autonomous manner . Furthermore , we consider negative sampling and contrastive learning in the proposed framework to effectively enhance the representation ability of the proposed neural network architecture . Irregularly Sampled Time Series Learning There exist two main groups of works regarding machine learning for irregularly sampled time series data . The first type of methods impute the missing values before conducting the subsequent machine learning tasks ( Shukla & Marlin , 2019 ; Luo et al. , 2018 ; 2019 ; Kim & Chi , 2018 ) . The second type directly learns from the irregularly sampled time series . For instance , Che et al . ( 2018 ) ; Cao et al . ( 2018 ) propose a memory decay mechanism , which replaces the memory cell of RNN by the memory of the previous timestamp multiplied by a learnable decay coefficient when there are no sampling value at this timestamp . Rubanova et al . ( 2019 ) combines RNN with ordinary differential equation to model the dynamic of irregularly sampled time series . Different from the previous works , TimeAutoML makes use of the special characteristics of RNN ( Abid & Zou , 2018 ) and automatically configure a representation learning pipeline to model the temporal dynamics of time series . It is worthy mentioning that there are many types of irregularly sampled time series , which may be caused by sensor failure or sampling time error . And what we put emphasis on analyzing in this paper is a special type of irregularly sampled time series , which have many missing timestamps compared to regularly sampled time series . AutoML Automatic Machine Learning ( AutoML ) aims to automate the time-consuming model development process and has received significant amount of research interests recently . Previous works about AutoML mostly emphasize on the domains of computer vision and natural language processing , including object detection ( Ghiasi et al. , 2019 ; Xu et al. , 2019 ; Chen et al . ) , semantic segmentation ( Weng et al. , 2019 ; Nekrasov et al. , 2019 ; Bae et al. , 2019 ) , translation ( Fan et al. , 2020 ) and sequence labeling ( Chen et al. , 2018a ) . However , AutoML for time series learning is an underappreciated topic so far and the existing works mainly focus on supervised learning tasks , e.g. , time series classification . Ukil & Bandyopadhyay propose an AutoML pipeline for automatic feature extraction and feature selection for time series classification . Van Kuppevelt et al . ( 2020 ) develops an AutoML framework for supervised time series classification , which involves both neural architecture search and hyperparameter optimization . Olsavszky et al . ( 2020 ) proposes a framework called AutoTS , which performs time series forecasting of multiple diseases . Nevertheless , to our best knowledge , no previous work has addressed unsupervised time series learning based on AutoML . Summary of comparisons with related work We next provide a comprehensive comparison between the proposed framework and other state-of-the-art methods , including ( WaRTEm ( Mathew et al. , 2019 ) , DTCR ( Ma et al. , 2019 ) , USRLT ( Franceschi et al. , 2019 ) and BeatGAN ( Zhou et al. , 2019 ) ) , as shown in Table 1 . In particular , we emphasize on a total of seven features in the comparison , including data augmentation , negative sample generation , contrastive learning , selection of autoencoders , similarity metric selection , attention mechanism selection , and automatic hyperparameter search . TimeAutoML is the only method that has all the desired properties . 3 TIMEAUTOML FRAMEWORK . 3.1 PROPOSED AUTOML FRAMEWORK . LetX = { x1 , x2 , · · ·xN } denote a set ofN time series in whichxi ∈ RTi , where Ti is the length of the ith time seriesxi . We aim to build an automated time series representation learning framework to generate task-aware representations that can support a variety of downstream machine learning tasks . In addition , we consider negative sample generation and contrastive self-supervised learning . The contrastive loss function focuses on building time series representations by learning to encode what makes two time series similar or different . The proposed TimeAutoML framework can automatically configure an representation learning pipeline with an array of functional modules , each of these modules is associated with a set of hyperparameters . We assume there are a total of M modules and there areQi options for the ith functional module . Let ki ∈ { 0 , 1 } Qi denote an indicating vector for ith module , with the constraint 1 > ki= ∑Qi j=1 ki , j = 1 ensuring that only a single option is chosen for each module . Let θi , j be the hyperparameters of j th option in ith module , where θCi , j and θ D i , j are respectively the continuous and discrete hyperparameters . Let Θ and K denote the set of variables to optimize , i.e. , Θ = { θi , j , ∀i ∈ [ M ] , j ∈ [ Qi ] } and K = { k1 , . . . , kM } . We further let f ( K , Θ ) denote the corresponding objective function value . Please note that the objective function differs for different tasks . For anomaly detection , we use Area Under the Receiver Operating Curve ( AUC ) as objective function while we use the Normalized Mutual Information ( NMI ) as objective function for clustering . The optimization problem of automatic pipeline configuration is shown below . max K , Θ f ( K , Θ ) subject to { ki ∈ { 0 , 1 } Qi , 1 > ki = 1 , ∀i ∈ [ M ] , θCi , j ∈ Ci , j , θ D i , j ∈ Di , j , ∀i ∈ [ M ] , j ∈ [ Qi ] . ( 1 ) We solve problem ( 1 ) by alternatively leveraging Thompson sampling and Bayesian optimization , which will be discussed as follows .
This work proposes an AutoML framework for multivariate irregularly sampled time series. To achieve this, the proposed framework integrates different modules: data-augmentation self-supervised loss (Equation 7), an anomaly detection loss (Equation 5), and a reconstruction loss. Besides, hyperparameters and model’s configuration is optimized by using AutoML (including Bayesian optimization). The model is evaluated on the well-known time-series datasets UCR and UAE.
SP:c3a4b596e4a86f0032646a166f9506f73a34d60d
TimeAutoML: Autonomous Representation Learning for Multivariate Irregularly Sampled Time Series
1 INTRODUCTION . The past decade has witnessed a rising proliferation in Multivariate Time Series ( MTS ) data , along with a plethora of applications in domains as diverse as IoT data analysis , medical informatics , and network security . Given the huge amount of MTS data , it is crucial to learn their representations effectively so as to facilitate underlying applications such as clustering and anomaly detection . For this purpose , different types of methods have been developed to represent time series data . Traditional time series representation techniques , e.g. , Discrete Fourier Transform ( DCT ) ( Faloutsos et al. , 1994 ) , Discrete Wavelet Transform ( DWT ) ( Chan & Fu , 1999 ) , Piecewise Aggregate Approximation ( PAA ) ( Keogh et al. , 2001 ) , etc. , represent raw time series data based on specific domain knowledge/data properties and hence could be suboptimal for subsequent tasks given the fact that their objectives and feature extraction are decoupled . More recent time series representation approaches , e.g. , Deep Temporal Clustering Representation ( DTCR ) ( Ma et al. , 2019 ) , Self-Organizing Map based Variational Auto Encoder ( SOM-VAE ) ( Fortuin et al. , 2018 ) , etc. , optimize the representation and the underlying task such as clustering in an end-to-end manner . These methods usually assume that time series under investigation are uniformly sampled with a fixed interval . This assumption , however , does not always hold in many applications . For example , within a multimodal IoT system , the sampling rates could vary for different types of sensors . Unsupervised representation learning for irregularly sampled multivariate time series is a challenging task and there are several major hurdles preventing us from building effective models : i ) the design of neural network architecture often employs a trial and error procedure which is time consuming and could cost a substantial amount of labor effort ; ii ) the irregularity in the sampling rates constitutes a major challenge against effective learning of time series representations and render most existing methods not directly applicable ; iii ) traditional unsupervised time series representation learning approach does not consider contrastive loss functions and consequently only can achieve suboptimal performance . To tackle the aforementioned challenges , we propose an autonomous unsupervised representation learning approach for multivariate time series to represent irregularly sampled multivariate time series . TimeAutoML differs from traditional time series representation approaches in three aspects . First , the representation learning pipeline configuration and hyperparameter optimization are carried out automatically . Second , a negative sample generation approach is proposed to generate negative samples for contrastive learning . Finally , an auxiliary classification task is developed to distinguish normal time series from negative samples . In this way , the representation capability of TimeAutoML is greatly enhanced . We conduct extensive experiments on UCR time series datasets and UEA multivariate time series datasets . Our experiments demonstrate that the proposed TimeAutoML outperforms comparison algorithms on both clustering and anomaly detection tasks by a large margin , especially when time series data is irregularly sampled . 2 RELATED WORK . Unsupervised Time Series Representation Learning Time series representation learning plays an essential role in a multitude of downstream analysis such as classification , clustering , anomaly detection . There is a growing interest in unsupervised time series representation learning , partially because no labels are required in the learning process , which suits very well many practical applications . Unsupervised time series representation learning can be broadly divided into two categories , namely 1 ) multi-stage methods and 2 ) end-to-end methods . Multi-stage methods first learn a distance metric from a set of time series , or extract the features from the time series , and then perform downstream machine learning tasks based on the learned or the extracted features . Euclidean distance ( ED ) and Dynamic Time Warping ( DTW ) are the most commonly used traditional time series distance metrics . Although the ED is competitive , it is very sensitive to outliers in the time series . The main drawback of DTW is its heavy computational burden . Traditional time series feature extraction methods include Singular Value Decomposition ( SVD ) , Symbolic Aggregate Approximation ( SAX ) , Discrete Wavelet Transform ( DWT ) ( Chan & Fu , 1999 ) , Piecewise Aggregate Approximation ( PAA ) ( Keogh et al. , 2001 ) , etc . Nevertheless , most of these traditional methods are for regularly sampled time series , so they may not perform well on irregularly sampled time series . In recent years , many new feature extraction methods and distance metrics are proposed to overcome the drawbacks mentioned above . For instance , Paparrizos & Gravano ( 2015 ) ; Petitjean et al . ( 2011 ) combine the proposed distance metrics and K-Means algorithm to achieve clustering . Lei et al . ( 2017 ) first extracts sparse features of time series , which is not sensitive to outliers and irregular sampling rate , and then carries out the K-Means clustering . In contrast , end-to-end approaches learn the representation of the time series in an end-to-end manner without explicit feature extraction or distance learning ( Fortuin et al. , 2018 ; Ma et al. , 2019 ) . However , the aforementioned methods need to manually design the network architecture based on human experience which is time-consuming and costly . Instead , we propose in this paper a representation learning method which optimizes an AutoML pipeline and their hyperparameters in a fully autonomous manner . Furthermore , we consider negative sampling and contrastive learning in the proposed framework to effectively enhance the representation ability of the proposed neural network architecture . Irregularly Sampled Time Series Learning There exist two main groups of works regarding machine learning for irregularly sampled time series data . The first type of methods impute the missing values before conducting the subsequent machine learning tasks ( Shukla & Marlin , 2019 ; Luo et al. , 2018 ; 2019 ; Kim & Chi , 2018 ) . The second type directly learns from the irregularly sampled time series . For instance , Che et al . ( 2018 ) ; Cao et al . ( 2018 ) propose a memory decay mechanism , which replaces the memory cell of RNN by the memory of the previous timestamp multiplied by a learnable decay coefficient when there are no sampling value at this timestamp . Rubanova et al . ( 2019 ) combines RNN with ordinary differential equation to model the dynamic of irregularly sampled time series . Different from the previous works , TimeAutoML makes use of the special characteristics of RNN ( Abid & Zou , 2018 ) and automatically configure a representation learning pipeline to model the temporal dynamics of time series . It is worthy mentioning that there are many types of irregularly sampled time series , which may be caused by sensor failure or sampling time error . And what we put emphasis on analyzing in this paper is a special type of irregularly sampled time series , which have many missing timestamps compared to regularly sampled time series . AutoML Automatic Machine Learning ( AutoML ) aims to automate the time-consuming model development process and has received significant amount of research interests recently . Previous works about AutoML mostly emphasize on the domains of computer vision and natural language processing , including object detection ( Ghiasi et al. , 2019 ; Xu et al. , 2019 ; Chen et al . ) , semantic segmentation ( Weng et al. , 2019 ; Nekrasov et al. , 2019 ; Bae et al. , 2019 ) , translation ( Fan et al. , 2020 ) and sequence labeling ( Chen et al. , 2018a ) . However , AutoML for time series learning is an underappreciated topic so far and the existing works mainly focus on supervised learning tasks , e.g. , time series classification . Ukil & Bandyopadhyay propose an AutoML pipeline for automatic feature extraction and feature selection for time series classification . Van Kuppevelt et al . ( 2020 ) develops an AutoML framework for supervised time series classification , which involves both neural architecture search and hyperparameter optimization . Olsavszky et al . ( 2020 ) proposes a framework called AutoTS , which performs time series forecasting of multiple diseases . Nevertheless , to our best knowledge , no previous work has addressed unsupervised time series learning based on AutoML . Summary of comparisons with related work We next provide a comprehensive comparison between the proposed framework and other state-of-the-art methods , including ( WaRTEm ( Mathew et al. , 2019 ) , DTCR ( Ma et al. , 2019 ) , USRLT ( Franceschi et al. , 2019 ) and BeatGAN ( Zhou et al. , 2019 ) ) , as shown in Table 1 . In particular , we emphasize on a total of seven features in the comparison , including data augmentation , negative sample generation , contrastive learning , selection of autoencoders , similarity metric selection , attention mechanism selection , and automatic hyperparameter search . TimeAutoML is the only method that has all the desired properties . 3 TIMEAUTOML FRAMEWORK . 3.1 PROPOSED AUTOML FRAMEWORK . LetX = { x1 , x2 , · · ·xN } denote a set ofN time series in whichxi ∈ RTi , where Ti is the length of the ith time seriesxi . We aim to build an automated time series representation learning framework to generate task-aware representations that can support a variety of downstream machine learning tasks . In addition , we consider negative sample generation and contrastive self-supervised learning . The contrastive loss function focuses on building time series representations by learning to encode what makes two time series similar or different . The proposed TimeAutoML framework can automatically configure an representation learning pipeline with an array of functional modules , each of these modules is associated with a set of hyperparameters . We assume there are a total of M modules and there areQi options for the ith functional module . Let ki ∈ { 0 , 1 } Qi denote an indicating vector for ith module , with the constraint 1 > ki= ∑Qi j=1 ki , j = 1 ensuring that only a single option is chosen for each module . Let θi , j be the hyperparameters of j th option in ith module , where θCi , j and θ D i , j are respectively the continuous and discrete hyperparameters . Let Θ and K denote the set of variables to optimize , i.e. , Θ = { θi , j , ∀i ∈ [ M ] , j ∈ [ Qi ] } and K = { k1 , . . . , kM } . We further let f ( K , Θ ) denote the corresponding objective function value . Please note that the objective function differs for different tasks . For anomaly detection , we use Area Under the Receiver Operating Curve ( AUC ) as objective function while we use the Normalized Mutual Information ( NMI ) as objective function for clustering . The optimization problem of automatic pipeline configuration is shown below . max K , Θ f ( K , Θ ) subject to { ki ∈ { 0 , 1 } Qi , 1 > ki = 1 , ∀i ∈ [ M ] , θCi , j ∈ Ci , j , θ D i , j ∈ Di , j , ∀i ∈ [ M ] , j ∈ [ Qi ] . ( 1 ) We solve problem ( 1 ) by alternatively leveraging Thompson sampling and Bayesian optimization , which will be discussed as follows .
This paper proposes an autonomous representation learning framework for multivariate time series with irregular sampling rates. Specifically, there are three major components proposed in the framework. 1) An AutoML solution for hyperparameters optimization under Bayesian framework is proposed to automatically seek optimal network structures and parameters. 2) Variational autoencoders based on generative approach and attention mechanism is employed to learn the semantic representation of time series with limitation of irregular sampling. 3) A sample energy function derived from Gaussian mixture model attempts to depict the level of anomaly of sliced time series.
SP:c3a4b596e4a86f0032646a166f9506f73a34d60d
Probing BERT in Hyperbolic Spaces
1 INTRODUCTION . Contextualized word representations with pretrained language models have significantly advanced NLP progress ( Peters et al. , 2018a ; Devlin et al. , 2019 ) . Previous works point out that abundant linguistic knowledge implicitly exists in these representations ( Belinkov et al. , 2017 ; Peters et al. , 2018b ; a ; Tenney et al. , 2019 ) . This paper is primarily inspired by Hewitt & Manning ( 2019 ) who propose a structural probe to recover dependency trees encoded under squared Euclidean distance in a syntactic subspace . Although being an implicit assumption , there is no strict evidence that the geometry of these syntactic subspaces should be Euclidean , especially under the fact that the Euclidean space has intrinsic difficulties for modeling trees ( Linial et al. , 1995 ) . We propose to impose and explore different inductive biases for modeling syntactic subspaces . The hyperbolic space , a special Riemannian space with constant negative curvature , is a good candidate because of its tree-likeness ( Nickel & Kiela , 2017 ; Sarkar , 2011 ) . We adopt a generalized Poincaré Ball , a special model of hyperbolic spaces , to construct a Poincaré probe for contextualized embeddings . Figure 1 ( A , B ) give an example of a tree embedded in the Poincaré ball and compare the Euclidean counterparts . Intuitively , the volume of a Poincaré ball grows exponentially with its radius , which is similar to the phenomenon that the number of nodes of a full tree grows exponentially with its depth . This would give “ enough space ” to embed the tree . In the meantime , the volume of the Euclidean ball grows polynomially and thus has less capacity to embed tree nodes . ∗Equal contribution . Work was done during an internship at Alibaba DAMO Academy . †Corresponding author . 1Our results can be reproduced at https : //github.com/FranxYao/PoincareProbe . Before going any further , it is crutial to differentiate a probe and supervised parser ( Hall Maudslay et al. , 2020 ) , and ask what makes a good probe . Ideally , a probe should correctly recover syntactic information intrinsically contained in the embeddings , rather than being a powerful parser by itself . So it is important that the probe should have restricted modeling power but still be sensitive enough to the existence of syntax . For embeddings without strong syntax information ( e.g. , randomly initialized word embeddings ) , a probe should not aim to assign high parsing scores ( because this would overestimate the existence of syntax ) , while a parser aims for high scores no matter how bad the input embeddings are . The quality of a probe is defined by its sensitivity to syntax . Our work of probing BERT in hyperbolic spaces is exploratory . As opposed to the Euclidean syntactic subspaces in Hewitt & Manning ( 2019 ) , we consider the Poincaré syntactic subspace , and show its effectiveness for recovering syntax . Figure 1 ( C ) gives an example of the reconstructed dependency tree embedded in the Poincaré ball . In our experiments , we highlight two important observations of our Poincaré probe : ( a ) it does not give higher parsing scores to baseline embeddings ( which have no syntactic information ) than Euclidean probes , meaning that it is not a better parser ; ( b ) it reveals higher parsing scores , especially for deeper trees , longer edges , and longer sentences , than the Euclidean probe with strictly restricted capacity . Observation ( b ) can be interpreted from two perspectives : ( 1 ) it indicates that the Poincaré probe might be more sensitive to the existence of deeper syntax ; ( 2 ) the structure of syntactic subspaces of BERT could be different than Euclidean , especially for deeper trees . Consequently , the Euclidean probe may underestimate the syntactic capability of BERT , and BERT may exhibit stronger modeling power for deeper syntax in some special metric space , in our case , a Poincaré ball . To best exploit the inductive bias for hierarchical structures of hyperbolic space , we generalize our Poincaré probe to sentiment analysis . We construct a Poincaré sentiment subspace by predicting sentiments of individual words using vector geometry ( Figure 1 D ) . We assume two meta representations for the positive and negative sentiments as the roots in the sentiment subspace . The stronger a word ’ s polarity is , the closer it locates to its corresponding meta embedding . In our experiments , with clearly different geometric properties , the Poincaré probe shows that BERT encodes sentiments for each word in a very fine-grained way . We further reveal how the localization of word embeddings may change according to lexically-controlled contextualization , i.e. , how different contexts would affect the geometric location of the embeddings in the sentiment subspace . In summary , we present an Poincaré probe to reveal hierarchical linguistic structures encoded in BERT . From a hyperbolic deep learning perspective , our results indicate the possibility of using Poincaré models for learning better representations of linguistic hierarchies . From a linguistic perspective , we reveal the geometric properties of linguistic hierarchies encoded in BERT and posit that BERT may encode linguistic information in special metric spaces that are not necessarily Euclidean . We demonstrate the effectiveness of our approach with extensive experiments and visualization . 2 RELATED WORK . Probing BERT Recently , there are increasing interests in finding linguistic information encoded in BERT ( Rogers et al. , 2020 ) . One typical line of work is the structural probes aiming to reveal how syntax trees are encoded geometrically in BERT embeddings ( Hewitt & Manning , 2019 ; Reif et al. , 2019 ) . Our Poincaré probe generally follows this line and exploits the geometric properties of hyperbolic spaces for modeling trees . Again , we note that the goal of syntactic probes is to find syntax trees with strictly limited capacity , i.e. , a probe should not be a parser ( Hewitt & Manning , 2019 ; Kim et al. , 2020 ) , and strictly follow this restriction in our experiments . Other probing tasks consider a variety of linguistic properties , including morphology ( Belinkov et al. , 2017 ) , word sense ( Reif et al. , 2019 ) , phrases ( Kim et al. , 2020 ) , semantic fragments ( Richardson et al. , 2020 ) , and other aspects of syntax and semantics ( Tenney et al. , 2019 ) . Our extended Poincaré probe for sentiment can be viewed as one typical semantic probe that reveals how BERT geometrically encodes word sentiments . Hyperbolic Deep Learning Recently , methods using hyperbolic geometry have been proposed for several NLP tasks due to its better inductive bias for capturing hierarchical information than Euclidean space . Poincaré embeddings ( Nickel & Kiela , 2017 ) and POINCARÉGLOVE ( Tifrea et al. , 2019 ) learn embeddings of hierarchies using Poincaré models and exhibit impressive results , especially in low dimension . These works show the advantages of hyperbolic geometry for modeling trees while we focus on using hyperbolic spaces for probing contextualized embeddings . To learn models in hyperbolic spaces , previous works combine the formalism of Möbius gyrovector spaces with the Riemannian geometry , derive hyperbolic versions of important mathematical operations such as Möbius matrix-vector multiplication , and use them to build hyperbolic neural networks ( Ganea et al. , 2018 ) . Riemannian adaptive optimization methods ( Bonnabel , 2013 ; Bécigneul & Ganea , 2019 ) are proposed for gradient-based optimization . Techniques in these works are used as the infrastructure in this work for training Poincaré probes . 3 POINCARÉ PROBE . We begin by reviewing the basics of Hyperbolic Geometry . We follow the notations from Ganea et al . ( 2018 ) . A generalized Poincaré ball is a typical model of hyperbolic space , denoted as ( Dnc , gDx ) for c > 0 , where Dnc = { x ∈ Rn | c‖x‖2 < 1 } is a Riemannian manifold , gDx = ( λcx ) 2In is the metric tensor , λcx = 2/ ( 1 − c‖x‖2 ) is the conformal factor and c is the negative curvature of the hyperbolic space . We will use the term hyperbolic and Poincaré interchangeably according to the context . Our Poincaré probe uses the standard Poincaré ball Dnc with c = 1 . The distance function for x , y ∈ Dnc is : dD ( x , y ) = ( 2/ √ c ) tanh−1 ( √ c‖ − x⊕c y‖ ) , ( 1 ) where⊕c denotes the Möbius addition , the hyperbolic version of the addition operator . Note that we recover the Euclidean space Rn when c → 0 . Additionally , we use M ⊗c x to denote the Möbius matrix-vector multiplication for a linear map M : Rn → Rm , which is the hyperbolic version of linear transforms . We use expcx ( · ) to denote the exponential map , which maps vectors in the tangent space ( in our case , a space projected from the BERT embedding space ) to the hyperbolic space . Their closed-form formulas are detailed in Appendix C. Our probes consist two simple linear maps P and Q that project BERT embeddings into a Poincaré syntactic/sentiment subspace . Formally , let M denote a pretrained language model that produces a sequence of distributed representations h1 : t given a sentence of t words w1 : t. We train a linear map P : Rn → Rk , n being the dimension of contextualized embeddings and k being the probe rank , that projects the distributed representations to the tangent space . Then the exponential map projects the tangent space to the hyperbolic space . In the hyperbolic space , we construct the Poincaré syntactic/sentiment subspace via another linear map Q : Rk → Rk . The equations are : pi = exp0 ( Phi ) ( 2 ) qi = Q⊗c pi ( 3 ) Here P maps the original BERT embedding space to the tangent space of the origin of the Poincaré ball . Then exp0 ( · ) maps the tangent space inside the Poincaré ball2 . Consequently , in equation 3 we use the Möbius matrix-vector multiplication as the linear transformation in the hyperbolic space3 . 4 PROBING SYNTAX . Following Hewitt & Manning ( 2019 ) , we aim to test if there exists a hyperbolic subspace transformed from the original BERT embedding space with simple parameterization where squared distances between embeddings or squared norms of embeddings approximate tree distances or node depths , respectively . The goal of the probe is to recover syntactic information intrinsically contained in the embeddings . To this end , a probe should not assign high parsing scores to baseline non-contextualized embeddings ( otherwise it would become a parser , rather than being a probe ) . So it is crucial for the probe to have restricted modeling power ( in our case , two linear transforms P and Q ) but still being sensitive enough for syntactic structures . We further test if the Poincaré probe is able to discover more syntactic information for deeper trees due to its intrinsic bias for modeling trees . Similar to Hewitt & Manning ( 2019 ) , we use the squared Poincaré distance to recreate tree distances between word pairs and the squared Poincaré distance to the origin to recreate the depth of a word : Ldistance = 1 t2 ∑ i , j∈ { 1 , ... , t } |dT ( wi , wj ) − dDn ( qi , qj ) 2| ( 4 ) Ldepth = 1 t ∑ i∈ { 1 , ... , t } |dD ( wi ) − dDn ( qi,0 ) 2| ( 5 ) where dT ( wi , wj ) denotes the distance between word i , j on their dependency tree , i.e. , number of edges linking word i to j and dD ( wi ) denotes the depth of word i in the dependency tree . For optimization , we use the Adam ( Kingma & Ba , 2014 ) initialized at learning rate 0.001 and train up to 40 epochs . We decay the learning rate and perform model selection based on the dev loss . 2The choice of tangent space at the origin , instead of other points , follows previous works ( Ganea et al. , 2018 ; Mathieu et al. , 2019 ) for its mathematical simplexity and optimization convenience . 3This transformation is theoretically redundent , we use it primarily for numerical stability during optimization . We further note that such optimization stability is still an open problem in hyperbolic deep learning ( Mathieu et al. , 2019 ) . We leave a detailed investigation to future work .
This paper proposes probes based on hyperbolic embedding spaces, and compares them to the behaviour of Euclidean probes from recent work. The main result is that these probes allow for better recovery of syntactic properties of sentences from contextualized word embeddings compared to context-independent ones, when comparing them to euclidean probes. Similar results are presented on sentiment analysis, even though no results are presented for context-independent word embeddings.
SP:9f713e213bde5ac69147e961004757cf0b6ae956
Probing BERT in Hyperbolic Spaces
1 INTRODUCTION . Contextualized word representations with pretrained language models have significantly advanced NLP progress ( Peters et al. , 2018a ; Devlin et al. , 2019 ) . Previous works point out that abundant linguistic knowledge implicitly exists in these representations ( Belinkov et al. , 2017 ; Peters et al. , 2018b ; a ; Tenney et al. , 2019 ) . This paper is primarily inspired by Hewitt & Manning ( 2019 ) who propose a structural probe to recover dependency trees encoded under squared Euclidean distance in a syntactic subspace . Although being an implicit assumption , there is no strict evidence that the geometry of these syntactic subspaces should be Euclidean , especially under the fact that the Euclidean space has intrinsic difficulties for modeling trees ( Linial et al. , 1995 ) . We propose to impose and explore different inductive biases for modeling syntactic subspaces . The hyperbolic space , a special Riemannian space with constant negative curvature , is a good candidate because of its tree-likeness ( Nickel & Kiela , 2017 ; Sarkar , 2011 ) . We adopt a generalized Poincaré Ball , a special model of hyperbolic spaces , to construct a Poincaré probe for contextualized embeddings . Figure 1 ( A , B ) give an example of a tree embedded in the Poincaré ball and compare the Euclidean counterparts . Intuitively , the volume of a Poincaré ball grows exponentially with its radius , which is similar to the phenomenon that the number of nodes of a full tree grows exponentially with its depth . This would give “ enough space ” to embed the tree . In the meantime , the volume of the Euclidean ball grows polynomially and thus has less capacity to embed tree nodes . ∗Equal contribution . Work was done during an internship at Alibaba DAMO Academy . †Corresponding author . 1Our results can be reproduced at https : //github.com/FranxYao/PoincareProbe . Before going any further , it is crutial to differentiate a probe and supervised parser ( Hall Maudslay et al. , 2020 ) , and ask what makes a good probe . Ideally , a probe should correctly recover syntactic information intrinsically contained in the embeddings , rather than being a powerful parser by itself . So it is important that the probe should have restricted modeling power but still be sensitive enough to the existence of syntax . For embeddings without strong syntax information ( e.g. , randomly initialized word embeddings ) , a probe should not aim to assign high parsing scores ( because this would overestimate the existence of syntax ) , while a parser aims for high scores no matter how bad the input embeddings are . The quality of a probe is defined by its sensitivity to syntax . Our work of probing BERT in hyperbolic spaces is exploratory . As opposed to the Euclidean syntactic subspaces in Hewitt & Manning ( 2019 ) , we consider the Poincaré syntactic subspace , and show its effectiveness for recovering syntax . Figure 1 ( C ) gives an example of the reconstructed dependency tree embedded in the Poincaré ball . In our experiments , we highlight two important observations of our Poincaré probe : ( a ) it does not give higher parsing scores to baseline embeddings ( which have no syntactic information ) than Euclidean probes , meaning that it is not a better parser ; ( b ) it reveals higher parsing scores , especially for deeper trees , longer edges , and longer sentences , than the Euclidean probe with strictly restricted capacity . Observation ( b ) can be interpreted from two perspectives : ( 1 ) it indicates that the Poincaré probe might be more sensitive to the existence of deeper syntax ; ( 2 ) the structure of syntactic subspaces of BERT could be different than Euclidean , especially for deeper trees . Consequently , the Euclidean probe may underestimate the syntactic capability of BERT , and BERT may exhibit stronger modeling power for deeper syntax in some special metric space , in our case , a Poincaré ball . To best exploit the inductive bias for hierarchical structures of hyperbolic space , we generalize our Poincaré probe to sentiment analysis . We construct a Poincaré sentiment subspace by predicting sentiments of individual words using vector geometry ( Figure 1 D ) . We assume two meta representations for the positive and negative sentiments as the roots in the sentiment subspace . The stronger a word ’ s polarity is , the closer it locates to its corresponding meta embedding . In our experiments , with clearly different geometric properties , the Poincaré probe shows that BERT encodes sentiments for each word in a very fine-grained way . We further reveal how the localization of word embeddings may change according to lexically-controlled contextualization , i.e. , how different contexts would affect the geometric location of the embeddings in the sentiment subspace . In summary , we present an Poincaré probe to reveal hierarchical linguistic structures encoded in BERT . From a hyperbolic deep learning perspective , our results indicate the possibility of using Poincaré models for learning better representations of linguistic hierarchies . From a linguistic perspective , we reveal the geometric properties of linguistic hierarchies encoded in BERT and posit that BERT may encode linguistic information in special metric spaces that are not necessarily Euclidean . We demonstrate the effectiveness of our approach with extensive experiments and visualization . 2 RELATED WORK . Probing BERT Recently , there are increasing interests in finding linguistic information encoded in BERT ( Rogers et al. , 2020 ) . One typical line of work is the structural probes aiming to reveal how syntax trees are encoded geometrically in BERT embeddings ( Hewitt & Manning , 2019 ; Reif et al. , 2019 ) . Our Poincaré probe generally follows this line and exploits the geometric properties of hyperbolic spaces for modeling trees . Again , we note that the goal of syntactic probes is to find syntax trees with strictly limited capacity , i.e. , a probe should not be a parser ( Hewitt & Manning , 2019 ; Kim et al. , 2020 ) , and strictly follow this restriction in our experiments . Other probing tasks consider a variety of linguistic properties , including morphology ( Belinkov et al. , 2017 ) , word sense ( Reif et al. , 2019 ) , phrases ( Kim et al. , 2020 ) , semantic fragments ( Richardson et al. , 2020 ) , and other aspects of syntax and semantics ( Tenney et al. , 2019 ) . Our extended Poincaré probe for sentiment can be viewed as one typical semantic probe that reveals how BERT geometrically encodes word sentiments . Hyperbolic Deep Learning Recently , methods using hyperbolic geometry have been proposed for several NLP tasks due to its better inductive bias for capturing hierarchical information than Euclidean space . Poincaré embeddings ( Nickel & Kiela , 2017 ) and POINCARÉGLOVE ( Tifrea et al. , 2019 ) learn embeddings of hierarchies using Poincaré models and exhibit impressive results , especially in low dimension . These works show the advantages of hyperbolic geometry for modeling trees while we focus on using hyperbolic spaces for probing contextualized embeddings . To learn models in hyperbolic spaces , previous works combine the formalism of Möbius gyrovector spaces with the Riemannian geometry , derive hyperbolic versions of important mathematical operations such as Möbius matrix-vector multiplication , and use them to build hyperbolic neural networks ( Ganea et al. , 2018 ) . Riemannian adaptive optimization methods ( Bonnabel , 2013 ; Bécigneul & Ganea , 2019 ) are proposed for gradient-based optimization . Techniques in these works are used as the infrastructure in this work for training Poincaré probes . 3 POINCARÉ PROBE . We begin by reviewing the basics of Hyperbolic Geometry . We follow the notations from Ganea et al . ( 2018 ) . A generalized Poincaré ball is a typical model of hyperbolic space , denoted as ( Dnc , gDx ) for c > 0 , where Dnc = { x ∈ Rn | c‖x‖2 < 1 } is a Riemannian manifold , gDx = ( λcx ) 2In is the metric tensor , λcx = 2/ ( 1 − c‖x‖2 ) is the conformal factor and c is the negative curvature of the hyperbolic space . We will use the term hyperbolic and Poincaré interchangeably according to the context . Our Poincaré probe uses the standard Poincaré ball Dnc with c = 1 . The distance function for x , y ∈ Dnc is : dD ( x , y ) = ( 2/ √ c ) tanh−1 ( √ c‖ − x⊕c y‖ ) , ( 1 ) where⊕c denotes the Möbius addition , the hyperbolic version of the addition operator . Note that we recover the Euclidean space Rn when c → 0 . Additionally , we use M ⊗c x to denote the Möbius matrix-vector multiplication for a linear map M : Rn → Rm , which is the hyperbolic version of linear transforms . We use expcx ( · ) to denote the exponential map , which maps vectors in the tangent space ( in our case , a space projected from the BERT embedding space ) to the hyperbolic space . Their closed-form formulas are detailed in Appendix C. Our probes consist two simple linear maps P and Q that project BERT embeddings into a Poincaré syntactic/sentiment subspace . Formally , let M denote a pretrained language model that produces a sequence of distributed representations h1 : t given a sentence of t words w1 : t. We train a linear map P : Rn → Rk , n being the dimension of contextualized embeddings and k being the probe rank , that projects the distributed representations to the tangent space . Then the exponential map projects the tangent space to the hyperbolic space . In the hyperbolic space , we construct the Poincaré syntactic/sentiment subspace via another linear map Q : Rk → Rk . The equations are : pi = exp0 ( Phi ) ( 2 ) qi = Q⊗c pi ( 3 ) Here P maps the original BERT embedding space to the tangent space of the origin of the Poincaré ball . Then exp0 ( · ) maps the tangent space inside the Poincaré ball2 . Consequently , in equation 3 we use the Möbius matrix-vector multiplication as the linear transformation in the hyperbolic space3 . 4 PROBING SYNTAX . Following Hewitt & Manning ( 2019 ) , we aim to test if there exists a hyperbolic subspace transformed from the original BERT embedding space with simple parameterization where squared distances between embeddings or squared norms of embeddings approximate tree distances or node depths , respectively . The goal of the probe is to recover syntactic information intrinsically contained in the embeddings . To this end , a probe should not assign high parsing scores to baseline non-contextualized embeddings ( otherwise it would become a parser , rather than being a probe ) . So it is crucial for the probe to have restricted modeling power ( in our case , two linear transforms P and Q ) but still being sensitive enough for syntactic structures . We further test if the Poincaré probe is able to discover more syntactic information for deeper trees due to its intrinsic bias for modeling trees . Similar to Hewitt & Manning ( 2019 ) , we use the squared Poincaré distance to recreate tree distances between word pairs and the squared Poincaré distance to the origin to recreate the depth of a word : Ldistance = 1 t2 ∑ i , j∈ { 1 , ... , t } |dT ( wi , wj ) − dDn ( qi , qj ) 2| ( 4 ) Ldepth = 1 t ∑ i∈ { 1 , ... , t } |dD ( wi ) − dDn ( qi,0 ) 2| ( 5 ) where dT ( wi , wj ) denotes the distance between word i , j on their dependency tree , i.e. , number of edges linking word i to j and dD ( wi ) denotes the depth of word i in the dependency tree . For optimization , we use the Adam ( Kingma & Ba , 2014 ) initialized at learning rate 0.001 and train up to 40 epochs . We decay the learning rate and perform model selection based on the dev loss . 2The choice of tangent space at the origin , instead of other points , follows previous works ( Ganea et al. , 2018 ; Mathieu et al. , 2019 ) for its mathematical simplexity and optimization convenience . 3This transformation is theoretically redundent , we use it primarily for numerical stability during optimization . We further note that such optimization stability is still an open problem in hyperbolic deep learning ( Mathieu et al. , 2019 ) . We leave a detailed investigation to future work .
In the same vein as Hewitt & Manning 2019, the authors present an extremely lightly parametrized “probe” model to determine the presence of syntactic structure in the embedding space of BERT models. While Hewitt & Manning examine the Euclidean distance between linearly transformed token embeddings and its correlation with parse tree distance and depth, this work examines a different distance function based on distances in hyperbolic space. They find that this distance measure, for an equivalent or lesser number of parameters, better reproduces the syntactic properties. This suggests that the BERT model may operate simply, but on a non-Euclidean manifold, in order to work with syntactic information.
SP:9f713e213bde5ac69147e961004757cf0b6ae956
FASG: Feature Aggregation Self-training GCN for Semi-supervised Node Classification
1 INTRODUCTION . Graph convolutional network ( GCN ) can be seen as the migration of convolutional neural network ( CNN ) on non-Euclidean structure data . Due to its its excellent ability in representation learning , GCN has achieved significant success in many graph-based learning tasks , including node clustering , graph classification and link prediction ( Dwivedi et al. , 2020 ) . Kipf & Welling ( 2016 ) proposed a GCN mode from the perspective of spectrogram theory and validated its effectiveness on semi-supervised node classification task . Subsequent models such as GraphSAGE ( Hamilton et al. , 2017 ) , GAT ( Veličković et al. , 2017 ) , SGCN ( Wu et al. , 2019 ) and APPNP ( Klicpera et al. , 2018 ) designed more sophisticated neighborhood aggregation functions from spatial or spectral views . These methods obtain much more effective results on semi-supervised node classification than traditional methods such as MLP , DeepWalk ( Perozzi et al. , 2014 ) , etc . However , the prediction accuracy of such GCN models depends largely on the quantity and quality of supervised information , and it will decrease significantly when the quantity of labeled nodes is quite small ( Li et al. , 2018 ) . The main reason lies that scarce supervised information is difficult to be spread far away in the graph so that unlabeled nodes are hardly to make full use of supervised information for prediction . Addressing the above issue , many studies have been devoted to improving the representation ability by designing multi-layer GCN model ( Li et al. , 2019 ) . However , the representation ability of GCN , as illustrated in Kipf & Welling ( 2016 ) , can hardly be improved by simply stacking layers just like MLP . Moreover , stacking too many layers tends to cause over-smoothing ( Xu et al. , 2018 ) that makes all node embeddings indistinguishable . Alternatively , Li et al . ( 2018 ) proposed to improve the reasoning ability of GCN models by applying self-training techniques on the training . Rather than trying to enhance the expressive ability of the model , the self-training strategy prefers to expand the supervised information by adding unlabeled nodes with high confidences to the training set at each round . Following this line , Sun et al . ( 2019 ) proposed a multi-stage self-training strategy ( M3S ) to enrich the training set , which uses deep cluster ( Caron et al. , 2018 ) and an aligning mechanism to generate pseudo-labels of nodes for updating of the training set . Later , Zhou et al . ( 2019 ) proposed a dynamic self-training framework to continuously refresh the training set by directly using the output of GCN without a checking part . In general these self-training algorithms generate pseudolabels using relatively simple checking mechanism , which may introduce false labels as supervision information and prevent the improvement of prediction accuracy . In this paper , we propose a novel feature aggregation self-training GCN ( FASG ) algorithm for semisupervised node classification . We firstly propose a lightweight classifier that applies linear SVM on aggregated node features , and validate that it achieves comparable performance to popular GCN approaches . Furthermore , this classifier is served as a checking part in the multi-round training process to generate pseudo-labels , which are used to filter unreliable nodes when expanding the supervised information . By fully considering the structural information of graph nodes , the newly developed checking part is able to improve the accuracy of the generated pseudo-labels and finally boost the node classification . Finally , we illustrate that the proposed self-training strategy can be integrated with various existing GCN models to improve the prediction performance . The proposed algorithms is validated in comparison with several state-of-the-art baseline algorithms in three public benchmarks , and the experimental results illustrate that the proposed algorithm outperforms all compared algorithms in general on all benchmarks . We will release the source code upon publication of this paper . 2 RELATED WORK . In the past decade CNN has achieved great success in many areas of machine learning ( Krizhevsky et al. , 2012 ; LeCun et al. , 1998 ; Sermanet et al. , 2012 ) , but its applications are mainly restricted in dealing with Euclidean structure data ( Bruna et al. , 2013 ) . Consequently , in recent years more and more studies are devoted to learning the representation on non-Euclidean structure data such as graph . Graph neural network ( GNN ) plays an important role in the field of graph representation learning , which can learn the representation of nodes or the whole graph . There are many famous GNN architectures including GCN ( Kipf & Welling , 2016 ) , graph recurrent neural network ( Hajiramezanali et al. , 2019 ) and graph autoencoder ( Pan et al. , 2018 ) . As one of the most important architecture of GNN , GCN can be roughly categorized into spectral and spatial approaches . The spectral approaches ( Bruna et al. , 2013 ) define convolution operation by Laplacian feature decomposition of the graph , thereby filtering the graph structure in the spectral domain . On the basis of the Chebyshev polynomial ( Defferrard et al. , 2016 ) of the graph Laplacian matrix , Kipf & Welling ( 2016 ) proposed a much simper GCN framework that limits the filter to the first-order neighbor around each node . On the other hand , spatial approaches implement convolution in spatial domain by defining aggregation functions and transform functions . Notable work includes GraphSAGE ( Hamilton et al. , 2017 ) that transformed representation learning into a formal pattern called aggregation and combination and proposed several effective aggregation strategies such as mean-aggregator and max-aggregator , and GAT ( Veličković et al. , 2017 ) that focuses on the diversity in connected nodes and leverages selfattention mechanism to learn the important information in neighborhoods . Although these models have achieved far better performance on node classification than traditional methods , they still suffer from scarce supervised information due to the limitation on GCN layers making it hard to transform the supervised information to the entire graph . Self-training is an ancient and classic topic in the NLP field before deep learning era ( Hearst , 1991 ; Riloff et al. , 1999 ; Rosenberg et al. , 2005 ; Van Asch & Daelemans , 2016 ) , and has recently been introduced into semi-supervised node classification . For making full use of supervised information to improve the prediction accuracy , Li et al . ( 2018 ) proposed to improve GCN model by self-training mechanism , which trains and applies a base model in rounds , and adds nodes with high confidences as supervision after each round . The newly added nodes are expect to be beneficial to predict rest nodes so as to enhance the final performance of the model . Following this line , the M3S training algorithm Sun et al . ( 2019 ) pretrains a model over the labeled data , and then assigns pseudo-labels to highly confident unlabeled samples that are considered as labeled data for the next round of the training . Later , Zhou et al . ( 2019 ) proposed a dynamic self-training GCN that generalizes and simplifies previous by directly using the output of GCN without a checking part to continuously refresh the training set . Similarly , Yang et al . ( 2020 ) proposed self-enhanced GNN ( SEG ) to improve the quality of the input data using the outputs of existing GNN models . These self-training methods expand the labeled node set with relatively simple checking mechanism or even directly using the output of GCN , as a result they may introduce noise as supervision and thus hurt the final prediction performance . 3 PRELIMINARIES . An attributed relational graph of n nodes can be represented by G = ( V , E , X ) , where V = { v1 , v2 , ... , vn } denotes the set of n nodes , and E = { eij } is the edge set . X = { x1 , x2 , ... xn } ∈ Rn×d is the set of attributes of all nodes , where xi is the d-dimensional attribute vector associated with node vi . Adjacency matrix A = { aij } ∈ Rn×n denotes the topological structure of graph G , where aij > 0 if there is an edge eij between node vi and vj and aij = 0 otherwise . For semi-supervised node classification , the node set V can be split into a labeled node set VL ∈ V with attributes XL ∈ X and an unlabeled one VU = V \VL with attributes XU = X\XL . We assume each node belongs to exactly one class , and denote YL = { yi } the ground-truth labels of node set VL where yi is the class label of node vi ∈ VL . The aim of semi-supervised node classification is to learn a classifier from the graph and known node labels YL , and use it to predict labels for unlabeled nodes VU . Define a classifier fθ : ( ỸL , ỸU ) ← fθ ( X , A , YL ) , where θ denotes the parameters of model , ỸL and ỸU are the predicted labels of nodes VL and VU respectively . In general , we want the predict labels ỸL is close to the ground-truth labels YL as possible in favor of θ∗ = argmin θ d ( ỸL , YL ) = argmin θ d ( fθ ( X , A , YL ) , YL ) , ( 1 ) where d ( · , · ) is a distance measure between two label sets . In recent years GCN has become a popular model for semi-supervised node classification , which aggregates a structural feature for each node and use the formed features , rather than the initial attributes X , for label prediction . 4 THE PROPOSED METHOD . In this section , we will elaborate our proposed framework , namely feature aggregation self-training GCN ( FASG ) , for semi-supervised node classification . Firstly , we do analysis of pseudo-labels to explain the importance of checking part in self-training framework . Secondly , we illustrate the design of checking part in our framework and show the superiority of our checking part in graph networks . Then we elaborate every part of the framework and display the FASG training algorithm . Finally we integrate our framework with various GNN models . 4.1 ANALYSIS OF PSEUDO-LABELS . It is common for existing self-training GCN models to assign pseudo-labels to highly confident nodes and expand them as supervised information . Therefore , the quality of the generated pseudolabels is crucial for node classification and the wrongly introduced supervision information may hurt the final prediction performance . Table 1 summarizes the prediction accuracy of the GCN model ( Kipf & Welling , 2016 ) on Cora when it is trained given different ratios of falsely labeled nodes . It is shown that the accuracy decreases significantly with the ratio of bad training nodes increasing . 4.2 CHECKING PART WITH FEATURE AGGREGATION . To guarantee the quality of the generated pseudo-labels , we develop a delicate checking part in the assistance of feature aggregation . The implementation of feature aggregation can be described as Xaggre = D̃−1ÃX , where D is digree matrix of the graph , D̃ = D + I , Ã = A+ I . We use deep graph library DGL ( Wang et al. , 2019 ) to implement feature aggregation . For illustration of the effectiveness of feature aggregation , we apply t-SNE ( Maaten & Hinton , 2008 ) to visualize the aggregated features of each node on the Cora dataset in Fig 1 , where feati denotes the features aggregated from the original features for i times . As shown in Fig . 1 ( a ) , the original node features are mixed together and are difficult to distinguish . As the fusion of node features going deeper from feat1 to feat4 , nodes with the same label tend to aggregate into clusters in 2-D space . However , the cluster boundaries become blur again after the aggregation goes up to a certain level , e.g .. feat15 and feat20 . Furthermore , we apply linear svm ( Cortes & Vapnik , 1995 ) on aggregated features feat5 to form a classifier , and report its performance in Table 2 in comparison with several GCN models on three citation networks , Cora , CiteSeer and PubMed . Clearly , this relatively simple classifier is able to achieve comparable performance with popular GCN models due to the representation ability of aggregated features . As for the self-training mechanism , we employ the above classifier that combines feature aggregation with line svm to serve as check part for generation of pseudo-labels of nodes . In Fig . 2 , we compare the quality of pseudo-labels generated by different checking mechanisms including plain self-training method ( Li et al. , 2018 ) , deep cluster Sun et al . ( 2019 ) and the proposed checking part with feature aggregation . It is shown that our method introduces less bad training nodes than the compared methods in different label rates on both Cora and CiteSeer , which accounts for the better performance on node classification shown in Sec . 5 .
This paper presents a self-training algorithm based on GCN to improve the semi-supervised node classification on graphs. The key idea is to add new nodes with high confidence as supervision to enlarge the labeled nodes. Although the experimental results show the proposed method outperforms or performs similarly to baseline methods, the paper has several weaknesses. First the presented approach is not clearly introduced, with inconsistent statements on building the checking part, and lack of details on how to calculate the confidence to add the new nodes. Second, the novelty of the presented approach is limited, as adding unlabeled samples with high confidence is not a novel idea. Third, the paper writing should be improved, as there are errors.
SP:64794a022e18c8cee6599446d5846dd00bc0b8ab
FASG: Feature Aggregation Self-training GCN for Semi-supervised Node Classification
1 INTRODUCTION . Graph convolutional network ( GCN ) can be seen as the migration of convolutional neural network ( CNN ) on non-Euclidean structure data . Due to its its excellent ability in representation learning , GCN has achieved significant success in many graph-based learning tasks , including node clustering , graph classification and link prediction ( Dwivedi et al. , 2020 ) . Kipf & Welling ( 2016 ) proposed a GCN mode from the perspective of spectrogram theory and validated its effectiveness on semi-supervised node classification task . Subsequent models such as GraphSAGE ( Hamilton et al. , 2017 ) , GAT ( Veličković et al. , 2017 ) , SGCN ( Wu et al. , 2019 ) and APPNP ( Klicpera et al. , 2018 ) designed more sophisticated neighborhood aggregation functions from spatial or spectral views . These methods obtain much more effective results on semi-supervised node classification than traditional methods such as MLP , DeepWalk ( Perozzi et al. , 2014 ) , etc . However , the prediction accuracy of such GCN models depends largely on the quantity and quality of supervised information , and it will decrease significantly when the quantity of labeled nodes is quite small ( Li et al. , 2018 ) . The main reason lies that scarce supervised information is difficult to be spread far away in the graph so that unlabeled nodes are hardly to make full use of supervised information for prediction . Addressing the above issue , many studies have been devoted to improving the representation ability by designing multi-layer GCN model ( Li et al. , 2019 ) . However , the representation ability of GCN , as illustrated in Kipf & Welling ( 2016 ) , can hardly be improved by simply stacking layers just like MLP . Moreover , stacking too many layers tends to cause over-smoothing ( Xu et al. , 2018 ) that makes all node embeddings indistinguishable . Alternatively , Li et al . ( 2018 ) proposed to improve the reasoning ability of GCN models by applying self-training techniques on the training . Rather than trying to enhance the expressive ability of the model , the self-training strategy prefers to expand the supervised information by adding unlabeled nodes with high confidences to the training set at each round . Following this line , Sun et al . ( 2019 ) proposed a multi-stage self-training strategy ( M3S ) to enrich the training set , which uses deep cluster ( Caron et al. , 2018 ) and an aligning mechanism to generate pseudo-labels of nodes for updating of the training set . Later , Zhou et al . ( 2019 ) proposed a dynamic self-training framework to continuously refresh the training set by directly using the output of GCN without a checking part . In general these self-training algorithms generate pseudolabels using relatively simple checking mechanism , which may introduce false labels as supervision information and prevent the improvement of prediction accuracy . In this paper , we propose a novel feature aggregation self-training GCN ( FASG ) algorithm for semisupervised node classification . We firstly propose a lightweight classifier that applies linear SVM on aggregated node features , and validate that it achieves comparable performance to popular GCN approaches . Furthermore , this classifier is served as a checking part in the multi-round training process to generate pseudo-labels , which are used to filter unreliable nodes when expanding the supervised information . By fully considering the structural information of graph nodes , the newly developed checking part is able to improve the accuracy of the generated pseudo-labels and finally boost the node classification . Finally , we illustrate that the proposed self-training strategy can be integrated with various existing GCN models to improve the prediction performance . The proposed algorithms is validated in comparison with several state-of-the-art baseline algorithms in three public benchmarks , and the experimental results illustrate that the proposed algorithm outperforms all compared algorithms in general on all benchmarks . We will release the source code upon publication of this paper . 2 RELATED WORK . In the past decade CNN has achieved great success in many areas of machine learning ( Krizhevsky et al. , 2012 ; LeCun et al. , 1998 ; Sermanet et al. , 2012 ) , but its applications are mainly restricted in dealing with Euclidean structure data ( Bruna et al. , 2013 ) . Consequently , in recent years more and more studies are devoted to learning the representation on non-Euclidean structure data such as graph . Graph neural network ( GNN ) plays an important role in the field of graph representation learning , which can learn the representation of nodes or the whole graph . There are many famous GNN architectures including GCN ( Kipf & Welling , 2016 ) , graph recurrent neural network ( Hajiramezanali et al. , 2019 ) and graph autoencoder ( Pan et al. , 2018 ) . As one of the most important architecture of GNN , GCN can be roughly categorized into spectral and spatial approaches . The spectral approaches ( Bruna et al. , 2013 ) define convolution operation by Laplacian feature decomposition of the graph , thereby filtering the graph structure in the spectral domain . On the basis of the Chebyshev polynomial ( Defferrard et al. , 2016 ) of the graph Laplacian matrix , Kipf & Welling ( 2016 ) proposed a much simper GCN framework that limits the filter to the first-order neighbor around each node . On the other hand , spatial approaches implement convolution in spatial domain by defining aggregation functions and transform functions . Notable work includes GraphSAGE ( Hamilton et al. , 2017 ) that transformed representation learning into a formal pattern called aggregation and combination and proposed several effective aggregation strategies such as mean-aggregator and max-aggregator , and GAT ( Veličković et al. , 2017 ) that focuses on the diversity in connected nodes and leverages selfattention mechanism to learn the important information in neighborhoods . Although these models have achieved far better performance on node classification than traditional methods , they still suffer from scarce supervised information due to the limitation on GCN layers making it hard to transform the supervised information to the entire graph . Self-training is an ancient and classic topic in the NLP field before deep learning era ( Hearst , 1991 ; Riloff et al. , 1999 ; Rosenberg et al. , 2005 ; Van Asch & Daelemans , 2016 ) , and has recently been introduced into semi-supervised node classification . For making full use of supervised information to improve the prediction accuracy , Li et al . ( 2018 ) proposed to improve GCN model by self-training mechanism , which trains and applies a base model in rounds , and adds nodes with high confidences as supervision after each round . The newly added nodes are expect to be beneficial to predict rest nodes so as to enhance the final performance of the model . Following this line , the M3S training algorithm Sun et al . ( 2019 ) pretrains a model over the labeled data , and then assigns pseudo-labels to highly confident unlabeled samples that are considered as labeled data for the next round of the training . Later , Zhou et al . ( 2019 ) proposed a dynamic self-training GCN that generalizes and simplifies previous by directly using the output of GCN without a checking part to continuously refresh the training set . Similarly , Yang et al . ( 2020 ) proposed self-enhanced GNN ( SEG ) to improve the quality of the input data using the outputs of existing GNN models . These self-training methods expand the labeled node set with relatively simple checking mechanism or even directly using the output of GCN , as a result they may introduce noise as supervision and thus hurt the final prediction performance . 3 PRELIMINARIES . An attributed relational graph of n nodes can be represented by G = ( V , E , X ) , where V = { v1 , v2 , ... , vn } denotes the set of n nodes , and E = { eij } is the edge set . X = { x1 , x2 , ... xn } ∈ Rn×d is the set of attributes of all nodes , where xi is the d-dimensional attribute vector associated with node vi . Adjacency matrix A = { aij } ∈ Rn×n denotes the topological structure of graph G , where aij > 0 if there is an edge eij between node vi and vj and aij = 0 otherwise . For semi-supervised node classification , the node set V can be split into a labeled node set VL ∈ V with attributes XL ∈ X and an unlabeled one VU = V \VL with attributes XU = X\XL . We assume each node belongs to exactly one class , and denote YL = { yi } the ground-truth labels of node set VL where yi is the class label of node vi ∈ VL . The aim of semi-supervised node classification is to learn a classifier from the graph and known node labels YL , and use it to predict labels for unlabeled nodes VU . Define a classifier fθ : ( ỸL , ỸU ) ← fθ ( X , A , YL ) , where θ denotes the parameters of model , ỸL and ỸU are the predicted labels of nodes VL and VU respectively . In general , we want the predict labels ỸL is close to the ground-truth labels YL as possible in favor of θ∗ = argmin θ d ( ỸL , YL ) = argmin θ d ( fθ ( X , A , YL ) , YL ) , ( 1 ) where d ( · , · ) is a distance measure between two label sets . In recent years GCN has become a popular model for semi-supervised node classification , which aggregates a structural feature for each node and use the formed features , rather than the initial attributes X , for label prediction . 4 THE PROPOSED METHOD . In this section , we will elaborate our proposed framework , namely feature aggregation self-training GCN ( FASG ) , for semi-supervised node classification . Firstly , we do analysis of pseudo-labels to explain the importance of checking part in self-training framework . Secondly , we illustrate the design of checking part in our framework and show the superiority of our checking part in graph networks . Then we elaborate every part of the framework and display the FASG training algorithm . Finally we integrate our framework with various GNN models . 4.1 ANALYSIS OF PSEUDO-LABELS . It is common for existing self-training GCN models to assign pseudo-labels to highly confident nodes and expand them as supervised information . Therefore , the quality of the generated pseudolabels is crucial for node classification and the wrongly introduced supervision information may hurt the final prediction performance . Table 1 summarizes the prediction accuracy of the GCN model ( Kipf & Welling , 2016 ) on Cora when it is trained given different ratios of falsely labeled nodes . It is shown that the accuracy decreases significantly with the ratio of bad training nodes increasing . 4.2 CHECKING PART WITH FEATURE AGGREGATION . To guarantee the quality of the generated pseudo-labels , we develop a delicate checking part in the assistance of feature aggregation . The implementation of feature aggregation can be described as Xaggre = D̃−1ÃX , where D is digree matrix of the graph , D̃ = D + I , Ã = A+ I . We use deep graph library DGL ( Wang et al. , 2019 ) to implement feature aggregation . For illustration of the effectiveness of feature aggregation , we apply t-SNE ( Maaten & Hinton , 2008 ) to visualize the aggregated features of each node on the Cora dataset in Fig 1 , where feati denotes the features aggregated from the original features for i times . As shown in Fig . 1 ( a ) , the original node features are mixed together and are difficult to distinguish . As the fusion of node features going deeper from feat1 to feat4 , nodes with the same label tend to aggregate into clusters in 2-D space . However , the cluster boundaries become blur again after the aggregation goes up to a certain level , e.g .. feat15 and feat20 . Furthermore , we apply linear svm ( Cortes & Vapnik , 1995 ) on aggregated features feat5 to form a classifier , and report its performance in Table 2 in comparison with several GCN models on three citation networks , Cora , CiteSeer and PubMed . Clearly , this relatively simple classifier is able to achieve comparable performance with popular GCN models due to the representation ability of aggregated features . As for the self-training mechanism , we employ the above classifier that combines feature aggregation with line svm to serve as check part for generation of pseudo-labels of nodes . In Fig . 2 , we compare the quality of pseudo-labels generated by different checking mechanisms including plain self-training method ( Li et al. , 2018 ) , deep cluster Sun et al . ( 2019 ) and the proposed checking part with feature aggregation . It is shown that our method introduces less bad training nodes than the compared methods in different label rates on both Cora and CiteSeer , which accounts for the better performance on node classification shown in Sec . 5 .
This paper proposes a self-training based semi-supervised framework for node classification using Graph Neural Networks when the amount of labelled data is very limited. Self-training is performed by incorporating highly confident samples with their corresponding predicted class as the pseudo label. Authors show that incorporation of correct pseudo labels is a crucial step as the performance degrades rapidly with the incorporation of wrong labels. This work ensures high quality of pseudo labels by a "checking part" with feature aggregation. Aggregated features with linear SVM performs comparably with GNN methods.
SP:64794a022e18c8cee6599446d5846dd00bc0b8ab
Deep Gated Canonical Correlation Analysis
1 INTRODUCTION . Canonical Correlation Analysis ( CCA ) ( Hotelling , 1936 ; Thompson , 2005 ) , is a classic statistical method for finding the maximally correlated linear transformations of two modalities ( or views ) . Using modalities X ∈ RDx×N and Y ∈ RDY ×N , which are centered and have N samples with Dx and Dy features respectively . CCA seeks canonical vectors ai ∈ RDX , and bi ∈ RDY , such that , ui = aTi X , and vi = b T i Y , i = 1 , ... , N , maximize the sample correlations between ui and vi , where ui ( vi ) form an orthonormal basis for i = 1 , ... , d , i.e . ai , bi = argmax 〈ui , uj〉=δi , j , 〈vi , vj〉=δi , j , i , j=1 , ... , d Corr ( ui , vi ) . ( 1 ) While CCA enjoys a closed-form solution using a generalized eigen pair problem , it is restricted to the linear transformationsA = [ a1 , ... , ad ] andB = [ b1 , ... , bd ] . In order to identify non-linear relations between input variables , several extensions of CCA have been proposed . Kernel methods such as Kernel CCA ( Bach & Jordan , 2002 ) , Non-paramatric CCA ( Michaeli et al. , 2016 ) or Multi-view Diffusion maps ( Lindenbaum et al. , 2020 ) learn the non-linear relations in reproducing Hilbert spaces . These methods have several shortcomings : they are limited to a designed kernel , they requireO ( N2 ) computations for training , and they have poor interpolation and extrapolation capabilities . To overcome these limitations , Andrew et al . ( 2013 ) have proposed Deep CCA , to learn parametric non-linear transformations of the input modalities X and Y . The functions are learned by training two neural networks to maximize the total correlation between their outputs . Linear and non-linear canonical correlation models have been widely used in the setting of unsupervised or semi-supervised learning . When d is set to a dimension satisfying d < Dx , Dy , these models find dimensional reduced representations that may be useful for clustering , classification or manifold learning in many applications . For example , in biology ( Pimentel et al. , 2018 ) , neuroscience ( Al-Shargie et al. , 2017 ) , medicine ( Zhang et al. , 2017 ) , and engineering ( Chen et al. , 2017 ) . One key limitations of these models is that they typically require more samples than features , i.e . N > Dx , Dy . However , if we have more variable than samples , the estimation based on the closed form solution of the CCA problem ( in Eq . 1 ) breaks ( Suo et al. , 2017 ) . Moreover , in high dimensional data , often some of the variables are not informative and thus should be omitted from the transformations . For these reasons , there has been a growing interest in studying sparse CCA models . Sparse CCA ( SCCA ) ( Waaijenborg et al. , 2008 ; Hardoon & Shawe-Taylor , 2011 ; Suo et al. , 2017 ) uses an ` 1 penalty to encourage sparsity of the canonical vectors ai and bi . This can not only remove the degeneracy inherit to N < Dx , Dy , but can improve interpetability and performance . One caveat of this approach is its high computational complexity , which can be reduced by replacing the orthonormality constraints on ui and vi with orthonormality constraints on ai and bi . This procedure is known as simplified-SCCA ( Parkhomenko et al. , 2009 ; Witten et al. , 2009 ) , which enjoys a closed form solution . There has been limited work on extending these models to sparse nonlinear CCA . Specifically , there are two kernel based extensions , two-stage kernel CCA ( TSKCCA ) by Yoshida et al . ( 2017 ) and SCCA based on Hilbert-Schmidt Independence Criterion ( SCCAHSIC ) by Uurtio et al . ( 2018 ) . However , these models suffer from the same limitations as KCCA and are not scalable to a high dimensional regime . This paper presents a sparse CCA model that can be optimized using standard deep learning methodologies . The method combines the differentiable loss presented in DCCA ( Andrew et al. , 2013 ) with an approximate ` 0 regularization term designed to sparsify the input variables of both X and Y . Our regularization relies on a recently proposed Gaussian based continuous relaxation of Bernoulli random variables , termed gates ( Yamada et al. , 2020 ) . The gates are applied to the input features to sparsify X and Y . The gates parameters are trained jointly via stochastic gradient decent to maximize the correlation between the representations of X and Y , while simultaneously selecting only the subsets of the most correlated input features . We apply the proposed method to synthetic data , and demonstrate that our method can improve the estimation of the canonical vectors compared with SCCA models . Then , we use the method to identify informative variable in multichannel noisy seismic data and show its advantage over other CCA models . 1.1 BACKGROUND . 1.2 DEEP CCA . Andrew et al . ( 2013 ) , present a deep neural network that learns correlated representations . They proposed Deep Canonical Correlation Analysis ( DCCA ) which extracts two nonlinear transformations of X and Y with maximal correlation . DCCA trains two neural networks with a joint loss aiming to maximize the total correlation of the network ’ s outputs . The parameters of the networks are learned by applying stochastic gradient decent to the following objective : θ∗X , θ ∗ Y = argmax θX , θY Corr ( f ( X ; θX ) , g ( Y ; θY ) ) , ( 2 ) where θX and θY are the trainable parameters , and f ( X ) , g ( Y ) ∈ Rd are the desired correlated representations . 1.3 SPARSE CCA . Several authors have proposed solutions for the problem of recovering sparse canonical vectors . The key advantages of sparse vectors are that they enable identifying correlated representations even in the regime of N < Dx , Dy and they allow unsupervised feature selection . Following the formulation by Suo et al . ( 2017 ) , SCCA could be described using the following regularized objective a , b = argmin [ − Cov ( aTX , bTY ) + τ1‖a‖1 + τ2‖b‖1 ] , subject to ‖aTX‖2 ≤ 1 , ‖bTY ‖2 ≤ 1 , where τ1 and τ2 are regularization parameters for controlling the sparsity of the canonical vectors a and b . Note that the relaxed inequality constrain on aTX and bTY makes the problem bi-convex , however , if ‖aTX‖2 < 1 or ‖bTX‖2 < 1 , then the covariance in the objective is no longer equal to the correlation . 1.4 STOCHASTIC GATES . In the last few years , several methods have been proposed for incorporating discrete random variables into gradient based optimization methods . Towards this goal , continuous relaxations of discrete random variables such as ( Maddison et al. , 2016 ; Jang et al. , 2017 ) have been proposed . Such relaxations have been used in several applications , for example , model compression ( Louizos et al. , 2017 ) , feature selection or for defining discrete activations ( Jang et al. , 2016 ) . We focus on a Gaussian-based relaxation of Bernoulli variables , termed Stochastic Gates ( STG ) ( Yamada et al. , 2020 ) , which were originally proposed for supervised feature selection . We denote the STG random vector by z ∈ [ 0 , 1 ] D , where each entry is defined as z [ i ] = max ( 0 , min ( 1 , µ [ i ] + [ i ] ) ) , ( 3 ) where µ [ i ] is a trainable parameter for entry i , the injected noise [ i ] is drawn fromN ( 0 , σ2 ) and σ is fixed throughout training . This approximation can be viewed as a clipped , mean-shifted , Gaussian random variable . In Fig . 1 we illustrate generation of the transformed random variable z [ i ] for µ [ i ] = 0.5 which represents a “ fair ” relaxed Bernoulli variable . 2 DEEP GATED CCA . 2.1 MODEL . It is appealing to try to combine ideas from Sparse CCA into the rich differentiable model of Deep CCA . However , a straight forward ` 1 regularization of the input layer of a neural network does not work in practice because it makes the learning procedure unstable . This was observed in the supervised setting by Li et al . ( 2016 ) ; Feng & Simon ( 2017 ) . This instability occurs because the objective is not differentiable everywhere . To overcome this limitation , we use the STG random variables ( see Eq . 3 ) by multiplying them with the features of X and Y . Then , by penalizing for active gates using a regularization term E‖z‖0 , we can induce sparsity in the input variables . We formulate the problem of sparse nonlinear CCA by regularizing a deep neural network with a correlation term . We introduce two random STG vectors into the input layers of two neural networks which are trained in tandem to maximize the total correlation . Denoting the random gating vectors zx and zy for viewX and Y respectively , the Deep Gated CCA ( DG-CCA ) loss is defined by L ( θ , µ ) = Ezx , zy [ − Corr ( f ( zTxX ; θX ) , g ( zTy Y ; θY ) ) + λx‖zx‖0 + λy‖zy‖0 ] , ( 4 ) where θ = ( θX , θY ) , µ = ( µX , µY ) are the model parameters , and λx , λy are regularization parameters that control the sparsity of the input variables . The vectors zx and zy are random STG vectors , with elements defined based on Eq . 3 . Fig . 2 highlights the proposed architecture . Each observed modality is first passed through the gates . Then , the outputs of the gates are used as inputs to a view-specific neural sub-net . Finally , the shared loss term in Eq . 4 is minimized by optimizing the parameters of the gates and neural sub-nets . 2.2 ALGORITHM DETAILS . We now detail the procedure used in DG-CCA for minimizing the loss L ( θ , µ ) ( in Eq . 4 ) . The regularization is based on a parametric expectation and therefore , can be expressed by Ezx‖z‖0 = Dx∑ i=1 P ( zx [ i ] ≥ 0 ) = Dx∑ i=1 ( 1 2 − 1 2 erf ( −µx [ i ] √ 2σ ) ) , where erf ( ) is the Gaussian error function , and is defined similarly for Ezy‖zy‖0 . Denoting the centered output representations of X , Y by ΨX , ΨY ∈ Rd×N respectively , the empirical covariance matrix between these representations can be expressed as Σ̂XY = 1N−1ΨXΨ T Y . Using a similar notations , we express the regularized empirical covariance matrices of X and Y as Σ̂X = 1 N−1ΨXΨ T X + γI and Σ̂Y = 1 N−1ΨY Ψ T Y + γI , where the matrix γI ( γ > 0 ) is added to stabilize the invertability of Σ̂X and Σ̂Y . The total correlation in Eq . 4 can be expressed using the trace of Σ̂ −1/2 Y Σ̂Y XΣ̂ −1 X Σ̂XY Σ̂ −1/2 Y . To learn the parameters of the gates µ and of the representations θ we apply stochastic gradient decent to L ( θ , µ ) . Specifically , we used Monte Carlo sampling to estimate the left part of Eq . 4 . This is repeated for each batch , using one Monte Carlo sample per batch as suggested by Louizos et al . ( 2017 ) and Yamada et al . ( 2020 ) , and worked well in our experiments . After training we remove the stochastic part of the gates , and use only variables ix ∈ { 1 , ... , DX } and iy ∈ { 1 , ... , Dy } such that zx [ ix ] > 0 and zy [ iy ] > 0 .
This paper presents a new deep CCA method to learn non-linear relationships between two modalities. It trains two neural networks each for a modality to maximize the total correlations of their output representations. Gating is applied to input variables by associating each with a latent Bernoulli variables which is then relaxed with the clipped Gaussian random variable. Experiments on one synthetic and two real datasets demonstrate the superiority of the proposed method.
SP:ce147e13a4126d022aa6c22dca433ca81062f924
Deep Gated Canonical Correlation Analysis
1 INTRODUCTION . Canonical Correlation Analysis ( CCA ) ( Hotelling , 1936 ; Thompson , 2005 ) , is a classic statistical method for finding the maximally correlated linear transformations of two modalities ( or views ) . Using modalities X ∈ RDx×N and Y ∈ RDY ×N , which are centered and have N samples with Dx and Dy features respectively . CCA seeks canonical vectors ai ∈ RDX , and bi ∈ RDY , such that , ui = aTi X , and vi = b T i Y , i = 1 , ... , N , maximize the sample correlations between ui and vi , where ui ( vi ) form an orthonormal basis for i = 1 , ... , d , i.e . ai , bi = argmax 〈ui , uj〉=δi , j , 〈vi , vj〉=δi , j , i , j=1 , ... , d Corr ( ui , vi ) . ( 1 ) While CCA enjoys a closed-form solution using a generalized eigen pair problem , it is restricted to the linear transformationsA = [ a1 , ... , ad ] andB = [ b1 , ... , bd ] . In order to identify non-linear relations between input variables , several extensions of CCA have been proposed . Kernel methods such as Kernel CCA ( Bach & Jordan , 2002 ) , Non-paramatric CCA ( Michaeli et al. , 2016 ) or Multi-view Diffusion maps ( Lindenbaum et al. , 2020 ) learn the non-linear relations in reproducing Hilbert spaces . These methods have several shortcomings : they are limited to a designed kernel , they requireO ( N2 ) computations for training , and they have poor interpolation and extrapolation capabilities . To overcome these limitations , Andrew et al . ( 2013 ) have proposed Deep CCA , to learn parametric non-linear transformations of the input modalities X and Y . The functions are learned by training two neural networks to maximize the total correlation between their outputs . Linear and non-linear canonical correlation models have been widely used in the setting of unsupervised or semi-supervised learning . When d is set to a dimension satisfying d < Dx , Dy , these models find dimensional reduced representations that may be useful for clustering , classification or manifold learning in many applications . For example , in biology ( Pimentel et al. , 2018 ) , neuroscience ( Al-Shargie et al. , 2017 ) , medicine ( Zhang et al. , 2017 ) , and engineering ( Chen et al. , 2017 ) . One key limitations of these models is that they typically require more samples than features , i.e . N > Dx , Dy . However , if we have more variable than samples , the estimation based on the closed form solution of the CCA problem ( in Eq . 1 ) breaks ( Suo et al. , 2017 ) . Moreover , in high dimensional data , often some of the variables are not informative and thus should be omitted from the transformations . For these reasons , there has been a growing interest in studying sparse CCA models . Sparse CCA ( SCCA ) ( Waaijenborg et al. , 2008 ; Hardoon & Shawe-Taylor , 2011 ; Suo et al. , 2017 ) uses an ` 1 penalty to encourage sparsity of the canonical vectors ai and bi . This can not only remove the degeneracy inherit to N < Dx , Dy , but can improve interpetability and performance . One caveat of this approach is its high computational complexity , which can be reduced by replacing the orthonormality constraints on ui and vi with orthonormality constraints on ai and bi . This procedure is known as simplified-SCCA ( Parkhomenko et al. , 2009 ; Witten et al. , 2009 ) , which enjoys a closed form solution . There has been limited work on extending these models to sparse nonlinear CCA . Specifically , there are two kernel based extensions , two-stage kernel CCA ( TSKCCA ) by Yoshida et al . ( 2017 ) and SCCA based on Hilbert-Schmidt Independence Criterion ( SCCAHSIC ) by Uurtio et al . ( 2018 ) . However , these models suffer from the same limitations as KCCA and are not scalable to a high dimensional regime . This paper presents a sparse CCA model that can be optimized using standard deep learning methodologies . The method combines the differentiable loss presented in DCCA ( Andrew et al. , 2013 ) with an approximate ` 0 regularization term designed to sparsify the input variables of both X and Y . Our regularization relies on a recently proposed Gaussian based continuous relaxation of Bernoulli random variables , termed gates ( Yamada et al. , 2020 ) . The gates are applied to the input features to sparsify X and Y . The gates parameters are trained jointly via stochastic gradient decent to maximize the correlation between the representations of X and Y , while simultaneously selecting only the subsets of the most correlated input features . We apply the proposed method to synthetic data , and demonstrate that our method can improve the estimation of the canonical vectors compared with SCCA models . Then , we use the method to identify informative variable in multichannel noisy seismic data and show its advantage over other CCA models . 1.1 BACKGROUND . 1.2 DEEP CCA . Andrew et al . ( 2013 ) , present a deep neural network that learns correlated representations . They proposed Deep Canonical Correlation Analysis ( DCCA ) which extracts two nonlinear transformations of X and Y with maximal correlation . DCCA trains two neural networks with a joint loss aiming to maximize the total correlation of the network ’ s outputs . The parameters of the networks are learned by applying stochastic gradient decent to the following objective : θ∗X , θ ∗ Y = argmax θX , θY Corr ( f ( X ; θX ) , g ( Y ; θY ) ) , ( 2 ) where θX and θY are the trainable parameters , and f ( X ) , g ( Y ) ∈ Rd are the desired correlated representations . 1.3 SPARSE CCA . Several authors have proposed solutions for the problem of recovering sparse canonical vectors . The key advantages of sparse vectors are that they enable identifying correlated representations even in the regime of N < Dx , Dy and they allow unsupervised feature selection . Following the formulation by Suo et al . ( 2017 ) , SCCA could be described using the following regularized objective a , b = argmin [ − Cov ( aTX , bTY ) + τ1‖a‖1 + τ2‖b‖1 ] , subject to ‖aTX‖2 ≤ 1 , ‖bTY ‖2 ≤ 1 , where τ1 and τ2 are regularization parameters for controlling the sparsity of the canonical vectors a and b . Note that the relaxed inequality constrain on aTX and bTY makes the problem bi-convex , however , if ‖aTX‖2 < 1 or ‖bTX‖2 < 1 , then the covariance in the objective is no longer equal to the correlation . 1.4 STOCHASTIC GATES . In the last few years , several methods have been proposed for incorporating discrete random variables into gradient based optimization methods . Towards this goal , continuous relaxations of discrete random variables such as ( Maddison et al. , 2016 ; Jang et al. , 2017 ) have been proposed . Such relaxations have been used in several applications , for example , model compression ( Louizos et al. , 2017 ) , feature selection or for defining discrete activations ( Jang et al. , 2016 ) . We focus on a Gaussian-based relaxation of Bernoulli variables , termed Stochastic Gates ( STG ) ( Yamada et al. , 2020 ) , which were originally proposed for supervised feature selection . We denote the STG random vector by z ∈ [ 0 , 1 ] D , where each entry is defined as z [ i ] = max ( 0 , min ( 1 , µ [ i ] + [ i ] ) ) , ( 3 ) where µ [ i ] is a trainable parameter for entry i , the injected noise [ i ] is drawn fromN ( 0 , σ2 ) and σ is fixed throughout training . This approximation can be viewed as a clipped , mean-shifted , Gaussian random variable . In Fig . 1 we illustrate generation of the transformed random variable z [ i ] for µ [ i ] = 0.5 which represents a “ fair ” relaxed Bernoulli variable . 2 DEEP GATED CCA . 2.1 MODEL . It is appealing to try to combine ideas from Sparse CCA into the rich differentiable model of Deep CCA . However , a straight forward ` 1 regularization of the input layer of a neural network does not work in practice because it makes the learning procedure unstable . This was observed in the supervised setting by Li et al . ( 2016 ) ; Feng & Simon ( 2017 ) . This instability occurs because the objective is not differentiable everywhere . To overcome this limitation , we use the STG random variables ( see Eq . 3 ) by multiplying them with the features of X and Y . Then , by penalizing for active gates using a regularization term E‖z‖0 , we can induce sparsity in the input variables . We formulate the problem of sparse nonlinear CCA by regularizing a deep neural network with a correlation term . We introduce two random STG vectors into the input layers of two neural networks which are trained in tandem to maximize the total correlation . Denoting the random gating vectors zx and zy for viewX and Y respectively , the Deep Gated CCA ( DG-CCA ) loss is defined by L ( θ , µ ) = Ezx , zy [ − Corr ( f ( zTxX ; θX ) , g ( zTy Y ; θY ) ) + λx‖zx‖0 + λy‖zy‖0 ] , ( 4 ) where θ = ( θX , θY ) , µ = ( µX , µY ) are the model parameters , and λx , λy are regularization parameters that control the sparsity of the input variables . The vectors zx and zy are random STG vectors , with elements defined based on Eq . 3 . Fig . 2 highlights the proposed architecture . Each observed modality is first passed through the gates . Then , the outputs of the gates are used as inputs to a view-specific neural sub-net . Finally , the shared loss term in Eq . 4 is minimized by optimizing the parameters of the gates and neural sub-nets . 2.2 ALGORITHM DETAILS . We now detail the procedure used in DG-CCA for minimizing the loss L ( θ , µ ) ( in Eq . 4 ) . The regularization is based on a parametric expectation and therefore , can be expressed by Ezx‖z‖0 = Dx∑ i=1 P ( zx [ i ] ≥ 0 ) = Dx∑ i=1 ( 1 2 − 1 2 erf ( −µx [ i ] √ 2σ ) ) , where erf ( ) is the Gaussian error function , and is defined similarly for Ezy‖zy‖0 . Denoting the centered output representations of X , Y by ΨX , ΨY ∈ Rd×N respectively , the empirical covariance matrix between these representations can be expressed as Σ̂XY = 1N−1ΨXΨ T Y . Using a similar notations , we express the regularized empirical covariance matrices of X and Y as Σ̂X = 1 N−1ΨXΨ T X + γI and Σ̂Y = 1 N−1ΨY Ψ T Y + γI , where the matrix γI ( γ > 0 ) is added to stabilize the invertability of Σ̂X and Σ̂Y . The total correlation in Eq . 4 can be expressed using the trace of Σ̂ −1/2 Y Σ̂Y XΣ̂ −1 X Σ̂XY Σ̂ −1/2 Y . To learn the parameters of the gates µ and of the representations θ we apply stochastic gradient decent to L ( θ , µ ) . Specifically , we used Monte Carlo sampling to estimate the left part of Eq . 4 . This is repeated for each batch , using one Monte Carlo sample per batch as suggested by Louizos et al . ( 2017 ) and Yamada et al . ( 2020 ) , and worked well in our experiments . After training we remove the stochastic part of the gates , and use only variables ix ∈ { 1 , ... , DX } and iy ∈ { 1 , ... , Dy } such that zx [ ix ] > 0 and zy [ iy ] > 0 .
This paper proposes a DL method for learning sparse non-linear transformations that maximize correlations between two views. In particular, each view is passed through a separate network. Stochastic Gating is applied to the input layer of each network. The two networks are jointly trained by maximising the correlation between their outputs. Sparsity is obtained by imposing L0 regularization terms on the Stochastic Gating variables.
SP:ce147e13a4126d022aa6c22dca433ca81062f924
Einstein VI: General and Integrated Stein Variational Inference in NumPyro
1 INTRODUCTION . Interest in Bayesian deep learning has surged due to the need for quantifying the uncertainty of predictions provided by machine learning algorithms . The idea behind Bayesian learning is to describe observed data x using a model with latent variable z ( representing model parameters and nuisance variables , see e.g. , Fig . 4a ) . The goal is then to infer a posterior distribution p ( z|x ) over latent variables given a model describing the joint distribution p ( z , x ) = p ( x|z ) p ( z ) following the rules of Bayesian inference : p ( z|x ) = Z−1p ( x|z ) p ( z ) where the normalization constant Z = ∫ z p ( x|z ) p ( z ) dz is intractable for most practical models including deep neural networks : an analytic solution is lacking or may require an infeasible number of calculations . Variational Inference ( VI ) techniques ( Blei et al. , 2017 ; Hoffman et al. , 2013 ; Ranganath et al. , 2014 ) provide a way to find an approximation of the posterior distribution . VI poses a family of distributions over latent variables q ( z ) ∈ Q ( e.g. , Fig . 4b ) and chooses the one that minimizes a chosen divergence1 D ( q ( z ) ‖ p ( z|x ) ) ( e.g. , Kullback-Leibler ) to the true posterior distribution . VI often provides good approximations that can capture uncertainty , scaling to millions of data points using mini-batch training . 1Asymmetric distance Stein Variational Inference ( Liu and Wang , 2016 ) is a recent non-parametric approach to VI which uses a set of particles { zi } Ni=1 as the approximating distribution q ( z ) to provide better flexibility in capturing correlations between latent variables . The technique preserves the scalability of traditional VI approaches while offering the flexibility and modelling scope of techniques such as Markov Chain Monte Carlo ( MCMC ) . Stein VI has been shown to be good at capturing multi-modality ( Liu and Wang , 2016 ; Wang and Liu , 2019a ) , and has useful theoretical interpretations as particles following a gradient flow ( Liu , 2017 ) and as a moment matching optimization system ( Liu and Wang , 2018 ) . Many advanced inference methods based on Stein VI have been recently developed , including Stein mixtures ( Nalisnick , 2019 ) , non-linear Stein ( Wang and Liu , 2019b ) , factorized graphical models ( Zhuo et al. , 2018 ; Wang et al. , 2018b ) , matrix-valued kernels ( Wang et al. , 2019 ) and support for higher-order gradient-based optimization ( Detommaso et al. , 2018 ) . These techniques have been shown to significantly extend the power of Stein VI , allowing more flexible and effective approximations of the true posterior distribution . While algorithmic power is growing , there remains a distinct lack of integration of these techniques into a general probabilistic programming language ( PPL ) framework . Such an integration would solve one of the most prominent limitations of traditional VI , which lacks flexibility to capture rich correlations in the approximated posterior . This paper presents the EinStein VI library that extends the NumPyro PPL ( Bingham et al. , 2019 ; Phan et al. , 2019 ) with support for the recent developments in Stein Variational Inference in an integrated and compositional fashion ( see Fig . 1c and Fig . 1d ) . The library takes advantage of the capabilities of NumPyro— including universal probabilistic programming ( van de Meent et al. , 2018 ) , integration with deep learning using JAX ( Frostig et al. , 2018 ) , and automatic optimization and marginalization of discrete latent variables ( Obermeyer et al. , 2019 ) —to provide capabilities that work synergetically with the Stein algorithms . Concretely , our contributions are : • Einstein VI , a general library that extends NumPyro and allows Stein Variational Inference to work with custom guide programs based on ELBO-within-Stein optimization ( Nalisnick , 2019 ) . The library is compositional with NumPyro features , including supported deep learning and automatic marginalization , loss functions ( ELBO , Rényi ELBO , custom losses ) and optimization methods , allowing it to grow organically with NumPyro development . • Integration of recent developments in Stein variational inference within the EinStein library . This includes support for non-linear optimization ( Wang and Liu , 2019b ) , a wealth of kernels ( Liu and Wang , 2016 ; 2018 ; Gorham and Mackey , 2017 ) , matrix-valued kernels ( Wang et al. , 2019 ) supporting higher-order optimization , and factorization based on conditional independence between elements in the model ( graphical kernels ) . • We support the application of transforms on the parameter space , including triangular ( Parno and Marzouk , 2018 ) and neural transforms ( Hoffman et al. , 2018 ) to improve the gradient geometry of the inference problem . • A series of examples demonstrate the power of an integrated library such as EinStein VI and the synergy between different Stein VI techniques . The examples include a novel Stein Mixture version of Deep Markov Models ( SM-DMM ) , Stein Mixture Latent Dirichlet Allocation ( SM-LDA ) , and several examples using neural transforms and higher-order optimization . The paper proceeds as follows . We first present a primer on the theory of Stein VI in Section 2 relating it to our integrated implementation in EinStein VI . We discuss the general details of the implementation of EinStein VI in NumPyro in Section 3 . We present the various examples using EinStein VI in Section 4 and finally summarize our results and future work in Section 5 . 1.1 RELATED WORK . There has been a proliferation of deep probabilistic programming languages based on tensor frameworks with automatic differentiation , supporting various inference techniques . Pyro ( Bingham et al. , 2019 ) is a universal PPL based on PyTorch ( Paszke et al. , 2019 ) . The main mode of inference in Pyro is black-box Stochastic Variational Inference ( Ranganath et al. , 2014 ) with guides , which are flexible programs that approximate the posterior distribution by repeating the ( non-observed ) sample statements as the probabilistic model and can contain deep neural networks allowing amortization of inference ( Kingma and Welling , 2014 ; Gershman and Goodman , 2014 ) . Pyro also supports various sampling algorithms like Hamiltonian Monte Carlo/NUTS ( Neal , 2011 ; Hoffman and Gelman , 2014 ) and sample-adaptive MCMC ( Zhu , 2019 ) which provide more accurate posterior approximations but lack the scalability of VI techniques . NumPyro is a version of Pyro that runs on the JAX framework ( Frostig et al. , 2018 ) , which allows it to exploit the powerful program optimization and parallelizability of the JAX compiler . Our library , EinStein VI , extends the Stochastic VI mode of inference by adding Stein Variational Inference on top of NumPyro , allowing the optimizable parameters in the guide to be approximated by a set of particles instead of a point estimate . Other languages with similar feature set include PyMC3 ( Salvatier et al. , 2016 ) , Edward ( Tran et al. , 2016 ; 2019 ) and HackPPL ( Ai et al. , 2019 ) . 2 PRIMER ON STEIN VI . The core idea of Stein VI ( Liu and Wang , 2016 ) is to perform inference by approximating the target posterior distribution p ( z|x ) by an approximate distribution qZ ( z ) = N−1 ∑ i δzi ( z ) based on a set of particles Z = { zi } Ni=1 . Here , δx ( y ) represents the Dirac delta measure , which is equal to 1 if x = y and 0 otherwise . One could thus see the approximating distribution qZ ( z ) as a mixture of point estimates , each represented by a particle z ∈ Z . The idea is then that we minimize the Kullback-Leibler divergence DKL ( q ( z ) ‖ p ( z|x ) ) between the approximation and the true posterior by iteratively updating the particles using the Stein forces : zi ← zi + SZ ( zi ) where represents the learning rate and SZ the Stein forces . The Two Forces of Stein VI Stein VI consists of two forces which work additively under the form SZ = S + Z + S − Z , where the attractive force S+Z ( zi ) = Ezj∼qZ ( z ) [ k ( zj , zi ) ∇zi log p ( zi|x ) ] and the repulsive force S−Z ( zi ) = Ezj∼qZ ( z ) [ ∇zik ( zj , zi ) ] . Here k : Rd × Rd → R is a kernel . The attractive force can be seen as pushing the particles towards the direction that maximizes the true posterior distribution , smoothed by some kernel . For an example of a kernel , consider the standard RBF kernel k ( zi , zj ) = exp ( − 1h ‖ zi − zj ‖ 2 2 ) with bandwidth parameter h , usually chosen as 1lognmed ( z ) . The normalization constant becomes additive in the log-posterior log p ( zi|x ) = − logZ + log p ( x|z ) + log p ( z ) and so does not need to be computed for the gradient . The repulsive force can be seen as moving particles away from each other , ensuring that they do not all collapse to the same mode . For the RBF kernel , the repulsive force becomes Ezj∼qZ ( z ) [ k ( zj , zi ) 2 h ∑ ` ( zi ` − zj ` ) ] and so particles that are close together ( thus having a high kernel value ) will be pushed away from each other . Non-linear Stein In non-linear Stein ( Wang and Liu , 2019a ) , the repulsive force can be scaled by a factor λ , so SZ = S+Z + λS − Z which is often useful when dealing with multi-modal distributions . It is also useful in our framework since the repulsive force often vanishes compared to the likelihood for large datasets X and therefore scaling the repulsive force by a constant λ = λ ( |X | ) proportional to the size of the dataset |X | appears logical , e.g . 0.1 or 0.01 . Matrix-valued kernels The choice of kernels can be extended to matrix-valued ones ( Wang et al. , 2019 ) K : Rd × Rd → Rd×d in which case the Stein forces become S+Z ( zi ) = Ezj∼qZ ( z ) [ K ( zj , zi ) ∇zi log p ( zi|x ) ] and S−Z ( zi ) = Ezj∼qZ ( z ) [ K ( zj , zi ) ∇zi ] where the standalone del∇zi in the repulsive force represents the vector ( ∂ ∂zi,1 , . . . , ∂∂zi , d ) and so ( K ( zj , zi ) ∇zi ) ` = ∑ k∇kK ` , k ( zj , zi ) . The advantage of matrix-valued kernels is that they allow preconditioning using the Hessian or Fisher Information matrix ( second-order derivatives ) , which can capture local curvature and thus achieve better optima than standard Stein VI . Furthermore , it is easy to capture graphical kernels ( Wang et al. , 2018b ) K = diag ( { K ( ` ) } ` ) where the set of variables are partitioned with each their own local kernel K ( ` ) . ELBO-within-Stein The standard form of Stein VI guides the particles toward maximizing the log-posterior log p ( z|x ) but in principle we could replace this with another objective ( negative loss ) Lθ which we want to maximize . Assume our guide qθ ( z ) comes from a parametric distribution with parameters θ , as in traditional VI . We can then for example maximize the ELBO ( Kingma and Welling , 2014 ) Lθ = Ez∼qθ ( z ) [ log p ( z , x ) − log qθ ( z ) ] as in traditional VI but using a set of particles for the parameters { θi } i guided by the Stein forces . One can see this as a generalization of traditional VI using a Stein-based mixture-model ( Nalisnick , 2019 ) , giving the parameters the flexibility to better capture correlations between distributions and to cover multiple modes ( Wang and Liu , 2019a ) . Another perspective is that ELBO-within-Stein adds uncertainty to the approximating distribution qθ ( z ) , allowing it to work with distributions over latent variables that are richer than simply point masses . The objective to be maximized in our framework is compositional , which means that ELBO can be replaced by other objectives , e.g. , Rényi ELBO ( Li and Turner , 2016 ) , Tail-adaptive f-divergence ( Wang et al. , 2018a ) or Wasserstein pseudo-divergence ( Ambrogioni et al. , 2018 ) when these are implemented in NumPyro . Einstein VI makes it possible to integrate all these developments within Stein VI in a coherent fashion . Parameter Transforms Deterministic transport maps have been suggested to be integrated in MCMC methods by Parno and Marzouk ( 2018 ) and Hoffman et al . ( 2018 ) , to allow constructing a better geometry for the posterior approximation and thus improve inference . We provide a novel adaptation of the idea to work with Stein-based methods , in the EinStein VI framework . Consider the general objective we optimize in EinStein VI , which has the form : SΘ ( θi ) = Eθj∼q ( θ ) [ k ( θj , θi ) ∇θiLθi +∇θik ( θj , θi ) ] where Lθ is our negative loss objective ( e.g. , ELBO ) parameterised by θ which we update using a set of Stein particles Θ = { θi } i . The core idea is then that we would like to reparametrize the calculation so each Stein particle θi is expressed as an ( invertible ) deterministic transformation of another particle φi , so θi = T ( φi ) ( thus Θ = { T ( φ ) |φ ∈ Φ } ) . We do this reparametrization by first declaring the set of particles to be optimized Φ = { φi } i and the transformation to be used T , and then define the reparametrized Stein force as follows : SΦ ( φi ) = SΘ ( T ( φi ) ) ( ∇φiT ( φi ) ) > where ∇φiT ( φi ) : Rd×e is the reparametrization Jacobian , that adjusts for the change of variables ( from θi : Re to φi : Rd ) . The power of parameter transforms is amplified in our EinStein VI framework , in that we allow for its parameters to be learnable . We can thus use e.g. , sparse triangular maps , invertible neural networks or normalizing flows , which have been shown to be particularly effective for Bayesian inference .
This paper introduces EinStein VI: a lightweight composable library for Stein Variational Inference (Stein VI). The library is built on top of NumPyro and can take advantage of many of NumPyro's capabilities. It supports recent techniques associated with Stein VI, as well as novel features. The paper provides examples of using the EinStein VI library on different probabilistic models.
SP:07e42db34b99c1c6bd5c7c5823db9f0bffe5ecdb
Einstein VI: General and Integrated Stein Variational Inference in NumPyro
1 INTRODUCTION . Interest in Bayesian deep learning has surged due to the need for quantifying the uncertainty of predictions provided by machine learning algorithms . The idea behind Bayesian learning is to describe observed data x using a model with latent variable z ( representing model parameters and nuisance variables , see e.g. , Fig . 4a ) . The goal is then to infer a posterior distribution p ( z|x ) over latent variables given a model describing the joint distribution p ( z , x ) = p ( x|z ) p ( z ) following the rules of Bayesian inference : p ( z|x ) = Z−1p ( x|z ) p ( z ) where the normalization constant Z = ∫ z p ( x|z ) p ( z ) dz is intractable for most practical models including deep neural networks : an analytic solution is lacking or may require an infeasible number of calculations . Variational Inference ( VI ) techniques ( Blei et al. , 2017 ; Hoffman et al. , 2013 ; Ranganath et al. , 2014 ) provide a way to find an approximation of the posterior distribution . VI poses a family of distributions over latent variables q ( z ) ∈ Q ( e.g. , Fig . 4b ) and chooses the one that minimizes a chosen divergence1 D ( q ( z ) ‖ p ( z|x ) ) ( e.g. , Kullback-Leibler ) to the true posterior distribution . VI often provides good approximations that can capture uncertainty , scaling to millions of data points using mini-batch training . 1Asymmetric distance Stein Variational Inference ( Liu and Wang , 2016 ) is a recent non-parametric approach to VI which uses a set of particles { zi } Ni=1 as the approximating distribution q ( z ) to provide better flexibility in capturing correlations between latent variables . The technique preserves the scalability of traditional VI approaches while offering the flexibility and modelling scope of techniques such as Markov Chain Monte Carlo ( MCMC ) . Stein VI has been shown to be good at capturing multi-modality ( Liu and Wang , 2016 ; Wang and Liu , 2019a ) , and has useful theoretical interpretations as particles following a gradient flow ( Liu , 2017 ) and as a moment matching optimization system ( Liu and Wang , 2018 ) . Many advanced inference methods based on Stein VI have been recently developed , including Stein mixtures ( Nalisnick , 2019 ) , non-linear Stein ( Wang and Liu , 2019b ) , factorized graphical models ( Zhuo et al. , 2018 ; Wang et al. , 2018b ) , matrix-valued kernels ( Wang et al. , 2019 ) and support for higher-order gradient-based optimization ( Detommaso et al. , 2018 ) . These techniques have been shown to significantly extend the power of Stein VI , allowing more flexible and effective approximations of the true posterior distribution . While algorithmic power is growing , there remains a distinct lack of integration of these techniques into a general probabilistic programming language ( PPL ) framework . Such an integration would solve one of the most prominent limitations of traditional VI , which lacks flexibility to capture rich correlations in the approximated posterior . This paper presents the EinStein VI library that extends the NumPyro PPL ( Bingham et al. , 2019 ; Phan et al. , 2019 ) with support for the recent developments in Stein Variational Inference in an integrated and compositional fashion ( see Fig . 1c and Fig . 1d ) . The library takes advantage of the capabilities of NumPyro— including universal probabilistic programming ( van de Meent et al. , 2018 ) , integration with deep learning using JAX ( Frostig et al. , 2018 ) , and automatic optimization and marginalization of discrete latent variables ( Obermeyer et al. , 2019 ) —to provide capabilities that work synergetically with the Stein algorithms . Concretely , our contributions are : • Einstein VI , a general library that extends NumPyro and allows Stein Variational Inference to work with custom guide programs based on ELBO-within-Stein optimization ( Nalisnick , 2019 ) . The library is compositional with NumPyro features , including supported deep learning and automatic marginalization , loss functions ( ELBO , Rényi ELBO , custom losses ) and optimization methods , allowing it to grow organically with NumPyro development . • Integration of recent developments in Stein variational inference within the EinStein library . This includes support for non-linear optimization ( Wang and Liu , 2019b ) , a wealth of kernels ( Liu and Wang , 2016 ; 2018 ; Gorham and Mackey , 2017 ) , matrix-valued kernels ( Wang et al. , 2019 ) supporting higher-order optimization , and factorization based on conditional independence between elements in the model ( graphical kernels ) . • We support the application of transforms on the parameter space , including triangular ( Parno and Marzouk , 2018 ) and neural transforms ( Hoffman et al. , 2018 ) to improve the gradient geometry of the inference problem . • A series of examples demonstrate the power of an integrated library such as EinStein VI and the synergy between different Stein VI techniques . The examples include a novel Stein Mixture version of Deep Markov Models ( SM-DMM ) , Stein Mixture Latent Dirichlet Allocation ( SM-LDA ) , and several examples using neural transforms and higher-order optimization . The paper proceeds as follows . We first present a primer on the theory of Stein VI in Section 2 relating it to our integrated implementation in EinStein VI . We discuss the general details of the implementation of EinStein VI in NumPyro in Section 3 . We present the various examples using EinStein VI in Section 4 and finally summarize our results and future work in Section 5 . 1.1 RELATED WORK . There has been a proliferation of deep probabilistic programming languages based on tensor frameworks with automatic differentiation , supporting various inference techniques . Pyro ( Bingham et al. , 2019 ) is a universal PPL based on PyTorch ( Paszke et al. , 2019 ) . The main mode of inference in Pyro is black-box Stochastic Variational Inference ( Ranganath et al. , 2014 ) with guides , which are flexible programs that approximate the posterior distribution by repeating the ( non-observed ) sample statements as the probabilistic model and can contain deep neural networks allowing amortization of inference ( Kingma and Welling , 2014 ; Gershman and Goodman , 2014 ) . Pyro also supports various sampling algorithms like Hamiltonian Monte Carlo/NUTS ( Neal , 2011 ; Hoffman and Gelman , 2014 ) and sample-adaptive MCMC ( Zhu , 2019 ) which provide more accurate posterior approximations but lack the scalability of VI techniques . NumPyro is a version of Pyro that runs on the JAX framework ( Frostig et al. , 2018 ) , which allows it to exploit the powerful program optimization and parallelizability of the JAX compiler . Our library , EinStein VI , extends the Stochastic VI mode of inference by adding Stein Variational Inference on top of NumPyro , allowing the optimizable parameters in the guide to be approximated by a set of particles instead of a point estimate . Other languages with similar feature set include PyMC3 ( Salvatier et al. , 2016 ) , Edward ( Tran et al. , 2016 ; 2019 ) and HackPPL ( Ai et al. , 2019 ) . 2 PRIMER ON STEIN VI . The core idea of Stein VI ( Liu and Wang , 2016 ) is to perform inference by approximating the target posterior distribution p ( z|x ) by an approximate distribution qZ ( z ) = N−1 ∑ i δzi ( z ) based on a set of particles Z = { zi } Ni=1 . Here , δx ( y ) represents the Dirac delta measure , which is equal to 1 if x = y and 0 otherwise . One could thus see the approximating distribution qZ ( z ) as a mixture of point estimates , each represented by a particle z ∈ Z . The idea is then that we minimize the Kullback-Leibler divergence DKL ( q ( z ) ‖ p ( z|x ) ) between the approximation and the true posterior by iteratively updating the particles using the Stein forces : zi ← zi + SZ ( zi ) where represents the learning rate and SZ the Stein forces . The Two Forces of Stein VI Stein VI consists of two forces which work additively under the form SZ = S + Z + S − Z , where the attractive force S+Z ( zi ) = Ezj∼qZ ( z ) [ k ( zj , zi ) ∇zi log p ( zi|x ) ] and the repulsive force S−Z ( zi ) = Ezj∼qZ ( z ) [ ∇zik ( zj , zi ) ] . Here k : Rd × Rd → R is a kernel . The attractive force can be seen as pushing the particles towards the direction that maximizes the true posterior distribution , smoothed by some kernel . For an example of a kernel , consider the standard RBF kernel k ( zi , zj ) = exp ( − 1h ‖ zi − zj ‖ 2 2 ) with bandwidth parameter h , usually chosen as 1lognmed ( z ) . The normalization constant becomes additive in the log-posterior log p ( zi|x ) = − logZ + log p ( x|z ) + log p ( z ) and so does not need to be computed for the gradient . The repulsive force can be seen as moving particles away from each other , ensuring that they do not all collapse to the same mode . For the RBF kernel , the repulsive force becomes Ezj∼qZ ( z ) [ k ( zj , zi ) 2 h ∑ ` ( zi ` − zj ` ) ] and so particles that are close together ( thus having a high kernel value ) will be pushed away from each other . Non-linear Stein In non-linear Stein ( Wang and Liu , 2019a ) , the repulsive force can be scaled by a factor λ , so SZ = S+Z + λS − Z which is often useful when dealing with multi-modal distributions . It is also useful in our framework since the repulsive force often vanishes compared to the likelihood for large datasets X and therefore scaling the repulsive force by a constant λ = λ ( |X | ) proportional to the size of the dataset |X | appears logical , e.g . 0.1 or 0.01 . Matrix-valued kernels The choice of kernels can be extended to matrix-valued ones ( Wang et al. , 2019 ) K : Rd × Rd → Rd×d in which case the Stein forces become S+Z ( zi ) = Ezj∼qZ ( z ) [ K ( zj , zi ) ∇zi log p ( zi|x ) ] and S−Z ( zi ) = Ezj∼qZ ( z ) [ K ( zj , zi ) ∇zi ] where the standalone del∇zi in the repulsive force represents the vector ( ∂ ∂zi,1 , . . . , ∂∂zi , d ) and so ( K ( zj , zi ) ∇zi ) ` = ∑ k∇kK ` , k ( zj , zi ) . The advantage of matrix-valued kernels is that they allow preconditioning using the Hessian or Fisher Information matrix ( second-order derivatives ) , which can capture local curvature and thus achieve better optima than standard Stein VI . Furthermore , it is easy to capture graphical kernels ( Wang et al. , 2018b ) K = diag ( { K ( ` ) } ` ) where the set of variables are partitioned with each their own local kernel K ( ` ) . ELBO-within-Stein The standard form of Stein VI guides the particles toward maximizing the log-posterior log p ( z|x ) but in principle we could replace this with another objective ( negative loss ) Lθ which we want to maximize . Assume our guide qθ ( z ) comes from a parametric distribution with parameters θ , as in traditional VI . We can then for example maximize the ELBO ( Kingma and Welling , 2014 ) Lθ = Ez∼qθ ( z ) [ log p ( z , x ) − log qθ ( z ) ] as in traditional VI but using a set of particles for the parameters { θi } i guided by the Stein forces . One can see this as a generalization of traditional VI using a Stein-based mixture-model ( Nalisnick , 2019 ) , giving the parameters the flexibility to better capture correlations between distributions and to cover multiple modes ( Wang and Liu , 2019a ) . Another perspective is that ELBO-within-Stein adds uncertainty to the approximating distribution qθ ( z ) , allowing it to work with distributions over latent variables that are richer than simply point masses . The objective to be maximized in our framework is compositional , which means that ELBO can be replaced by other objectives , e.g. , Rényi ELBO ( Li and Turner , 2016 ) , Tail-adaptive f-divergence ( Wang et al. , 2018a ) or Wasserstein pseudo-divergence ( Ambrogioni et al. , 2018 ) when these are implemented in NumPyro . Einstein VI makes it possible to integrate all these developments within Stein VI in a coherent fashion . Parameter Transforms Deterministic transport maps have been suggested to be integrated in MCMC methods by Parno and Marzouk ( 2018 ) and Hoffman et al . ( 2018 ) , to allow constructing a better geometry for the posterior approximation and thus improve inference . We provide a novel adaptation of the idea to work with Stein-based methods , in the EinStein VI framework . Consider the general objective we optimize in EinStein VI , which has the form : SΘ ( θi ) = Eθj∼q ( θ ) [ k ( θj , θi ) ∇θiLθi +∇θik ( θj , θi ) ] where Lθ is our negative loss objective ( e.g. , ELBO ) parameterised by θ which we update using a set of Stein particles Θ = { θi } i . The core idea is then that we would like to reparametrize the calculation so each Stein particle θi is expressed as an ( invertible ) deterministic transformation of another particle φi , so θi = T ( φi ) ( thus Θ = { T ( φ ) |φ ∈ Φ } ) . We do this reparametrization by first declaring the set of particles to be optimized Φ = { φi } i and the transformation to be used T , and then define the reparametrized Stein force as follows : SΦ ( φi ) = SΘ ( T ( φi ) ) ( ∇φiT ( φi ) ) > where ∇φiT ( φi ) : Rd×e is the reparametrization Jacobian , that adjusts for the change of variables ( from θi : Re to φi : Rd ) . The power of parameter transforms is amplified in our EinStein VI framework , in that we allow for its parameters to be learnable . We can thus use e.g. , sparse triangular maps , invertible neural networks or normalizing flows , which have been shown to be particularly effective for Bayesian inference .
The paper shows how a particle-based nonparameteric Variational Inference methodology known as Stein Variational Inference is integrated in a full-featured Probabilistic Programming Language, NumPyro. The paper goes into a fair amount detail describing a number of enhancements that have been made into numpyro using the general technique of particle-based representation of non-parameteric approximating distributions. They describe how geometric transforms of the parameter space can fit into their scheme, how matrix-valued kernels can be integrated. Also, they describe a new variant of Stein VI which they call ELBO-within-Stein. This introduces a new line of research for Stein VI. They also describe a Stein Mixture extension to Deep Markov Models (SM-DMM) and demonstrate on a very large dataset for the latter method.
SP:07e42db34b99c1c6bd5c7c5823db9f0bffe5ecdb
Adaptive Multi-model Fusion Learning for Sparse-Reward Reinforcement Learning
In this paper , we consider intrinsic reward generation for sparse-reward reinforcement learning based on model prediction errors . In typical model-prediction-errorbased intrinsic reward generation , an agent has a learning model for the underlying environment . Then , intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment , based on the fact that for less-visited or non-visited states , the learned model yields larger prediction errors , promoting exploration helpful for reinforcement learning . This paper generalizes this model-prediction-error-based intrinsic reward generation method to multiple prediction models . We propose a new adaptive fusion method relevant to the multiple-model case , which learns optimal prediction-error fusion across the learning phase to enhance the overall learning performance . Numerical results show that for representative locomotion tasks , the proposed intrinsic reward generation method outperforms most of the previous methods , and the gain is significant in some tasks . 1 INTRODUCTION . Reinforcement learning ( RL ) with sparse reward is an active research area ( Andrychowicz et al. , 2017 ; Tang et al. , 2017 ; de Abril & Kanai , 2018 ; Oh et al. , 2018 ; Kim et al. , 2019 ) . In sparse-reward RL , the environment does not return a non-zero reward for every agent ’ s action but returns a non-zero reward only when certain conditions are met . Such situations are encountered in many action control problems ( Houthooft et al. , 2016 ; Andrychowicz et al. , 2017 ; Oh et al. , 2018 ) . As in conventional RL , exploration is essential at the early stage of learning in sparse-reward RL , whereas the balance between exploration and exploitation is required later . Intrinsically motivated RL has been studied to stimulate better exploration by generating intrinsic reward for each action by the agent itself . Recently , many intrinsically-motivated RL algorithms have been devised especially to deal with the sparsity of reward , e.g. , based on the notion of curiosity ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ) , surprise ( Achiam & Sastry , 2017 ) . In essence , in these intrinsic reward generation methods , the agent has a learning model for the next state or the transition probability of the underlying environment , and intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment , based on the fact that for less-visited or non-visited states , the learned model yields larger prediction errors , promoting exploration helpful for reinforcement learning . These previous methods typically use a single prediction model for the next state or the environment ’ s transition probability . In this paper , we generalize this model-prediction-error-based approach to the case of multiple prediction models and propose a new framework for intrinsic reward generation based on the optimal adaptive fusion of multiple values from multiple models . The use of multiple models increases diversity in modeling error values and the chance to design a better intrinsic reward from these values . The critical task is to learn an optimal fusion rule to maximize the performance across the entire learning phase . In order to devise such an optimal adaptive fusion algorithm , we adopt the α-mean with the scale-free property from the field of information geometry ( Amari , 2016 ) and apply the meta-gradient optimization to search for optimal fusion at each stage of learning . Numerical results show that the proposed multi-model intrinsic reward generation combined with fusion learning significantly outperforms existing intrinsic reward generation methods . 2 RELATED WORK . Intrinsically-motivated RL and exploration methods can be classified mainly into two categories . One is to explicitly generate intrinsic reward and train the agent with the sum of the extrinsic reward and the adequately scaled intrinsic reward . The other is indirect methods that do not explicitly generate intrinsic reward . Our work belongs to the first category , and we conducted experiments using baselines in the first category . However , we also detailed the second category in Appendix H for readers for further work in the intrinsically-motivated RL area . Houthooft et al . ( 2016 ) used the information gain on the prediction model as an additional reward based on the notion of curiosity . Tang et al . ( 2017 ) efficiently applied count-based exploration to high-dimensional state space by mapping the states ’ trained features into a hash table . The concept of surprise was exploited to yield intrinsic rewards ( Achiam & Sastry , 2017 ) . Pathak et al . ( 2017 ) defined an intrinsic reward with the prediction error using a feature state space , and de Abril & Kanai ( 2018 ) enhanced Pathak et al . ( 2017 ) ’ s work with the idea of homeostasis in biology . Zheng et al . ( 2018 ) used a delayed reward environment to propose training the module to generate intrinsic reward apart from training the policy . This delayed reward environment for sparse-reward settings differs from the previous sparse-reward environment based on thresholding ( Houthooft et al. , 2016 ) . ( The agent gets a non-zero reward when the agent achieves a specific physical quantity - such as the distance from the origin - larger than the predefined threshold . ) Pathak et al . ( 2019 ) interpreted the disagreement among the models as the variance of the predicted next states and used the variance as the final differentiable intrinsic reward . Our method is a generalized version of their work as we can apply our proposed fusion method to the multiple squared error values between a predicted next state and all the predicted next states ’ average . Freirich et al . ( 2019 ) proposed generating intrinsic reward by applying a generative model with the Wasserstein-1 distance . With the concept of state-action embedding , Kim et al . ( 2019 ) adopted the Jensen-Shannon divergence ( JSD ) ( Hjelm et al. , 2019 ) to construct a new variational lower bound of the corresponding mutual information , guaranteeing numerical stability . Our work differs from these two works in that we use the adaptive fusion method of multiple intrinsic reward at every timestep . 3 THE PROPOSED METHOD . 3.1 SETUP . We consider a discrete-time continuous-state Markov Decision Process ( MDP ) , denoted as ( S , A , P , r , ρ0 , γ ) , where S and A are the sets of states and actions , respectively , P : S ×A → Π ( S ) is the transition probability function , where Π ( S ) is the space of probability distributions over S , r : S ×A× S → R is the extrinsic reward function , ρ0 is the probability distribution of the initial state , and γ is the discounting factor . A ( stochastic ) policy is represented by π : S → Π ( A ) , where Π ( A ) is the space of probability distributions on A and π ( a|s ) represents the probability of choosing action a ∈ A for given state s ∈ S . In sparse-reward RL , the environment does not return a non-zero reward for every action but returns a non-zero reward only when certain conditions are met by the current state , the action and the next state ( Houthooft et al. , 2016 ; Andrychowicz et al. , 2017 ; Oh et al. , 2018 ) . Our goal is to optimize the policy π to maximize the expected cumulative return η ( π ) by properly generating intrinsic reward in such sparse-reward environments . We assume that the true transition probability distribution P is unknown to the agent . 3.2 INTRINSIC REWARD DESIGN BASED ON MODEL PREDICTION ERRORS . Intrinsically-motivated RL adds a properly designed intrinsic reward at every timestep t to the actual extrinsic reward to yield a non-zero total reward for training even when the extrinsic reward returned by the environment is zero ( Pathak et al. , 2017 ; Tang et al. , 2017 ; de Abril & Kanai , 2018 ) . In the model-prediction-error-based intrinsic reward design , the agent has a prediction model parametrized by φ for the next state st+1 or the transition probability P ( st+1|st , at ) , and the intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment ( Houthooft et al. , 2016 ; Achiam & Sastry , 2017 ; Pathak et al. , 2017 ; Burda et al. , 2019 ; de Abril & Kanai , 2018 ) . Thus , the intrinsic-reward-incorporated problem under this approach is given in most cases as max π { η ( π ) + c E ( s , a ) ∼π [ D ( P ||Pφ ) | ( s , a ) ] } ( 1 ) for some constant c > 0 and some divergence function D ( ·||· ) , where η ( π ) is the cumulative reward associated with policy π , and Pφ is the learning model parameterized by φ that the agent has regarding the true unknown transition probability P of the environment . For the divergence , the mean squared error ( MSE ) between the actual next state and the predicted next state can be used for the error measure when the learning model predicts the next state itself , or alternatively the Kullback-Leibler divergence ( KLD ) between the probability distribution for the next state st+1 and the predicted probability distribution for st+1 can be used when the learning models learn the transition probability . In the case of KLD , the intractable DKL ( P ||Pφ ) | ( s , a ) with unknown P can be approximated based on the 1-step approximation ( Achiam & Sastry , 2017 ) . 3.3 THE PROPOSED ADAPTIVE FUSION LEARNING . We consider using multiple prediction models and the design of prediction-error-based intrinsic reward from the multiple models . Suppose we have a collection of K ( ≥ 2 ) models parametrized by φ1 , · · · , φK to generate K prediction error ( approximation ) values at timestep t as intrinsic reward rjt , int ( st , at , st+1 ) , j = 1 , · · · , K , respectively . The key problem of multi-model prediction-errorbased intrinsic reward design is how to learn φ1 , · · · , φK and how to optimally fuse the K values rjt , int ( st , at , st+1 ) , j = 1 , · · · , K , to generate a single intrinsic reward to be added to the scalar cumulative return for policy update . The considered multi-model fusion structure is shown in Fig . 1 . To fuse the K values for a single reward value , one can use one of the known methods such as average , minimum , or maximum . However , there is no guarantee of optimality for such arbitrary choices , and one fixed fusion rule may not be optimal for the entire learning phase . Let a fusion function be denoted as rint = f ( r 1 int , r 2 int , · · · , rKint ) , ( 2 ) where r1int , r 2 int , · · · , rKint are the K input values and rint is the output value . To devise an optimal adaptive fusion rule , we consider the following requirements for the fusion function f . Condition 1 . The fusion function f varies with some control parameter to adapt to the relative importance of the K input values . We require Condition 1 so that the fusion of the K input values can adapt to the learning situation . When the more aggressive fusion is required at some phase of learning , we want the function f to be more like maximum . On the other hand , when the more conservative fusion is required at other learning phases , we want the function f to be more like minimum . Furthermore , we want this optimal adaptation is learned based on data to yield maximum cumulative return . In addition , we impose the following relevant condition for any reasonable fusion function : Condition 2 . The fusion function f is scale-free , i.e. , f ( cr1int , cr 2 int , · · · , crKint ) = cf ( r1int , r2int , · · · , rKint ) . ( 3 ) Condition 2 implies that when we scale all the input values by the same factor c , the output is the c-scaled version of the fusion output of the not-scaled inputs . Condition 2 is a proper requirement for any reasonable averaging function . The necessity of Condition 2 is explained in detail in Appendix G. Such a fusion function can be found based on the α-mean of positive measures in the field of information geometry ( Amari , 2016 ) . For any K positive1 values x1 , · · · , xK > 0 , the α-mean of x1 , · · · , xK is defined as fα ( x1 , · · · , xK ) = h−1 ( 1 K K∑ i=1 h ( xi ) ) ( 4 ) where h ( x ) is given by the α-embedding transformation : h ( x ) = { x 1−α 2 , if α 6= 1 log x , if α = 1 . ( 5 ) It is proven that the unique class of transformation h satisfying Condition 2 under the twicedifferentiability and the strict monotonicity of h is given by the α-embedding ( 5 ) ( Amari , 2007 ; 2016 ) . Basically , Condition 2 is used to write fα ( cx1 , · · · , cxK ) = h−1 ( 1 K ∑K i=1 h ( cxi ) ) = cfα ( x1 , · · · , xK ) . Taking h ( · ) on both sides yields h ( cfα ( x1 , · · · , xK ) ) = 1K ∑K i=1 h ( cxi ) . Then , taking partial derivative with respect to xi ( 1 ≤ i ≤ K ) on both sides , we can show that the equation ( 5 ) is the unique class of mapping functions ( Amari , 2007 ; 2016 ) . Furthermore , by varying α , the α-mean includes all numeric fusions with the scale-free property such as minimum , maximum , and conventional mean functions ( Amari , 2016 ) . When α = −∞ , fα ( x1 , · · · , xK ) = maxi xi . On the other hand , when α = ∞ , fα ( x1 , · · · , xK ) = mini xi . As α increases from −∞ to∞ , the α-mean output varies monotonically from maximum to minimum . See Appendix B . Hence , we can perform aggressive fusion to conservative fusion by controlling the parameter α . 3.3.1 LEARNING OF α WITH META-GRADIENT OPTIMIZATION In the proposed adaptive fusion , we need to adaptively control α judiciously to maximize the expected cumulative extrinsic return η ( π ) . To learn optimal α maximizing η ( π ) , we use the meta gradient method ( Xu et al. , 2018 ; Zheng et al. , 2018 ) . Optimal α at each stage of learning is learned with the proposed method , and it will be shown that optimal α varies according to the stage of learning . For policy πθ with policy parameter θ , let us define the following quantities . • η ( πθ ) = Eτ∼πθ [ ∞∑ t=0 γtr ( st , at , st+1 ) ] : the expected cumulative sum of extrinsic rewards which we want to maximize . Here , τ is a sample trajectory . • ηtotal ( πθ ) = Eτ∼πθ [ ∞∑ t=0 γt ( r ( st , at , st+1 ) + cfα ( st , at , st+1 ) ) ] : the expected cumulative sum of both extrinsic and intrinsic rewards with which the policy πθ is updated . Here , the dependence of the fusion output fα on ( st , at , st+1 ) through r j t , int ( st , at , st+1 ) is shown with notation simplification . Then , for a given trajectory τ = ( s0 , a0 , s1 , a1 , . . . ) generated by πθ , we update θ towards the direction of maximizing ηtotal ( πθ ) : θ̃ = θ + δθ∇θηtotal ( πθ ) ( 6 ) where δθ is the learning rate for θ . Then , the fusion parameter α is updated to maximize the expected cumulated sum of extrinsic rewards for the updated policy πθ̃ : α̃ = α+ δα∇αη ( πθ̃ ) ( 7 ) 1When an input value to the α-mean is negative due to divergence approximation in some cases , we can use exponentiation at the input stage and its inverse logarithm at the output stage . We used the exponentiation exp ( −x ) at the input stage with input x and the negative logarithm of the α-mean as its inverse at the output stage for actual implementation . In this case , due to the monotone decreasing property of the input mapping : x→ exp ( −x ) , the output is the maximum when α =∞ and is the minimum when α = −∞ . where δα is the learning rate for α . Note that we update the policy parameter θ to maximize ηtotal ( πθ ) so that the updated policy parameter θ̃ is a function of α . Therefore , ∇αη ( πθ̃ ) is not zero and can be computed by chain rule : ∇αη ( πθ̃ ) = ∇θ̃η ( πθ̃ ) ∇αθ̃ ( 8 ) To learn optimal α together with θ , we adopt an alternating optimization method widely used in meta-parameter optimization . That is , we iterate the following two steps in an alternating manner : 1 ) Update the policy parameter θ to maximize ηtotal ( πθ ) . 2 ) Update the fusion parameter α to maximize η ( πθ̃ ) , where θ̃ is the updated policy parameter from Step 1 ) . In this way , we can learn proper α adaptively over timesteps to maximize the performance .
This paper proposes an intrinsic reward formulation to address the challenge of sparse reward in reinforcement learning. The key idea is to learn multiple models. The prediction error of each model is used as a component of the intrinsic reward. These components are fused using an alpha-mean function. The parameter alpha can be tuned automatically throughout the training process using meta-gradient methods. The method is evaluated on 6 OpenAI continuous control benchmarks (with delayed reward), and demonstrates better performance than several state-of-the-art prior works on intrinsic reward.
SP:bd65ec9b7d991a0c23b882bb137653f2f2f94c71
Adaptive Multi-model Fusion Learning for Sparse-Reward Reinforcement Learning
In this paper , we consider intrinsic reward generation for sparse-reward reinforcement learning based on model prediction errors . In typical model-prediction-errorbased intrinsic reward generation , an agent has a learning model for the underlying environment . Then , intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment , based on the fact that for less-visited or non-visited states , the learned model yields larger prediction errors , promoting exploration helpful for reinforcement learning . This paper generalizes this model-prediction-error-based intrinsic reward generation method to multiple prediction models . We propose a new adaptive fusion method relevant to the multiple-model case , which learns optimal prediction-error fusion across the learning phase to enhance the overall learning performance . Numerical results show that for representative locomotion tasks , the proposed intrinsic reward generation method outperforms most of the previous methods , and the gain is significant in some tasks . 1 INTRODUCTION . Reinforcement learning ( RL ) with sparse reward is an active research area ( Andrychowicz et al. , 2017 ; Tang et al. , 2017 ; de Abril & Kanai , 2018 ; Oh et al. , 2018 ; Kim et al. , 2019 ) . In sparse-reward RL , the environment does not return a non-zero reward for every agent ’ s action but returns a non-zero reward only when certain conditions are met . Such situations are encountered in many action control problems ( Houthooft et al. , 2016 ; Andrychowicz et al. , 2017 ; Oh et al. , 2018 ) . As in conventional RL , exploration is essential at the early stage of learning in sparse-reward RL , whereas the balance between exploration and exploitation is required later . Intrinsically motivated RL has been studied to stimulate better exploration by generating intrinsic reward for each action by the agent itself . Recently , many intrinsically-motivated RL algorithms have been devised especially to deal with the sparsity of reward , e.g. , based on the notion of curiosity ( Houthooft et al. , 2016 ; Pathak et al. , 2017 ) , surprise ( Achiam & Sastry , 2017 ) . In essence , in these intrinsic reward generation methods , the agent has a learning model for the next state or the transition probability of the underlying environment , and intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment , based on the fact that for less-visited or non-visited states , the learned model yields larger prediction errors , promoting exploration helpful for reinforcement learning . These previous methods typically use a single prediction model for the next state or the environment ’ s transition probability . In this paper , we generalize this model-prediction-error-based approach to the case of multiple prediction models and propose a new framework for intrinsic reward generation based on the optimal adaptive fusion of multiple values from multiple models . The use of multiple models increases diversity in modeling error values and the chance to design a better intrinsic reward from these values . The critical task is to learn an optimal fusion rule to maximize the performance across the entire learning phase . In order to devise such an optimal adaptive fusion algorithm , we adopt the α-mean with the scale-free property from the field of information geometry ( Amari , 2016 ) and apply the meta-gradient optimization to search for optimal fusion at each stage of learning . Numerical results show that the proposed multi-model intrinsic reward generation combined with fusion learning significantly outperforms existing intrinsic reward generation methods . 2 RELATED WORK . Intrinsically-motivated RL and exploration methods can be classified mainly into two categories . One is to explicitly generate intrinsic reward and train the agent with the sum of the extrinsic reward and the adequately scaled intrinsic reward . The other is indirect methods that do not explicitly generate intrinsic reward . Our work belongs to the first category , and we conducted experiments using baselines in the first category . However , we also detailed the second category in Appendix H for readers for further work in the intrinsically-motivated RL area . Houthooft et al . ( 2016 ) used the information gain on the prediction model as an additional reward based on the notion of curiosity . Tang et al . ( 2017 ) efficiently applied count-based exploration to high-dimensional state space by mapping the states ’ trained features into a hash table . The concept of surprise was exploited to yield intrinsic rewards ( Achiam & Sastry , 2017 ) . Pathak et al . ( 2017 ) defined an intrinsic reward with the prediction error using a feature state space , and de Abril & Kanai ( 2018 ) enhanced Pathak et al . ( 2017 ) ’ s work with the idea of homeostasis in biology . Zheng et al . ( 2018 ) used a delayed reward environment to propose training the module to generate intrinsic reward apart from training the policy . This delayed reward environment for sparse-reward settings differs from the previous sparse-reward environment based on thresholding ( Houthooft et al. , 2016 ) . ( The agent gets a non-zero reward when the agent achieves a specific physical quantity - such as the distance from the origin - larger than the predefined threshold . ) Pathak et al . ( 2019 ) interpreted the disagreement among the models as the variance of the predicted next states and used the variance as the final differentiable intrinsic reward . Our method is a generalized version of their work as we can apply our proposed fusion method to the multiple squared error values between a predicted next state and all the predicted next states ’ average . Freirich et al . ( 2019 ) proposed generating intrinsic reward by applying a generative model with the Wasserstein-1 distance . With the concept of state-action embedding , Kim et al . ( 2019 ) adopted the Jensen-Shannon divergence ( JSD ) ( Hjelm et al. , 2019 ) to construct a new variational lower bound of the corresponding mutual information , guaranteeing numerical stability . Our work differs from these two works in that we use the adaptive fusion method of multiple intrinsic reward at every timestep . 3 THE PROPOSED METHOD . 3.1 SETUP . We consider a discrete-time continuous-state Markov Decision Process ( MDP ) , denoted as ( S , A , P , r , ρ0 , γ ) , where S and A are the sets of states and actions , respectively , P : S ×A → Π ( S ) is the transition probability function , where Π ( S ) is the space of probability distributions over S , r : S ×A× S → R is the extrinsic reward function , ρ0 is the probability distribution of the initial state , and γ is the discounting factor . A ( stochastic ) policy is represented by π : S → Π ( A ) , where Π ( A ) is the space of probability distributions on A and π ( a|s ) represents the probability of choosing action a ∈ A for given state s ∈ S . In sparse-reward RL , the environment does not return a non-zero reward for every action but returns a non-zero reward only when certain conditions are met by the current state , the action and the next state ( Houthooft et al. , 2016 ; Andrychowicz et al. , 2017 ; Oh et al. , 2018 ) . Our goal is to optimize the policy π to maximize the expected cumulative return η ( π ) by properly generating intrinsic reward in such sparse-reward environments . We assume that the true transition probability distribution P is unknown to the agent . 3.2 INTRINSIC REWARD DESIGN BASED ON MODEL PREDICTION ERRORS . Intrinsically-motivated RL adds a properly designed intrinsic reward at every timestep t to the actual extrinsic reward to yield a non-zero total reward for training even when the extrinsic reward returned by the environment is zero ( Pathak et al. , 2017 ; Tang et al. , 2017 ; de Abril & Kanai , 2018 ) . In the model-prediction-error-based intrinsic reward design , the agent has a prediction model parametrized by φ for the next state st+1 or the transition probability P ( st+1|st , at ) , and the intrinsic reward is designed as the error between the model prediction and the actual outcome of the environment ( Houthooft et al. , 2016 ; Achiam & Sastry , 2017 ; Pathak et al. , 2017 ; Burda et al. , 2019 ; de Abril & Kanai , 2018 ) . Thus , the intrinsic-reward-incorporated problem under this approach is given in most cases as max π { η ( π ) + c E ( s , a ) ∼π [ D ( P ||Pφ ) | ( s , a ) ] } ( 1 ) for some constant c > 0 and some divergence function D ( ·||· ) , where η ( π ) is the cumulative reward associated with policy π , and Pφ is the learning model parameterized by φ that the agent has regarding the true unknown transition probability P of the environment . For the divergence , the mean squared error ( MSE ) between the actual next state and the predicted next state can be used for the error measure when the learning model predicts the next state itself , or alternatively the Kullback-Leibler divergence ( KLD ) between the probability distribution for the next state st+1 and the predicted probability distribution for st+1 can be used when the learning models learn the transition probability . In the case of KLD , the intractable DKL ( P ||Pφ ) | ( s , a ) with unknown P can be approximated based on the 1-step approximation ( Achiam & Sastry , 2017 ) . 3.3 THE PROPOSED ADAPTIVE FUSION LEARNING . We consider using multiple prediction models and the design of prediction-error-based intrinsic reward from the multiple models . Suppose we have a collection of K ( ≥ 2 ) models parametrized by φ1 , · · · , φK to generate K prediction error ( approximation ) values at timestep t as intrinsic reward rjt , int ( st , at , st+1 ) , j = 1 , · · · , K , respectively . The key problem of multi-model prediction-errorbased intrinsic reward design is how to learn φ1 , · · · , φK and how to optimally fuse the K values rjt , int ( st , at , st+1 ) , j = 1 , · · · , K , to generate a single intrinsic reward to be added to the scalar cumulative return for policy update . The considered multi-model fusion structure is shown in Fig . 1 . To fuse the K values for a single reward value , one can use one of the known methods such as average , minimum , or maximum . However , there is no guarantee of optimality for such arbitrary choices , and one fixed fusion rule may not be optimal for the entire learning phase . Let a fusion function be denoted as rint = f ( r 1 int , r 2 int , · · · , rKint ) , ( 2 ) where r1int , r 2 int , · · · , rKint are the K input values and rint is the output value . To devise an optimal adaptive fusion rule , we consider the following requirements for the fusion function f . Condition 1 . The fusion function f varies with some control parameter to adapt to the relative importance of the K input values . We require Condition 1 so that the fusion of the K input values can adapt to the learning situation . When the more aggressive fusion is required at some phase of learning , we want the function f to be more like maximum . On the other hand , when the more conservative fusion is required at other learning phases , we want the function f to be more like minimum . Furthermore , we want this optimal adaptation is learned based on data to yield maximum cumulative return . In addition , we impose the following relevant condition for any reasonable fusion function : Condition 2 . The fusion function f is scale-free , i.e. , f ( cr1int , cr 2 int , · · · , crKint ) = cf ( r1int , r2int , · · · , rKint ) . ( 3 ) Condition 2 implies that when we scale all the input values by the same factor c , the output is the c-scaled version of the fusion output of the not-scaled inputs . Condition 2 is a proper requirement for any reasonable averaging function . The necessity of Condition 2 is explained in detail in Appendix G. Such a fusion function can be found based on the α-mean of positive measures in the field of information geometry ( Amari , 2016 ) . For any K positive1 values x1 , · · · , xK > 0 , the α-mean of x1 , · · · , xK is defined as fα ( x1 , · · · , xK ) = h−1 ( 1 K K∑ i=1 h ( xi ) ) ( 4 ) where h ( x ) is given by the α-embedding transformation : h ( x ) = { x 1−α 2 , if α 6= 1 log x , if α = 1 . ( 5 ) It is proven that the unique class of transformation h satisfying Condition 2 under the twicedifferentiability and the strict monotonicity of h is given by the α-embedding ( 5 ) ( Amari , 2007 ; 2016 ) . Basically , Condition 2 is used to write fα ( cx1 , · · · , cxK ) = h−1 ( 1 K ∑K i=1 h ( cxi ) ) = cfα ( x1 , · · · , xK ) . Taking h ( · ) on both sides yields h ( cfα ( x1 , · · · , xK ) ) = 1K ∑K i=1 h ( cxi ) . Then , taking partial derivative with respect to xi ( 1 ≤ i ≤ K ) on both sides , we can show that the equation ( 5 ) is the unique class of mapping functions ( Amari , 2007 ; 2016 ) . Furthermore , by varying α , the α-mean includes all numeric fusions with the scale-free property such as minimum , maximum , and conventional mean functions ( Amari , 2016 ) . When α = −∞ , fα ( x1 , · · · , xK ) = maxi xi . On the other hand , when α = ∞ , fα ( x1 , · · · , xK ) = mini xi . As α increases from −∞ to∞ , the α-mean output varies monotonically from maximum to minimum . See Appendix B . Hence , we can perform aggressive fusion to conservative fusion by controlling the parameter α . 3.3.1 LEARNING OF α WITH META-GRADIENT OPTIMIZATION In the proposed adaptive fusion , we need to adaptively control α judiciously to maximize the expected cumulative extrinsic return η ( π ) . To learn optimal α maximizing η ( π ) , we use the meta gradient method ( Xu et al. , 2018 ; Zheng et al. , 2018 ) . Optimal α at each stage of learning is learned with the proposed method , and it will be shown that optimal α varies according to the stage of learning . For policy πθ with policy parameter θ , let us define the following quantities . • η ( πθ ) = Eτ∼πθ [ ∞∑ t=0 γtr ( st , at , st+1 ) ] : the expected cumulative sum of extrinsic rewards which we want to maximize . Here , τ is a sample trajectory . • ηtotal ( πθ ) = Eτ∼πθ [ ∞∑ t=0 γt ( r ( st , at , st+1 ) + cfα ( st , at , st+1 ) ) ] : the expected cumulative sum of both extrinsic and intrinsic rewards with which the policy πθ is updated . Here , the dependence of the fusion output fα on ( st , at , st+1 ) through r j t , int ( st , at , st+1 ) is shown with notation simplification . Then , for a given trajectory τ = ( s0 , a0 , s1 , a1 , . . . ) generated by πθ , we update θ towards the direction of maximizing ηtotal ( πθ ) : θ̃ = θ + δθ∇θηtotal ( πθ ) ( 6 ) where δθ is the learning rate for θ . Then , the fusion parameter α is updated to maximize the expected cumulated sum of extrinsic rewards for the updated policy πθ̃ : α̃ = α+ δα∇αη ( πθ̃ ) ( 7 ) 1When an input value to the α-mean is negative due to divergence approximation in some cases , we can use exponentiation at the input stage and its inverse logarithm at the output stage . We used the exponentiation exp ( −x ) at the input stage with input x and the negative logarithm of the α-mean as its inverse at the output stage for actual implementation . In this case , due to the monotone decreasing property of the input mapping : x→ exp ( −x ) , the output is the maximum when α =∞ and is the minimum when α = −∞ . where δα is the learning rate for α . Note that we update the policy parameter θ to maximize ηtotal ( πθ ) so that the updated policy parameter θ̃ is a function of α . Therefore , ∇αη ( πθ̃ ) is not zero and can be computed by chain rule : ∇αη ( πθ̃ ) = ∇θ̃η ( πθ̃ ) ∇αθ̃ ( 8 ) To learn optimal α together with θ , we adopt an alternating optimization method widely used in meta-parameter optimization . That is , we iterate the following two steps in an alternating manner : 1 ) Update the policy parameter θ to maximize ηtotal ( πθ ) . 2 ) Update the fusion parameter α to maximize η ( πθ̃ ) , where θ̃ is the updated policy parameter from Step 1 ) . In this way , we can learn proper α adaptively over timesteps to maximize the performance .
In this paper, the authors explore a model based intrinsic reward generation mechanism, in environment settings where the reward assignment is sparse. The authors used an ensemble of models, and computed the alpha-mean value of their KL divergences with respect to the "true transitions". The alpha-mean serves as the intrinsic reward, with the parameter alpha being co-optimized during the training. The authors demonstrated that their proposed approach yields top performance in six augmented MuJuCo continuous control tasks.
SP:bd65ec9b7d991a0c23b882bb137653f2f2f94c71
MULTI-SPAN QUESTION ANSWERING USING SPAN-IMAGE NETWORK
1 INTRODUCTION . Answering questions posted as text to search engines or spoken to virtual assistants like Alexa has become a key feature in information retrieval systems . Publicly available reading comprehension datasets including WikiQA ( Yang et al. , 2015 ) , TriviaQA ( Joshi et al. , 2017 ) , NewsQA ( Trischler et al. , 2016 ) , and SQuAD ( Rajpurkar et al. , 2016 ) have fostered research in QA models . SQuAD is one of the most widely-used reading comprehension benchmarks that has an active leaderboard with many participants . Even though there are models that beat human-level accuracy in SQuAD , these QA systems can do well by learning only context and type-matching heuristics ( Weissenborn et al. , 2017 ) but may still be far from true language understanding since they do not offer robustness to adversarial sentences ( Jia & Liang , 2017 ) . To better measure performance , SQuAD v2.0 Rajpurkar et al . ( 2018 ) extends v1.1 by allowing questions that have no explicit answers in a given paragraph . QA can be modeled as a task to predict the span ( i.e. , start and end indices ) of an answer given a question and an input paragraph . To find the answer span , language representation models such as BERT can be used to associate a question with a given paragraph Devlin et al . ( 2019 ) . BERT is pre-trained on unsupervised tasks using large corpora . Its input representation permits a pair , which is well suited for having a question and a passage as input . By fine-tuning BERT on SQuAD , a QA model can be obtained . Questions without an answer are treated as having a span that begins and ends with the special BERT token : [ CLS ] . In this way , a BERT-based QA model can offer an actual answer or ‘ no-answer ” to all questions in SQuAD v1.1 and v2.0 datasets . Prior work on QA assumes presence of a single answer or lack of any answer Seo et al . ( 2016 ) , Devlin et al . ( 2019 ) . Furthermore , they assume a separable probability distribution function ( pdf ) for start and end indices of an answer span , which leads to a separable loss function . This approach has two major disadvantages : 1 ) It prevents the QA model from predicting multiple spans without postprocessing . 2 ) Since a separable pdf is used , the QA model can not learn to evaluate compatibility of start and end indices , thus suffering from performance degradation . Pang et al . ( 2019 ) consider a hierarchical answer span by sorting the product of start and end probabilities to support multiple spans . However , they still assume a separable pdf for start and end indices . To the best of our knowledge , a multi-span QA architecture has not been proposed . We introduce Span-Image architecture to enable multi-span answers ( or multiple answers ) given a question and a paragraph . Each pixel ( i , j ) in the span-image corresponds to a span starting at ith position and ending at jth . Typical image processing networks like 2D convolutional network layers are used . Span-Image architecture enables the model to couple start and end indices to check for their compatibility . Constraints such as “ the end index has to be bigger than the start index ” , can be automatically embedded into the model . Moreover , other span characteristics such as “ shorter answers are more likely to occur ” ( see Figure 1 ) , can be learned by the model , thus eliminating the need for post-processing or regularization . Our contributions are summarized as below : • We present Span-Image architecture , a novel method that enables multi-span answer prediction . • Specially designed image channels in the proposed architecture can help the QA model capture span-characteristics and eliminate the need for post-processing . • Span-Image network is modular and can be added to most DNN-based QA models without requiring changes to the previous layers . 2 MULTI-SPAN PREDICTION . In this section we first highlight BERT QA architecture , and present our span-image architecture that consumes BERT outputs . 2.1 BERT QA ARCHITECTURE . The QA task in BERT uses a separable pdf : p ( sS , sE ) = p ( sS ) × p ( sE ) where sS and sE denotes one-hot variables of length N for start and end indices for a paragraph of length N , respectively . Therefore , BERT QA architecture assumes start and end index probabilities to be independent from each other . Given predicted probabilities pBERT ( sS ) and pBERT ( sE ) as outputs of BERT , a question q of length M and a passage g of length N , the QA loss fuction for fine-tuning BERT is then given by Loss ( q , p , tS , tE ) = H ( tS , pBERT ( s S ) ) +H ( tE , pBERT ( s E ) ) , ( 1 ) where H is the cross-entropy function , and t is target span with start and end indices tS and tE , respectively . BERT has two separate outputs for start and end indices , which makes it impossible for the model to check for compatibility of sS and sE1 or utilize information such as span length ( i.e. , sE − sS ) in its predictions . Figure 2 shows BERT QA architecture . 1One can claim attention heads in the transformer network will correlate tokens but this does not happen explicitly as in our architecture , where probability for each possible span is computed jointly . 2.2 SPAN-IMAGE NETWORK . Span-image network does not dictate a separable pdf for start and end indices , hence p ( sS , sE ) 6= p ( sS ) × p ( sE ) . Given a question q and paragraph g , BERT outputs D dimensional vector sequence BERT ( q , g ) of length M +N + 2 ( see Figure 2 ) . Let ’ s denote the last N vectors in the sequence , which corresponds to paragraph g , with BERT g ( q , g ) . Using two affine transformations denoted by WS and WE , each of which has D units , we create 2 vector sequences WS ( BERT g ( q , g ) ) and WE ( BERT g ( q , g ) ) of length N . A pixel at location ( i , j ) has D channels and is given by span imi , j =W S ( BERT g ( q , g ) ) i ◦WE ( BERT g ( q , g ) ) j , ( 2 ) where ◦ denotes element-wise multiplication of D-dimensional vectors in ith and jth locations of WS ( BERT g ( q , g ) ) and WE ( BERT g ( q , g ) ) , respectively . Hence , span-image span im shown in Figure 3 , is a 3-dimensional tensor of depth D and of height and width N . This enables us to borrow techniques such as 2-dimensional convolutional filtering , max-pooling , and ReLU from convolutional neural network ( CNN ) architectures for image classification . The output of the spanimage network is an N × N logit-image , logit im , with a single channel ( i.e. , a logit for each possible pixel/span ) . Each channel in span im is a matrix of rank 1 . Therefore , each channel is separable and has limited potential beyond the separable approach described in Section 2.1 . However , applying twodimensional convolutional layers improves performance and makes logit im non-separable , thus eliminating the independence assumption on start and end indices . The probability of each span can be computed by applying sigmoid function on each pixel or softmax in logit im . Using sigmoid makes no assumption on number of spans , while using softmax assumes a single span in every paragraph . The best function to use depends on the QA dataset . For example , in our experiments , using softmax gave us best results for fine-tuning BERT on SQuAD while sigmoid performed better on our internal multi-span datasets . Denoting p ( sS = i , jsE = j ) by pi , j for simplicity , span probabilities for single-span and multi-span datasets can be computed by psigmoidi , j = sigmoid ( logit imi , j ) , if training datasets can have multi-span answers psoftmaxi , j = softmax ( logit im ) i , j , if training datasets only have single-span answers ( 3 ) Target image , target im , is a binary image with zeros at every pixel except those corresponding to target spans . ( i.e. , target im ( i , j ) = 1 for any target span in g with start index i and end index j ) . Given logit im and target im , the loss function using sigmoid is given below Loss ( q , p , target im ) = ∑ i , j H ( target imi , j , p sigmoid i , j ) /N2 , ( 4 ) where H is the cross-entropy function . The loss function for softmax is given by Loss ( q , p , target im ) = H ( target im , psoftmax ) . ( 5 ) Note that target im and psoftmax are joint pdfs on sS and sE , while psigmoidi , j is a pdf for binary variable indicating if ( i , j ) is an answer span or not . 2.2.1 INCORPORATING SPAN CHARACTERISTICS . Typical post-processing on BERT QA output involves checking for valid spans and sorting them with the multiplication of start/end index probabilities . As shown in Figure 1 , a priori information about the span length distribution can be used to break ties or prefer between spans that have close probabilities . In BERT QA , this can only be achieved by implementing a post-processing technique that penalizes spans based on their lengths . Our span-image architecture , however , has an inherent capability to learn and incorporate such patterns . We simply create a new channel span ch , and our model learns how to utilize this channel to capture span-characteristics during training . span ch = { −1 if i < j j − i if j ≥ i , j − i < ς ς if j − i > ς . ( 6 ) span ch is concatenated to span im increasing its depth to D + 1 . 3 EXPERIMENTS . 3.1 IMPLEMENTATION DETAILS . In multi-span QA tasks , we compare the standard BERT-QA model by Devlin et al . ( 2019 ) , which has a separate output layer for start and end index prediction , against the following variants of the span-image architecture , which is described in Section 2.2 : • bert-qa : The BERT base model that is available from Transformers ( Wolf et al. , 2019 ) library as bert-base-uncased . • bert-ms-sigmoid : Consists of the BERT base model augmented by the span-image network , which involves two 2D convolution layers with 100 and 50 filters , respectively . Both layers use 3x3 filters . The output layer has sigmoid activation on span-image pixels to enable multiple span predictions . • base-ms-softmax : Replaces the sigmoid activation of the bert-ms-sigmoid with softmax activation . Softmax serves as a useful regularization when task dictates one answer ( noanswer counts as a “ null ” answer ) . • bert-ms-sigmoid-sl : bert-ms-sigmoid model with a span-length indicator channel concatenated to the span-image . • bert-ms-softmax-sl : bert-ms-softmax model with a span-length indicator channel concatenated to the span-image .
The paper proposes a novel method for predicting multiple answer spans in question-answering (QA) tasks. When the Span-Image technique is applied to a base BERT model, the authors show performance gains on a single-span dataset (SQuAD) and substantial improvements on a multi-span dataset (an internal Amazon dataset). The authors propose that the method is both model-agnostic and can eliminate common post-processing steps via built-in architecture design choices.
SP:23d329d9d5208e429f714761d33eb48498700153
MULTI-SPAN QUESTION ANSWERING USING SPAN-IMAGE NETWORK
1 INTRODUCTION . Answering questions posted as text to search engines or spoken to virtual assistants like Alexa has become a key feature in information retrieval systems . Publicly available reading comprehension datasets including WikiQA ( Yang et al. , 2015 ) , TriviaQA ( Joshi et al. , 2017 ) , NewsQA ( Trischler et al. , 2016 ) , and SQuAD ( Rajpurkar et al. , 2016 ) have fostered research in QA models . SQuAD is one of the most widely-used reading comprehension benchmarks that has an active leaderboard with many participants . Even though there are models that beat human-level accuracy in SQuAD , these QA systems can do well by learning only context and type-matching heuristics ( Weissenborn et al. , 2017 ) but may still be far from true language understanding since they do not offer robustness to adversarial sentences ( Jia & Liang , 2017 ) . To better measure performance , SQuAD v2.0 Rajpurkar et al . ( 2018 ) extends v1.1 by allowing questions that have no explicit answers in a given paragraph . QA can be modeled as a task to predict the span ( i.e. , start and end indices ) of an answer given a question and an input paragraph . To find the answer span , language representation models such as BERT can be used to associate a question with a given paragraph Devlin et al . ( 2019 ) . BERT is pre-trained on unsupervised tasks using large corpora . Its input representation permits a pair , which is well suited for having a question and a passage as input . By fine-tuning BERT on SQuAD , a QA model can be obtained . Questions without an answer are treated as having a span that begins and ends with the special BERT token : [ CLS ] . In this way , a BERT-based QA model can offer an actual answer or ‘ no-answer ” to all questions in SQuAD v1.1 and v2.0 datasets . Prior work on QA assumes presence of a single answer or lack of any answer Seo et al . ( 2016 ) , Devlin et al . ( 2019 ) . Furthermore , they assume a separable probability distribution function ( pdf ) for start and end indices of an answer span , which leads to a separable loss function . This approach has two major disadvantages : 1 ) It prevents the QA model from predicting multiple spans without postprocessing . 2 ) Since a separable pdf is used , the QA model can not learn to evaluate compatibility of start and end indices , thus suffering from performance degradation . Pang et al . ( 2019 ) consider a hierarchical answer span by sorting the product of start and end probabilities to support multiple spans . However , they still assume a separable pdf for start and end indices . To the best of our knowledge , a multi-span QA architecture has not been proposed . We introduce Span-Image architecture to enable multi-span answers ( or multiple answers ) given a question and a paragraph . Each pixel ( i , j ) in the span-image corresponds to a span starting at ith position and ending at jth . Typical image processing networks like 2D convolutional network layers are used . Span-Image architecture enables the model to couple start and end indices to check for their compatibility . Constraints such as “ the end index has to be bigger than the start index ” , can be automatically embedded into the model . Moreover , other span characteristics such as “ shorter answers are more likely to occur ” ( see Figure 1 ) , can be learned by the model , thus eliminating the need for post-processing or regularization . Our contributions are summarized as below : • We present Span-Image architecture , a novel method that enables multi-span answer prediction . • Specially designed image channels in the proposed architecture can help the QA model capture span-characteristics and eliminate the need for post-processing . • Span-Image network is modular and can be added to most DNN-based QA models without requiring changes to the previous layers . 2 MULTI-SPAN PREDICTION . In this section we first highlight BERT QA architecture , and present our span-image architecture that consumes BERT outputs . 2.1 BERT QA ARCHITECTURE . The QA task in BERT uses a separable pdf : p ( sS , sE ) = p ( sS ) × p ( sE ) where sS and sE denotes one-hot variables of length N for start and end indices for a paragraph of length N , respectively . Therefore , BERT QA architecture assumes start and end index probabilities to be independent from each other . Given predicted probabilities pBERT ( sS ) and pBERT ( sE ) as outputs of BERT , a question q of length M and a passage g of length N , the QA loss fuction for fine-tuning BERT is then given by Loss ( q , p , tS , tE ) = H ( tS , pBERT ( s S ) ) +H ( tE , pBERT ( s E ) ) , ( 1 ) where H is the cross-entropy function , and t is target span with start and end indices tS and tE , respectively . BERT has two separate outputs for start and end indices , which makes it impossible for the model to check for compatibility of sS and sE1 or utilize information such as span length ( i.e. , sE − sS ) in its predictions . Figure 2 shows BERT QA architecture . 1One can claim attention heads in the transformer network will correlate tokens but this does not happen explicitly as in our architecture , where probability for each possible span is computed jointly . 2.2 SPAN-IMAGE NETWORK . Span-image network does not dictate a separable pdf for start and end indices , hence p ( sS , sE ) 6= p ( sS ) × p ( sE ) . Given a question q and paragraph g , BERT outputs D dimensional vector sequence BERT ( q , g ) of length M +N + 2 ( see Figure 2 ) . Let ’ s denote the last N vectors in the sequence , which corresponds to paragraph g , with BERT g ( q , g ) . Using two affine transformations denoted by WS and WE , each of which has D units , we create 2 vector sequences WS ( BERT g ( q , g ) ) and WE ( BERT g ( q , g ) ) of length N . A pixel at location ( i , j ) has D channels and is given by span imi , j =W S ( BERT g ( q , g ) ) i ◦WE ( BERT g ( q , g ) ) j , ( 2 ) where ◦ denotes element-wise multiplication of D-dimensional vectors in ith and jth locations of WS ( BERT g ( q , g ) ) and WE ( BERT g ( q , g ) ) , respectively . Hence , span-image span im shown in Figure 3 , is a 3-dimensional tensor of depth D and of height and width N . This enables us to borrow techniques such as 2-dimensional convolutional filtering , max-pooling , and ReLU from convolutional neural network ( CNN ) architectures for image classification . The output of the spanimage network is an N × N logit-image , logit im , with a single channel ( i.e. , a logit for each possible pixel/span ) . Each channel in span im is a matrix of rank 1 . Therefore , each channel is separable and has limited potential beyond the separable approach described in Section 2.1 . However , applying twodimensional convolutional layers improves performance and makes logit im non-separable , thus eliminating the independence assumption on start and end indices . The probability of each span can be computed by applying sigmoid function on each pixel or softmax in logit im . Using sigmoid makes no assumption on number of spans , while using softmax assumes a single span in every paragraph . The best function to use depends on the QA dataset . For example , in our experiments , using softmax gave us best results for fine-tuning BERT on SQuAD while sigmoid performed better on our internal multi-span datasets . Denoting p ( sS = i , jsE = j ) by pi , j for simplicity , span probabilities for single-span and multi-span datasets can be computed by psigmoidi , j = sigmoid ( logit imi , j ) , if training datasets can have multi-span answers psoftmaxi , j = softmax ( logit im ) i , j , if training datasets only have single-span answers ( 3 ) Target image , target im , is a binary image with zeros at every pixel except those corresponding to target spans . ( i.e. , target im ( i , j ) = 1 for any target span in g with start index i and end index j ) . Given logit im and target im , the loss function using sigmoid is given below Loss ( q , p , target im ) = ∑ i , j H ( target imi , j , p sigmoid i , j ) /N2 , ( 4 ) where H is the cross-entropy function . The loss function for softmax is given by Loss ( q , p , target im ) = H ( target im , psoftmax ) . ( 5 ) Note that target im and psoftmax are joint pdfs on sS and sE , while psigmoidi , j is a pdf for binary variable indicating if ( i , j ) is an answer span or not . 2.2.1 INCORPORATING SPAN CHARACTERISTICS . Typical post-processing on BERT QA output involves checking for valid spans and sorting them with the multiplication of start/end index probabilities . As shown in Figure 1 , a priori information about the span length distribution can be used to break ties or prefer between spans that have close probabilities . In BERT QA , this can only be achieved by implementing a post-processing technique that penalizes spans based on their lengths . Our span-image architecture , however , has an inherent capability to learn and incorporate such patterns . We simply create a new channel span ch , and our model learns how to utilize this channel to capture span-characteristics during training . span ch = { −1 if i < j j − i if j ≥ i , j − i < ς ς if j − i > ς . ( 6 ) span ch is concatenated to span im increasing its depth to D + 1 . 3 EXPERIMENTS . 3.1 IMPLEMENTATION DETAILS . In multi-span QA tasks , we compare the standard BERT-QA model by Devlin et al . ( 2019 ) , which has a separate output layer for start and end index prediction , against the following variants of the span-image architecture , which is described in Section 2.2 : • bert-qa : The BERT base model that is available from Transformers ( Wolf et al. , 2019 ) library as bert-base-uncased . • bert-ms-sigmoid : Consists of the BERT base model augmented by the span-image network , which involves two 2D convolution layers with 100 and 50 filters , respectively . Both layers use 3x3 filters . The output layer has sigmoid activation on span-image pixels to enable multiple span predictions . • base-ms-softmax : Replaces the sigmoid activation of the bert-ms-sigmoid with softmax activation . Softmax serves as a useful regularization when task dictates one answer ( noanswer counts as a “ null ” answer ) . • bert-ms-sigmoid-sl : bert-ms-sigmoid model with a span-length indicator channel concatenated to the span-image . • bert-ms-softmax-sl : bert-ms-softmax model with a span-length indicator channel concatenated to the span-image .
This paper introduces a new QA model based on BERT, which is called Span-Image Network. The paper first points out that previous span extraction models model independent probability of the start and the end of the span, making the extension to multi-span extraction harder. Span-Image Network model the joint probability of the start and the end by deploying a 2-D convolution, enabling multi-span extraction.
SP:23d329d9d5208e429f714761d33eb48498700153
Random Network Distillation as a Diversity Metric for Both Image and Text Generation
Generative models are increasingly able to produce remarkably high quality images and text . The community has developed numerous evaluation metrics for comparing generative models . However , these metrics do not effectively quantify data diversity . We develop a new diversity metric that can readily be applied to data , both synthetic and natural , of any type . Our method employs random network distillation , a technique introduced in reinforcement learning . We validate and deploy this metric on both images and text . We further explore diversity in few-shot image generation , a setting which was previously difficult to evaluate . 1 INTRODUCTION . State-of-the-art generative adversarial networks ( GANs ) are able to synthesize such high quality images that humans may have a difficult time distinguishing them from natural images ( Brock et al. , 2018 ; Karras et al. , 2019 ) . Not only can GANs produce pretty pictures , but they are also useful for applied tasks from projecting noisy images onto the natural image manifold to generating training data ( Samangouei et al. , 2018 ; Sixt et al. , 2018 ; Bowles et al. , 2018 ) . Similarly , massive transformer models are capable of performing question-answering and translation ( Brown et al. , 2020 ) . In order for GANs and text generators to be valuable , they must generate diverse data rather than memorizing a small number of samples . Diverse data should contain a wide variety of semantic content , and its distribution should not concentrate around a small subset of modes from the true image distribution . A number of metrics have emerged for evaluating GAN-generated images and synthetic text . However , these metrics do not effectively quantify data diversity , and they work on a small number of specific benchmark tasks ( Salimans et al. , 2016 ; Heusel et al. , 2017 ) . Diversity metrics for synthetic text use only rudimentary tools and only measure similarity of phrases and vocabulary rather than semantic meaning ( Zhu et al. , 2018 ) . Our novel contributions can be summarized as follows : • We design a framework ( RND ) for comparing diversity of datasets using random network distillation . Our framework can be applied to any type of data , from images to text and beyond . RND does not suffer from common problems that have plagued evaluation of generative models , such as vulnerability to memorization , and it can even be used to evaluate the diversity of natural data ( not synthetic ) since it does not require a reference dataset . • We validate the effectiveness of our method in a controlled setting by synthetically manipulating the diversity of GAN-generated images . We use the same truncation strategy employed by BigGAN to increase FID scores , and we confirm that this strategy indeed decreases diversity . This observation calls into question the usefulness of such popular metrics as FID scores for measuring diversity . • We benchmark data , both synthetic and natural , using our random distillation method . In addition to evaluating the most popular ImageNet-trained generative models and popular language models , we evaluate GANs in the data scarce regime , i.e . single-image GANs , which were previously difficult to evaluate . We also evaluate the diversity of natural data . 2 DESIGNING A GOOD DIVERSITY METRIC . Formally defining “ diversity ” is a difficult problem ; human perception is hard to understand and does not match standard mathematical norms . Thus , we first define desiderata for a useful diversity metric , and we explore the existing literature on evaluation of generative models . 2.1 WHAT DO WE WANT FROM A DIVERSITY METRIC ? . Diversity should increase as the data distribution ’ s support includes more data . For example , the distribution of images containing brown dogs should be considered less diverse than the distribution of images containing brown , black , or white dogs . While this property might seem to be a good stand-alone definition of diversity , we have not yet specified what types of additional data should increase diversity measurements . Diversity should reflect signal rather than noise . If a metric is to agree with human perception of diversity , it must not be highly sensitive to noise . Humans looking at static on their television screen do not recognize that this noise is different than the last time they saw static on their screen , yet these two static noises are likely far apart with respect to lp metrics . The need to measure semantic signal rather than noise precludes using entropy-based measurements in image space without an effective perceptual similarity metric . Similarly , diversity metrics for text that rely on counting unique tokens may be sensitive to randomly exchanging words with their synonyms , or even random word swaps , without increasing the diversity of semantic content . Quality 6= diversity . While some GANs can consistently produce realistic images , we do not want to assign their images a high diversity measurement if they produce very little variety . In contrast , other GANs may produce a large variety of unrealistic images and should receive high diversity marks . The quality and diversity of data are not the same , and we want a measurement that disentangles the two . Metrics should be agnostic to training data . Recent single-image GANs and few-shot GANs are able to generate many distinct images from very few training images ( sometimes just one ) ( Shaham et al. , 2019b ; Clouâtre & Demers , 2019 ) . Thus , a good metric should be capable of producing diversity scores for synthetic data that are higher than those of the training set . Likewise , simply memorizing the training data should not allow a generative model to achieve a maximal diversity score . Moreover , two companies may deploy face-generating models trained on two disjoint proprietary datasets , and we should still be able to compare the diversity of faces generated by these models without having training set access . An ideal diversity metric would allow one to collect data and measure its diversity outside of the setting of generative models . Diversity should be measureable on many kinds of data . Measurements based on hand-crafted perceptual similarity metrics or high-performance neural networks trained carefully on large datasets can only be used for the single type of data for which they are designed . We develop a diversity concept that is adaptable to various domain , including both images and text . 2.2 EXISTING METRICS . We now review existing metrics for generative models to check if any already satisfy the above criteria . We focus on the most popular metrics before briefly discussing additional examples . Inception Score ( IS ) ( Salimans et al. , 2016 ) . The Inception Score is a popular metric that rewards having high confidence class labels for each generated example , according to an ImageNet trained InceptionV3 network , while also producing a diversity of softmax outputs across the overall set of generated images ( Deng et al. , 2009 ; Szegedy et al. , 2016 ) . While this metric does encourage generated data to be class-balanced and is not fooled by noise , IS suffers from several disqualifying problems when considered as a measure of diversity . First , it does not significantly reward diversity within classes ; a generative model that memorizes one image from each class in ImageNet may achieve a very strong score . Second , IS often fails when used on classes not in ImageNet and is not adaptable to settings outside of natural image classification ( Barratt & Sharma , 2018 ) . Finally , IS does not disentangle diversity from quality . The Inception Score can provide a general evaluation of GANs trained on ImageNet , but it has limited utility in other settings . Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) . The FID score measures the Fréchet distance between a Gaussian distribution fit to InceptionV3 features on generated data and a Gaussian distribution fit to features on ground-truth data , for example natural images on which the generative model was trained . Unlike IS , FID scores compare generated data to real data , and they do not explicitly rely on ImageNet classes . Thus , FID more effectively discourages a generator from memorizing one image per class . However , FID assumes that the training data is “ sufficient ” and does not reward producing more diversity than the training data . A second problem with FID is that it relies on either ( 1 ) ImageNet models being useful for the problem at hand or ( 2 ) the ability to acquire a reference dataset and train a high-performance model on the problem . Like IS , FID does not disentangle diversity from quality and suffers from similar problems . Several additional metrics have attempted to address these problems . For example , precision and recall have been suggested to tease apart different aspects of a generative model ’ s performance ( Sajjadi et al. , 2018 ; Kynkäänniemi et al. , 2019 ) . However , these metrics ( as used to measure diversity ) , along with other earlier metrics all aim to estimate the likelihood of real data under the generated distribution , and thus , require access to a reference ground-truth dataset . This makes these metrics are inflexible , and these metrics achieve optimal values when a generator simply memorizes the reference dataset . Other examples of metrics include the Modified Inception Score ( m-IS ) uses a crossentropy term to resolve the fact that IS rewards models for memorizing one image per ImageNet class ( Gurumurthy et al. , 2017 ) . However , m-IS is still beholden to the InceptionV3 label space and still prevents a user from discerning diversity from quality . Boundary distortion is a method for detecting covariate shift in GAN distributions by comparing how well classifiers trained on synthetic data perform on ground-truth data ( Santurkar et al. , 2018 ) . This measurement indicates similarity to the true data distribution rather than purely measuring diversity , and it ignores the possibility of models generating even more diverse data than the data on which they are trained . Additionally , this method assumes the user has a large ground-truth dataset . Recently , classification accuracy score ( CAS ) was introduced to measure the performance of generative models by training classifiers on synthetic data produced by the generative models and evaluating the performance of the classifier ( Ravuri & Vinyals , 2019 ) . Similar to the boundary distortion method , this measurement focuses its comparison on the likeness of the synthetic data distribution to the ground-truth distribution and is dependent upon having access to labeled ground-truth data . In natural language processing , several metrics exist for evaluating text generation for dialogue , conversational AI systems , and machine translation . Papineni et al . ( 2002 ) introduced the now widely used Bilingual Evaluation Understudy ( BLEU ) score as a metric for evaluating the quality of machine translated text . BLEU uses a modified form of precision to compare a candidate translation against multiple reference translations , where diversity ideally can be evaluated by including all plausible translations as references when computing the score . However , this requires massive annotation cost , and it remains difficult to capture all viable translations for a given sentence . Li et al . ( 2015 ) and Xu et al . ( 2018 ) propose counting the number of unique n-grams as a measure for evaluating the diversity of text generation tasks in conversational models , however , this metric does not account for the semantic meaning of different tokens and fails to capture paraphrases of semantically similar text . Montahaei et al . ( 2019 ) propose a joint metric for assessing both quality and diversity for text generation systems by approximating the distance of the learned generative model and the real data distribution . This metric couples both diversity and quality in a single metric . Zhu et al . ( 2018 ) introduce Self-BLEU to evaluate sentence variety . Self-BLEU measures BLEU score for each generated sentence by considering other generations as references . By averaging these BLEU scores , a metric called Self-BLEU is computed where lower values indicate more diversity . However , Self-BLEU remains very sensitive to local syntax , and it fails to capture global consistency and diverse semantic information in generated text . Many other metrics exist for generative models which do not approach the problem of diversity . Our work is not the first to recognize this gap in the literature ( Borji , 2019 ) .
In this paper, the authors introduce a new quantitative diversity measure advocating its usage for generative models evaluation. In a nutshell, to measure the diversity of a particular set, the authors split it into disjoint train/val subsets and learn a DNN to predict the outputs of another randomly initialized DNN on the train set. Then the generalization gap of the trained DNN is computed on the unseen val subset, and the normalized value of this gap (averaged over several splits/initializations) is considered as a diversity measure.
SP:feabfeef5c1282d0b8de3d98611588b698013baf
Random Network Distillation as a Diversity Metric for Both Image and Text Generation
Generative models are increasingly able to produce remarkably high quality images and text . The community has developed numerous evaluation metrics for comparing generative models . However , these metrics do not effectively quantify data diversity . We develop a new diversity metric that can readily be applied to data , both synthetic and natural , of any type . Our method employs random network distillation , a technique introduced in reinforcement learning . We validate and deploy this metric on both images and text . We further explore diversity in few-shot image generation , a setting which was previously difficult to evaluate . 1 INTRODUCTION . State-of-the-art generative adversarial networks ( GANs ) are able to synthesize such high quality images that humans may have a difficult time distinguishing them from natural images ( Brock et al. , 2018 ; Karras et al. , 2019 ) . Not only can GANs produce pretty pictures , but they are also useful for applied tasks from projecting noisy images onto the natural image manifold to generating training data ( Samangouei et al. , 2018 ; Sixt et al. , 2018 ; Bowles et al. , 2018 ) . Similarly , massive transformer models are capable of performing question-answering and translation ( Brown et al. , 2020 ) . In order for GANs and text generators to be valuable , they must generate diverse data rather than memorizing a small number of samples . Diverse data should contain a wide variety of semantic content , and its distribution should not concentrate around a small subset of modes from the true image distribution . A number of metrics have emerged for evaluating GAN-generated images and synthetic text . However , these metrics do not effectively quantify data diversity , and they work on a small number of specific benchmark tasks ( Salimans et al. , 2016 ; Heusel et al. , 2017 ) . Diversity metrics for synthetic text use only rudimentary tools and only measure similarity of phrases and vocabulary rather than semantic meaning ( Zhu et al. , 2018 ) . Our novel contributions can be summarized as follows : • We design a framework ( RND ) for comparing diversity of datasets using random network distillation . Our framework can be applied to any type of data , from images to text and beyond . RND does not suffer from common problems that have plagued evaluation of generative models , such as vulnerability to memorization , and it can even be used to evaluate the diversity of natural data ( not synthetic ) since it does not require a reference dataset . • We validate the effectiveness of our method in a controlled setting by synthetically manipulating the diversity of GAN-generated images . We use the same truncation strategy employed by BigGAN to increase FID scores , and we confirm that this strategy indeed decreases diversity . This observation calls into question the usefulness of such popular metrics as FID scores for measuring diversity . • We benchmark data , both synthetic and natural , using our random distillation method . In addition to evaluating the most popular ImageNet-trained generative models and popular language models , we evaluate GANs in the data scarce regime , i.e . single-image GANs , which were previously difficult to evaluate . We also evaluate the diversity of natural data . 2 DESIGNING A GOOD DIVERSITY METRIC . Formally defining “ diversity ” is a difficult problem ; human perception is hard to understand and does not match standard mathematical norms . Thus , we first define desiderata for a useful diversity metric , and we explore the existing literature on evaluation of generative models . 2.1 WHAT DO WE WANT FROM A DIVERSITY METRIC ? . Diversity should increase as the data distribution ’ s support includes more data . For example , the distribution of images containing brown dogs should be considered less diverse than the distribution of images containing brown , black , or white dogs . While this property might seem to be a good stand-alone definition of diversity , we have not yet specified what types of additional data should increase diversity measurements . Diversity should reflect signal rather than noise . If a metric is to agree with human perception of diversity , it must not be highly sensitive to noise . Humans looking at static on their television screen do not recognize that this noise is different than the last time they saw static on their screen , yet these two static noises are likely far apart with respect to lp metrics . The need to measure semantic signal rather than noise precludes using entropy-based measurements in image space without an effective perceptual similarity metric . Similarly , diversity metrics for text that rely on counting unique tokens may be sensitive to randomly exchanging words with their synonyms , or even random word swaps , without increasing the diversity of semantic content . Quality 6= diversity . While some GANs can consistently produce realistic images , we do not want to assign their images a high diversity measurement if they produce very little variety . In contrast , other GANs may produce a large variety of unrealistic images and should receive high diversity marks . The quality and diversity of data are not the same , and we want a measurement that disentangles the two . Metrics should be agnostic to training data . Recent single-image GANs and few-shot GANs are able to generate many distinct images from very few training images ( sometimes just one ) ( Shaham et al. , 2019b ; Clouâtre & Demers , 2019 ) . Thus , a good metric should be capable of producing diversity scores for synthetic data that are higher than those of the training set . Likewise , simply memorizing the training data should not allow a generative model to achieve a maximal diversity score . Moreover , two companies may deploy face-generating models trained on two disjoint proprietary datasets , and we should still be able to compare the diversity of faces generated by these models without having training set access . An ideal diversity metric would allow one to collect data and measure its diversity outside of the setting of generative models . Diversity should be measureable on many kinds of data . Measurements based on hand-crafted perceptual similarity metrics or high-performance neural networks trained carefully on large datasets can only be used for the single type of data for which they are designed . We develop a diversity concept that is adaptable to various domain , including both images and text . 2.2 EXISTING METRICS . We now review existing metrics for generative models to check if any already satisfy the above criteria . We focus on the most popular metrics before briefly discussing additional examples . Inception Score ( IS ) ( Salimans et al. , 2016 ) . The Inception Score is a popular metric that rewards having high confidence class labels for each generated example , according to an ImageNet trained InceptionV3 network , while also producing a diversity of softmax outputs across the overall set of generated images ( Deng et al. , 2009 ; Szegedy et al. , 2016 ) . While this metric does encourage generated data to be class-balanced and is not fooled by noise , IS suffers from several disqualifying problems when considered as a measure of diversity . First , it does not significantly reward diversity within classes ; a generative model that memorizes one image from each class in ImageNet may achieve a very strong score . Second , IS often fails when used on classes not in ImageNet and is not adaptable to settings outside of natural image classification ( Barratt & Sharma , 2018 ) . Finally , IS does not disentangle diversity from quality . The Inception Score can provide a general evaluation of GANs trained on ImageNet , but it has limited utility in other settings . Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) . The FID score measures the Fréchet distance between a Gaussian distribution fit to InceptionV3 features on generated data and a Gaussian distribution fit to features on ground-truth data , for example natural images on which the generative model was trained . Unlike IS , FID scores compare generated data to real data , and they do not explicitly rely on ImageNet classes . Thus , FID more effectively discourages a generator from memorizing one image per class . However , FID assumes that the training data is “ sufficient ” and does not reward producing more diversity than the training data . A second problem with FID is that it relies on either ( 1 ) ImageNet models being useful for the problem at hand or ( 2 ) the ability to acquire a reference dataset and train a high-performance model on the problem . Like IS , FID does not disentangle diversity from quality and suffers from similar problems . Several additional metrics have attempted to address these problems . For example , precision and recall have been suggested to tease apart different aspects of a generative model ’ s performance ( Sajjadi et al. , 2018 ; Kynkäänniemi et al. , 2019 ) . However , these metrics ( as used to measure diversity ) , along with other earlier metrics all aim to estimate the likelihood of real data under the generated distribution , and thus , require access to a reference ground-truth dataset . This makes these metrics are inflexible , and these metrics achieve optimal values when a generator simply memorizes the reference dataset . Other examples of metrics include the Modified Inception Score ( m-IS ) uses a crossentropy term to resolve the fact that IS rewards models for memorizing one image per ImageNet class ( Gurumurthy et al. , 2017 ) . However , m-IS is still beholden to the InceptionV3 label space and still prevents a user from discerning diversity from quality . Boundary distortion is a method for detecting covariate shift in GAN distributions by comparing how well classifiers trained on synthetic data perform on ground-truth data ( Santurkar et al. , 2018 ) . This measurement indicates similarity to the true data distribution rather than purely measuring diversity , and it ignores the possibility of models generating even more diverse data than the data on which they are trained . Additionally , this method assumes the user has a large ground-truth dataset . Recently , classification accuracy score ( CAS ) was introduced to measure the performance of generative models by training classifiers on synthetic data produced by the generative models and evaluating the performance of the classifier ( Ravuri & Vinyals , 2019 ) . Similar to the boundary distortion method , this measurement focuses its comparison on the likeness of the synthetic data distribution to the ground-truth distribution and is dependent upon having access to labeled ground-truth data . In natural language processing , several metrics exist for evaluating text generation for dialogue , conversational AI systems , and machine translation . Papineni et al . ( 2002 ) introduced the now widely used Bilingual Evaluation Understudy ( BLEU ) score as a metric for evaluating the quality of machine translated text . BLEU uses a modified form of precision to compare a candidate translation against multiple reference translations , where diversity ideally can be evaluated by including all plausible translations as references when computing the score . However , this requires massive annotation cost , and it remains difficult to capture all viable translations for a given sentence . Li et al . ( 2015 ) and Xu et al . ( 2018 ) propose counting the number of unique n-grams as a measure for evaluating the diversity of text generation tasks in conversational models , however , this metric does not account for the semantic meaning of different tokens and fails to capture paraphrases of semantically similar text . Montahaei et al . ( 2019 ) propose a joint metric for assessing both quality and diversity for text generation systems by approximating the distance of the learned generative model and the real data distribution . This metric couples both diversity and quality in a single metric . Zhu et al . ( 2018 ) introduce Self-BLEU to evaluate sentence variety . Self-BLEU measures BLEU score for each generated sentence by considering other generations as references . By averaging these BLEU scores , a metric called Self-BLEU is computed where lower values indicate more diversity . However , Self-BLEU remains very sensitive to local syntax , and it fails to capture global consistency and diverse semantic information in generated text . Many other metrics exist for generative models which do not approach the problem of diversity . Our work is not the first to recognize this gap in the literature ( Borji , 2019 ) .
This paper applies random network distillation (RND) as a method for quantifying how diverse samples from a generative model are. Samples from the generative model (or any dataset) are used to train a neural network to mimic a randomly initialized network. Intuitively, this is a more difficult task on a more diverse dataset, and so the distillation loss can be interpreted as a measure of diversity. The authors argue that this approach has advantages over other diversity metrics because it can capture semantic diversity and does not require a second reference dataset.
SP:feabfeef5c1282d0b8de3d98611588b698013baf
AWAC: Accelerating Online Reinforcement Learning with Offline Datasets
1 INTRODUCTION . Learning models that generalize effectively to complex open-world settings , from image recognition ( Krizhevsky et al. , 2012 ) to natural language processing ( Devlin et al. , 2019 ) , relies on large , high-capacity models and large , diverse , and representative datasets . Leveraging this recipe for reinforcement learning ( RL ) has the potential to yield real-world generalization for control applications such as robotics . However , while deep RL algorithms enable the use of large models , the use of large datasets for real-world RL has proven challenging . Most RL algorithms collect new data online every time a new policy is learned , which limits the size and diversity of the datasets for RL . In the same way that powerful models in computer vision and NLP are often pre-trained on large , general-purpose datasets and then fine-tuned on task-specific data , RL policies that generalize effectively to open-world settings will need to be able to incorporate large amounts of prior data effectively into the learning process , while still collecting additional data online for the task at hand . For data-driven reinforcement learning , offline datasets consist of trajectories of states , actions and associated rewards . This data can potentially come from demonstrations for the desired task ( Schaal , 1997 ; Atkeson & Schaal , 1997 ) , suboptimal policies ( Gao et al. , 2018 ) , demonstrations for related tasks ( Zhou et al. , 2019 ) , or even just random exploration in the environment . Depending on the quality of the data that is provided , useful knowledge can be extracted about the dynamics of the world , about the task being solved , or both . Effective data-driven methods for deep reinforcement learning should be able to use this data to pre-train offline while improving with online fine-tuning . Since this prior data can come from a variety of sources , we would like to design an algorithm that does not utilize different types of data in any privileged way . For example , prior methods that incorporate demonstrations into RL directly aim to mimic these demonstrations ( Nair et al. , 2018 ) , which is desirable when the demonstrations are known to be optimal , but imposes strict requirements on the type of offline data , and can cause undesirable bias when the prior data is not optimal . While prior methods for fully offline RL provide a mechanism for utilizing offline data ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ) , as we will show in our experiments , such methods generally are not effective for fine-tuning with online data as they are often too conservative . In effect , prior methods require us to choose : Do we assume prior data is optimal or not ? Do we use only offline data , or only online data ? To make it feasible to learn policies for open-world settings , we need algorithms that learn successfully in any of these cases . In this work , we study how to build RL algorithms that are effective for pre-training from offpolicy datasets , but also well suited to continuous improvement with online data collection . We systematically analyze the challenges with using standard off-policy RL algorithms ( Haarnoja et al. , 2018 ; Kumar et al. , 2019 ; Abdolmaleki et al. , 2018 ) for this problem , and introduce a simple actor critic algorithm that elegantly bridges data-driven pre-training from offline data and improvement with online data collection . Our method , which uses dynamic programming to train a critic but a supervised learning style update to train a constrained actor , combines the best of supervised learning and actor-critic algorithms . Dynamic programming can leverage off-policy data and enable sample-efficient learning . The simple supervised actor update implicitly enforces a constraint that mitigates the effects of distribution shift when learning from offline data ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ) , while avoiding overly conservative updates . We evaluate our algorithm on a wide variety of robotic control and benchmark tasks across three simulated domains : dexterous manipulation , tabletop manipulation , and MuJoCo control tasks . Our algorithm , Advantage Weighted Actor Critic ( AWAC ) , is able to quickly learn successful policies on difficult tasks with high action dimension and binary sparse rewards , significantly better than prior methods for off-policy and offline reinforcement learning . Moreover , AWAC can utilize different types of prior data without any algorithmic changes : demonstrations , suboptimal data , or random exploration data . The contribution of this work is not just another RL algorithm , but a systematic study of what makes offline pre-training with online fine-tuning unique compared to the standard RL paradigm , which then directly motivates a simple algorithm , AWAC , to address these challenges . 2 PRELIMINARIES . We consider the standard reinforcement learning notation , with states s , actions a , policy π ( a|s ) , rewards r ( s , a ) , and dynamics p ( s′|s , a ) . The discounted return is defined as Rt = ∑T i=t γ ir ( si , ai ) , for a discount factor γ and horizon T which may be infinite . The objective of an RL agent is to maximize the expected discounted return J ( π ) = Epπ ( τ ) [ R0 ] under the distribution induced by the policy . The optimal policy can be learned directly by policy gradient , estimating ∇J ( π ) ( Williams , 1992 ) , but this is often ineffective due to high variance of the estimator . Many algorithms attempt to reduce this variance by making use of the value function V π ( s ) = Epπ ( τ ) [ Rt|s ] , action-value function Qπ ( s , a ) = Epπ ( τ ) [ Rt|s , a ] , or advantage Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . The action-value function for a policy can be written recursively via the Bellman equation : Qπ ( s , a ) = r ( s , a ) + γEp ( s′|s , a ) [ V π ( s′ ) ] = r ( s , a ) + γEp ( s′|s , a ) [ Eπ ( a′|s′ ) [ Qπ ( s′ , a′ ) ] ] . ( 1 ) Instead of estimating policy gradients directly , actor-critic algorithms maximize returns by alternating between two phases ( Konda & Tsitsiklis , 2000 ) : policy evaluation and policy improvement . During the policy evaluation phase , the critic Qπ ( s , a ) is estimated for the current policy π . This can be accomplished by repeatedly applying the Bellman operator B , corresponding to the right-hand side of Equation 1 , as defined below : BπQ ( s , a ) = r ( s , a ) + γEp ( s′|s , a ) [ Eπ ( a′|s′ ) [ Qπ ( s′ , a′ ) ] ] . ( 2 ) By iterating according to Qk+1 = BπQk , Qk converges to Qπ ( Sutton & Barto , 1998 ) . With function approximation , we can not apply the Bellman operator exactly , and instead minimize the Bellman error with respect to Q-function parameters φk : φk = argmin φ ED [ ( Qφ ( s , a ) − y ) 2 ] , y = r ( s , a ) + γEs′ , a′ [ Qφk−1 ( s′ , a′ ) ] . ( 3 ) During policy improvement , the actor π is typically updated based on the current estimate of Qπ . A commonly used technique ( Lillicrap et al. , 2016 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) is to update the actor πθk ( a|s ) via likelihood ratio or pathwise derivatives to optimize the following objective , such that the expected value of the Q-function Qπ is maximized : θk = argmax θ Es∼D [ Eπθ ( a|s ) [ Qφk ( s , a ) ] ] ( 4 ) Actor-critic algorithms are widely used in deep RL ( Mnih et al. , 2016 ; Lillicrap et al. , 2016 ; Haarnoja et al. , 2018 ; Fujimoto et al. , 2018 ) . With a Q-function estimator , they can in principle utilize off-policy data when used with a replay buffer for storing prior transition tuples , which we will denote β , to sample previous transitions , although we show that this by itself is insufficient for our problem setting . 3 CHALLENGES IN OFFLINE RL WITH ONLINE FINE-TUNING . In this section , we study the unique challenges that exist when pre-training using offline data , followed by fine-tuning with online data collection . We first describe the problem , and then analyze what makes this problem difficult for prior methods . Problem definition . A static dataset of transitions , D = { ( s , a , s′ , r ) j } , is provided to the algorithm at the beginning of training . This dataset can be sampled from an arbitrary policy or mixture of policies , and may even be collected by a human expert . This definition is general and encompasses many scenarios , such as learning from demonstrations , random data , prior RL experiments , or even from multi-task data . Given the dataset D , our goal is to leverage D for pre-training and use some online interaction to learn the optimal policy π∗ ( a|s ) , with as few interactions with the environment as possible ( depicted in Fig 1 ) . This setting is representative of many real-world RL settings , where prior data is available and the aim is to learn new skills efficiently . We first study existing algorithms empirically in this setting on the HalfCheetah-v2 Gym environment1 . The prior dataset consists of 15 demonstrations from an expert policy and 100 suboptimal trajectories sampled from a behavioral clone of these demonstrations . All methods for the remainder of this paper incorporate the prior dataset , unless explicitly labeled “ scratch ” . 3.1 ) Data Efficiency . One of the simplest ways to utilize prior data such as demonstrations for RL is to pre-train a policy with imitation learning , and fine-tune with on-policy RL ( Gupta et al. , 2019 ; Rajeswaran et al. , 2018 ) . This approach has two drawbacks : ( 1 ) prior data may not be optimal ; ( 2 ) on-policy fine-tuning is data inefficient as it does not reuse the prior data in the RL stage . In our setting , data efficiency is vital . To this end , we require algorithms that are able to reuse arbitrary offpolicy data during online RL for data-efficient fine-tuning . We find that algorithms that use on-policy fine-tuning ( Rajeswaran et al. , 2018 ; Gupta et al. , 2019 ) , or Monte-Carlo return estimation ( Peters & Schaal , 2007 ; Wang et al. , 2018 ; Peng et al. , 2019 ) are generally much less efficient than off-policy actor-critic algorithms , which iterate between improving π and estimating Qπ via Bellman backups . This can be seen from the results in Figure 2 plot 1 , where on-policy methods like DAPG ( Rajeswaran et al. , 2018 ) and Monte-Carlo return methods like AWR ( Peng et al. , 2019 ) and MARWIL ( Wang et al. , 2018 ) are an order of magnitude slower than off-policy actor-critic methods . Actor-critic methods , shown in Figure 2 plot 2 , can in principle use off-policy data . However , as we will discuss next , naïvely applying these algorithms to our problem suffers from a different set of challenges . 3.2 ) Bootstrap Error in Offline Learning with Actor-Critic Methods . When standard off-policy actor-critic methods are applied to this problem setting , they perform poorly , as shown in the second plot in Figure 2 : despite having a prior dataset in the replay buffer , these algorithms do not benefit significantly from offline training . We evaluate soft actor critic ( Haarnoja et al. , 2018 ) , a state-of-theart actor-critic algorithm for continuous control . Note that “ SAC-scratch , ” which does not receive the prior data , performs similarly to “ SACfD-prior , ” which does have access to the prior data , indicating that the off-policy RL algorithm is not actually able to make use of the off-policy data for pre-training . Moreover , even if the SAC is policy is pre-trained by behavior cloning , labeled “ SACfD-pretrain ” , we still observe an initial decrease in performance , and performance similar to learning from scratch . This challenge can be attributed to off-policy bootstrapping error accumulation , as observed in several prior works ( Sutton & Barto , 1998 ; Kumar et al. , 2019 ; Wu et al. , 2020 ; Levine et al. , 2020 ; 1We use this environment for analysis because it helps understand and accentuate the differences between different algorithms . More challenging environments like the ones shown in Fig 3 are too hard to solve to analyze variants of different methods . Fujimoto et al. , 2019 ) . In actor-critic algorithms , the target value Q ( s′ , a′ ) , with a′ ∼ π , is used to update Q ( s , a ) . When a′ is outside of the data distribution , Q ( s′ , a′ ) will be inaccurate , leading to accumulation of error on static datasets . Offline RL algorithms ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ; Wu et al. , 2020 ) propose to address this issue by explicitly adding constraints on the policy improvement update ( Equation 4 ) to avoid bootstrapping on out-of-distribution actions , leading to a policy update of this form : argmax θ Es∼D [ Eπθ ( a|s ) [ Qφk ( s , a ) ] ] s.t . D ( πθ , πβ ) ≤ . ( 5 ) Here , πθ is the actor being updated , and πβ ( a|s ) represents the ( potentially unknown ) distribution from which all of the data seen so far ( both offline data and online data ) was generated . In the case of a replay buffer , πβ corresponds to a mixture distribution over all past policies . Typically , πβ is not known , especially for offline data , and must be estimated from the data itself . Many offline RL algorithms ( Kumar et al. , 2019 ; Fujimoto et al. , 2019 ; Siegel et al. , 2020 ) explicitly fit a parametric model to samples for the distribution πβ via maximum likelihood estimation , where samples from πβ are obtained simply by sampling uniformly from the data seen thus far : π̂β = maxπ̂β Es , a∼πβ [ log π̂β ( a|s ) ] . After estimating π̂β , prior methods implement the constraint given in Equation 5 in various ways , including penalties on the policy update ( Kumar et al. , 2019 ; Wu et al. , 2020 ) or architecture choices for sampling actions for policy training ( Fujimoto et al. , 2019 ; Siegel et al. , 2020 ) . As we will see next , the requirement for accurate estimation of π̂β makes these methods difficult to use with online fine-tuning . 3.3 ) Excessively Conservative Online Learning . While offline RL algorithms with constraints ( Kumar et al. , 2019 ; Fujimoto et al. , 2019 ; Wu et al. , 2020 ) perform well offline , they struggle to improve with fine-tuning , as shown in the third plot in Figure 2 . We see that the purely offline RL performance ( at “ 0K ” in Fig . 2 ) is much better than the standard off-policy methods shown in Section 3.2 . However , with additional iterations of online fine-tuning , the performance increases very slowly ( as seen from the slope of the BEAR curve in Fig 2 ) . What causes this phenomenon ? This can be attributed to challenges in fitting an accurate behavior model as data is collected online during fine-tuning . In the offline setting , behavior models must only be trained once via maximum likelihood , but in the online setting , the behavior model must be updated online to track incoming data . Training density models online ( in the “ streaming ” setting ) is a challenging research problem ( Ramapuram et al. , 2017 ) , made more difficult by a potentially complex multi-modal behavior distribution induced by the mixture of online and offline data . To understand this , we plot the log likelihood of learned behavior models on the dataset during online and offline training for the HalfCheetah task . As we can see in the plot , the accuracy of the behavior models ( log πβ on the y-axis ) reduces during online fine-tuning , indicating that it is not fitting the new data well during online training . When the behavior models are inaccurate or unable to model new data well , constrained optimization becomes too conservative , resulting in limited improvement with fine-tuning . This analysis suggests that , in order to address our problem setting , we require an off-policy RL algorithm that constrains the policy to prevent offline instability and error accumulation , but not so conservatively that it prevents online fine-tuning due to imperfect behavior modeling . Our proposed algorithm , which we discuss in the next section , accomplishes this by employing an implicit constraint , which does not require any explicit modeling of the behavior policy .
In this paper, the authors intend to accelerate on-line reinforcement learning with off-line datasets. To achieve this goal, they propose an algorithm called advantage weighted actor-critic (AWAC), which uses an implicit constraint to reduce accumulated bootstrapping error when doing off-line training and reduce the conservation when doing on-line fine-tuning. The experiments show that the proposed method can learn difficult, high-dimensional, sparse reward dexterous manipulation problems from human demonstrations and off-policy data.
SP:7e456aff1e90c9f11b51c22e9ec7132eca76d700
AWAC: Accelerating Online Reinforcement Learning with Offline Datasets
1 INTRODUCTION . Learning models that generalize effectively to complex open-world settings , from image recognition ( Krizhevsky et al. , 2012 ) to natural language processing ( Devlin et al. , 2019 ) , relies on large , high-capacity models and large , diverse , and representative datasets . Leveraging this recipe for reinforcement learning ( RL ) has the potential to yield real-world generalization for control applications such as robotics . However , while deep RL algorithms enable the use of large models , the use of large datasets for real-world RL has proven challenging . Most RL algorithms collect new data online every time a new policy is learned , which limits the size and diversity of the datasets for RL . In the same way that powerful models in computer vision and NLP are often pre-trained on large , general-purpose datasets and then fine-tuned on task-specific data , RL policies that generalize effectively to open-world settings will need to be able to incorporate large amounts of prior data effectively into the learning process , while still collecting additional data online for the task at hand . For data-driven reinforcement learning , offline datasets consist of trajectories of states , actions and associated rewards . This data can potentially come from demonstrations for the desired task ( Schaal , 1997 ; Atkeson & Schaal , 1997 ) , suboptimal policies ( Gao et al. , 2018 ) , demonstrations for related tasks ( Zhou et al. , 2019 ) , or even just random exploration in the environment . Depending on the quality of the data that is provided , useful knowledge can be extracted about the dynamics of the world , about the task being solved , or both . Effective data-driven methods for deep reinforcement learning should be able to use this data to pre-train offline while improving with online fine-tuning . Since this prior data can come from a variety of sources , we would like to design an algorithm that does not utilize different types of data in any privileged way . For example , prior methods that incorporate demonstrations into RL directly aim to mimic these demonstrations ( Nair et al. , 2018 ) , which is desirable when the demonstrations are known to be optimal , but imposes strict requirements on the type of offline data , and can cause undesirable bias when the prior data is not optimal . While prior methods for fully offline RL provide a mechanism for utilizing offline data ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ) , as we will show in our experiments , such methods generally are not effective for fine-tuning with online data as they are often too conservative . In effect , prior methods require us to choose : Do we assume prior data is optimal or not ? Do we use only offline data , or only online data ? To make it feasible to learn policies for open-world settings , we need algorithms that learn successfully in any of these cases . In this work , we study how to build RL algorithms that are effective for pre-training from offpolicy datasets , but also well suited to continuous improvement with online data collection . We systematically analyze the challenges with using standard off-policy RL algorithms ( Haarnoja et al. , 2018 ; Kumar et al. , 2019 ; Abdolmaleki et al. , 2018 ) for this problem , and introduce a simple actor critic algorithm that elegantly bridges data-driven pre-training from offline data and improvement with online data collection . Our method , which uses dynamic programming to train a critic but a supervised learning style update to train a constrained actor , combines the best of supervised learning and actor-critic algorithms . Dynamic programming can leverage off-policy data and enable sample-efficient learning . The simple supervised actor update implicitly enforces a constraint that mitigates the effects of distribution shift when learning from offline data ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ) , while avoiding overly conservative updates . We evaluate our algorithm on a wide variety of robotic control and benchmark tasks across three simulated domains : dexterous manipulation , tabletop manipulation , and MuJoCo control tasks . Our algorithm , Advantage Weighted Actor Critic ( AWAC ) , is able to quickly learn successful policies on difficult tasks with high action dimension and binary sparse rewards , significantly better than prior methods for off-policy and offline reinforcement learning . Moreover , AWAC can utilize different types of prior data without any algorithmic changes : demonstrations , suboptimal data , or random exploration data . The contribution of this work is not just another RL algorithm , but a systematic study of what makes offline pre-training with online fine-tuning unique compared to the standard RL paradigm , which then directly motivates a simple algorithm , AWAC , to address these challenges . 2 PRELIMINARIES . We consider the standard reinforcement learning notation , with states s , actions a , policy π ( a|s ) , rewards r ( s , a ) , and dynamics p ( s′|s , a ) . The discounted return is defined as Rt = ∑T i=t γ ir ( si , ai ) , for a discount factor γ and horizon T which may be infinite . The objective of an RL agent is to maximize the expected discounted return J ( π ) = Epπ ( τ ) [ R0 ] under the distribution induced by the policy . The optimal policy can be learned directly by policy gradient , estimating ∇J ( π ) ( Williams , 1992 ) , but this is often ineffective due to high variance of the estimator . Many algorithms attempt to reduce this variance by making use of the value function V π ( s ) = Epπ ( τ ) [ Rt|s ] , action-value function Qπ ( s , a ) = Epπ ( τ ) [ Rt|s , a ] , or advantage Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . The action-value function for a policy can be written recursively via the Bellman equation : Qπ ( s , a ) = r ( s , a ) + γEp ( s′|s , a ) [ V π ( s′ ) ] = r ( s , a ) + γEp ( s′|s , a ) [ Eπ ( a′|s′ ) [ Qπ ( s′ , a′ ) ] ] . ( 1 ) Instead of estimating policy gradients directly , actor-critic algorithms maximize returns by alternating between two phases ( Konda & Tsitsiklis , 2000 ) : policy evaluation and policy improvement . During the policy evaluation phase , the critic Qπ ( s , a ) is estimated for the current policy π . This can be accomplished by repeatedly applying the Bellman operator B , corresponding to the right-hand side of Equation 1 , as defined below : BπQ ( s , a ) = r ( s , a ) + γEp ( s′|s , a ) [ Eπ ( a′|s′ ) [ Qπ ( s′ , a′ ) ] ] . ( 2 ) By iterating according to Qk+1 = BπQk , Qk converges to Qπ ( Sutton & Barto , 1998 ) . With function approximation , we can not apply the Bellman operator exactly , and instead minimize the Bellman error with respect to Q-function parameters φk : φk = argmin φ ED [ ( Qφ ( s , a ) − y ) 2 ] , y = r ( s , a ) + γEs′ , a′ [ Qφk−1 ( s′ , a′ ) ] . ( 3 ) During policy improvement , the actor π is typically updated based on the current estimate of Qπ . A commonly used technique ( Lillicrap et al. , 2016 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) is to update the actor πθk ( a|s ) via likelihood ratio or pathwise derivatives to optimize the following objective , such that the expected value of the Q-function Qπ is maximized : θk = argmax θ Es∼D [ Eπθ ( a|s ) [ Qφk ( s , a ) ] ] ( 4 ) Actor-critic algorithms are widely used in deep RL ( Mnih et al. , 2016 ; Lillicrap et al. , 2016 ; Haarnoja et al. , 2018 ; Fujimoto et al. , 2018 ) . With a Q-function estimator , they can in principle utilize off-policy data when used with a replay buffer for storing prior transition tuples , which we will denote β , to sample previous transitions , although we show that this by itself is insufficient for our problem setting . 3 CHALLENGES IN OFFLINE RL WITH ONLINE FINE-TUNING . In this section , we study the unique challenges that exist when pre-training using offline data , followed by fine-tuning with online data collection . We first describe the problem , and then analyze what makes this problem difficult for prior methods . Problem definition . A static dataset of transitions , D = { ( s , a , s′ , r ) j } , is provided to the algorithm at the beginning of training . This dataset can be sampled from an arbitrary policy or mixture of policies , and may even be collected by a human expert . This definition is general and encompasses many scenarios , such as learning from demonstrations , random data , prior RL experiments , or even from multi-task data . Given the dataset D , our goal is to leverage D for pre-training and use some online interaction to learn the optimal policy π∗ ( a|s ) , with as few interactions with the environment as possible ( depicted in Fig 1 ) . This setting is representative of many real-world RL settings , where prior data is available and the aim is to learn new skills efficiently . We first study existing algorithms empirically in this setting on the HalfCheetah-v2 Gym environment1 . The prior dataset consists of 15 demonstrations from an expert policy and 100 suboptimal trajectories sampled from a behavioral clone of these demonstrations . All methods for the remainder of this paper incorporate the prior dataset , unless explicitly labeled “ scratch ” . 3.1 ) Data Efficiency . One of the simplest ways to utilize prior data such as demonstrations for RL is to pre-train a policy with imitation learning , and fine-tune with on-policy RL ( Gupta et al. , 2019 ; Rajeswaran et al. , 2018 ) . This approach has two drawbacks : ( 1 ) prior data may not be optimal ; ( 2 ) on-policy fine-tuning is data inefficient as it does not reuse the prior data in the RL stage . In our setting , data efficiency is vital . To this end , we require algorithms that are able to reuse arbitrary offpolicy data during online RL for data-efficient fine-tuning . We find that algorithms that use on-policy fine-tuning ( Rajeswaran et al. , 2018 ; Gupta et al. , 2019 ) , or Monte-Carlo return estimation ( Peters & Schaal , 2007 ; Wang et al. , 2018 ; Peng et al. , 2019 ) are generally much less efficient than off-policy actor-critic algorithms , which iterate between improving π and estimating Qπ via Bellman backups . This can be seen from the results in Figure 2 plot 1 , where on-policy methods like DAPG ( Rajeswaran et al. , 2018 ) and Monte-Carlo return methods like AWR ( Peng et al. , 2019 ) and MARWIL ( Wang et al. , 2018 ) are an order of magnitude slower than off-policy actor-critic methods . Actor-critic methods , shown in Figure 2 plot 2 , can in principle use off-policy data . However , as we will discuss next , naïvely applying these algorithms to our problem suffers from a different set of challenges . 3.2 ) Bootstrap Error in Offline Learning with Actor-Critic Methods . When standard off-policy actor-critic methods are applied to this problem setting , they perform poorly , as shown in the second plot in Figure 2 : despite having a prior dataset in the replay buffer , these algorithms do not benefit significantly from offline training . We evaluate soft actor critic ( Haarnoja et al. , 2018 ) , a state-of-theart actor-critic algorithm for continuous control . Note that “ SAC-scratch , ” which does not receive the prior data , performs similarly to “ SACfD-prior , ” which does have access to the prior data , indicating that the off-policy RL algorithm is not actually able to make use of the off-policy data for pre-training . Moreover , even if the SAC is policy is pre-trained by behavior cloning , labeled “ SACfD-pretrain ” , we still observe an initial decrease in performance , and performance similar to learning from scratch . This challenge can be attributed to off-policy bootstrapping error accumulation , as observed in several prior works ( Sutton & Barto , 1998 ; Kumar et al. , 2019 ; Wu et al. , 2020 ; Levine et al. , 2020 ; 1We use this environment for analysis because it helps understand and accentuate the differences between different algorithms . More challenging environments like the ones shown in Fig 3 are too hard to solve to analyze variants of different methods . Fujimoto et al. , 2019 ) . In actor-critic algorithms , the target value Q ( s′ , a′ ) , with a′ ∼ π , is used to update Q ( s , a ) . When a′ is outside of the data distribution , Q ( s′ , a′ ) will be inaccurate , leading to accumulation of error on static datasets . Offline RL algorithms ( Fujimoto et al. , 2019 ; Kumar et al. , 2019 ; Wu et al. , 2020 ) propose to address this issue by explicitly adding constraints on the policy improvement update ( Equation 4 ) to avoid bootstrapping on out-of-distribution actions , leading to a policy update of this form : argmax θ Es∼D [ Eπθ ( a|s ) [ Qφk ( s , a ) ] ] s.t . D ( πθ , πβ ) ≤ . ( 5 ) Here , πθ is the actor being updated , and πβ ( a|s ) represents the ( potentially unknown ) distribution from which all of the data seen so far ( both offline data and online data ) was generated . In the case of a replay buffer , πβ corresponds to a mixture distribution over all past policies . Typically , πβ is not known , especially for offline data , and must be estimated from the data itself . Many offline RL algorithms ( Kumar et al. , 2019 ; Fujimoto et al. , 2019 ; Siegel et al. , 2020 ) explicitly fit a parametric model to samples for the distribution πβ via maximum likelihood estimation , where samples from πβ are obtained simply by sampling uniformly from the data seen thus far : π̂β = maxπ̂β Es , a∼πβ [ log π̂β ( a|s ) ] . After estimating π̂β , prior methods implement the constraint given in Equation 5 in various ways , including penalties on the policy update ( Kumar et al. , 2019 ; Wu et al. , 2020 ) or architecture choices for sampling actions for policy training ( Fujimoto et al. , 2019 ; Siegel et al. , 2020 ) . As we will see next , the requirement for accurate estimation of π̂β makes these methods difficult to use with online fine-tuning . 3.3 ) Excessively Conservative Online Learning . While offline RL algorithms with constraints ( Kumar et al. , 2019 ; Fujimoto et al. , 2019 ; Wu et al. , 2020 ) perform well offline , they struggle to improve with fine-tuning , as shown in the third plot in Figure 2 . We see that the purely offline RL performance ( at “ 0K ” in Fig . 2 ) is much better than the standard off-policy methods shown in Section 3.2 . However , with additional iterations of online fine-tuning , the performance increases very slowly ( as seen from the slope of the BEAR curve in Fig 2 ) . What causes this phenomenon ? This can be attributed to challenges in fitting an accurate behavior model as data is collected online during fine-tuning . In the offline setting , behavior models must only be trained once via maximum likelihood , but in the online setting , the behavior model must be updated online to track incoming data . Training density models online ( in the “ streaming ” setting ) is a challenging research problem ( Ramapuram et al. , 2017 ) , made more difficult by a potentially complex multi-modal behavior distribution induced by the mixture of online and offline data . To understand this , we plot the log likelihood of learned behavior models on the dataset during online and offline training for the HalfCheetah task . As we can see in the plot , the accuracy of the behavior models ( log πβ on the y-axis ) reduces during online fine-tuning , indicating that it is not fitting the new data well during online training . When the behavior models are inaccurate or unable to model new data well , constrained optimization becomes too conservative , resulting in limited improvement with fine-tuning . This analysis suggests that , in order to address our problem setting , we require an off-policy RL algorithm that constrains the policy to prevent offline instability and error accumulation , but not so conservatively that it prevents online fine-tuning due to imperfect behavior modeling . Our proposed algorithm , which we discuss in the next section , accomplishes this by employing an implicit constraint , which does not require any explicit modeling of the behavior policy .
This paper studies shorting coming of existing off-policy methods when it comes to prior data and fine-tuning and shows that those existing methods can't effectively utilize previously collected data with online updates. To address this problem, they propose to constraint policy updates with respect to behavioral policy. Their proposed method is built mainly on the top of AWR [1].
SP:7e456aff1e90c9f11b51c22e9ec7132eca76d700
On Data-Augmentation and Consistency-Based Semi-Supervised Learning
1 INTRODUCTION . Consider a datasetD = DL∪DU that is comprised of labelled samplesDL = { xi , yi } i∈IL as well as unlabelled samples DU = { xi } i∈IU . Semi-Supervised Learning ( SSL ) is concerned with the use of both the labelled and unlabeled data for training . In many scenarios , collecting labelled data is difficult or time consuming or expensive so that the amount of labelled data can be relatively small when compared to the amount of unlabelled data . The main challenge of SSL is in the design of methods that can exploit the information contained in the distribution of the unlabelled data ( Zhu05 ; CSZ09 ) . In modern high-dimensional settings that are common to computer vision , signal processing , Natural Language Processing ( NLP ) or genomics , standard graph/distance based methods ( BC01 ; ZG02 ; ZGL03 ; BNS06 ; DSST19 ) that are successful in low-dimensional scenarios are difficult to implement . Indeed , in high-dimensional spaces , it is often difficult to design sensible notions of distances that can be exploited within these methods . We refer the interested reader to the book-length treatments ( Zhu05 ; CSZ09 ) for discussion of other approaches . The manifold assumption is the fundamental structural property that is exploited in most modern approaches to SSL : high-dimensional data samples lie in a small neighbourhood of a low-dimensional manifold ( TP91 ; BJ03 ; Pey09 ; Cay05 ; RDV+11 ) . In computer vision , the presence of this lowdimensional structure is instrumental to the success of ( variational ) autoencoder and generative adversarial networks : large datasets of images can often be parametrized by a relatively small number of degrees of freedom . Exploiting the unlabelled data to uncover this low-dimensional structure is crucial to the design of efficient SSL methods . A recent and independent evaluation of several modern methods for SSL can be found in ( OOR+18 ) . It is found there that consistency-based methods ( BAP14 ; SJT16 ; LA16 ; TV17 ; MMIK18 ; LZL+18 ; GSA+20 ) , the topic of this paper , achieve state-of-the art performances in many realistic scenarios . Contributions : consistency-based semi-supervised learning methods have recently been shown to achieve state-of-the-art results . Despite these methodological advances , the understanding of these methods is still relatively limited when compared to the fully-supervised setting ( SMG13 ; AS17 ; SBD+18 ; TZ15 ; SZT17 ) . In this article , we do not propose a new SSL method . Instead , we analyse consistency-based methods in settings where analytically tractable results can be obtained , when the data-samples lie in the neighbourhood of well-defined and tractable low-dimensional manifolds , and simple and controlled experiments can be carried out . We establish links with Manifold Tangent Classifiers and demonstrate that consistency-based SSL methods are in general more powerful since they can better exploit the local geometry of the data-manifold if efficient data-augmentation/perturbation schemes are used . Furthermore , in section 4.1 we show that the popular Mean Teacher method and the conceptually more simple Π-model approach share the same solutions in the regime when the data-augmentations are small ; this confirms often reported claim that the data-augmentation schemes leveraged by the recent SSL , as well as fully unsupervised algorithms , are instrumental to their success . Finally , in section 4.3 we propose an extension of the Hidden Manifold Model ( GMKZ19 ; GLK+20 ) . This generative model allows us to investigate the properties of consistency-based SSL methods , taking into account the data-augmentation process and the underlying low-dimensionality of the data , in a simple and principled manner , and without relying on a specific dataset . For gaining understanding of SSL , as well as self-supervised learning methods , we believe it to be important to develop a framework that ( i ) can take into account the geometry of the data ( ii ) allows the study of the influence of the quality of the data-augmentation schemes ( iii ) does not rely on any particular dataset . While the understanding of fully-supervised methods have largely been driven by the analysis of simplified model architectures ( eg . linear and two-layered models , large dimension asymptotic such as the Neural Tangent Kernel ) , these analytical tools alone are unlikely to be enough to explain the mechanisms responsible for the success of SSL and self-supervised learning methods ( CKNH20 ; GSA+20 ) , since they do not , and can not easily be extended to , account for the geometry of the data and data-augmentation schemes . Our proposed framework offers a small step in that direction . 2 CONSISTENCY-BASED SEMI-SUPERVISED LEARNING . For concreteness and clarity of exposition , we focus the discussion on classification problems . The arguments described in the remaining of this article can be adapted without any difficulty to other situations such as regression or image segmentation . Assume that the samples xi ∈ X ⊂ RD can be represented as D-dimensional vectors and that the labels belong to C ≥ 2 possible classes , yi ∈ Y ≡ { 1 , . . . , C } . Consider a mapping Fθ : RD → RC parametrized by θ ∈ Θ ⊂ R|Θ| . This can be a neural network , although that is not necessary . For x ∈ X , the quantity Fθ ( x ) can represent probabilistic output of the classifier , or , for example , the pre-softmax activations . Empirical risk minimization consists in minimizing the function LL ( θ ) = 1 |DL| ∑ i∈IL ` ( Fθ ( xi ) , yi ) for a loss function ` : RC × Y 7→ R. Maximum likelihood estimation corresponds to choosing the loss function as the cross entropy . The optimal parameter θ ∈ Θ is found by a variant of stochastic gradient descent ( RM51 ) with estimated gradient ∇θ { 1 |BL| ∑ i∈BL ` ( Fθ ( xi ) , yi ) } for a mini-batch BL of labelled samples . Consistency-based SSL algorithms regularize the learning by enforcing that the learned function x 7→ Fθ ( x ) respects local derivative and invariance constraints . For simplicity , assume that the mapping x 7→ Fθ ( x ) is deterministic , although the use of dropout ( SHK+14 ) and other sources of stochasticity are popular in practice . The Π-model ( LA16 ; SJT16 ) makes use of a stochastic mapping S : X × Ω → X that maps a sample x ∈ X and a source of randomness ω ∈ Ω ⊂ RdΩ to another sample Sω ( x ) ∈ X . The mapping S describes a stochastic data augmentation process . In computer vision , popular data-augmentation schemes include random translations , rotations , dilatations , croppings , flippings , elastic deformations , color jittering , addition of speckle noise , and many more domain-specific variants . In NLP , synonym replacements , insertions and deletions , back-translations are often used although it is often more difficult to implement these data-augmentation strategies . In a purely supervised setting , data-augmentation can be used as a regularizer . Instead of directly minimizing LL , one can minimize instead θ 7→ 1 |DL| ∑ i∈IL Eω [ ` ( Fθ [ Sω ( xi ) ] , yi ) ] . In practice , data-augmentation regularization , although a simple strategy , is often crucial to obtaining good generalization properties ( PW17 ; CZM+18 ; LBC17 ; PCZ+19 ) . The idea of regularizing by enforcing robustness to the injection of noise can be traced back at least to ( Bis95 ) . In the Π-model , the data-augmentation mapping S is used to define a consistency regularization term , R ( θ ) = 1 |D| ∑ i∈IL∪IU Eω { ∥∥Fθ [ Sω ( xi ) ] −Fθ ? ( xi ) ∥∥2 } . ( 1 ) The notation θ ? designates a copy of the parameter θ , i.e . θ ? = θ , and emphasizes that when differentiating the consistency regularization term θ 7→ R ( θ ) , one does not differentiate through θ ? . In practice , a stochastic estimate of ∇R ( θ ) is obtained as follows . For a mini-batch B of samples { xi } i∈B , the current value θ ? ∈ Θ of the parameter and the current predictions fi ≡ Fθ ? ( xi ) , the quantity ∇ { 1 |B| ∑ i∈B ∥∥Fθ [ Sω ( xi ) ] − fi∥∥2 } is an approximation of∇R ( θ ) . There are indeed many variants ( eg . use of different norms , different manners to inject noise ) , but the general idea is to force the learned function x 7→ Fθ ( x ) to be locally invariant to the data-augmentation scheme S. Several extensions such as the Mean Teacher ( TV17 ) and the VAT ( MMIK18 ) schemes have been recently proposed and have been shown to lead to good results in many SSL tasks . The recently proposed and state-of-the-art BYOL approach ( GSA+20 ) is relying on mechanisms that are very close to the consistency regularization methods discussed on this text . If one recalls the manifold assumption , this approach is natural : since the samples corresponding to different classes lie on separate manifolds , the function Fθ : X → RC should be constant on each one of these manifolds . Since the correct value of Fθ is typically well approximated or known for labelled samples ( xi , yi ) ∈ DL , the consistency regularization term equation 1 helps propagating these known values across these manifolds . This mechanism is indeed similar to standard SSL graph-based approaches such as label propagation ( ZG02 ) . Graph-based methods are difficult to directly implement in computer vision , or NLP , when a meaningful notion of distance is not available . This interpretation reveals that it is crucial to include the labelled samples in the regularization term equation 1 in order to help propagating the information contained in the labelled samples to the unlabelled samples . Our numerical experiments suggest that , in the standard setting when the number of labelled samples is much lower than the number of unlabeled samples , i.e . |DL| |DU | , the formulation equation 1 of the consistency regularization leads to sub-optimal results and convergence issues : the information contained in the labelled data is swamped by the number of unlabelled samples . In all our experiments , we have adopted instead the following regularization term R ( θ ) = 1 |DL| ∑ i∈IL Eω { ∥∥Fθ [ Sω ( xi ) ] −Fθ ? ( xi ) ∥∥2 } + 1 |DU | ∑ j∈IU Eω { ∥∥Fθ [ Sω ( xj ) ] −Fθ ? ( xj ) ∥∥2 } ( 2 ) that balances the labelled and unlabelled data samples more efficiently . Furthermore , it is clear that the quality and variety of the data-augmentation scheme S : X × Ω→ X is pivotal to the success of consistency-based SSL methods . We argue in this article that it is the dominant factor contributing to the success of this class of methods . Effort spent on building efficient local data-augmentation schemes will be rewarded in terms of generalization performances . Designing good data-augmentation schemes is an efficient manner of injecting expert/prior knowledge into the learning process . It is done by leveraging the understanding of the local geometry of the data manifold . As usual and not surprisingly ( NGP98 ; MHF+12 ) , in data-scarce settings , any type of domain-knowledge needs to be exploited and we argue that consistency regularization approaches to SSL are instances of this general principle .
This paper analyses the consistency-based SSL methods in settings where data lie a manifold of much lower dimension than the input space and obtains tractable results. The paper relates the analysis with Manifold Tangent Classifiers and shows that the quality of the perturbations plays a key role to achieve a promising results in this set of SSL methods. Finally, the paper extends the Hidden Manifold Model by incorporating data-augmentation techniques and proposes a framework to provide a direction for analyzing consistency-based SSL methods.
SP:49bb8457a99e6a178e7893c9629e6543b15a564a
On Data-Augmentation and Consistency-Based Semi-Supervised Learning
1 INTRODUCTION . Consider a datasetD = DL∪DU that is comprised of labelled samplesDL = { xi , yi } i∈IL as well as unlabelled samples DU = { xi } i∈IU . Semi-Supervised Learning ( SSL ) is concerned with the use of both the labelled and unlabeled data for training . In many scenarios , collecting labelled data is difficult or time consuming or expensive so that the amount of labelled data can be relatively small when compared to the amount of unlabelled data . The main challenge of SSL is in the design of methods that can exploit the information contained in the distribution of the unlabelled data ( Zhu05 ; CSZ09 ) . In modern high-dimensional settings that are common to computer vision , signal processing , Natural Language Processing ( NLP ) or genomics , standard graph/distance based methods ( BC01 ; ZG02 ; ZGL03 ; BNS06 ; DSST19 ) that are successful in low-dimensional scenarios are difficult to implement . Indeed , in high-dimensional spaces , it is often difficult to design sensible notions of distances that can be exploited within these methods . We refer the interested reader to the book-length treatments ( Zhu05 ; CSZ09 ) for discussion of other approaches . The manifold assumption is the fundamental structural property that is exploited in most modern approaches to SSL : high-dimensional data samples lie in a small neighbourhood of a low-dimensional manifold ( TP91 ; BJ03 ; Pey09 ; Cay05 ; RDV+11 ) . In computer vision , the presence of this lowdimensional structure is instrumental to the success of ( variational ) autoencoder and generative adversarial networks : large datasets of images can often be parametrized by a relatively small number of degrees of freedom . Exploiting the unlabelled data to uncover this low-dimensional structure is crucial to the design of efficient SSL methods . A recent and independent evaluation of several modern methods for SSL can be found in ( OOR+18 ) . It is found there that consistency-based methods ( BAP14 ; SJT16 ; LA16 ; TV17 ; MMIK18 ; LZL+18 ; GSA+20 ) , the topic of this paper , achieve state-of-the art performances in many realistic scenarios . Contributions : consistency-based semi-supervised learning methods have recently been shown to achieve state-of-the-art results . Despite these methodological advances , the understanding of these methods is still relatively limited when compared to the fully-supervised setting ( SMG13 ; AS17 ; SBD+18 ; TZ15 ; SZT17 ) . In this article , we do not propose a new SSL method . Instead , we analyse consistency-based methods in settings where analytically tractable results can be obtained , when the data-samples lie in the neighbourhood of well-defined and tractable low-dimensional manifolds , and simple and controlled experiments can be carried out . We establish links with Manifold Tangent Classifiers and demonstrate that consistency-based SSL methods are in general more powerful since they can better exploit the local geometry of the data-manifold if efficient data-augmentation/perturbation schemes are used . Furthermore , in section 4.1 we show that the popular Mean Teacher method and the conceptually more simple Π-model approach share the same solutions in the regime when the data-augmentations are small ; this confirms often reported claim that the data-augmentation schemes leveraged by the recent SSL , as well as fully unsupervised algorithms , are instrumental to their success . Finally , in section 4.3 we propose an extension of the Hidden Manifold Model ( GMKZ19 ; GLK+20 ) . This generative model allows us to investigate the properties of consistency-based SSL methods , taking into account the data-augmentation process and the underlying low-dimensionality of the data , in a simple and principled manner , and without relying on a specific dataset . For gaining understanding of SSL , as well as self-supervised learning methods , we believe it to be important to develop a framework that ( i ) can take into account the geometry of the data ( ii ) allows the study of the influence of the quality of the data-augmentation schemes ( iii ) does not rely on any particular dataset . While the understanding of fully-supervised methods have largely been driven by the analysis of simplified model architectures ( eg . linear and two-layered models , large dimension asymptotic such as the Neural Tangent Kernel ) , these analytical tools alone are unlikely to be enough to explain the mechanisms responsible for the success of SSL and self-supervised learning methods ( CKNH20 ; GSA+20 ) , since they do not , and can not easily be extended to , account for the geometry of the data and data-augmentation schemes . Our proposed framework offers a small step in that direction . 2 CONSISTENCY-BASED SEMI-SUPERVISED LEARNING . For concreteness and clarity of exposition , we focus the discussion on classification problems . The arguments described in the remaining of this article can be adapted without any difficulty to other situations such as regression or image segmentation . Assume that the samples xi ∈ X ⊂ RD can be represented as D-dimensional vectors and that the labels belong to C ≥ 2 possible classes , yi ∈ Y ≡ { 1 , . . . , C } . Consider a mapping Fθ : RD → RC parametrized by θ ∈ Θ ⊂ R|Θ| . This can be a neural network , although that is not necessary . For x ∈ X , the quantity Fθ ( x ) can represent probabilistic output of the classifier , or , for example , the pre-softmax activations . Empirical risk minimization consists in minimizing the function LL ( θ ) = 1 |DL| ∑ i∈IL ` ( Fθ ( xi ) , yi ) for a loss function ` : RC × Y 7→ R. Maximum likelihood estimation corresponds to choosing the loss function as the cross entropy . The optimal parameter θ ∈ Θ is found by a variant of stochastic gradient descent ( RM51 ) with estimated gradient ∇θ { 1 |BL| ∑ i∈BL ` ( Fθ ( xi ) , yi ) } for a mini-batch BL of labelled samples . Consistency-based SSL algorithms regularize the learning by enforcing that the learned function x 7→ Fθ ( x ) respects local derivative and invariance constraints . For simplicity , assume that the mapping x 7→ Fθ ( x ) is deterministic , although the use of dropout ( SHK+14 ) and other sources of stochasticity are popular in practice . The Π-model ( LA16 ; SJT16 ) makes use of a stochastic mapping S : X × Ω → X that maps a sample x ∈ X and a source of randomness ω ∈ Ω ⊂ RdΩ to another sample Sω ( x ) ∈ X . The mapping S describes a stochastic data augmentation process . In computer vision , popular data-augmentation schemes include random translations , rotations , dilatations , croppings , flippings , elastic deformations , color jittering , addition of speckle noise , and many more domain-specific variants . In NLP , synonym replacements , insertions and deletions , back-translations are often used although it is often more difficult to implement these data-augmentation strategies . In a purely supervised setting , data-augmentation can be used as a regularizer . Instead of directly minimizing LL , one can minimize instead θ 7→ 1 |DL| ∑ i∈IL Eω [ ` ( Fθ [ Sω ( xi ) ] , yi ) ] . In practice , data-augmentation regularization , although a simple strategy , is often crucial to obtaining good generalization properties ( PW17 ; CZM+18 ; LBC17 ; PCZ+19 ) . The idea of regularizing by enforcing robustness to the injection of noise can be traced back at least to ( Bis95 ) . In the Π-model , the data-augmentation mapping S is used to define a consistency regularization term , R ( θ ) = 1 |D| ∑ i∈IL∪IU Eω { ∥∥Fθ [ Sω ( xi ) ] −Fθ ? ( xi ) ∥∥2 } . ( 1 ) The notation θ ? designates a copy of the parameter θ , i.e . θ ? = θ , and emphasizes that when differentiating the consistency regularization term θ 7→ R ( θ ) , one does not differentiate through θ ? . In practice , a stochastic estimate of ∇R ( θ ) is obtained as follows . For a mini-batch B of samples { xi } i∈B , the current value θ ? ∈ Θ of the parameter and the current predictions fi ≡ Fθ ? ( xi ) , the quantity ∇ { 1 |B| ∑ i∈B ∥∥Fθ [ Sω ( xi ) ] − fi∥∥2 } is an approximation of∇R ( θ ) . There are indeed many variants ( eg . use of different norms , different manners to inject noise ) , but the general idea is to force the learned function x 7→ Fθ ( x ) to be locally invariant to the data-augmentation scheme S. Several extensions such as the Mean Teacher ( TV17 ) and the VAT ( MMIK18 ) schemes have been recently proposed and have been shown to lead to good results in many SSL tasks . The recently proposed and state-of-the-art BYOL approach ( GSA+20 ) is relying on mechanisms that are very close to the consistency regularization methods discussed on this text . If one recalls the manifold assumption , this approach is natural : since the samples corresponding to different classes lie on separate manifolds , the function Fθ : X → RC should be constant on each one of these manifolds . Since the correct value of Fθ is typically well approximated or known for labelled samples ( xi , yi ) ∈ DL , the consistency regularization term equation 1 helps propagating these known values across these manifolds . This mechanism is indeed similar to standard SSL graph-based approaches such as label propagation ( ZG02 ) . Graph-based methods are difficult to directly implement in computer vision , or NLP , when a meaningful notion of distance is not available . This interpretation reveals that it is crucial to include the labelled samples in the regularization term equation 1 in order to help propagating the information contained in the labelled samples to the unlabelled samples . Our numerical experiments suggest that , in the standard setting when the number of labelled samples is much lower than the number of unlabeled samples , i.e . |DL| |DU | , the formulation equation 1 of the consistency regularization leads to sub-optimal results and convergence issues : the information contained in the labelled data is swamped by the number of unlabelled samples . In all our experiments , we have adopted instead the following regularization term R ( θ ) = 1 |DL| ∑ i∈IL Eω { ∥∥Fθ [ Sω ( xi ) ] −Fθ ? ( xi ) ∥∥2 } + 1 |DU | ∑ j∈IU Eω { ∥∥Fθ [ Sω ( xj ) ] −Fθ ? ( xj ) ∥∥2 } ( 2 ) that balances the labelled and unlabelled data samples more efficiently . Furthermore , it is clear that the quality and variety of the data-augmentation scheme S : X × Ω→ X is pivotal to the success of consistency-based SSL methods . We argue in this article that it is the dominant factor contributing to the success of this class of methods . Effort spent on building efficient local data-augmentation schemes will be rewarded in terms of generalization performances . Designing good data-augmentation schemes is an efficient manner of injecting expert/prior knowledge into the learning process . It is done by leveraging the understanding of the local geometry of the data manifold . As usual and not surprisingly ( NGP98 ; MHF+12 ) , in data-scarce settings , any type of domain-knowledge needs to be exploited and we argue that consistency regularization approaches to SSL are instances of this general principle .
The authors analyze consistency-based models in specific settings where analytically tractable results can be obtained. They establish that leveraging more sophisticated data augmentation schemes is crucial to obtain huge gains when using consistency based models. Finally, they propose an extension of Hidden Manifold Model that incorporates data augmentation for understanding and experimenting with SSL methods.
SP:49bb8457a99e6a178e7893c9629e6543b15a564a
FTSO: Effective NAS via First Topology Second Operator
1 INTRODUCTION . Since the great success of AlexNet ( Krizhevsky et al. , 2012 ) in image classification , most modern machine learning models have been developed based on deep neural networks . For neural networks , their performance is greatly determined by the architectures . Thus , in the past decade , a tremendous amount of work ( Simonyan & Zisserman , 2015 ; Szegedy et al. , 2015 ; He et al. , 2016 ) has been done to investigate proper network architecture design . However , as the network size has grown larger and larger , it has gradually become unaffordable to manually search for better network architectures via trial and error due to the expensive time and resource overhead . To ease this problem , a new technique called neural architecture search ( NAS ) was introduced , which allows computers to search for better network architectures automatically instead of relying on human experts .. Early-proposed reinforcement learning-based NAS methods ( Zoph & Le , 2017 ; Baker et al. , 2017 ; Zoph et al. , 2018 ) typically have an RNN-based controller to sample candidate network architectures from the search space . Although these algorithms can provide promising accuracy , their computation cost is usually unaffordable , e.g. , 1800 GPU-days are required for NASNet . To ease the search efficiency problem , one-shot approaches ( Pham et al. , 2018 ; Cai et al. , 2019 ; Liu et al. , 2019 ) with parameter sharing were proposed . These methods first create a huge directed acyclic graph ( DAG ) super-net , containing the whole search space . Then , the kernel weights are shared among all the sampled architectures via the super-net . This strategy makes it possible to measure the candidate architecture ’ s performance without repeatedly retraining it from scratch . However , these algorithms suffer from the super-nets ’ computational overheads . This problem is particularly severe for differentiable models ( Liu et al. , 2019 ; Xu et al. , 2020 ) . Limited by current NAS algorithms ’ inefficiency , it is rather challenging to find satisfying network architectures on large-scale datasets and high-level tasks . For instance , current speed-oriented NAS approaches generally require days to accomplish one search trial on ImageNet , e.g. , 8.3 GPU-days for ProxylessNAS ( Cai et al. , 2019 ) and 3.8 GPU-days for PC-DARTS ( Xu et al. , 2020 ) . Therefore , we argue that it is essential to propose a new well-defined search space , which is not only expressive enough to cover the most powerful architectures , but also compact enough to filter out the poor architectures . Motivated by Shu et al . ( 2020 ) , who demonstrated that randomly replacing operators in a found architecture does not harm the accuracy much , we believe that it could not only bring no reduction to the testing accuracy but also significantly benefit the search efficiency if we omit the influence of operators and cluster architectures according to the topology . Thus , in this paper , we propose to separately search for the network topology and the operators . We name this new method Effective NAS via First Topology Second Operator ( FTSO ) . In this paper , we mathematically prove that FTSO reduces the required parameters by 5.3× 107 and decreases the FLOPs per iteration by 1 × 105 . Besides , FTSO significantly promotes the accuracy compared to the baseline by greatly shrinking the search space , reducing the operators complexity in magnitude and lowering the required searching period from 50 epochs to one iteration . What ’ s more , the Matthew effect is eased . Furthermore , we empirically show that FTSO is superior in both efficiency and effectiveness , accomplishing the whole architecture search in 0.68 seconds . On ImageNet , FTSO can achieve 76.4 % testing accuracy , 1.5 % higher than the baseline , within merely 18 seconds . More importantly , when we only search for one iteration , FTSO can reach 75.64 % testing accuracy , 0.74 % higher than the baseline in just 0.68 seconds . Besides , if we allow FTSO to search for 19 minutes , 76.42 % Top1 and 93.2 % Top5 testing accuracy can be obtained . In addition , FTSO can reach 97.77 % testing accuracy , 0.27 % higher than the baseline , with 99.8 % of search time saved on CIFAR10 . Although in this paper we have only implemented FTSO within a continuous search space , we illustrate in Section 5 that FTSO can be seamlessly transferred to other NAS algorithms . 2 RELATED WORK . In general , existing NAS algorithms can be divided into three categories , namely , reinforcement learning-based , revolution-based and differentiable . Early-proposed reinforcement learning-based methods ( Zoph & Le , 2017 ; Zoph et al. , 2018 ) generally suffer from high computational cost and low-efficiency sampling . Instead of sampling a discrete architecture and then evaluating it , DARTS ( Liu et al. , 2019 ) treats the whole search space as a continuous super-net . It assigns every operator a real number weight and treats every node as the linear combination of all its transformed predecessors . To be specific , DARTS ’ s search space is a directed acyclic graph ( DAG ) containing two input nodes inherited from previous cells , four intermediate nodes and one output node . Each node denotes one latent representation and each edge denotes an operator . Every intermediate node xj is calculated from all its predecessors xi , i.e. , xj = ∑ i < j ∑ o∈O expαoi , j∑ o′∈O expα o′ i , j o ( xi ) , where O denotes the collection of all candidate operators , αoi , j denotes the weight for operator o from node i to j . This strategy allows DARTS to directly use gradients to optimize the whole super-net . After the super-net converges , DARTS only retains the operators with the largest weights . In this way , the final discrete architecture is derived . The main defect of DARTS is that it needs to maintain and do all calculations on a giant super-net , which inevitably leads to heavy computational overheads and over-fitting . Proposed to relieve the computational overhead of DARTS , DARTS-ES ( Zela et al. , 2020 ) reduces the number of searching epochs via early stopping , according to the Hessian matrix ’ s max eigenvalue . PC-DARTS ( Xu et al. , 2020 ) decreases the FLOPs per iteration by only calculating a proportion of the input channels and retaining the remainder unchanged , and normalizes the edge weights to stabilize the search . To be specific , in PC-DARTS , every intermediate node xj is computed from all its predecessors xi , i.e. , xj = ∑ i < j exp βi , j∑ i′ < j exp βi′ , j fi , j ( xi ) , where βi , j describes the input node i ’ s importance to the node j , and fi , j is the weighted sum of all the candidate operators ’ outputs between node i and j . Specifically , fi , j ( xi , Si , j ) = ∑ o∈O e αoi , j∑ o′∈O e αo ′ i , j o ( Si , j ∗xi ) + ( 1−Si , j ) ∗xi , where Si , j denotes a binary vector , in which only 1/K elements are 1 . 3 FTSO : EFFECTIVE NAS VIA FIRST TOPOLOGY SECOND OPERATOR . Existing NAS approaches generally suffer from the heavy computational overhead and the unsatisfying testing accuracy leaded by the huge search space . Such problems are especially stern in one-shot and differentiable methods because , these algorithms need to maintain and even do all the calculations directly on the search space . To ease such problems , it is of great demand to investigate the correlations among different architectures and to shrink the search space according to these prior knowledge . We notice that there is an important observation in Shu et al . ( 2020 ) that randomly substituting the operators does not observably influence the testing accuracy in a found architecture . Therefore , it would be a great inspiration that we could cluster the architectures according to their connection topologies . To be specific , suppose we have found an architecture only containing the simplest operators achieves high accuracy on the testing set , if we replace all the skip connections in this architecture with powerful operators , the converted architecture can also perform well on the testing set with high confidence . Thus , in this paper , we first propose to find the effective network topology with simple operators and then we fix the topology , and search for the most suitable operators for the given topology . In this way , the testing accuracy can still be guaranteed , while the search space is shrunk in magnitude . We name this new NAS algorithm Effective NAS via First Topology Second Operator ( FTSO ) . As shown in Figure 1 , we inherit the differentiable framework of PC-DARTS , and divide the architecture search into two phases . We name these two phases topology search and operator search , and illustrate how they work in Algorithm 1 and 2 , respectively . In the first phase , we form a supernet only containing the simplest operator , skip connection . Because the skip connection operator contains no kernel weights , we only need to optimize the architecture parameters βi , j , denoting the node i ’ s importance to the node j . In fact , as shown in Table 3 , the max pooling operator also brings satisfying results for the topology search . There are two reasons why we use skip connection . The first reason is that the skip connection operator not only requires zero parameter , but also produces the minimum computational cost . The second reason is that max pooling may lead to the loss of useful information if the network is deep . Furthermore , as the the only difference between our topology search and the vanilla DARTS is the number of candidate operators , the pruned architecture ’ s connectivity can be guaranteed . After the topology search , for every intermediate node j , we only retain its connections to its predecessors i∗ with the highest two βi , j similar to DARTS and PC-DARTS . In the second phase , we search for the operators suitable for the pruned topology with two strategies . One replaces each operator in the pruned topology with a mix-operator fi , j , where fi , j is the linear combination of all the candidate operators o with weight αoi , j , denoting the importance of the operator o between the node i and j . After that , we optimize the architecture parameters , αoi , j , βi , j and the kernel weights ωoi , j alternatively . After the super-net converges , we only retain one operator o ∗ with the highest αoi , j for every two connected nodes i and j . The other is to directly replace all the operators in the pruned topology with one single operator owning the highest model capacity , e.g. , a convolution operator . In this paper , we take the second strategy as the default configuration because it is much more efficient and avoid over-fitting . The final architecture outputted by the first strategy is only a small part of the super-net . If the sub-graph can generalize perfectly on the testing set , the super-net must over-fit . Thus , under this circumstance , the optimum super-net on training set is not the optimum one on testing set , and so is the sub-graph . PC-DARTS has mentioned this issue and reduced the size of the super-net via only computing partial input channels . While in the second strategy , since no super-net is adopted and all the simple operators in the sub-graph are replaced with powerful operators , the final architecture ’ s model capacity gets promoted . Additional empirical comparisons between these two strategies can be found in Section 4.4 . Algorithm 1 : topology search Input : a set of nodes : nk Output : the pruned architecture : Ap 1 Create an directed edge ei , j with weight βi , j between each pair of nodes ni and nj ( i < j ) ; 2 Assign each edge ei , j a skip connection operator oi , j with kernel weights wi , j ; 3 while still in the first epoch do 4 Forward-propagate following nj = ∑ i < j o ( ni ) βi , j ; 5 Update architecture β by descending ∇βLval ( w , β ) ; 6 Update weights w by descending ∇wLtrain ( w , β ) ; 7 foreach node nj ∈ Ap do 8 Tj ← the second largest βi , j ; 9 foreach node ni do 10 if βi , j < Tj then 11 Prune edge ei , j 12 Derive the pruned architecture Ap . Algorithm 2 : operator search Input : the pruned architecture produced by the topology search : Ap Output : the found architecture : Af 1 if replace with convolutions then 2 Replace all the retained operators oi , j in Ap with convolutions ; 3 else 4 Assign each node nj ← ∑ i < j ∑ o∈O expαoi , j∑ o′∈O expα o′ i , j o ( ni ) ; 5 while not converged do 6 Update architecture α by descending∇αLval ( w , α ) ; 7 Update weights w by descending∇wLtrain ( w , α ) ; 8 foreach edge ei , j ∈ Ap do 9 Assign edge ei , j the operator o′ ∈ O with the highest αo ′ i , j ; 10 Derive the found architecture Af ← Ap . In DARTS , the network topology and operators are jointly searched , which makes both the size and the computational cost of the super-net extremely high . We use n to denote the number of nodes , p to denote the number of candidate operators . Since we have two input nodes , one output node and n − 3 intermediate nodes , the super-net contains totally 12 ( n 2 − 3n ) edges . At the same time , every edge keeps p operators , thus , the total number of operators in DARTS is 12 ( n 2 − 3n ) p. By comparison , there are only 12n ( n−3 ) operations in our topology search , and 2 ( n−3 ) p operations in our operator search . This is because in the topology search , every edge contains only one operator ; and in the topology search , every intermediate node only connects to two predecessors . Since n is usually close to p , FTSO reduces the number of operations from O ( n3 ) to O ( n2 ) . In addition to the reduction on the number of operations , FTSO also dramatically decreases the internal cost of the operations because , during the topology search , all the powerful operators are replaced with the simple operators . To be specific , a vanilla convolutional operator needs k2CinHoutWoutCout FLOPs and ( k2Cin + 1 ) Cout parameters , where k is the kernel size , Cin is the input tensor ’ s channel number and Hout , Wout , and Cout are the output tensor ’ s height , width and channel number respectively . By comparison , a skip connection operator needs 0 parameters and 0 FLOPs . For simplicity , assume all the candidate operators are convolutions . Since DARTS has 1 2pn ( n−3 ) edges , it needs to compute 1 2pn ( n−3 ) convolutions and 1 2pn ( n−3 ) tensor summations . Because each tensor summation consumesHinWinCin FLOPs , DARTS requires totally 12pk 2n ( n− 3 ) CinHoutWoutCout+ 1 2pn ( n−3 ) HoutWoutCout = 1 2pn ( n−3 ) HoutWoutCout ( k 2Cin+1 ) FLOPs and 12n ( n − 3 ) p ( k 2Cin + 1 ) Cout parameters . While in FTSO , if we first search for the topology and then directly substituting the operators , only 12n ( n − 3 ) tensor summation need to be calculated . Thus , the total number of FLOPs and parameters of FTSO are 12n ( n − 3 ) HinWinCin and 1 2n ( n − 3 ) respectively . As a typical configuration , let k = 5 , Cin = Cout = 512 , n = 7 , p = 8 . Then , our algorithm requires only 1p ( k2Cin+1 ) Cout = 1.9 × 10 −8 times the parameters and 1 p ( k2Cin+1 ) = 9.8× 10−6 times the forward-propagation FLOPs per iteration compared to those of DARTS . FTSO ’ s huge reduction on the parameter numbers provides us a large amount of benefits . As mentioned above , it allows the algorithm to converge in only a few iterations and prevent over-fitting . This is because when extracting the discrete sub-graph from the super-net , many architecture parameters are set to be 0 . The introduced disturbance impacts more on the over-fitting super-nets since they prefer sharper local minimums . Furthermore , it avoids the Matthew ’ s effect . Each architecture has only one iteration to tune its kernel weights in DARTS . However , within one iteration , only the operators with few parameters can converge and thus , the simpler operators outperform the powerful ones in the super-net , then obtain larger gradients to enlarge their advantages . In this way , the found architectures tend to only contain the simplest operators and perform poorly on both training and testing set . Since FTSO only contains one operator with 0 parameter , the Matthew ’ s effect is eliminated .
This work researches the issue of neural architecture search (NAS), which is of significance for practical applications of deep neural networks and has become an active research topic in the past several years. Many methods on NAS have been developed recently. The computational efficiency of search has been one of the obstacles for this line of research.
SP:ef74c56a1e29fc366078c7d3ac2746e5282f496f
FTSO: Effective NAS via First Topology Second Operator
1 INTRODUCTION . Since the great success of AlexNet ( Krizhevsky et al. , 2012 ) in image classification , most modern machine learning models have been developed based on deep neural networks . For neural networks , their performance is greatly determined by the architectures . Thus , in the past decade , a tremendous amount of work ( Simonyan & Zisserman , 2015 ; Szegedy et al. , 2015 ; He et al. , 2016 ) has been done to investigate proper network architecture design . However , as the network size has grown larger and larger , it has gradually become unaffordable to manually search for better network architectures via trial and error due to the expensive time and resource overhead . To ease this problem , a new technique called neural architecture search ( NAS ) was introduced , which allows computers to search for better network architectures automatically instead of relying on human experts .. Early-proposed reinforcement learning-based NAS methods ( Zoph & Le , 2017 ; Baker et al. , 2017 ; Zoph et al. , 2018 ) typically have an RNN-based controller to sample candidate network architectures from the search space . Although these algorithms can provide promising accuracy , their computation cost is usually unaffordable , e.g. , 1800 GPU-days are required for NASNet . To ease the search efficiency problem , one-shot approaches ( Pham et al. , 2018 ; Cai et al. , 2019 ; Liu et al. , 2019 ) with parameter sharing were proposed . These methods first create a huge directed acyclic graph ( DAG ) super-net , containing the whole search space . Then , the kernel weights are shared among all the sampled architectures via the super-net . This strategy makes it possible to measure the candidate architecture ’ s performance without repeatedly retraining it from scratch . However , these algorithms suffer from the super-nets ’ computational overheads . This problem is particularly severe for differentiable models ( Liu et al. , 2019 ; Xu et al. , 2020 ) . Limited by current NAS algorithms ’ inefficiency , it is rather challenging to find satisfying network architectures on large-scale datasets and high-level tasks . For instance , current speed-oriented NAS approaches generally require days to accomplish one search trial on ImageNet , e.g. , 8.3 GPU-days for ProxylessNAS ( Cai et al. , 2019 ) and 3.8 GPU-days for PC-DARTS ( Xu et al. , 2020 ) . Therefore , we argue that it is essential to propose a new well-defined search space , which is not only expressive enough to cover the most powerful architectures , but also compact enough to filter out the poor architectures . Motivated by Shu et al . ( 2020 ) , who demonstrated that randomly replacing operators in a found architecture does not harm the accuracy much , we believe that it could not only bring no reduction to the testing accuracy but also significantly benefit the search efficiency if we omit the influence of operators and cluster architectures according to the topology . Thus , in this paper , we propose to separately search for the network topology and the operators . We name this new method Effective NAS via First Topology Second Operator ( FTSO ) . In this paper , we mathematically prove that FTSO reduces the required parameters by 5.3× 107 and decreases the FLOPs per iteration by 1 × 105 . Besides , FTSO significantly promotes the accuracy compared to the baseline by greatly shrinking the search space , reducing the operators complexity in magnitude and lowering the required searching period from 50 epochs to one iteration . What ’ s more , the Matthew effect is eased . Furthermore , we empirically show that FTSO is superior in both efficiency and effectiveness , accomplishing the whole architecture search in 0.68 seconds . On ImageNet , FTSO can achieve 76.4 % testing accuracy , 1.5 % higher than the baseline , within merely 18 seconds . More importantly , when we only search for one iteration , FTSO can reach 75.64 % testing accuracy , 0.74 % higher than the baseline in just 0.68 seconds . Besides , if we allow FTSO to search for 19 minutes , 76.42 % Top1 and 93.2 % Top5 testing accuracy can be obtained . In addition , FTSO can reach 97.77 % testing accuracy , 0.27 % higher than the baseline , with 99.8 % of search time saved on CIFAR10 . Although in this paper we have only implemented FTSO within a continuous search space , we illustrate in Section 5 that FTSO can be seamlessly transferred to other NAS algorithms . 2 RELATED WORK . In general , existing NAS algorithms can be divided into three categories , namely , reinforcement learning-based , revolution-based and differentiable . Early-proposed reinforcement learning-based methods ( Zoph & Le , 2017 ; Zoph et al. , 2018 ) generally suffer from high computational cost and low-efficiency sampling . Instead of sampling a discrete architecture and then evaluating it , DARTS ( Liu et al. , 2019 ) treats the whole search space as a continuous super-net . It assigns every operator a real number weight and treats every node as the linear combination of all its transformed predecessors . To be specific , DARTS ’ s search space is a directed acyclic graph ( DAG ) containing two input nodes inherited from previous cells , four intermediate nodes and one output node . Each node denotes one latent representation and each edge denotes an operator . Every intermediate node xj is calculated from all its predecessors xi , i.e. , xj = ∑ i < j ∑ o∈O expαoi , j∑ o′∈O expα o′ i , j o ( xi ) , where O denotes the collection of all candidate operators , αoi , j denotes the weight for operator o from node i to j . This strategy allows DARTS to directly use gradients to optimize the whole super-net . After the super-net converges , DARTS only retains the operators with the largest weights . In this way , the final discrete architecture is derived . The main defect of DARTS is that it needs to maintain and do all calculations on a giant super-net , which inevitably leads to heavy computational overheads and over-fitting . Proposed to relieve the computational overhead of DARTS , DARTS-ES ( Zela et al. , 2020 ) reduces the number of searching epochs via early stopping , according to the Hessian matrix ’ s max eigenvalue . PC-DARTS ( Xu et al. , 2020 ) decreases the FLOPs per iteration by only calculating a proportion of the input channels and retaining the remainder unchanged , and normalizes the edge weights to stabilize the search . To be specific , in PC-DARTS , every intermediate node xj is computed from all its predecessors xi , i.e. , xj = ∑ i < j exp βi , j∑ i′ < j exp βi′ , j fi , j ( xi ) , where βi , j describes the input node i ’ s importance to the node j , and fi , j is the weighted sum of all the candidate operators ’ outputs between node i and j . Specifically , fi , j ( xi , Si , j ) = ∑ o∈O e αoi , j∑ o′∈O e αo ′ i , j o ( Si , j ∗xi ) + ( 1−Si , j ) ∗xi , where Si , j denotes a binary vector , in which only 1/K elements are 1 . 3 FTSO : EFFECTIVE NAS VIA FIRST TOPOLOGY SECOND OPERATOR . Existing NAS approaches generally suffer from the heavy computational overhead and the unsatisfying testing accuracy leaded by the huge search space . Such problems are especially stern in one-shot and differentiable methods because , these algorithms need to maintain and even do all the calculations directly on the search space . To ease such problems , it is of great demand to investigate the correlations among different architectures and to shrink the search space according to these prior knowledge . We notice that there is an important observation in Shu et al . ( 2020 ) that randomly substituting the operators does not observably influence the testing accuracy in a found architecture . Therefore , it would be a great inspiration that we could cluster the architectures according to their connection topologies . To be specific , suppose we have found an architecture only containing the simplest operators achieves high accuracy on the testing set , if we replace all the skip connections in this architecture with powerful operators , the converted architecture can also perform well on the testing set with high confidence . Thus , in this paper , we first propose to find the effective network topology with simple operators and then we fix the topology , and search for the most suitable operators for the given topology . In this way , the testing accuracy can still be guaranteed , while the search space is shrunk in magnitude . We name this new NAS algorithm Effective NAS via First Topology Second Operator ( FTSO ) . As shown in Figure 1 , we inherit the differentiable framework of PC-DARTS , and divide the architecture search into two phases . We name these two phases topology search and operator search , and illustrate how they work in Algorithm 1 and 2 , respectively . In the first phase , we form a supernet only containing the simplest operator , skip connection . Because the skip connection operator contains no kernel weights , we only need to optimize the architecture parameters βi , j , denoting the node i ’ s importance to the node j . In fact , as shown in Table 3 , the max pooling operator also brings satisfying results for the topology search . There are two reasons why we use skip connection . The first reason is that the skip connection operator not only requires zero parameter , but also produces the minimum computational cost . The second reason is that max pooling may lead to the loss of useful information if the network is deep . Furthermore , as the the only difference between our topology search and the vanilla DARTS is the number of candidate operators , the pruned architecture ’ s connectivity can be guaranteed . After the topology search , for every intermediate node j , we only retain its connections to its predecessors i∗ with the highest two βi , j similar to DARTS and PC-DARTS . In the second phase , we search for the operators suitable for the pruned topology with two strategies . One replaces each operator in the pruned topology with a mix-operator fi , j , where fi , j is the linear combination of all the candidate operators o with weight αoi , j , denoting the importance of the operator o between the node i and j . After that , we optimize the architecture parameters , αoi , j , βi , j and the kernel weights ωoi , j alternatively . After the super-net converges , we only retain one operator o ∗ with the highest αoi , j for every two connected nodes i and j . The other is to directly replace all the operators in the pruned topology with one single operator owning the highest model capacity , e.g. , a convolution operator . In this paper , we take the second strategy as the default configuration because it is much more efficient and avoid over-fitting . The final architecture outputted by the first strategy is only a small part of the super-net . If the sub-graph can generalize perfectly on the testing set , the super-net must over-fit . Thus , under this circumstance , the optimum super-net on training set is not the optimum one on testing set , and so is the sub-graph . PC-DARTS has mentioned this issue and reduced the size of the super-net via only computing partial input channels . While in the second strategy , since no super-net is adopted and all the simple operators in the sub-graph are replaced with powerful operators , the final architecture ’ s model capacity gets promoted . Additional empirical comparisons between these two strategies can be found in Section 4.4 . Algorithm 1 : topology search Input : a set of nodes : nk Output : the pruned architecture : Ap 1 Create an directed edge ei , j with weight βi , j between each pair of nodes ni and nj ( i < j ) ; 2 Assign each edge ei , j a skip connection operator oi , j with kernel weights wi , j ; 3 while still in the first epoch do 4 Forward-propagate following nj = ∑ i < j o ( ni ) βi , j ; 5 Update architecture β by descending ∇βLval ( w , β ) ; 6 Update weights w by descending ∇wLtrain ( w , β ) ; 7 foreach node nj ∈ Ap do 8 Tj ← the second largest βi , j ; 9 foreach node ni do 10 if βi , j < Tj then 11 Prune edge ei , j 12 Derive the pruned architecture Ap . Algorithm 2 : operator search Input : the pruned architecture produced by the topology search : Ap Output : the found architecture : Af 1 if replace with convolutions then 2 Replace all the retained operators oi , j in Ap with convolutions ; 3 else 4 Assign each node nj ← ∑ i < j ∑ o∈O expαoi , j∑ o′∈O expα o′ i , j o ( ni ) ; 5 while not converged do 6 Update architecture α by descending∇αLval ( w , α ) ; 7 Update weights w by descending∇wLtrain ( w , α ) ; 8 foreach edge ei , j ∈ Ap do 9 Assign edge ei , j the operator o′ ∈ O with the highest αo ′ i , j ; 10 Derive the found architecture Af ← Ap . In DARTS , the network topology and operators are jointly searched , which makes both the size and the computational cost of the super-net extremely high . We use n to denote the number of nodes , p to denote the number of candidate operators . Since we have two input nodes , one output node and n − 3 intermediate nodes , the super-net contains totally 12 ( n 2 − 3n ) edges . At the same time , every edge keeps p operators , thus , the total number of operators in DARTS is 12 ( n 2 − 3n ) p. By comparison , there are only 12n ( n−3 ) operations in our topology search , and 2 ( n−3 ) p operations in our operator search . This is because in the topology search , every edge contains only one operator ; and in the topology search , every intermediate node only connects to two predecessors . Since n is usually close to p , FTSO reduces the number of operations from O ( n3 ) to O ( n2 ) . In addition to the reduction on the number of operations , FTSO also dramatically decreases the internal cost of the operations because , during the topology search , all the powerful operators are replaced with the simple operators . To be specific , a vanilla convolutional operator needs k2CinHoutWoutCout FLOPs and ( k2Cin + 1 ) Cout parameters , where k is the kernel size , Cin is the input tensor ’ s channel number and Hout , Wout , and Cout are the output tensor ’ s height , width and channel number respectively . By comparison , a skip connection operator needs 0 parameters and 0 FLOPs . For simplicity , assume all the candidate operators are convolutions . Since DARTS has 1 2pn ( n−3 ) edges , it needs to compute 1 2pn ( n−3 ) convolutions and 1 2pn ( n−3 ) tensor summations . Because each tensor summation consumesHinWinCin FLOPs , DARTS requires totally 12pk 2n ( n− 3 ) CinHoutWoutCout+ 1 2pn ( n−3 ) HoutWoutCout = 1 2pn ( n−3 ) HoutWoutCout ( k 2Cin+1 ) FLOPs and 12n ( n − 3 ) p ( k 2Cin + 1 ) Cout parameters . While in FTSO , if we first search for the topology and then directly substituting the operators , only 12n ( n − 3 ) tensor summation need to be calculated . Thus , the total number of FLOPs and parameters of FTSO are 12n ( n − 3 ) HinWinCin and 1 2n ( n − 3 ) respectively . As a typical configuration , let k = 5 , Cin = Cout = 512 , n = 7 , p = 8 . Then , our algorithm requires only 1p ( k2Cin+1 ) Cout = 1.9 × 10 −8 times the parameters and 1 p ( k2Cin+1 ) = 9.8× 10−6 times the forward-propagation FLOPs per iteration compared to those of DARTS . FTSO ’ s huge reduction on the parameter numbers provides us a large amount of benefits . As mentioned above , it allows the algorithm to converge in only a few iterations and prevent over-fitting . This is because when extracting the discrete sub-graph from the super-net , many architecture parameters are set to be 0 . The introduced disturbance impacts more on the over-fitting super-nets since they prefer sharper local minimums . Furthermore , it avoids the Matthew ’ s effect . Each architecture has only one iteration to tune its kernel weights in DARTS . However , within one iteration , only the operators with few parameters can converge and thus , the simpler operators outperform the powerful ones in the super-net , then obtain larger gradients to enlarge their advantages . In this way , the found architectures tend to only contain the simplest operators and perform poorly on both training and testing set . Since FTSO only contains one operator with 0 parameter , the Matthew ’ s effect is eliminated .
The paper proposes a method for Neural Architecture Search (NAS) with two stages of search. In the first stage, the topology of the cell is searched with only one operator (skip connection) using graph pruning through gradient descents. In the later stage, there are two ways to search the operators. In the first approach, the found topology is equipped with some operators (e.g., 3x3 convolution, skip connection, and 3x3 dilated convolution) and then the architecture parameters are optimized. Another approach is to replace all operators with one single operator e.g. convolution. The experiments show that the searching time is reduced significantly compared to DARTS and the results on CIFAR-10 and ImageNet are very competitive.
SP:ef74c56a1e29fc366078c7d3ac2746e5282f496f
Learning to Observe with Reinforcement Learning
We consider a decision making problem where an autonomous agent decides on which actions to take based on the observations it collects from the environment . We are interested in revealing the information structure of the observation space illustrating which type of observations are the most important ( such as position versus velocity ) and the dependence of this on the state of agent ( such as at the bottom versus top of a hill ) . We approach this problem by associating a cost with collecting observations which increases with the accuracy . We adopt a reinforcement learning ( RL ) framework where the RL agent learns to adjust the accuracy of the observations alongside learning to perform the original task . We consider both the scenario where the accuracy can be adjusted continuously and also the scenario where the agent has to choose between given preset levels , such as taking a sample perfectly or not taking a sample at all . In contrast to the existing work that mostly focuses on sample efficiency during training , our focus is on the behaviour during the actual task . Our results illustrate that the RL agent can learn to use the observation space efficiently and obtain satisfactory performance in the original task while collecting effectively smaller amount of data . By uncovering the relative usefulness of different types of observations and trade-offs within , these results also provide insights for further design of active data acquisition schemes . 1 INTRODUCTION . Autonomous decision making relies on collecting data , i.e . observations , from the environment where the actions are decided based on the observations . We are interested in revealing the information structure of the observation space illustrating which type of observations are the most important ( such as position versus velocity ) . Revealing this structure is challenging since the usefulness of the information that an observation can bring is a priori unknown and depends on the environment as well as the current knowledge state of the decision-maker , for instance , whether the agent is at the bottom versus the top of a hill and how sure the agent is about its position . Hence , we ’ re interested in questions such as “ Instead of collecting all available observations , is it possible to skip some observations and obtain satisfactory performance ? ” , “ Which observation components ( such as the position or the velocity ) are the most useful when the object is far away from ( or close to ) the target state ? ” . The primary aim of this work is to reveal this information structure of the observation space within a systematic framework . We approach this problem by associating a cost with collecting observations which increases with the accuracy . The agent can choose the accuracy level of its observations . Since cost increases with the accuracy , we expect that the agent will choose to collect only the observations which are most likely to be informative and worth the cost . We adopt a reinforcement learning ( RL ) framework where the RL agent learns to adjust the accuracy of the observations alongside learning to perform the original task . We consider both the scenario where the accuracy can be adjusted continuously and also the scenario where the agent has to choose between given preset levels , such as taking a sample perfectly or not taking a sample at all . In contrast to the existing work that mostly focuses on sample efficiency during training , our focus is on the behaviour during the actual task . Our results illustrate that the RL agent can learn to use the observation space efficiently and obtain satisfactory performance in the original task while collecting effectively smaller amount of data . 2 RELATED WORK . A related setting is active learning ( Settles , 2010 ; Donmez et al. , 2010 ) where an agent decides which queries to perform , i.e. , which samples to take , during training . For instance , in an active learning set-up , an agent learning to classify images can decide which images from a large dataset it would like to have labels for in order to have improved classification performance . In a standard active learning approach ( Settles , 2010 ; Donmez et al. , 2010 ) as well as its extensions in RL ( Lopes et al. , 2009 ) , the main aim is to reduce the size of the training set , hence the agent tries to determine informative queries during training so that the performance during the test phase is optimal . In the test phase , the agent can not ask any questions ; instead , it will answer questions , for instance , it will be given images to label . In contrast , in our setting the agent continues to perform queries during the test phase , since it still needs to collect observations during the test phase , for instance as in the case of collecting camera images for an autonomous driving application . From this perspective , one of our main aims is to reduce the number of queries the agent performs during this actual operation as opposed to number of queries in its training phase . Another related line of work consists of the RL approaches that facilitate efficient exploration of state space , such as curiosity-driven RL and intrinsic motivation ( Pathak et al. , 2017 ; Bellemare et al. , 2016 ; Mohamed & Rezende , 2015 ; Still & Precup , 2012 ) or active-inference based methods utilizing free-energy ( Ueltzhöffer , 2018 ; Schwöbel et al. , 2018 ) ; and the works that focus on operation with limited data using a model ( Chua et al. , 2018 ; Deisenroth & Rasmussen , 2011 ; Henaff et al. , 2018 ; Gal et al. , 2016 ) . In these works , the focus is either finding informative samples ( Pathak et al. , 2017 ) or using a limited number of samples/trials as much as possible by making use of a forward dynamics model ( Boedecker et al. , 2014 ; Chua et al. , 2018 ; Deisenroth & Rasmussen , 2011 ; Henaff et al. , 2018 ; Gal et al. , 2016 ) during the agent ’ s training . In contrast to these approaches , we would like to decrease the effective size of the data or the number of samples taken during the test phase , i.e . operation of the agent after the training phase is over . Representation learning for control and RL constitutes another line of related work ( Watter et al. , 2015 ; Hafner et al. , 2019 ; Banijamali et al. , 2018 ) . In these works , the transformation of the observation space to a low-dimensional space is investigated so that action selection can be performed using this low-dimensional space . Similar to these works , our framework can be also interpreted as a transformation of the original observation space where an effectively low-dimensional space is sought after . Instead of allowing a general class of transformations on the observations , here we consider a constrained setting so that only specific operations are allowed , for instance , we allow dropping some of the samples but we do not allow collecting observations and then applying arbitrary transformations on them . Our work associates a cost with obtaining observations . Cost of data acquisition in the context of Markov decision processes ( MDPs ) has been considered in a number of works , both as a direct cost on the observations ( Hansen , 1997 ; Zubek & Dietterich , 2000 ; 2002 ) or as an indirect cost of information sharing in multiple agent settings ( Melo & Veloso , 2009 ; De Hauwere et al. , 2010 ) . Another related line of work is performed under the umbrella of configurable MDPs ( Metelli et al. , 2018 ; Silva et al. , 2019 ) where the agent can modify the dynamics of the environment . Although in our setting , it is the accuracy of the observations rather than the dynamics of the environment that the agent can modify , in some settings our work can be also interpreted as a configurable MDP . We further discuss this point in Section 4.2 . 3 PROPOSED FRAMEWORK AND THE SOLUTION APPROACH . 3.1 PRELIMINARIES . Consider a Markov decision process given by 〈S , A , P , R , Ps0 , γ〉 where S is the state space , A is the set of actions , P : S ×A× S → R denotes the transition probabilities , R : S ×A → R denotes the bounded reward function , Ps0 : S → R denotes the probability distribution over the initial state and γ ∈ ( 0 , 1 ] is the discount factor . The agent , i.e . the decision maker , observes the state of the system st at time t and decides on its action at based on its policy π ( s , a ) . The policy mapping of the agent π ( s , a ) : S × A → [ 0 , 1 ] is possibly stochastic and gives the probability of taking the action a at the state s. After the agent implements the action at , it receives a reward r ( st , at ) and the environment moves to the next state st+1 which is governed by P and depends on at and st . The aim of the RL agent is to learn an optimal policy mapping π ( s , a ) so that the expected return , i.e . expected cumulative discounted reward , J ( π ) = Eat∼π , st∼P [ ∑ t γ tr ( st , at ) ] is maximized . 3.2 PARTIAL OBSERVABILITY . Although most RL algorithms are typically expressed in terms of MDPs , in typical real-life applications the states are not directly observable , i.e. , the observations only provide partial , possibly inaccurate information . For instance , consider a vehicle which uses the noisy images with limited angle-of-view obtained from cameras mounted on the vehicle for autonomous-driving decisions . In such scenarios , the data used by the agent to make decisions is not a direct representation of the state of the world . Hence , we consider a partially observable Markov decision process ( POMDP ) where the above MDP is augmented by O and Po where O represents the set of observations and Po : S → O represents the observation probabilities . Accordingly , the policy mapping is now expressed as π ( o , a ) : O ×A → [ 0 , 1 ] . The observation vector at time t is given by ot = [ o1t ; . . . ; o n t ] ∈ Rn , where n is the dimension of the observation vector . The observations are governed by ot ∼ po ( ot|st ; βt ) ( 1 ) where po ( ot|st ; βt ) denotes the conditional probability distribution function ( pdf ) of ot given st and is parametrized by the accuracy vector βt = [ β 1 t ; . . . ; β n t ] ∈ Rn ( 2 ) The parameter βit ≥ 0 represents the average accuracy of the observation component i at time step t , i.e . oit . For instance , say we have two observations , position o 1 and velocity o2 . Then , β1t denotes the accuracy of the position and β2t denotes the accuracy of the velocity . As β i t increases , the accuracy of the observation oit decreases . Given st and βt , the observations are statistically independent , i.e . we have the factorization po ( ot|st ; βt ) = ∏ i=1 , ... , n poi ( o i t|st ; βit ) ( 3 ) where poi ( oit|st ; βit ) denotes the conditional pdf of oit given st and βit . Note that βit determines the average accuracy , i.e . the accuracy in the statistical sense . We provide an example below : Example : Consider the common Gaussian additive noise model with oit = s i t + v i t , i = 1 , . . . , n , ( 4 ) where st = [ s1t ; . . . ; s n t ] ∈ Rn is the state vector and vt = [ v1t ; . . . ; vnt ] ∈ Rn is the Gaussian noise vector with N ( 0 , diag ( σ2 vit ) ) . Here , vt and vt′ are statistically independent ( stat . ind . ) for all t 6= t′ and also vt and st′ are stat . ind . for all t , t′ . Under this observation model , a reasonable choice for βit is β i t = σ 2 vit . Hence , we parametrize pio ( . ) as p i o ( o i t|sit ; βit ) = N ( sit , βit = σ2vit ) . Note that the parametrization in terms of βit can be done in multiple ways , for instance , one may also adopt βit = σvit .
In contrast to standard reinforcement learning (RL), the paper investigates the variant where the observation made by the agent about its state has a cost. The authors propose to model the problem as a POMDP with an augmented action space (normal action + observation accuracy) and a new reward function that is defined as the original one penalized by the observation cost. They solve the problem with TRPO in three control domains: mountain car, pendulum, and cart pole.
SP:4a1a4003949cbe2f0d0fee232d166874ab52716f
Learning to Observe with Reinforcement Learning
We consider a decision making problem where an autonomous agent decides on which actions to take based on the observations it collects from the environment . We are interested in revealing the information structure of the observation space illustrating which type of observations are the most important ( such as position versus velocity ) and the dependence of this on the state of agent ( such as at the bottom versus top of a hill ) . We approach this problem by associating a cost with collecting observations which increases with the accuracy . We adopt a reinforcement learning ( RL ) framework where the RL agent learns to adjust the accuracy of the observations alongside learning to perform the original task . We consider both the scenario where the accuracy can be adjusted continuously and also the scenario where the agent has to choose between given preset levels , such as taking a sample perfectly or not taking a sample at all . In contrast to the existing work that mostly focuses on sample efficiency during training , our focus is on the behaviour during the actual task . Our results illustrate that the RL agent can learn to use the observation space efficiently and obtain satisfactory performance in the original task while collecting effectively smaller amount of data . By uncovering the relative usefulness of different types of observations and trade-offs within , these results also provide insights for further design of active data acquisition schemes . 1 INTRODUCTION . Autonomous decision making relies on collecting data , i.e . observations , from the environment where the actions are decided based on the observations . We are interested in revealing the information structure of the observation space illustrating which type of observations are the most important ( such as position versus velocity ) . Revealing this structure is challenging since the usefulness of the information that an observation can bring is a priori unknown and depends on the environment as well as the current knowledge state of the decision-maker , for instance , whether the agent is at the bottom versus the top of a hill and how sure the agent is about its position . Hence , we ’ re interested in questions such as “ Instead of collecting all available observations , is it possible to skip some observations and obtain satisfactory performance ? ” , “ Which observation components ( such as the position or the velocity ) are the most useful when the object is far away from ( or close to ) the target state ? ” . The primary aim of this work is to reveal this information structure of the observation space within a systematic framework . We approach this problem by associating a cost with collecting observations which increases with the accuracy . The agent can choose the accuracy level of its observations . Since cost increases with the accuracy , we expect that the agent will choose to collect only the observations which are most likely to be informative and worth the cost . We adopt a reinforcement learning ( RL ) framework where the RL agent learns to adjust the accuracy of the observations alongside learning to perform the original task . We consider both the scenario where the accuracy can be adjusted continuously and also the scenario where the agent has to choose between given preset levels , such as taking a sample perfectly or not taking a sample at all . In contrast to the existing work that mostly focuses on sample efficiency during training , our focus is on the behaviour during the actual task . Our results illustrate that the RL agent can learn to use the observation space efficiently and obtain satisfactory performance in the original task while collecting effectively smaller amount of data . 2 RELATED WORK . A related setting is active learning ( Settles , 2010 ; Donmez et al. , 2010 ) where an agent decides which queries to perform , i.e. , which samples to take , during training . For instance , in an active learning set-up , an agent learning to classify images can decide which images from a large dataset it would like to have labels for in order to have improved classification performance . In a standard active learning approach ( Settles , 2010 ; Donmez et al. , 2010 ) as well as its extensions in RL ( Lopes et al. , 2009 ) , the main aim is to reduce the size of the training set , hence the agent tries to determine informative queries during training so that the performance during the test phase is optimal . In the test phase , the agent can not ask any questions ; instead , it will answer questions , for instance , it will be given images to label . In contrast , in our setting the agent continues to perform queries during the test phase , since it still needs to collect observations during the test phase , for instance as in the case of collecting camera images for an autonomous driving application . From this perspective , one of our main aims is to reduce the number of queries the agent performs during this actual operation as opposed to number of queries in its training phase . Another related line of work consists of the RL approaches that facilitate efficient exploration of state space , such as curiosity-driven RL and intrinsic motivation ( Pathak et al. , 2017 ; Bellemare et al. , 2016 ; Mohamed & Rezende , 2015 ; Still & Precup , 2012 ) or active-inference based methods utilizing free-energy ( Ueltzhöffer , 2018 ; Schwöbel et al. , 2018 ) ; and the works that focus on operation with limited data using a model ( Chua et al. , 2018 ; Deisenroth & Rasmussen , 2011 ; Henaff et al. , 2018 ; Gal et al. , 2016 ) . In these works , the focus is either finding informative samples ( Pathak et al. , 2017 ) or using a limited number of samples/trials as much as possible by making use of a forward dynamics model ( Boedecker et al. , 2014 ; Chua et al. , 2018 ; Deisenroth & Rasmussen , 2011 ; Henaff et al. , 2018 ; Gal et al. , 2016 ) during the agent ’ s training . In contrast to these approaches , we would like to decrease the effective size of the data or the number of samples taken during the test phase , i.e . operation of the agent after the training phase is over . Representation learning for control and RL constitutes another line of related work ( Watter et al. , 2015 ; Hafner et al. , 2019 ; Banijamali et al. , 2018 ) . In these works , the transformation of the observation space to a low-dimensional space is investigated so that action selection can be performed using this low-dimensional space . Similar to these works , our framework can be also interpreted as a transformation of the original observation space where an effectively low-dimensional space is sought after . Instead of allowing a general class of transformations on the observations , here we consider a constrained setting so that only specific operations are allowed , for instance , we allow dropping some of the samples but we do not allow collecting observations and then applying arbitrary transformations on them . Our work associates a cost with obtaining observations . Cost of data acquisition in the context of Markov decision processes ( MDPs ) has been considered in a number of works , both as a direct cost on the observations ( Hansen , 1997 ; Zubek & Dietterich , 2000 ; 2002 ) or as an indirect cost of information sharing in multiple agent settings ( Melo & Veloso , 2009 ; De Hauwere et al. , 2010 ) . Another related line of work is performed under the umbrella of configurable MDPs ( Metelli et al. , 2018 ; Silva et al. , 2019 ) where the agent can modify the dynamics of the environment . Although in our setting , it is the accuracy of the observations rather than the dynamics of the environment that the agent can modify , in some settings our work can be also interpreted as a configurable MDP . We further discuss this point in Section 4.2 . 3 PROPOSED FRAMEWORK AND THE SOLUTION APPROACH . 3.1 PRELIMINARIES . Consider a Markov decision process given by 〈S , A , P , R , Ps0 , γ〉 where S is the state space , A is the set of actions , P : S ×A× S → R denotes the transition probabilities , R : S ×A → R denotes the bounded reward function , Ps0 : S → R denotes the probability distribution over the initial state and γ ∈ ( 0 , 1 ] is the discount factor . The agent , i.e . the decision maker , observes the state of the system st at time t and decides on its action at based on its policy π ( s , a ) . The policy mapping of the agent π ( s , a ) : S × A → [ 0 , 1 ] is possibly stochastic and gives the probability of taking the action a at the state s. After the agent implements the action at , it receives a reward r ( st , at ) and the environment moves to the next state st+1 which is governed by P and depends on at and st . The aim of the RL agent is to learn an optimal policy mapping π ( s , a ) so that the expected return , i.e . expected cumulative discounted reward , J ( π ) = Eat∼π , st∼P [ ∑ t γ tr ( st , at ) ] is maximized . 3.2 PARTIAL OBSERVABILITY . Although most RL algorithms are typically expressed in terms of MDPs , in typical real-life applications the states are not directly observable , i.e. , the observations only provide partial , possibly inaccurate information . For instance , consider a vehicle which uses the noisy images with limited angle-of-view obtained from cameras mounted on the vehicle for autonomous-driving decisions . In such scenarios , the data used by the agent to make decisions is not a direct representation of the state of the world . Hence , we consider a partially observable Markov decision process ( POMDP ) where the above MDP is augmented by O and Po where O represents the set of observations and Po : S → O represents the observation probabilities . Accordingly , the policy mapping is now expressed as π ( o , a ) : O ×A → [ 0 , 1 ] . The observation vector at time t is given by ot = [ o1t ; . . . ; o n t ] ∈ Rn , where n is the dimension of the observation vector . The observations are governed by ot ∼ po ( ot|st ; βt ) ( 1 ) where po ( ot|st ; βt ) denotes the conditional probability distribution function ( pdf ) of ot given st and is parametrized by the accuracy vector βt = [ β 1 t ; . . . ; β n t ] ∈ Rn ( 2 ) The parameter βit ≥ 0 represents the average accuracy of the observation component i at time step t , i.e . oit . For instance , say we have two observations , position o 1 and velocity o2 . Then , β1t denotes the accuracy of the position and β2t denotes the accuracy of the velocity . As β i t increases , the accuracy of the observation oit decreases . Given st and βt , the observations are statistically independent , i.e . we have the factorization po ( ot|st ; βt ) = ∏ i=1 , ... , n poi ( o i t|st ; βit ) ( 3 ) where poi ( oit|st ; βit ) denotes the conditional pdf of oit given st and βit . Note that βit determines the average accuracy , i.e . the accuracy in the statistical sense . We provide an example below : Example : Consider the common Gaussian additive noise model with oit = s i t + v i t , i = 1 , . . . , n , ( 4 ) where st = [ s1t ; . . . ; s n t ] ∈ Rn is the state vector and vt = [ v1t ; . . . ; vnt ] ∈ Rn is the Gaussian noise vector with N ( 0 , diag ( σ2 vit ) ) . Here , vt and vt′ are statistically independent ( stat . ind . ) for all t 6= t′ and also vt and st′ are stat . ind . for all t , t′ . Under this observation model , a reasonable choice for βit is β i t = σ 2 vit . Hence , we parametrize pio ( . ) as p i o ( o i t|sit ; βit ) = N ( sit , βit = σ2vit ) . Note that the parametrization in terms of βit can be done in multiple ways , for instance , one may also adopt βit = σvit .
The paper proposes a reinforcement learning algorithm that enables an agent to "fine tune" the quality/accuracy of its sensors to its current task. The paper considers a partially observable MDP setting where the agent, besides the control actions, is endowed with a set of "tuning actions" that control the noise in the perception of the different components of the state. Additional reward terms are introduced that discourage the use of "tuning". By enabling the agent to fine tune its perception to the current task, the paper seeks to also investigate the relative importance of different state features in terms of the task.
SP:4a1a4003949cbe2f0d0fee232d166874ab52716f
Addressing Extrapolation Error in Deep Offline Reinforcement Learning
1 INTRODUCTION . Agents are , fundamentally , entities which map observations to actions and can be trained with reinforcement learning ( RL ) in either an online or offline fashion . When trained online , an agent learns through trial and error by interacting with its environment . Online RL has had considerable success recently : on Atari ( Mnih et al. , 2015 ) , the game of GO ( Silver et al. , 2017 ) , video games like StarCraft II , and Dota 2 , ( Vinyals et al. , 2019 ; Berner et al. , 2019 ) , and robotics ( Andrychowicz et al. , 2020 ) . However , the requirement of extensive environmental interaction combined with a need for exploratory behavior makes these algorithms unsuitable and potentially unsafe for many real world applications . In contrast , in the offline setting ( Fu et al. , 2020 ; Fujimoto et al. , 2018 ; Gulcehre et al. , 2020 ; Levine et al. , 2020 ) , also known as batch RL ( Ernst et al. , 2005 ; Lange et al. , 2012 ) , agents learn from a fixed dataset which is assumed to have been logged by other ( possibly unknown ) agents . See also Fig . 1 for an illustration of these two settings . Learning purely from logged data allows these algorithms to be more widely applicable , including in problems such as healthcare and self-driving cars , where repeated interaction with the environment is costly and potentially unsafe or unethical , and where logged historical data is abundant . However these algorithms tend to behave considerably worse than their online counterpart . Although similar in principle , there are some important differences between the two regimes . While it is useful for online agents to explore unknown regions of the state space so as to gain knowledge about the environment and better their chances of finding a good policy ( Schmidhuber , 1991 ) , this is not the case for the offline setting . Choosing actions not well-represented in the dataset for offline methods would force the agent to rely on function approximators ’ extrapolation ability . This can lead to substantial errors during training , as well as during deployment of the agent . During training , the extrapolation errors are exacerbated by bootstrapping and the use of max operators ( e.g . in Q-learning ) where evaluating the loss entails taking the maximum over noisy and possibly overestimated values of the different possible actions . This can result in a propagation of the erroneous values , leading to extreme over-estimation of the value function and potentially unbounded error ; see ( Fujimoto et al. , 2019b ) and our remark in Appendix A . As we empirically show in Section 4.2 , extrapolation errors are a different source of overestimation compared to those considered by standard methods such as Double DQN ( Hasselt , 2010 ) , and hence can not be addressed by those approaches . In addition to extrapolation errors during training , a further degradation in performance can result from the use of greedy policies at test time which maximize over value estimates extrapolated to under-represented actions . We propose a coherent set of techniques that work well together to combat extrapolation error and overestimation : Behavior value estimation . First , we address extrapolation errors during training time . Instead of Qπ ∗ , we estimate the value of the behavioral policy QπB , thereby avoid the max-operator during training . To improve upon the behavioral policy , we conduct what amounts to a single step of policy improvement by employing a greedy policy at test time . Surprisingly , this technique with only one round of improvement allows us to perform significantly better than the behavioral policies and often outperform existing offline RL algorithms . Ranking regularization . We introduce a max-margin based regularizer that encourages the value function , represented as a deep neural network , to rank actions present in the observed rewarding episodes higher than any other actions . Intuitively , this regularizer pushes down the value of all unobserved state-action pairs , thereby minimizing the chance of a greedy policy selecting actions under-represented in the dataset . Employing the regularizer during training will minimize the impact of the max-operator used by the greedy policy at test time , i.e . this approach addresses extrapolation errors both at training and ( indirectly ) at test time . Reparametrization of Q-values . While behavior value estimation typically performs well , particularly when combined with ranking regularization , it only allows for one iteration of policy improvement . When more data is available , and hence we can trust our function approximator to capture more of the structure of the state space and as a result generalize better , we can rely on Q-learning which permits multiple policy improvement iterations . However this exacerbates the overestimation issue . We propose , in addition to the ranking loss , a simple reparametrization of the value function to disentangle the scale from the relative ranks of the actions . This reparametrization allows us to introduce a regularization term on the scale of the value function alone , which reduces over-estimation . To evaluate our proposed method , we introduce new datasets based on bsuite environments ( Osband et al. , 2019 ) , as well as the partially observable DeepMind Lab environments ( Beattie et al. , 2016 ) . We further evaluate our method as well as baselines on the RL Unplugged ( RLU ) Atari dataset ( Gulcehre et al. , 2020 ) . We achieve a new state of the art ( SOTA ) performance on the RLU Atari dataset as well as outperform existing SOTA offline RL methods on our newly introduced datasets . Last but not least , we provide careful ablations and analyses that provide insights into our proposed method as well as other existing offline RL algorithms . Related work . Early examples of offline/batch RL include least-squares temporal difference methods ( Bradtke & Barto , 1996 ; Lagoudakis & Parr , 2003 ) and fitted Q iteration ( Ernst et al. , 2005 ; Riedmiller , 2005 ) . Recently , Agarwal et al . ( 2019a ) , Fujimoto et al . ( 2019b ) , Kumar et al . ( 2019 ) , Siegel et al . ( 2020 ) , Wang et al . ( 2020 ) and Ghasemipour et al . ( 2020 ) have proposed offline-RL algorithms and shown that they outperform off-the-shelf off-policy RL methods . There also exist methods explicitly addressing the issues stemming from extrapolation error ( Fujimoto et al. , 2019b ) . 2 BACKGROUND AND PROBLEM STATEMENT . We consider , in this work , Markov Decision Processes ( MDPs ) defined by ( S , A , P , R , ρ0 , γ ) where S is the set of all possible states and A all possible actions . An agent starts in some state s0 ∼ ρ0 ( · ) where ρ0 ( · ) is a distribution over S and takes actions according to its policy a ∼ π ( ·|s ) , a ∈ A , when in state s. Then it observes a new state s′ and reward r according to the transition distribution P ( s′|s , a ) and reward function r ( s , a ) . The state action value function Qπ describes the expected discounted return starting from state s and action a and following π afterwards : Qπ ( s , a ) = E [ ∑ t=0 γtr ( st , at ) ] , s0 = s , a0 = a , st ∼ P ( ·|st−1 , at−1 ) , at ∼ π ( ·|st ) , ( 1 ) and V π ( s ) = Ea∼π ( ·|s ) Qπ ( s , a ) is the state value function . The optimal policy π∗ , which we aim to discover through RL , is one that maximizes the expected cumulative discounted rewards , or expected returns such that Qπ ∗ ( s , a ) ≥ Qπ ( s , a ) ∀s , a , π . For notational simplicity , we denote the policy used to generate an offline dataset as πB1 . In the same vein , for a state s in an offline dataset , we write GB ( s ) to denote an empirical estimate of V πB ( s ) , computed by summing future discounted rewards over the trajectory that s is part of . Approaches to RL can be broadly categorized as either on-policy or off-policy algorithms . Whereas on-policy algorithms update their current policy based on data generated by that same policy , offpolicy approaches can take advantage of data generated by other policies . Algorithms in the mold of fitted Q-iteration make up many of the most popular approaches to deep off-policy RL ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ; Haarnoja et al. , 2018 ) . This class of algorithms learns a Q function by minimizing the Temporal Difference ( TD ) error . To increase stability and sample efficiency , the use of experience replay is also typically employed . For example , DQN ( Mnih et al. , 2015 ) minimizes the following loss function : Lθ′ ( θ ) = E ( s , a , r , s′ ) ∼D ( Qθ ( s , a ) − ( r + γmax a′ Qθ′ ( s ′ , a′ ) ) ) 2 , ( 2 ) where D represents experience replay , i.e . a dataset generated by some behavior policy . Typically , for off-policy algorithms the behavior policy is periodically updated to remain close to the policy being optimized . A deterministic policy can be derived by being greedy with respect to Q̂ , i.e . by defining π ( s ) = arg maxaQ ( s , a ) . In cases where maximization is nontrivial ( e.g . continuous action spaces ) , we typically adopt a separate policy π and optimize losses similar to : Lθ′ ( θ ) = E ( s , a , r , s′ ) ∼D ( Qθ ( s , a ) − ( r+ γEa′∼π ( ·|s′ ) [ Qθ′ ( s′ , a′ ) ] ) ) 2 . In this case , π is optimized separately in order to maximize Ea∼π ( ·|s ) [ Q ( s , a ) ] , sometimes subject to other constraints ( Lillicrap et al. , 2015 ; Haarnoja et al. , 2018 ) . Various extensions have been proposed for this class of algorithms , including but not limited to : distributional critics ( Bellemare et al. , 2017 ) , prioritized replays ( Schaul et al. , 2015 ) , and n-step returns ( Kapturowski et al. , 2019 ; Barth-Maron et al. , 2018 ; Hessel et al. , 2017 ) . In the offline RL setting ( see Figure 1 , right ) , agents learn from fixed datasets generated via other processes , thus rendering off-policy RL algorithms particularly pertinent . Many existing offline RL algorithms adopt variants of Equation ( 2 ) to learn value functions ; e.g . Agarwal et al . ( 2019b ) . Offline RL , however , is different from off-policy learning in the online setting . The dataset used is finite and fixed , and does not track the policy being learned . When a policy moves towards a part of the state space not covered by the behavior policy ( s ) , for example , one can not effectively learn the value function . We will explore this in more detail in the next subsection .
The paper deals with offline aka batch RL for discrete actions. Three techniques ((i) behavior value estimation, (ii) ranking regularization, and (iii) reparametrization of the value function), which can be combined with each other, are presented. These techniques are compared with other methods in different experiments. Furthermore a new benchmark is being introduced. It is claimed that in this new benchmark, the new techniques outperform state-of-the-art methods. Furthermore it is claimed that the presented method „behavior value estimation“, although it is only a one-step greedy optimization is typically already sufficient for dramatic gains.
SP:6fa0afdd0b767254f88f9b06494f4193b4fd2c4f
Addressing Extrapolation Error in Deep Offline Reinforcement Learning
1 INTRODUCTION . Agents are , fundamentally , entities which map observations to actions and can be trained with reinforcement learning ( RL ) in either an online or offline fashion . When trained online , an agent learns through trial and error by interacting with its environment . Online RL has had considerable success recently : on Atari ( Mnih et al. , 2015 ) , the game of GO ( Silver et al. , 2017 ) , video games like StarCraft II , and Dota 2 , ( Vinyals et al. , 2019 ; Berner et al. , 2019 ) , and robotics ( Andrychowicz et al. , 2020 ) . However , the requirement of extensive environmental interaction combined with a need for exploratory behavior makes these algorithms unsuitable and potentially unsafe for many real world applications . In contrast , in the offline setting ( Fu et al. , 2020 ; Fujimoto et al. , 2018 ; Gulcehre et al. , 2020 ; Levine et al. , 2020 ) , also known as batch RL ( Ernst et al. , 2005 ; Lange et al. , 2012 ) , agents learn from a fixed dataset which is assumed to have been logged by other ( possibly unknown ) agents . See also Fig . 1 for an illustration of these two settings . Learning purely from logged data allows these algorithms to be more widely applicable , including in problems such as healthcare and self-driving cars , where repeated interaction with the environment is costly and potentially unsafe or unethical , and where logged historical data is abundant . However these algorithms tend to behave considerably worse than their online counterpart . Although similar in principle , there are some important differences between the two regimes . While it is useful for online agents to explore unknown regions of the state space so as to gain knowledge about the environment and better their chances of finding a good policy ( Schmidhuber , 1991 ) , this is not the case for the offline setting . Choosing actions not well-represented in the dataset for offline methods would force the agent to rely on function approximators ’ extrapolation ability . This can lead to substantial errors during training , as well as during deployment of the agent . During training , the extrapolation errors are exacerbated by bootstrapping and the use of max operators ( e.g . in Q-learning ) where evaluating the loss entails taking the maximum over noisy and possibly overestimated values of the different possible actions . This can result in a propagation of the erroneous values , leading to extreme over-estimation of the value function and potentially unbounded error ; see ( Fujimoto et al. , 2019b ) and our remark in Appendix A . As we empirically show in Section 4.2 , extrapolation errors are a different source of overestimation compared to those considered by standard methods such as Double DQN ( Hasselt , 2010 ) , and hence can not be addressed by those approaches . In addition to extrapolation errors during training , a further degradation in performance can result from the use of greedy policies at test time which maximize over value estimates extrapolated to under-represented actions . We propose a coherent set of techniques that work well together to combat extrapolation error and overestimation : Behavior value estimation . First , we address extrapolation errors during training time . Instead of Qπ ∗ , we estimate the value of the behavioral policy QπB , thereby avoid the max-operator during training . To improve upon the behavioral policy , we conduct what amounts to a single step of policy improvement by employing a greedy policy at test time . Surprisingly , this technique with only one round of improvement allows us to perform significantly better than the behavioral policies and often outperform existing offline RL algorithms . Ranking regularization . We introduce a max-margin based regularizer that encourages the value function , represented as a deep neural network , to rank actions present in the observed rewarding episodes higher than any other actions . Intuitively , this regularizer pushes down the value of all unobserved state-action pairs , thereby minimizing the chance of a greedy policy selecting actions under-represented in the dataset . Employing the regularizer during training will minimize the impact of the max-operator used by the greedy policy at test time , i.e . this approach addresses extrapolation errors both at training and ( indirectly ) at test time . Reparametrization of Q-values . While behavior value estimation typically performs well , particularly when combined with ranking regularization , it only allows for one iteration of policy improvement . When more data is available , and hence we can trust our function approximator to capture more of the structure of the state space and as a result generalize better , we can rely on Q-learning which permits multiple policy improvement iterations . However this exacerbates the overestimation issue . We propose , in addition to the ranking loss , a simple reparametrization of the value function to disentangle the scale from the relative ranks of the actions . This reparametrization allows us to introduce a regularization term on the scale of the value function alone , which reduces over-estimation . To evaluate our proposed method , we introduce new datasets based on bsuite environments ( Osband et al. , 2019 ) , as well as the partially observable DeepMind Lab environments ( Beattie et al. , 2016 ) . We further evaluate our method as well as baselines on the RL Unplugged ( RLU ) Atari dataset ( Gulcehre et al. , 2020 ) . We achieve a new state of the art ( SOTA ) performance on the RLU Atari dataset as well as outperform existing SOTA offline RL methods on our newly introduced datasets . Last but not least , we provide careful ablations and analyses that provide insights into our proposed method as well as other existing offline RL algorithms . Related work . Early examples of offline/batch RL include least-squares temporal difference methods ( Bradtke & Barto , 1996 ; Lagoudakis & Parr , 2003 ) and fitted Q iteration ( Ernst et al. , 2005 ; Riedmiller , 2005 ) . Recently , Agarwal et al . ( 2019a ) , Fujimoto et al . ( 2019b ) , Kumar et al . ( 2019 ) , Siegel et al . ( 2020 ) , Wang et al . ( 2020 ) and Ghasemipour et al . ( 2020 ) have proposed offline-RL algorithms and shown that they outperform off-the-shelf off-policy RL methods . There also exist methods explicitly addressing the issues stemming from extrapolation error ( Fujimoto et al. , 2019b ) . 2 BACKGROUND AND PROBLEM STATEMENT . We consider , in this work , Markov Decision Processes ( MDPs ) defined by ( S , A , P , R , ρ0 , γ ) where S is the set of all possible states and A all possible actions . An agent starts in some state s0 ∼ ρ0 ( · ) where ρ0 ( · ) is a distribution over S and takes actions according to its policy a ∼ π ( ·|s ) , a ∈ A , when in state s. Then it observes a new state s′ and reward r according to the transition distribution P ( s′|s , a ) and reward function r ( s , a ) . The state action value function Qπ describes the expected discounted return starting from state s and action a and following π afterwards : Qπ ( s , a ) = E [ ∑ t=0 γtr ( st , at ) ] , s0 = s , a0 = a , st ∼ P ( ·|st−1 , at−1 ) , at ∼ π ( ·|st ) , ( 1 ) and V π ( s ) = Ea∼π ( ·|s ) Qπ ( s , a ) is the state value function . The optimal policy π∗ , which we aim to discover through RL , is one that maximizes the expected cumulative discounted rewards , or expected returns such that Qπ ∗ ( s , a ) ≥ Qπ ( s , a ) ∀s , a , π . For notational simplicity , we denote the policy used to generate an offline dataset as πB1 . In the same vein , for a state s in an offline dataset , we write GB ( s ) to denote an empirical estimate of V πB ( s ) , computed by summing future discounted rewards over the trajectory that s is part of . Approaches to RL can be broadly categorized as either on-policy or off-policy algorithms . Whereas on-policy algorithms update their current policy based on data generated by that same policy , offpolicy approaches can take advantage of data generated by other policies . Algorithms in the mold of fitted Q-iteration make up many of the most popular approaches to deep off-policy RL ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ; Haarnoja et al. , 2018 ) . This class of algorithms learns a Q function by minimizing the Temporal Difference ( TD ) error . To increase stability and sample efficiency , the use of experience replay is also typically employed . For example , DQN ( Mnih et al. , 2015 ) minimizes the following loss function : Lθ′ ( θ ) = E ( s , a , r , s′ ) ∼D ( Qθ ( s , a ) − ( r + γmax a′ Qθ′ ( s ′ , a′ ) ) ) 2 , ( 2 ) where D represents experience replay , i.e . a dataset generated by some behavior policy . Typically , for off-policy algorithms the behavior policy is periodically updated to remain close to the policy being optimized . A deterministic policy can be derived by being greedy with respect to Q̂ , i.e . by defining π ( s ) = arg maxaQ ( s , a ) . In cases where maximization is nontrivial ( e.g . continuous action spaces ) , we typically adopt a separate policy π and optimize losses similar to : Lθ′ ( θ ) = E ( s , a , r , s′ ) ∼D ( Qθ ( s , a ) − ( r+ γEa′∼π ( ·|s′ ) [ Qθ′ ( s′ , a′ ) ] ) ) 2 . In this case , π is optimized separately in order to maximize Ea∼π ( ·|s ) [ Q ( s , a ) ] , sometimes subject to other constraints ( Lillicrap et al. , 2015 ; Haarnoja et al. , 2018 ) . Various extensions have been proposed for this class of algorithms , including but not limited to : distributional critics ( Bellemare et al. , 2017 ) , prioritized replays ( Schaul et al. , 2015 ) , and n-step returns ( Kapturowski et al. , 2019 ; Barth-Maron et al. , 2018 ; Hessel et al. , 2017 ) . In the offline RL setting ( see Figure 1 , right ) , agents learn from fixed datasets generated via other processes , thus rendering off-policy RL algorithms particularly pertinent . Many existing offline RL algorithms adopt variants of Equation ( 2 ) to learn value functions ; e.g . Agarwal et al . ( 2019b ) . Offline RL , however , is different from off-policy learning in the online setting . The dataset used is finite and fixed , and does not track the policy being learned . When a policy moves towards a part of the state space not covered by the behavior policy ( s ) , for example , one can not effectively learn the value function . We will explore this in more detail in the next subsection .
This paper focuses on the problem of Q value over-estimation in offline reinforcement learning and proposes three approaches (tricks) to help solve this problem. (1) estimate Q value of behavior policy avoiding max-operator in Q learning and take greedy action according to the behavior value estimation. (2) introduce ranking loss to push down the value estimation of all unobserved state-action pairs to avoid over-estimation. (3) use tanh operator to bound the range of Q value estimation, and learn a scale parameter with regularization term. The experimental results on several domains (Atari, Bsuite, Deepmind Lab) with discrete action space show performance better than existing algorithms.
SP:6fa0afdd0b767254f88f9b06494f4193b4fd2c4f
Intriguing class-wise properties of adversarial training
1 INTRODUCTION The existence of adversarial examples ( Szegedy et al. , 2014 ) reveals the vulnerability of deep neural networks , which greatly hinders the practical deployment of deep learning models . Adversarial training ( Madry et al. , 2018 ) has been demonstrated to be one of the most successful defense methods by Athalye et al . ( 2018 ) . Some researchers ( Zhang et al. , 2019 ; Wang et al. , 2019b ; Carmon et al. , 2019 ; Song et al. , 2019 ) have further improved adversarial training through various techniques . Although these efforts have promoted the progress of adversarial training , the performance of robust models is far from satisfactory . Thus we are eager for some new perspectives to break the current dilemma . We notice that focusing on the differences among classes has achieved great success in the research of noisy label ( Wang et al. , 2019a ) and long-tailed data ( Kang et al. , 2019 ) , while researchers in adversarial community mainly concentrate on the overall robustness . A question is then raised : How is the performance of each class in the adversarially robust model ? To explore this question , we conduct extensive experiments on six commonly used datasets in adversarial training , i.e. , MNIST ( LeCun et al. , 1998 ) , CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) , SVHN ( Netzer et al. , 2011 ) , STL-10 ( Coates et al. , 2011 ) and ImageNet ( Deng et al. , 2009 ) , and the pipeline of adversarial training and evaluation follows Madry et al . ( 2018 ) and Wong et al . ( 2019 ) . Figure 1 plots the robustness of each class at different epochs in the test set , where the shaded area in each sub-figure represents the robustness gap between different classes across epochs . Considering the large number of classes in CIFAR-100 and ImageNet , we randomly sample 12 classes for a better indication , and the number of classes in each robustness interval is shown in Appendix A . From Figure 1 , we surprisingly find that there are recognizable robustness gaps between different classes for all datasets . Specifically , for SVHN , CIFAR-10 , STL-10 and CIFAR-100 , the class-wise robustness gaps are obvious and the largest gaps can reach at 40 % -50 % ( Figure 1 ( b ) -1 ( e ) ) . For ImageNet , since the model uses the three-stage training method ( Wong et al. , 2019 ) , its class-wise robustness gap increases with the training epoch , and finally up to 80 % ( Figure 1 ( f ) ) . Even for the simplest dataset MNIST , on which model has achieved more than 95 % overall robustness , the largest class-wise robustness gap still has 6 % ( Figure 1 ( a ) ) . Motivated by the above discovery , we naturally raise the following three questions to better investigate the class-wise properties in the robust model : 1 ) Is there any relations among these different classes as they perform differently ? 2 ) Are there any factors related to the above phenomenon ? 3 ) Is the class-wise performance related to the strength of the attack ? We conduct extensive analysis on the obtained robust models and gain the following insights : • Many examples from a certain class could only be maliciously flipped to some specific classes . As long as we remove those specific classes and re-train the model , these examples will not exist adversarial counterparts in bounded -ball . • The robustness of each class is near monotonically related to its norm of classifier weight in deep neural networks . • In both white-box and black-box settings ( Dong et al. , 2020 ) , stronger attacks are usually more effective for vulnerable classes ( i.e. , their robustness is lower than overall robustness ) . Furthermore , we propose a simple but effective attack called Temperature-PGD attack . It can give us a deeper understanding of how variants of Madry ’ s model work , especially for the robust model with obvious improvement in vulnerable classes ( Wang et al. , 2019b ; Pang et al. , 2020 ) . Thus , our work draws the attention of future researchers to watch out the robustness discrepancies among classes . 2 RELATED WORK Adversarial training . Adversarial training ( Madry et al. , 2018 ) is often formulated as a minmax optimization problem . The inner maximization applies the Projected Gradient Descent ( PGD ) attack to craft adversarial examples , and the outer minimization uses these examples as augmented data to train the model . Subsequent works are then proposed to further improve adversarial training , including introducing regularization term ( Zhang et al. , 2019 ; Wang et al. , 2019b ) , adding unlabeled data ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , and data augmentation ( Song et al. , 2019 ) . Since adversarial training is more time-consuming than standard training , several methods ( Shafahi et al. , 2019 ; Wong et al. , 2019 ) are proposed to accelerate the adversarial training process . Exploring the properties in adversarial training . A lot of researchers try to understand adversarial training from different perspectives . Schmidt et al . ( 2018 ) find more data can improve adversarial training . Tsipras et al . ( 2019 ) demonstrate that adversarial robustness may be inherently at odds with natural accuracy . Zhang & Zhu ( 2019 ) visualize the features of the robust model . Xie & Yuille ( 2019 ) explore the scalability . The work of Ortiz-Jimenez et al . ( 2020 ) is most relevant to ours . The difference is they focus on the distance from each example to the decision boundary , while we provide some new insights on the role of different classes in adversarial training . 3 EXPLORING THE PROPERTIES AMONG DIFFERENT CLASSES ON ADVERSARIAL TRAINING Inspired by the phenomenon in Figure 1 , we further conduct the class-wise analysis to explore the properties among different classes for a better understanding on adversarial training . Datasets . We use six benchmark datasets in adversarial training to obtain the corresponding robust model , i.e. , MNIST ( LeCun et al. , 1998 ) , CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) , SVHN ( Netzer et al. , 2011 ) , STL-10 ( Coates et al. , 2011 ) and ImageNet ( Deng et al. , 2009 ) . Table 1 highlights that the classes of CIFAR-10 and STL-10 can be grouped into two superclasses : Transportation and Animals . Similarly , CIFAR-100 also contains 20 superclasses with each has 5 subclasses . See Appendix B for more details of all datasets . For ImageNet dataset , the pipeline of adversarial training follows Wong et al . ( 2019 ) , while the training methods of other datasets follow Madry et al . ( 2018 ) . The detailed experimental settings are : MNIST setup . Following Zhang et al . ( 2019 ) , we also use a four-layers CNN as the backbone . In the training phase , we adopt the SGD optimizer ( Zinkevich et al. , 2010 ) with momentum 0.9 , weight decay 2×10−4 and an initial learning rate of 0.01 , which is divided by 10 at the 55th , 75th and 90th epoch ( 100 epochs in total ) . Both the training and testing attacker are 40-step PGD ( PGD40 ) with random start , maximum perturbation = 0.3 and step size α = 0.01 . CIFAR-10 & CIFAR-100 setup . Like Wang et al . ( 2019b ) and Zhang et al . ( 2019 ) , we also use ResNet-18 ( He et al. , 2016 ) as the backbone . In the training phase , we use the SGD optimizer with momentum 0.9 , weight decay 2× 10−4 and an initial learning rate of 0.1 , which is divided by 10 at the 75th and 90th epoch ( 100 epochs in total ) . The training and testing attackers are PGD10/PGD20 with random start , maximum perturbation = 0.031 and step size α = 0.007 . SVHN & STL-10 setup . All settings are the same to CIFAR-10 & CIFAR-100 , except that the initial learning rate is 0.01 . ImageNet setup . Following Shafahi et al . ( 2019 ) and Wong et al . ( 2019 ) , we also use ResNet-50 ( He et al. , 2016 ) as the backbone . Specifically , in the training phase , we use the SGD optimizer with momentum 0.9 and weight decay 2×10−4 . A three-stage learning rate schedule is used as the same with Wong et al . ( 2019 ) . The training attacker is FGSM ( Goodfellow et al. , 2015 ) with random start , maximum perturbation = 0.007 , and the testing attacker is PGD50 with random start , maximum perturbation = 0.007 and step size α = 0.003 . For ImageNet dataset , a 14th epoch model is used to evaluate robustness as it did in Wong et al . ( 2019 ) . For other datasets , a 75th epoch model is used like it did in Madry et al . ( 2018 ) . These settings are fixed for all experiments unless otherwise stated . This paper mainly focuses on the adversarial robustness of the model , but the comparisons of the class-wise performance between the robust model and standard model are highlighted in Appendix C for saving space . 3.1 THE RELATIONS AMONG DIFFERENT CLASSES We first systematically investigate the relation of different classes under robust models . Figure 2 shows the confusion matrices of robustness between classes on all the six datasets . The X-axis and Y-axis represent the predicted classes and the ground truth classes , respectively . The grids on the diagonal line represent the robustness of each class , while the grids on the off-diagonal line represent the non-robustness on one class ( Y-axis ) to be misclassified to another class ( X-axis ) . Results Analysis . All the confusion matrices in Figure 2 roughly demonstrate one kind of symmetry , indicating that similar classes could easily be maliciously flipped to each other . Specifically , for SVHN , digits with similar shapes are more likely to be flipped to each other , e.g. , the number 6 and number 8 are similar in shape and the non-robustness between them ( number 6 is misclassified to be number 8 or vice versa ) is very high as shown in Figure 2 ( d ) . For CIFAR-10 and STL-10 , Figures 2 ( b ) and 2 ( e ) clearly show that the classes belonging to the same superclass1 have high probability to be craftily misclassified to each other , for example , both class 3 ( cat ) and class 5 ( dog ) in CIFAR10 belong to the superclass Animals , the non-robustness between them is very high in Figure 2 ( b ) . In contrast , there are few flips between superclasses , since the classes belonging to different superclasses are dissimilar with few mutual influence . For example , in STL-10 , the class 5 ( dog ) belongs to superclass Animals , while class 9 ( truck ) belongs to Transportation , and their non-robustness is almost 0 as shown in figure 2 ( e ) . A t-SNE ( Maaten & Hinton , 2008 ) visualization of CIFAR-10 is reported in Appendix D shows for further supporting our above analysis and conclusions on CIFAR10 . For CIFAR-100 and ImageNet , we can also observe symmetry properties of confusion matrix in Figure 2 ( c ) and Figure 2 ( f ) , indicating that some similar classes cloud easily be misclassified to each other . Overall , Figure 2 demonstrates that the classes with similar semantic would be easier misclassified ( with higher non-robustness ) to each other than those with different semantic ( e.g. , the classes belong to different superclasses ) in adversarial training . Removing the confound class . Inspired by the relations among different classes as shown in Figure 2 , in this subsection , we further investigate the class-wise properties of adversarial examples by removing the confound class . Specifically , for the example x from class i is attacked to the confound 1As we introduced in Table 1 , class 0,1,8,9 belong to superclass Transportation and class 2,3,4,5,6,7 belong to superclass Animals in CIFAR-10 . Similarly , class 0,2,8,9 belong to Transportation and class 1,3,4,5,6,7 belong to Animals in STL-10 . class j , we are curious if we remove confound class j ( i.e. , remove all examples of ground truth class j in the training set ) and re-train the model , will example x become a robust example WITHOUT being maliciously flipped to a new confound class ? Definition 1 . ( Confound Class ) The output class of the model to adversarial example x′ is defined as the confound class of this example x′ . ( This class must be different from ground truth class ) Definition 2 . ( Robust Example ) An example is defined as a robust example if it does not exist adversarial counterpart in bounded -ball , saying it would be correctly classified by the model . Definition 3 . ( Homing Property ) Given an adversarial example x′ from class i which is misclassified as the confound class j by a model , this example satisfies homing property if it becomes a robust example after we re-train the model via removing confound class j . To explore the above question , we conduct extensive experiments on the popular dataset CIFAR-10 as the case study . The results are reported in Figure 3 . Figure 3 ( a ) and Figure 2 ( b ) are similar , and the difference is that the values in Figure 3 ( a ) represent the number of examples instead of percentage , and the diagonal elements ( the number of examples correctly classified ) are hidden for better visualization and comparison . Thus this figure is called as the Misclassified confusion matrix . To check the homing property , we alternatively remove each confound class to re-train the model and plot the results in Figure 3 ( b ) , where the element in the ith row and jth column ( indexed by the classes starting from 0 ) indicates how many adversarial examples with ground truth class i and confound class j that satisfy homing property ( i.e. , these examples will become robust examples after removing the confound class j ) , so this figure is defined as the Homing confusion matrix . Results Analysis . Figure 3 clearly shows homing property is widely observed in many misclassified examples . For example , we can focus on the 9th row and the 1st column of Figure 3 ( a ) and 3 ( b ) . 147 in Figure 3 ( a ) means that 147 examples of class 9 are misclassified as class 1 , and 116 in Figure 3 ( b ) means that if we remove class 1 and re-train the model , 116 of 147 examples will home to the correct class 9 ( i.e. , become robust examples ) . This suggests that improving the robustness of class 9 only needs to carefully handle the relation with class 1 and has nothing to do with other classes . Interestingly , these group-based relations are commonly observed in CIFAR-10 , e.g. , class 0 ( airplane ) -class 8 ( ship ) and class 3 ( cat ) -class 5 ( dog ) . Conclusion and Suggestion . Classes can be divided into several groups , and intra-group classes are easily affected by each other . More importantly , many examples from a certain class are only attacked to some specific classes ( e.g. , most misclassified examples of class 9 are attacked to class 1 ) , which will become robust examples if we re-train the model by removing those specific classes . This discovery inspires us that the robustness of some classes can be handled in groups , e.g. , group by superclass or one-to-one grouping like class 1-class 9 in figure 3 ( b ) . 3.2 THE ROBUSTNESS OF CLASSES V.S . THE WEIGHT OF CLASSIFIER In this section , we attempt to explore whether some factors in the model are related to the unbalanced robustness among different classes in adversarial training . In fact , unbalanced performance is widely studied in the field of long-tailed data research ( Wang et al. , 2017 ) , that is , the number of training examples in each class varies greatly , and the class with a small number of examples can usually achieve lower accuracy since it can not be sufficiently trained . Recently , Kang et al . ( 2019 ) find there is a strong correlation between model parameters and the cardinality of classes , and they propose the state-of-the-art algorithm in long-tailed data research according to this property . Inspired by their work , we naturally curious whether the robustness of each class in adversarial training is related to the model parameters . For a better demonstration , we assume that the feature dimension of the penultimate layer is d and the total number of classes is C. Then the parameter of the last classifier can be represented by a classifier weight W = { wi } ∈ Rd×C and a classifier bias b = { bi } ∈ R1×C , where wi ∈ Rd is the classifier weight corresponding to class i . Similar to Kang et al . ( 2019 ) , we calculate the l2-norm of the classifier weight ‖wi‖2 corresponding to each class i ( i ∈ C ) . To clearly show the relation between the robustness of a class i and its corresponding classifier weight wi , we respectively normalize its robustness and l2-norm of wi , and report the results in Figure 4 . Results Analysis . From Figure 4 , we can find that for most classes , their robustness is positively correlated with their norm of classifier weight , i.e. , higher ( lower ) robustness corresponds to a higher ( lower ) norm of classifier weight . For example , the robustness of class reduced as decreasing of the norm of classifier weight across classes in CIFAR-100 as shown in 4 ( c ) . We also check this kind of correlation in standard training , but the experimental results show no significant correlation between the accuracy of each class and its corresponding norm of classifier weight in standard training . The main reason might be that these datasets in standard training are sufficient for most classes to be well trained , while adversarial training always requires abundant data for training ( Schmidt et al . ( 2018 ) ) , hence the insufficient adversarial data can not guarantee the classifier is well trained and lead to the above experimental observation results . Conclusion and Suggestion . The robustness of each class is near monotonically related to its norm of classifier weight . Inspired by this property , we believe that balancing the norm of classifier weight of each class is a possible way to alleviate the different robustness among classes , thereby improving overall model robustness . 3.3 THE CLASS-WISE ROBUSTNESS UNDER DIFFERENT ATTACKS The above analysis mainly concentrates on the performance under PGD attack . In this section , we investigate the class-wise robustness of state-of-the-art robust models against various popular attacks in the CIFAR-10 dataset . The defense methods we chose include Madry training ( Madry et al. , 2018 ) , TRADES ( Zhang et al. , 2019 ) , MART ( Wang et al. , 2019b ) and RST ( Carmon et al. , 2019 ) . We re-train WideResNet-32-10 ( Zagoruyko & Komodakis , 2016 ) following Madry et al . ( 2018 ) . Other defense methods directly use the models released by the authors . White-box attacks include FGSM ( Goodfellow et al. , 2015 ) , PGD ( Madry et al. , 2018 ) and CW∞ ( Carlini & Wagner , 2017 ) , and the implementation of CW∞ follows ( Carmon et al. , 2019 ) . Black-box attacks include a transfer-based and a query-based attack ( Dong et al. , 2020 ) . The former uses a standard trained WideResNet-32-10 as the substitute model to craft adversarial examples , and the latter uses N atacck ( Li et al. , 2019 ) . See Appendix E for the hyperparameters of all attacks . Results Analysis . As shown in Table 2 , in all models and attacks , there are remarkable robustness gaps between different classes , which further verifies our discovery in Figure 1 . Then we try to compare different attacks from a class-wise perspective . Interestingly , stronger attacks in whitebox settings are usually more effective for vulnerable classes , e.g. , comparing FGSM and PGD , the robustness reduction of the vulnerable classes ( e.g. , class 3 ) is obviously larger than that of robust classes ( e.g. , class 1 ) . In black-box settings , the main advantage of the query-based attack over the transfer-based attack is also concentrated in vulnerable classes . Additionally , we also notice that class 1 and class 3 are always the most robust and vulnerable class in all settings , which suggests the relative robustness of each class may have a strong correlation with the dataset itself . Conclusion and Suggestion . Unbalanced robustness is commonly observed in the defenses of state-of-the-art models against popular attacks , and stronger attacks are usually more powerful for vulnerable classes , e.g. , class 3 . We hope that future attack or defense works can report the results of class-wise robustness to better understand the proposed methods . 4 TEMPERATURE PGD ATTACK Some previous work has improved significantly in the vulnerable classes , such as MART ( Madry et al. , 2018 ) in Table 2 and HE ( Pang et al. , 2020 ) in Table 5 . One simple explanation is that they implicitly use instance-level ( a more fine-grained level than class-level ) information to improve model robustness . Specifically , MART achieves this by re-weighting misclassified examples ( mainly comes from vulnerable classes ) in the regular term . HE uses the re-scaled coefficient ( s in their paper ) to make the misclassified examples provide a larger gradient for the model ( more details can be found in Appendix G ) . Since the misclassified examples have received higher weight during the training process , the classification boundary of each class will be more complex , and the variance of the predicted probability of example x in each class i ( i ∈ C ) will be smaller , that is , the output distribution will be more smooth as shown in Figure 5 ( b ) -5 ( d ) ( MART ) . The vanilla PGD attacker may not be able to find the most effective direction in such a smooth probability distribution . Figure 5 ( a ) and Figure 5 ( e ) represents the mean value of the variance of the output probability distribution for each class . Specifically , the calculation process of class 0 in the Madry ’ s model is as follows : First , we calculate the variance of the prediction distribution of each examples with ground truth class 0 in CIFAR-10 , and then use these variance to obtain the mean value . This value can well reflect the smoothness of the output distribution of each class . Combine information from Table 2 , Figure 5 and Table 5 , the stronger model has a lower variance than the weak model , and the vulnerable class has a lower variance than the robust class . ( HE-LIS and HE-CMP are our improved methods based on HE which can boost robustness of vulnerable classes under vanilla PGD attack , see Appendix G for details ) . In order to find an effective direction in the extremely smooth distribution , we propose to use a temperature factor to change the smooth probability distribution , so as to create virtual power in the possible adversarial direction . For a better formulation , we assume that the DNN is f , the input sample is x , the number of classes in the dataset is C , then the softmax probability of this sample x corresponding to class i ( i ∈ C ) is S ( f ( x ) ) i = ef ( x ) i/T∑C k=1 e f ( x ) k/T ( 1 ) Using this improved softmax function , the adversarial perturbation crafted at tth step is δt+1 = ∏ ( δ t + α · sign ( ∇LCE ( S ( f ( x+ δt ) ) , y ) ) ) ( 2 ) Where ∏ is the projection operation , which ensures that δ is in -ball . LCE is the cross-entropy loss . α is the step size . y is the ground truth class . Figure 5 ( f ) -5 ( h ) is a good example of how Temperature-PGD works . This method allows us to arbitrarily control the absolute value of the gradient , and the idea of creating virtual power may The data in Table 3 is the result of comparing the performance of model robustness under Temperature-PGD attack with the vanilla PGD data in Table 2 . We find this method can reduce the overall robustness of the state-of-the-art models by 1.8 % -3.9 % , where the robustness of the vulnerable class ( i.e. , class 4 ) can be reduced by 4.2 % -10.2 % , which is consistent with our previous findings . Since the model output of Madry ’ s model is relatively more certain ( Figure 5 ( b ) -5 ( d ) ) , the effectiveness of Temperature-PGD is not obvious . See Appendix F for more ablation studies . In general , Temperature-PGD is a powerful tool for evaluating the defense which explicitly or implicitly use instance-wise information to improve model robustness . More importantly , it can give researchers a new perspective of how variants of Madry ’ s model work . We speculate that the robustness improvement of many current state-of-the-art models may be due to this phenomenon . For example , label-smoothing-based defenses ( Goibert & Dohmatob , 2019 ; Cheng et al. , 2020 ) may not be able to defense Temperature-PGD attack , since these methods explicitly flat the distribution of predicted probabilities . 5 CONCLUSION In this paper , we conduct a class-wise investigation in adversarial training based on the observation that robustness between each class has a recognizable gap , and reveal three intriguing properties among classes in the robust model : 1 ) Group-based relations between classes are commonly observed , and many adversarial examples satisfy the homing property . 2 ) The robustness of each class is positively correlated with its norm of classifier weight . 3 ) Stronger attacks are usually more effective for vulnerable classes , and we propose an attack to better understand the defense mechanism of some state-of-the-art models from the class-wise perspective . Based on these properties , we propose three promising guidelines for future improvements in model robustness : 1 ) Deal with different classes by groups . 2 ) Balance the norm of classifier weight corresponding to each class . 3 ) Pay more attention to classes suffering from poor robustness . We believe these findings can promote the progress of adversarial training and help to build the state-of-the-art robustness model . REFERENCES Anish Athalye , Nicholas Carlini , and David Wagner . Obfuscated gradients give a false sense of security : Circumventing defenses to adversarial examples . In ICML , pp . 274–283 , 2018 . Yoshua Bengio , Jérôme Louradour , Ronan Collobert , and Jason Weston . Curriculum learning . In ICML , pp . 41–48 , 2009 . Nicholas Carlini and David Wagner . Towards evaluating the robustness of neural networks . In S & P , pp . 39–57 . IEEE , 2017 . Yair Carmon , Aditi Raghunathan , Ludwig Schmidt , John C Duchi , and Percy S Liang . Unlabeled data improves adversarial robustness . In NeurIPS , pp . 11192–11203 , 2019 . Minhao Cheng , Qi Lei , Pin-Yu Chen , Inderjit Dhillon , and Cho-Jui Hsieh . Cat : Customized adversarial training for improved robustness . arXiv preprint arXiv:2002.06789 , 2020 . Adam Coates , Andrew Ng , and Honglak Lee . An analysis of single-layer networks in unsupervised feature learning . In Proceedings of the fourteenth international conference on artificial intelligence and statistics , pp . 215–223 , 2011 . Jia Deng , Wei Dong , Richard Socher , Li-Jia Li , Kai Li , and Li Fei-Fei . Imagenet : A large-scale hierarchical image database . In CVPR , pp . 248–255 . Ieee , 2009 . Yinpeng Dong , Qi-An Fu , Xiao Yang , Tianyu Pang , Hang Su , Zihao Xiao , and Jun Zhu . Benchmarking adversarial robustness on image classification . In CVPR , pp . 321–331 , 2020 . Morgane Goibert and Elvis Dohmatob . Adversarial robustness via adversarial label-smoothing . arXiv preprint arXiv:1906.11567 , 2019 . Ian J Goodfellow , Jonathon Shlens , and Christian Szegedy . Explaining and harnessing adversarial examples . ICLR , 2015 . Sven Gowal , Jonathan Uesato , Chongli Qin , Po-Sen Huang , Timothy Mann , and Pushmeet Kohli . An alternative surrogate loss for pgd-based adversarial testing . arXiv preprint arXiv:1910.09338 , 2019 . Yandong Guo and Lei Zhang . One-shot face recognition by promoting underrepresented classes . arXiv preprint arXiv:1707.05574 , 2017 . Kaiming He , Xiangyu Zhang , Shaoqing Ren , and Jian Sun . Deep residual learning for image recognition . In CVPR , pp . 770–778 , 2016 . Bingyi Kang , Saining Xie , Marcus Rohrbach , Zhicheng Yan , Albert Gordo , Jiashi Feng , and Yannis Kalantidis . Decoupling representation and classifier for long-tailed recognition . In ICLR , 2019 . Alex Krizhevsky , Geoffrey Hinton , et al . Learning multiple layers of features from tiny images . 2009 . Yann LeCun , Léon Bottou , Yoshua Bengio , and Patrick Haffner . Gradient-based learning applied to document recognition . Proceedings of the IEEE , 86 ( 11 ) :2278–2324 , 1998 . Yandong Li , Lijun Li , Liqiang Wang , Tong Zhang , and Boqing Gong . Nattack : Learning the distributions of adversarial examples for an improved black-box attack on deep neural networks . In ICML , pp . 3866–3876 , 2019 . Weiyang Liu , Yandong Wen , Zhiding Yu , and Meng Yang . Large-margin softmax loss for convolutional neural networks . In ICML , volume 2 , pp . 7 , 2016 . Laurens van der Maaten and Geoffrey Hinton . Visualizing data using t-sne . Journal of machine learning research , 9 ( Nov ) :2579–2605 , 2008 . Aleksander Madry , Aleksandar Makelov , Ludwig Schmidt , Dimitris Tsipras , and Adrian Vladu . Towards deep learning models resistant to adversarial attacks . In ICLR , 2018 . Yuval Netzer , Tao Wang , Adam Coates , Alessandro Bissacco , Bo Wu , and Andrew Y Ng . Reading digits in natural images with unsupervised feature learning . 2011 . Guillermo Ortiz-Jimenez , Apostolos Modas , Seyed-Mohsen Moosavi-Dezfooli , and Pascal Frossard . Optimism in the face of adversity : Understanding and improving deep learning through adversarial robustness . arXiv preprint arXiv:2010.09624 , 2020 . Tianyu Pang , Xiao Yang , Yinpeng Dong , Kun Xu , Hang Su , and Jun Zhu . Boosting adversarial training with hypersphere embedding . NeurIPS , 2020 . Adam Paszke , Sam Gross , Francisco Massa , Adam Lerer , James Bradbury , Gregory Chanan , Trevor Killeen , Zeming Lin , Natalia Gimelshein , Luca Antiga , et al . Pytorch : An imperative style , highperformance deep learning library . In NeurIPS , pp . 8026–8037 , 2019 . M.J.D . Powell . Nonlinear Programming . New York : Academic Press , 1970 . Rajeev Ranjan , Carlos D Castillo , and Rama Chellappa . L2-constrained softmax loss for discriminative face verification . arXiv preprint arXiv:1703.09507 , 2017 . Mengye Ren , Wenyuan Zeng , Bin Yang , and Raquel Urtasun . Learning to reweight examples for robust deep learning . arXiv preprint arXiv:1803.09050 , 2018 . Ludwig Schmidt , Shibani Santurkar , Dimitris Tsipras , Kunal Talwar , and Aleksander Madry . Adversarially robust generalization requires more data . In NeurIPS , pp . 5014–5026 , 2018 . Ali Shafahi , Mahyar Najibi , Mohammad Amin Ghiasi , Zheng Xu , John Dickerson , Christoph Studer , Larry S Davis , Gavin Taylor , and Tom Goldstein . Adversarial training for free ! In NeurIPS , pp . 3358–3369 , 2019 . Chuanbiao Song , Kun He , Jiadong Lin , Liwei Wang , and John E Hopcroft . Robust local features for improving the generalization of adversarial training . In ICLR , 2019 . Christian Szegedy , Wojciech Zaremba , Ilya Sutskever , Joan Bruna , Dumitru Erhan , Ian Goodfellow , and Rob Fergus . Intriguing properties of neural networks . ICLR , 2014 . Antonio Torralba , Rob Fergus , and William T Freeman . 80 million tiny images : A large data set for nonparametric object and scene recognition . TPAMI , 30 ( 11 ) :1958–1970 , 2008 . Dimitris Tsipras , Shibani Santurkar , Logan Engstrom , Alexander Turner , and Aleksander Madry . Robustness may be at odds with accuracy . In ICLR , number 2019 , 2019 . Jonathan Uesato , Jean-Baptiste Alayrac , Po-Sen Huang , Robert Stanforth , Alhussein Fawzi , and Pushmeet Kohli . Are labels required for improving adversarial robustness ? arXiv preprint arXiv:1905.13725 , 2019 . Yisen Wang , Xingjun Ma , Zaiyi Chen , Yuan Luo , Jinfeng Yi , and James Bailey . Symmetric cross entropy for robust learning with noisy labels . In CVPR , pp . 322–330 , 2019a . Yisen Wang , Din Zou , Jinfeng Yi , James Bailey , Xingjun Ma , and Quanquan Gu . Improving adversarial robustness requires revisiting misclassified examples . In ICLR , 2019b . Yu-Xiong Wang , Deva Ramanan , and Martial Hebert . Learning to model the tail . In NeurIPS , pp . 7029–7039 , 2017 . Eric Wong , Leslie Rice , and J Zico Kolter . Fast is better than free : Revisiting adversarial training . In ICLR , 2019 . Cihang Xie and Alan Yuille . Intriguing properties of adversarial training at scale . In ICLR , 2019 . Sergey Zagoruyko and Nikos Komodakis . Wide residual networks . arXiv preprint arXiv:1605.07146 , 2016 . Runtian Zhai , Tianle Cai , Di He , Chen Dan , Kun He , John Hopcroft , and Liwei Wang . Adversarially robust generalization just requires more unlabeled data . arXiv preprint arXiv:1906.00555 , 2019 . Hongyang Zhang , Yaodong Yu , Jiantao Jiao , Eric Xing , Laurent El Ghaoui , and Michael I Jordan . Theoretically principled trade-off between robustness and accuracy . In ICML , 2019 . Tianyuan Zhang and Zhanxing Zhu . Interpreting adversarially trained convolutional neural networks . In ICML , pp . 7502–7511 , 2019 . Bolei Zhou , Agata Lapedriza , Aditya Khosla , Aude Oliva , and Antonio Torralba . Places : A 10 million image database for scene recognition . TPAMI , 40 ( 6 ) :1452–1464 , 2017 . Martin Zinkevich , Markus Weimer , Lihong Li , and Alex J Smola . Parallelized stochastic gradient descent . In NeurIPS , pp . 2595–2603 , 2010 . A THE NUMBER OF CLASSES IN EACH ROBUSTNESS INTERVAL OF CIFAR-100 AND IMAGENET Due to the large number of classes in CIFAR-100 and ImageNet , we randomly sample 12 classes for analysis in the above paper . For the sake of experimental completeness , the number of classes in different robustness intervals is shown in Figure 6 . Obviously , the robustness of the classes is distributed at multiple intervals , which is consistent with the results shown in Figure 1 . B INTRODUCTION TO THE DATASETS USED IN THE EXPERIMENT A variety of datasets are used for research on adversarial training . Here , we introduce in detail the six datasets used in our experiment . MNIST . MNIST ( LeCun et al. , 1998 ) is a handwritten digit dataset , containing numbers 0 to 9 . The dataset consists of 60,000 training images and 10,000 test images , with 6,000 and 1,000 images per digit . All images are fixed size ( 28×28 pixels ) with a value of 0 to 1 , and these digits are located in the center of the image . This dataset is widely used in adversarial training ( Madry et al. , 2018 ; Zhang et al. , 2019 ; Wang et al. , 2019b ; Carmon et al. , 2019 ) . CIFAR-10 & CIFAR-100 . CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) are labeled subsets of the 80 million tiny images dataset ( Torralba et al. , 2008 ) . CIFAR-10 consists of 50,000 training images and 10,000 test images in 10 classes , with 5,000 and 1,000 images per class . CIFAR-100 has the same total number of images as CIFAR-10 , but it has 100 classes . Thus CIFAR-100 has only 500 training images and 100 test images per class . All images in these two datasets are 32×32 threechannel color images . As mentioned in Section 3 , CIFAR-10 can be grouped into 2 superclasses and CIFAR-100 can be grouped into 20 superclasses . CIFAR-10 is the most popular dataset for adversarial training ( Dong et al. , 2020 ) and all proposed methods are evaluated in this dataset . CIFAR-100 is more challenging than CIFAR-10 , Shafahi et al . ( 2019 ) and Song et al . ( 2019 ) evaluate their defense methods in CIFAR-100 . SVHN . SVHN ( Netzer et al. , 2011 ) is similar in flavor to MNIST and both of them contain 10 digits . SVHN contains 73,257 labeled digits for training , 26,032 labeled digits for testing and over 600,000 unlabeled digits images for semi-supervised or unsupervised training . In order to maintain MNIST-like style , SVHN crops the image to a size of 32×32 . As a result , many of the images do contain some distractors at the sides . Due to SVHN is obtained from house numbers in the real world , its data distribution is more complicated than MNIST . Uesato et al . ( 2019 ) and Zhai et al . ( 2019 ) use this dataset for semi-supervised adversarial training . STL-10 . STL-10 ( Coates et al. , 2011 ) is inspired by the CIFAR-10 and sampled from images in the ImageNet ( Deng et al. , 2009 ) . STL-10 also contains 10 classes and each class has only 500 training images and 800 test images . The size of all images is 96×96 . As mentioned in Section 3 , STL-10 can be grouped into 2 superclasses . Song et al . ( 2019 ) use this dataset to evaluate their proposed method . ImageNet . ImageNet ( Deng et al. , 2009 ) is a high-resolution image dataset with 1000 classes . It contains 1,281,167 training images , 50,000 validation images and 100,000 test images . Since the test set has no labels , the validation set is often used to evaluate model robustness . The speed of training a robust model on ImageNet is intolerable , so using this dataset to evaluate model robustness usually requires some accelerated training techniques ( Shafahi et al. , 2019 ; Wong et al. , 2019 ) . C COMPARE CLASS-WISE GAPS BETWEEN ADVERSARIAL TRAINING AND STANDARD TRAINING In the above paper , we mainly focus on the robustness gap in the model obtained by adversarial training . Since Wang et al . ( 2019a ) also report the emergence of unbalanced accuracy in the standard model , we compare this phenomenon with that in the robust model to highlight the differences between adversarial training and standard training . Experimental setup . We use the pre-trained model of Pytorch ( Paszke et al. , 2019 ) as the standard model for ImageNet . For other datasets , the experimental settings of standard models are the same as the robust models mentioned in Section 3 , but adversarial examples are not added to the training set . Figure 7 shows the class-wise accuracy in standard training and class-wise robustness in adversarial training . The slashed part in each sub-figure represents the largest gap in accuracy/robustness among different classes , and the classes in the bracket represent the highest and lowest accuracy/robustness class . Note that natural test images are evaluated for standard training , while adversarial test images are used for adversarial training . Results Analysis . As illustrated in Figure 7 , the relative order of accuracy/robustness of different classes is almost the same in standard training and adversarial training , but the class-wise gap is enlarged in adversarial training . For example , in CIFAR-10 and SVHN datasets , their largest classwise accuracy gap in standard training are 10.7 % ( Figure 7 ( b ) ) and 5.4 % ( Figure 7 ( d ) ) , but these indicators are enlarged to 52.8 % ( Figure 7 ( b ) ) and 37.0 % ( Figure 7 ( d ) ) in adversarial training . In more complex datasets , such as STL10 , CIFAR-100 and ImageNet , although standard models also have imbalanced accuracy between classes , these gaps in adversarial training are still larger . Conclusion . The performance discrepancies among classes in the robust model are larger than that of the standard model . e.g. , the largest gap in CIFAR-10 is enlarged from 10.7 % in the standard model to 52.8 % in the robust model . D T-SNE VISUALIZATION OF CIFAR-10 In the evaluation phase , we show the t-SNE ( Maaten & Hinton , 2008 ) visualization of CIFAR-10 to further demonstrate the property of the two superclasses Transportation and Animals in this dataset . The results of Figure 8 ( a ) and Figure 8 ( b ) show that the datapoints between Transportation ( class 0,1,8,9 ) and Animals ( class 2,3,4,5,6,7 ) can be clearly distinguished , while the datapoints between the inner classes in Animals are completely confused , which confirms our analysis in Section 3.1 . E HYPERPARAMETERS FOR POPULAR ATTACKS ON THE STATE-OF-THE-ART MODELS FGSM setup . Random start , maximum perturbation = 0.031 . PGD setup . Random start , maximum perturbation = 0.031 . For RST model , step size = 0.01 and steps α = 40 , following Carmon et al . ( 2019 ) . For other models , step size = 0.003 and steps α = 20 . CW∞ setup . Binary search steps b = 5 , maximum perturbation times n = 1000 , learning rate lr = 0.005 , initial constant c0 = 0.01 , τ decrease factor γ = 0.9 . Similar to Carmon et al . ( 2019 ) , we randomly sample 2000 images to evaluate model robustness , and 200 images per class . Transfer-based attack setup . All settings are the same to PGD for the substitute standard model . N attack setup . Random start , maximum perturbation = 0.031 , population size npop = 300 , noise standard deviation σ = 0.1 and learning rate lr = 0.02 . Similar to Li et al . ( 2019 ) , we randomly sample 2000 images to evaluate model robustness , and 200 images per class . F ABLATION EXPERIMENT OF TEMPERATURE-PGD ATTACK The data in Table 4 is similar to Table 3 , except that 1/T is different . Combined with the results of Table 3 , we can find the robustness of vulnerable classes ( e.g. , class 4 ) in TRADES , MART and RST has a significant decrease in all 1/T settings . When 1/T is set to 2 , the overall robustness of the model trained by Madry et al . ( 2018 ) is no exception reduced by 0.26 % , with the most significant decrease by 2.8 % in class 4 . Furthermore , the decline of the overall robustness in Madry ’ s model is indeed lower than that in other models , One possible explanation is that these improved robust models may obfuscate gradients Athalye et al . ( 2018 ) in vulnerable classes , and theoretical analysis is left to the future . Recently , Pang et al . ( 2020 ) combine feature normalization ( FN ) ( Ranjan et al. , 2017 ) , weight normalization ( WN ) ( Guo & Zhang , 2017 ) and angular margins ( AM ) ( Liu et al. , 2016 ) to propose a defense method that can boost model robustness . In their paper , they believe that using FN and WN to limit embeddings on the hypersphere is the key to robustness improvement , so they call their method hypersphere embedding ( HE ) . However , we find that the factor ( temperature factor in our paper ) for scaling WN is the real key to improve robustness . We try to understand this from a point of view they overlooked . Our analysis mainly focuses on FN and WN , following Pang et al . ( 2020 ) . For a better formulation , we assume the input sample is x , the extracted feature of an example in the penultimate layer is z ∈ Rd , the number of classes in the dataset is C , the scale factor is s ( corresponds to the 1/T in our paper ) and the parameter of the last classifier is W = { wi } ∈ Rd×C , where wi ∈ Rd is the classifier weight corresponding to class i . Then FN operation is z̃ = z/‖z‖2 , WN operation is w̃i = wi/‖wi‖2 and the probability Pi of this sample x corresponding to class i ( i ∈ C ) after the softmax function S is Pi = S ( z ) = ew̃i T·z̃·s∑C k=1 e w̃k T·z̃·s = ew̃i T·z̃/T∑C k=1 e w̃k T·z̃/T ( 3 ) The gradient of cross-entropy loss LCE corresponding to wi is ∇wiLCE = { ( Pi − 1 ) · z i = y Pi · z i 6= y ( 4 ) Equation ( 3 ) and Equation ( 4 ) suggest we can change Pi by adjusting T and finally control∇wiLCE . e.g. , the maximum probability for an example is class l , then Pl = 1 if 1/T →∞ and Pl = 1/C if 1/T → 0 . For better demonstration , suppose that there is a three classification task ( Figure 9 ) . The top three figures represent equation ( 3 ) and the bottom three figures represent the corresponding equation ( 4 ) . The light-colored bars in the top three figures indicate the sum of the probabilities should be equal to 1 . The bars corresponding to the pink arrows in Figure 9 ( b ) and Figure 9 ( e ) have the same length , and Figure 9 ( c ) and Figure 9 ( f ) are similar . Specifically , we consider an adversarial example , i.e. , the highest probability of this example is usually the incorrect class . Figures 9 ( a ) and 9 ( d ) represent the probability and gradient of this example after softmax . When 1/T > 1 ( Figures 9 ( b ) and 9 ( e ) ) , this example is considered by the model as a harder example ( the probability of the adversarial class becomes larger ) , so that the model can update more gradients based on this example . Similarly , when 1/T < 1 ( Figures 9 ( c ) and 9 ( f ) ) , this example becomes simpler for the model and obtains a smaller gradient . Overall , these figures clearly show that we can adjust the gradient through the temperature factor 1/T . According to the above analysis and learn from the ideas of curriculum learning ( Bengio et al. , 2009 ) , we believe the gradient should be gradually enlarged ( by increasing 1/T ) during adversarial training , instead of using a fixed 1/T like Pang et al . ( 2020 ) . Specifically , the following two schedules to adjust 1/T are proposed : Linear Interpolation Schedule ( LIS ) . We use a simple linear interpolation schedule to adjust 1/T . Therefore , the 1/T of nth epoch is 1 Tn = 1 T0 + n nFI ( 1 TFI − 1 T0 ) ( 5 ) In our implementation , the initial temperature factor 1/T0 = 1 and the final temperature factor of the interpolation 1/TFI = 75 , where the subscript FI is short for final interpolation . The final epoch of the interpolation is equal to the total training epoch nFI = ntot = 100 . The training pipeline follows Pang et al . ( 2020 ) , but we do not use angular margins . Other hyperparameters are the same to Section 3 . Control Maximum Probability ( CMP ) . At each epoch , we can accurately calculate the required 1/T according to equation ( 3 ) to control the maximum probability . Since equation ( 3 ) is a nonlinear function , Powell ’ s dogleg method ( Powell , 1970 ) is used to solve this function . Therefore , the maximum probability Pmax of all examples in nth epoch isP max n = P max 0 + n nFI ( PmaxFI − Pmax0 ) 0 ≤ n < nFI Pmaxn = 1 nFI ≤ n < ntot ( 6 ) In our implementation , the initial maximum probability Pmax0 = 0.2 and the final maximum probability of the interpolation PmaxFI = 1 . The final epoch of the interpolation nFI = 90 , while the total training epoch ntot = 100 . For the last 10 epochs , the maximum probability is always controlled at 1 . Other settings are the same to Linear Interpolation Schedule . We use the above methods to train ResNet-18 on CIFAR-10 and choose vanilla PGD20 attack to evaluate model robustness . For a fair comparison , we also re-train ResNet18 following Madry et al . ( 2018 ) and Pang et al . ( 2020 ) . As shown in Table 5 , our methods HE-LIS and HE-CMP have further boosted the model robustness . Especially , the improvement of vulnerable classes ( e.g. , class 3 and class 4 ) is impressive . This seems to be an exciting result because the robustness gaps between classes are largely reduced . Unfortunately , these improved methods can not defend the Temperature-PGD attack . As shown in Table 6 , the numbers in the first row indicate the different 1/T . The improvement disappears when 1/T in Temperature-PGD is large enough . We have analyzed it in Section 4
This paper examines the robustness of adversarially robust models at the class-level. Specifically, they note a disparity in the class-wise robustness of models for standard datasets. Furthermore, they suggest that many of these class-level vulnerabilities are eliminated if the model is trained without the corresponding confounding class. Finally, they propose a temperature based attack to further degrade accuracy of vulnerable classes.
SP:62517d35207a58ae175ea3c3787512424e8ece51
Intriguing class-wise properties of adversarial training
1 INTRODUCTION The existence of adversarial examples ( Szegedy et al. , 2014 ) reveals the vulnerability of deep neural networks , which greatly hinders the practical deployment of deep learning models . Adversarial training ( Madry et al. , 2018 ) has been demonstrated to be one of the most successful defense methods by Athalye et al . ( 2018 ) . Some researchers ( Zhang et al. , 2019 ; Wang et al. , 2019b ; Carmon et al. , 2019 ; Song et al. , 2019 ) have further improved adversarial training through various techniques . Although these efforts have promoted the progress of adversarial training , the performance of robust models is far from satisfactory . Thus we are eager for some new perspectives to break the current dilemma . We notice that focusing on the differences among classes has achieved great success in the research of noisy label ( Wang et al. , 2019a ) and long-tailed data ( Kang et al. , 2019 ) , while researchers in adversarial community mainly concentrate on the overall robustness . A question is then raised : How is the performance of each class in the adversarially robust model ? To explore this question , we conduct extensive experiments on six commonly used datasets in adversarial training , i.e. , MNIST ( LeCun et al. , 1998 ) , CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) , SVHN ( Netzer et al. , 2011 ) , STL-10 ( Coates et al. , 2011 ) and ImageNet ( Deng et al. , 2009 ) , and the pipeline of adversarial training and evaluation follows Madry et al . ( 2018 ) and Wong et al . ( 2019 ) . Figure 1 plots the robustness of each class at different epochs in the test set , where the shaded area in each sub-figure represents the robustness gap between different classes across epochs . Considering the large number of classes in CIFAR-100 and ImageNet , we randomly sample 12 classes for a better indication , and the number of classes in each robustness interval is shown in Appendix A . From Figure 1 , we surprisingly find that there are recognizable robustness gaps between different classes for all datasets . Specifically , for SVHN , CIFAR-10 , STL-10 and CIFAR-100 , the class-wise robustness gaps are obvious and the largest gaps can reach at 40 % -50 % ( Figure 1 ( b ) -1 ( e ) ) . For ImageNet , since the model uses the three-stage training method ( Wong et al. , 2019 ) , its class-wise robustness gap increases with the training epoch , and finally up to 80 % ( Figure 1 ( f ) ) . Even for the simplest dataset MNIST , on which model has achieved more than 95 % overall robustness , the largest class-wise robustness gap still has 6 % ( Figure 1 ( a ) ) . Motivated by the above discovery , we naturally raise the following three questions to better investigate the class-wise properties in the robust model : 1 ) Is there any relations among these different classes as they perform differently ? 2 ) Are there any factors related to the above phenomenon ? 3 ) Is the class-wise performance related to the strength of the attack ? We conduct extensive analysis on the obtained robust models and gain the following insights : • Many examples from a certain class could only be maliciously flipped to some specific classes . As long as we remove those specific classes and re-train the model , these examples will not exist adversarial counterparts in bounded -ball . • The robustness of each class is near monotonically related to its norm of classifier weight in deep neural networks . • In both white-box and black-box settings ( Dong et al. , 2020 ) , stronger attacks are usually more effective for vulnerable classes ( i.e. , their robustness is lower than overall robustness ) . Furthermore , we propose a simple but effective attack called Temperature-PGD attack . It can give us a deeper understanding of how variants of Madry ’ s model work , especially for the robust model with obvious improvement in vulnerable classes ( Wang et al. , 2019b ; Pang et al. , 2020 ) . Thus , our work draws the attention of future researchers to watch out the robustness discrepancies among classes . 2 RELATED WORK Adversarial training . Adversarial training ( Madry et al. , 2018 ) is often formulated as a minmax optimization problem . The inner maximization applies the Projected Gradient Descent ( PGD ) attack to craft adversarial examples , and the outer minimization uses these examples as augmented data to train the model . Subsequent works are then proposed to further improve adversarial training , including introducing regularization term ( Zhang et al. , 2019 ; Wang et al. , 2019b ) , adding unlabeled data ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , and data augmentation ( Song et al. , 2019 ) . Since adversarial training is more time-consuming than standard training , several methods ( Shafahi et al. , 2019 ; Wong et al. , 2019 ) are proposed to accelerate the adversarial training process . Exploring the properties in adversarial training . A lot of researchers try to understand adversarial training from different perspectives . Schmidt et al . ( 2018 ) find more data can improve adversarial training . Tsipras et al . ( 2019 ) demonstrate that adversarial robustness may be inherently at odds with natural accuracy . Zhang & Zhu ( 2019 ) visualize the features of the robust model . Xie & Yuille ( 2019 ) explore the scalability . The work of Ortiz-Jimenez et al . ( 2020 ) is most relevant to ours . The difference is they focus on the distance from each example to the decision boundary , while we provide some new insights on the role of different classes in adversarial training . 3 EXPLORING THE PROPERTIES AMONG DIFFERENT CLASSES ON ADVERSARIAL TRAINING Inspired by the phenomenon in Figure 1 , we further conduct the class-wise analysis to explore the properties among different classes for a better understanding on adversarial training . Datasets . We use six benchmark datasets in adversarial training to obtain the corresponding robust model , i.e. , MNIST ( LeCun et al. , 1998 ) , CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) , SVHN ( Netzer et al. , 2011 ) , STL-10 ( Coates et al. , 2011 ) and ImageNet ( Deng et al. , 2009 ) . Table 1 highlights that the classes of CIFAR-10 and STL-10 can be grouped into two superclasses : Transportation and Animals . Similarly , CIFAR-100 also contains 20 superclasses with each has 5 subclasses . See Appendix B for more details of all datasets . For ImageNet dataset , the pipeline of adversarial training follows Wong et al . ( 2019 ) , while the training methods of other datasets follow Madry et al . ( 2018 ) . The detailed experimental settings are : MNIST setup . Following Zhang et al . ( 2019 ) , we also use a four-layers CNN as the backbone . In the training phase , we adopt the SGD optimizer ( Zinkevich et al. , 2010 ) with momentum 0.9 , weight decay 2×10−4 and an initial learning rate of 0.01 , which is divided by 10 at the 55th , 75th and 90th epoch ( 100 epochs in total ) . Both the training and testing attacker are 40-step PGD ( PGD40 ) with random start , maximum perturbation = 0.3 and step size α = 0.01 . CIFAR-10 & CIFAR-100 setup . Like Wang et al . ( 2019b ) and Zhang et al . ( 2019 ) , we also use ResNet-18 ( He et al. , 2016 ) as the backbone . In the training phase , we use the SGD optimizer with momentum 0.9 , weight decay 2× 10−4 and an initial learning rate of 0.1 , which is divided by 10 at the 75th and 90th epoch ( 100 epochs in total ) . The training and testing attackers are PGD10/PGD20 with random start , maximum perturbation = 0.031 and step size α = 0.007 . SVHN & STL-10 setup . All settings are the same to CIFAR-10 & CIFAR-100 , except that the initial learning rate is 0.01 . ImageNet setup . Following Shafahi et al . ( 2019 ) and Wong et al . ( 2019 ) , we also use ResNet-50 ( He et al. , 2016 ) as the backbone . Specifically , in the training phase , we use the SGD optimizer with momentum 0.9 and weight decay 2×10−4 . A three-stage learning rate schedule is used as the same with Wong et al . ( 2019 ) . The training attacker is FGSM ( Goodfellow et al. , 2015 ) with random start , maximum perturbation = 0.007 , and the testing attacker is PGD50 with random start , maximum perturbation = 0.007 and step size α = 0.003 . For ImageNet dataset , a 14th epoch model is used to evaluate robustness as it did in Wong et al . ( 2019 ) . For other datasets , a 75th epoch model is used like it did in Madry et al . ( 2018 ) . These settings are fixed for all experiments unless otherwise stated . This paper mainly focuses on the adversarial robustness of the model , but the comparisons of the class-wise performance between the robust model and standard model are highlighted in Appendix C for saving space . 3.1 THE RELATIONS AMONG DIFFERENT CLASSES We first systematically investigate the relation of different classes under robust models . Figure 2 shows the confusion matrices of robustness between classes on all the six datasets . The X-axis and Y-axis represent the predicted classes and the ground truth classes , respectively . The grids on the diagonal line represent the robustness of each class , while the grids on the off-diagonal line represent the non-robustness on one class ( Y-axis ) to be misclassified to another class ( X-axis ) . Results Analysis . All the confusion matrices in Figure 2 roughly demonstrate one kind of symmetry , indicating that similar classes could easily be maliciously flipped to each other . Specifically , for SVHN , digits with similar shapes are more likely to be flipped to each other , e.g. , the number 6 and number 8 are similar in shape and the non-robustness between them ( number 6 is misclassified to be number 8 or vice versa ) is very high as shown in Figure 2 ( d ) . For CIFAR-10 and STL-10 , Figures 2 ( b ) and 2 ( e ) clearly show that the classes belonging to the same superclass1 have high probability to be craftily misclassified to each other , for example , both class 3 ( cat ) and class 5 ( dog ) in CIFAR10 belong to the superclass Animals , the non-robustness between them is very high in Figure 2 ( b ) . In contrast , there are few flips between superclasses , since the classes belonging to different superclasses are dissimilar with few mutual influence . For example , in STL-10 , the class 5 ( dog ) belongs to superclass Animals , while class 9 ( truck ) belongs to Transportation , and their non-robustness is almost 0 as shown in figure 2 ( e ) . A t-SNE ( Maaten & Hinton , 2008 ) visualization of CIFAR-10 is reported in Appendix D shows for further supporting our above analysis and conclusions on CIFAR10 . For CIFAR-100 and ImageNet , we can also observe symmetry properties of confusion matrix in Figure 2 ( c ) and Figure 2 ( f ) , indicating that some similar classes cloud easily be misclassified to each other . Overall , Figure 2 demonstrates that the classes with similar semantic would be easier misclassified ( with higher non-robustness ) to each other than those with different semantic ( e.g. , the classes belong to different superclasses ) in adversarial training . Removing the confound class . Inspired by the relations among different classes as shown in Figure 2 , in this subsection , we further investigate the class-wise properties of adversarial examples by removing the confound class . Specifically , for the example x from class i is attacked to the confound 1As we introduced in Table 1 , class 0,1,8,9 belong to superclass Transportation and class 2,3,4,5,6,7 belong to superclass Animals in CIFAR-10 . Similarly , class 0,2,8,9 belong to Transportation and class 1,3,4,5,6,7 belong to Animals in STL-10 . class j , we are curious if we remove confound class j ( i.e. , remove all examples of ground truth class j in the training set ) and re-train the model , will example x become a robust example WITHOUT being maliciously flipped to a new confound class ? Definition 1 . ( Confound Class ) The output class of the model to adversarial example x′ is defined as the confound class of this example x′ . ( This class must be different from ground truth class ) Definition 2 . ( Robust Example ) An example is defined as a robust example if it does not exist adversarial counterpart in bounded -ball , saying it would be correctly classified by the model . Definition 3 . ( Homing Property ) Given an adversarial example x′ from class i which is misclassified as the confound class j by a model , this example satisfies homing property if it becomes a robust example after we re-train the model via removing confound class j . To explore the above question , we conduct extensive experiments on the popular dataset CIFAR-10 as the case study . The results are reported in Figure 3 . Figure 3 ( a ) and Figure 2 ( b ) are similar , and the difference is that the values in Figure 3 ( a ) represent the number of examples instead of percentage , and the diagonal elements ( the number of examples correctly classified ) are hidden for better visualization and comparison . Thus this figure is called as the Misclassified confusion matrix . To check the homing property , we alternatively remove each confound class to re-train the model and plot the results in Figure 3 ( b ) , where the element in the ith row and jth column ( indexed by the classes starting from 0 ) indicates how many adversarial examples with ground truth class i and confound class j that satisfy homing property ( i.e. , these examples will become robust examples after removing the confound class j ) , so this figure is defined as the Homing confusion matrix . Results Analysis . Figure 3 clearly shows homing property is widely observed in many misclassified examples . For example , we can focus on the 9th row and the 1st column of Figure 3 ( a ) and 3 ( b ) . 147 in Figure 3 ( a ) means that 147 examples of class 9 are misclassified as class 1 , and 116 in Figure 3 ( b ) means that if we remove class 1 and re-train the model , 116 of 147 examples will home to the correct class 9 ( i.e. , become robust examples ) . This suggests that improving the robustness of class 9 only needs to carefully handle the relation with class 1 and has nothing to do with other classes . Interestingly , these group-based relations are commonly observed in CIFAR-10 , e.g. , class 0 ( airplane ) -class 8 ( ship ) and class 3 ( cat ) -class 5 ( dog ) . Conclusion and Suggestion . Classes can be divided into several groups , and intra-group classes are easily affected by each other . More importantly , many examples from a certain class are only attacked to some specific classes ( e.g. , most misclassified examples of class 9 are attacked to class 1 ) , which will become robust examples if we re-train the model by removing those specific classes . This discovery inspires us that the robustness of some classes can be handled in groups , e.g. , group by superclass or one-to-one grouping like class 1-class 9 in figure 3 ( b ) . 3.2 THE ROBUSTNESS OF CLASSES V.S . THE WEIGHT OF CLASSIFIER In this section , we attempt to explore whether some factors in the model are related to the unbalanced robustness among different classes in adversarial training . In fact , unbalanced performance is widely studied in the field of long-tailed data research ( Wang et al. , 2017 ) , that is , the number of training examples in each class varies greatly , and the class with a small number of examples can usually achieve lower accuracy since it can not be sufficiently trained . Recently , Kang et al . ( 2019 ) find there is a strong correlation between model parameters and the cardinality of classes , and they propose the state-of-the-art algorithm in long-tailed data research according to this property . Inspired by their work , we naturally curious whether the robustness of each class in adversarial training is related to the model parameters . For a better demonstration , we assume that the feature dimension of the penultimate layer is d and the total number of classes is C. Then the parameter of the last classifier can be represented by a classifier weight W = { wi } ∈ Rd×C and a classifier bias b = { bi } ∈ R1×C , where wi ∈ Rd is the classifier weight corresponding to class i . Similar to Kang et al . ( 2019 ) , we calculate the l2-norm of the classifier weight ‖wi‖2 corresponding to each class i ( i ∈ C ) . To clearly show the relation between the robustness of a class i and its corresponding classifier weight wi , we respectively normalize its robustness and l2-norm of wi , and report the results in Figure 4 . Results Analysis . From Figure 4 , we can find that for most classes , their robustness is positively correlated with their norm of classifier weight , i.e. , higher ( lower ) robustness corresponds to a higher ( lower ) norm of classifier weight . For example , the robustness of class reduced as decreasing of the norm of classifier weight across classes in CIFAR-100 as shown in 4 ( c ) . We also check this kind of correlation in standard training , but the experimental results show no significant correlation between the accuracy of each class and its corresponding norm of classifier weight in standard training . The main reason might be that these datasets in standard training are sufficient for most classes to be well trained , while adversarial training always requires abundant data for training ( Schmidt et al . ( 2018 ) ) , hence the insufficient adversarial data can not guarantee the classifier is well trained and lead to the above experimental observation results . Conclusion and Suggestion . The robustness of each class is near monotonically related to its norm of classifier weight . Inspired by this property , we believe that balancing the norm of classifier weight of each class is a possible way to alleviate the different robustness among classes , thereby improving overall model robustness . 3.3 THE CLASS-WISE ROBUSTNESS UNDER DIFFERENT ATTACKS The above analysis mainly concentrates on the performance under PGD attack . In this section , we investigate the class-wise robustness of state-of-the-art robust models against various popular attacks in the CIFAR-10 dataset . The defense methods we chose include Madry training ( Madry et al. , 2018 ) , TRADES ( Zhang et al. , 2019 ) , MART ( Wang et al. , 2019b ) and RST ( Carmon et al. , 2019 ) . We re-train WideResNet-32-10 ( Zagoruyko & Komodakis , 2016 ) following Madry et al . ( 2018 ) . Other defense methods directly use the models released by the authors . White-box attacks include FGSM ( Goodfellow et al. , 2015 ) , PGD ( Madry et al. , 2018 ) and CW∞ ( Carlini & Wagner , 2017 ) , and the implementation of CW∞ follows ( Carmon et al. , 2019 ) . Black-box attacks include a transfer-based and a query-based attack ( Dong et al. , 2020 ) . The former uses a standard trained WideResNet-32-10 as the substitute model to craft adversarial examples , and the latter uses N atacck ( Li et al. , 2019 ) . See Appendix E for the hyperparameters of all attacks . Results Analysis . As shown in Table 2 , in all models and attacks , there are remarkable robustness gaps between different classes , which further verifies our discovery in Figure 1 . Then we try to compare different attacks from a class-wise perspective . Interestingly , stronger attacks in whitebox settings are usually more effective for vulnerable classes , e.g. , comparing FGSM and PGD , the robustness reduction of the vulnerable classes ( e.g. , class 3 ) is obviously larger than that of robust classes ( e.g. , class 1 ) . In black-box settings , the main advantage of the query-based attack over the transfer-based attack is also concentrated in vulnerable classes . Additionally , we also notice that class 1 and class 3 are always the most robust and vulnerable class in all settings , which suggests the relative robustness of each class may have a strong correlation with the dataset itself . Conclusion and Suggestion . Unbalanced robustness is commonly observed in the defenses of state-of-the-art models against popular attacks , and stronger attacks are usually more powerful for vulnerable classes , e.g. , class 3 . We hope that future attack or defense works can report the results of class-wise robustness to better understand the proposed methods . 4 TEMPERATURE PGD ATTACK Some previous work has improved significantly in the vulnerable classes , such as MART ( Madry et al. , 2018 ) in Table 2 and HE ( Pang et al. , 2020 ) in Table 5 . One simple explanation is that they implicitly use instance-level ( a more fine-grained level than class-level ) information to improve model robustness . Specifically , MART achieves this by re-weighting misclassified examples ( mainly comes from vulnerable classes ) in the regular term . HE uses the re-scaled coefficient ( s in their paper ) to make the misclassified examples provide a larger gradient for the model ( more details can be found in Appendix G ) . Since the misclassified examples have received higher weight during the training process , the classification boundary of each class will be more complex , and the variance of the predicted probability of example x in each class i ( i ∈ C ) will be smaller , that is , the output distribution will be more smooth as shown in Figure 5 ( b ) -5 ( d ) ( MART ) . The vanilla PGD attacker may not be able to find the most effective direction in such a smooth probability distribution . Figure 5 ( a ) and Figure 5 ( e ) represents the mean value of the variance of the output probability distribution for each class . Specifically , the calculation process of class 0 in the Madry ’ s model is as follows : First , we calculate the variance of the prediction distribution of each examples with ground truth class 0 in CIFAR-10 , and then use these variance to obtain the mean value . This value can well reflect the smoothness of the output distribution of each class . Combine information from Table 2 , Figure 5 and Table 5 , the stronger model has a lower variance than the weak model , and the vulnerable class has a lower variance than the robust class . ( HE-LIS and HE-CMP are our improved methods based on HE which can boost robustness of vulnerable classes under vanilla PGD attack , see Appendix G for details ) . In order to find an effective direction in the extremely smooth distribution , we propose to use a temperature factor to change the smooth probability distribution , so as to create virtual power in the possible adversarial direction . For a better formulation , we assume that the DNN is f , the input sample is x , the number of classes in the dataset is C , then the softmax probability of this sample x corresponding to class i ( i ∈ C ) is S ( f ( x ) ) i = ef ( x ) i/T∑C k=1 e f ( x ) k/T ( 1 ) Using this improved softmax function , the adversarial perturbation crafted at tth step is δt+1 = ∏ ( δ t + α · sign ( ∇LCE ( S ( f ( x+ δt ) ) , y ) ) ) ( 2 ) Where ∏ is the projection operation , which ensures that δ is in -ball . LCE is the cross-entropy loss . α is the step size . y is the ground truth class . Figure 5 ( f ) -5 ( h ) is a good example of how Temperature-PGD works . This method allows us to arbitrarily control the absolute value of the gradient , and the idea of creating virtual power may The data in Table 3 is the result of comparing the performance of model robustness under Temperature-PGD attack with the vanilla PGD data in Table 2 . We find this method can reduce the overall robustness of the state-of-the-art models by 1.8 % -3.9 % , where the robustness of the vulnerable class ( i.e. , class 4 ) can be reduced by 4.2 % -10.2 % , which is consistent with our previous findings . Since the model output of Madry ’ s model is relatively more certain ( Figure 5 ( b ) -5 ( d ) ) , the effectiveness of Temperature-PGD is not obvious . See Appendix F for more ablation studies . In general , Temperature-PGD is a powerful tool for evaluating the defense which explicitly or implicitly use instance-wise information to improve model robustness . More importantly , it can give researchers a new perspective of how variants of Madry ’ s model work . We speculate that the robustness improvement of many current state-of-the-art models may be due to this phenomenon . For example , label-smoothing-based defenses ( Goibert & Dohmatob , 2019 ; Cheng et al. , 2020 ) may not be able to defense Temperature-PGD attack , since these methods explicitly flat the distribution of predicted probabilities . 5 CONCLUSION In this paper , we conduct a class-wise investigation in adversarial training based on the observation that robustness between each class has a recognizable gap , and reveal three intriguing properties among classes in the robust model : 1 ) Group-based relations between classes are commonly observed , and many adversarial examples satisfy the homing property . 2 ) The robustness of each class is positively correlated with its norm of classifier weight . 3 ) Stronger attacks are usually more effective for vulnerable classes , and we propose an attack to better understand the defense mechanism of some state-of-the-art models from the class-wise perspective . Based on these properties , we propose three promising guidelines for future improvements in model robustness : 1 ) Deal with different classes by groups . 2 ) Balance the norm of classifier weight corresponding to each class . 3 ) Pay more attention to classes suffering from poor robustness . We believe these findings can promote the progress of adversarial training and help to build the state-of-the-art robustness model . REFERENCES Anish Athalye , Nicholas Carlini , and David Wagner . Obfuscated gradients give a false sense of security : Circumventing defenses to adversarial examples . In ICML , pp . 274–283 , 2018 . Yoshua Bengio , Jérôme Louradour , Ronan Collobert , and Jason Weston . Curriculum learning . In ICML , pp . 41–48 , 2009 . Nicholas Carlini and David Wagner . Towards evaluating the robustness of neural networks . In S & P , pp . 39–57 . IEEE , 2017 . Yair Carmon , Aditi Raghunathan , Ludwig Schmidt , John C Duchi , and Percy S Liang . Unlabeled data improves adversarial robustness . In NeurIPS , pp . 11192–11203 , 2019 . Minhao Cheng , Qi Lei , Pin-Yu Chen , Inderjit Dhillon , and Cho-Jui Hsieh . Cat : Customized adversarial training for improved robustness . arXiv preprint arXiv:2002.06789 , 2020 . Adam Coates , Andrew Ng , and Honglak Lee . An analysis of single-layer networks in unsupervised feature learning . In Proceedings of the fourteenth international conference on artificial intelligence and statistics , pp . 215–223 , 2011 . Jia Deng , Wei Dong , Richard Socher , Li-Jia Li , Kai Li , and Li Fei-Fei . Imagenet : A large-scale hierarchical image database . In CVPR , pp . 248–255 . Ieee , 2009 . Yinpeng Dong , Qi-An Fu , Xiao Yang , Tianyu Pang , Hang Su , Zihao Xiao , and Jun Zhu . Benchmarking adversarial robustness on image classification . In CVPR , pp . 321–331 , 2020 . Morgane Goibert and Elvis Dohmatob . Adversarial robustness via adversarial label-smoothing . arXiv preprint arXiv:1906.11567 , 2019 . Ian J Goodfellow , Jonathon Shlens , and Christian Szegedy . Explaining and harnessing adversarial examples . ICLR , 2015 . Sven Gowal , Jonathan Uesato , Chongli Qin , Po-Sen Huang , Timothy Mann , and Pushmeet Kohli . An alternative surrogate loss for pgd-based adversarial testing . arXiv preprint arXiv:1910.09338 , 2019 . Yandong Guo and Lei Zhang . One-shot face recognition by promoting underrepresented classes . arXiv preprint arXiv:1707.05574 , 2017 . Kaiming He , Xiangyu Zhang , Shaoqing Ren , and Jian Sun . Deep residual learning for image recognition . In CVPR , pp . 770–778 , 2016 . Bingyi Kang , Saining Xie , Marcus Rohrbach , Zhicheng Yan , Albert Gordo , Jiashi Feng , and Yannis Kalantidis . Decoupling representation and classifier for long-tailed recognition . In ICLR , 2019 . Alex Krizhevsky , Geoffrey Hinton , et al . Learning multiple layers of features from tiny images . 2009 . Yann LeCun , Léon Bottou , Yoshua Bengio , and Patrick Haffner . Gradient-based learning applied to document recognition . Proceedings of the IEEE , 86 ( 11 ) :2278–2324 , 1998 . Yandong Li , Lijun Li , Liqiang Wang , Tong Zhang , and Boqing Gong . Nattack : Learning the distributions of adversarial examples for an improved black-box attack on deep neural networks . In ICML , pp . 3866–3876 , 2019 . Weiyang Liu , Yandong Wen , Zhiding Yu , and Meng Yang . Large-margin softmax loss for convolutional neural networks . In ICML , volume 2 , pp . 7 , 2016 . Laurens van der Maaten and Geoffrey Hinton . Visualizing data using t-sne . Journal of machine learning research , 9 ( Nov ) :2579–2605 , 2008 . Aleksander Madry , Aleksandar Makelov , Ludwig Schmidt , Dimitris Tsipras , and Adrian Vladu . Towards deep learning models resistant to adversarial attacks . In ICLR , 2018 . Yuval Netzer , Tao Wang , Adam Coates , Alessandro Bissacco , Bo Wu , and Andrew Y Ng . Reading digits in natural images with unsupervised feature learning . 2011 . Guillermo Ortiz-Jimenez , Apostolos Modas , Seyed-Mohsen Moosavi-Dezfooli , and Pascal Frossard . Optimism in the face of adversity : Understanding and improving deep learning through adversarial robustness . arXiv preprint arXiv:2010.09624 , 2020 . Tianyu Pang , Xiao Yang , Yinpeng Dong , Kun Xu , Hang Su , and Jun Zhu . Boosting adversarial training with hypersphere embedding . NeurIPS , 2020 . Adam Paszke , Sam Gross , Francisco Massa , Adam Lerer , James Bradbury , Gregory Chanan , Trevor Killeen , Zeming Lin , Natalia Gimelshein , Luca Antiga , et al . Pytorch : An imperative style , highperformance deep learning library . In NeurIPS , pp . 8026–8037 , 2019 . M.J.D . Powell . Nonlinear Programming . New York : Academic Press , 1970 . Rajeev Ranjan , Carlos D Castillo , and Rama Chellappa . L2-constrained softmax loss for discriminative face verification . arXiv preprint arXiv:1703.09507 , 2017 . Mengye Ren , Wenyuan Zeng , Bin Yang , and Raquel Urtasun . Learning to reweight examples for robust deep learning . arXiv preprint arXiv:1803.09050 , 2018 . Ludwig Schmidt , Shibani Santurkar , Dimitris Tsipras , Kunal Talwar , and Aleksander Madry . Adversarially robust generalization requires more data . In NeurIPS , pp . 5014–5026 , 2018 . Ali Shafahi , Mahyar Najibi , Mohammad Amin Ghiasi , Zheng Xu , John Dickerson , Christoph Studer , Larry S Davis , Gavin Taylor , and Tom Goldstein . Adversarial training for free ! In NeurIPS , pp . 3358–3369 , 2019 . Chuanbiao Song , Kun He , Jiadong Lin , Liwei Wang , and John E Hopcroft . Robust local features for improving the generalization of adversarial training . In ICLR , 2019 . Christian Szegedy , Wojciech Zaremba , Ilya Sutskever , Joan Bruna , Dumitru Erhan , Ian Goodfellow , and Rob Fergus . Intriguing properties of neural networks . ICLR , 2014 . Antonio Torralba , Rob Fergus , and William T Freeman . 80 million tiny images : A large data set for nonparametric object and scene recognition . TPAMI , 30 ( 11 ) :1958–1970 , 2008 . Dimitris Tsipras , Shibani Santurkar , Logan Engstrom , Alexander Turner , and Aleksander Madry . Robustness may be at odds with accuracy . In ICLR , number 2019 , 2019 . Jonathan Uesato , Jean-Baptiste Alayrac , Po-Sen Huang , Robert Stanforth , Alhussein Fawzi , and Pushmeet Kohli . Are labels required for improving adversarial robustness ? arXiv preprint arXiv:1905.13725 , 2019 . Yisen Wang , Xingjun Ma , Zaiyi Chen , Yuan Luo , Jinfeng Yi , and James Bailey . Symmetric cross entropy for robust learning with noisy labels . In CVPR , pp . 322–330 , 2019a . Yisen Wang , Din Zou , Jinfeng Yi , James Bailey , Xingjun Ma , and Quanquan Gu . Improving adversarial robustness requires revisiting misclassified examples . In ICLR , 2019b . Yu-Xiong Wang , Deva Ramanan , and Martial Hebert . Learning to model the tail . In NeurIPS , pp . 7029–7039 , 2017 . Eric Wong , Leslie Rice , and J Zico Kolter . Fast is better than free : Revisiting adversarial training . In ICLR , 2019 . Cihang Xie and Alan Yuille . Intriguing properties of adversarial training at scale . In ICLR , 2019 . Sergey Zagoruyko and Nikos Komodakis . Wide residual networks . arXiv preprint arXiv:1605.07146 , 2016 . Runtian Zhai , Tianle Cai , Di He , Chen Dan , Kun He , John Hopcroft , and Liwei Wang . Adversarially robust generalization just requires more unlabeled data . arXiv preprint arXiv:1906.00555 , 2019 . Hongyang Zhang , Yaodong Yu , Jiantao Jiao , Eric Xing , Laurent El Ghaoui , and Michael I Jordan . Theoretically principled trade-off between robustness and accuracy . In ICML , 2019 . Tianyuan Zhang and Zhanxing Zhu . Interpreting adversarially trained convolutional neural networks . In ICML , pp . 7502–7511 , 2019 . Bolei Zhou , Agata Lapedriza , Aditya Khosla , Aude Oliva , and Antonio Torralba . Places : A 10 million image database for scene recognition . TPAMI , 40 ( 6 ) :1452–1464 , 2017 . Martin Zinkevich , Markus Weimer , Lihong Li , and Alex J Smola . Parallelized stochastic gradient descent . In NeurIPS , pp . 2595–2603 , 2010 . A THE NUMBER OF CLASSES IN EACH ROBUSTNESS INTERVAL OF CIFAR-100 AND IMAGENET Due to the large number of classes in CIFAR-100 and ImageNet , we randomly sample 12 classes for analysis in the above paper . For the sake of experimental completeness , the number of classes in different robustness intervals is shown in Figure 6 . Obviously , the robustness of the classes is distributed at multiple intervals , which is consistent with the results shown in Figure 1 . B INTRODUCTION TO THE DATASETS USED IN THE EXPERIMENT A variety of datasets are used for research on adversarial training . Here , we introduce in detail the six datasets used in our experiment . MNIST . MNIST ( LeCun et al. , 1998 ) is a handwritten digit dataset , containing numbers 0 to 9 . The dataset consists of 60,000 training images and 10,000 test images , with 6,000 and 1,000 images per digit . All images are fixed size ( 28×28 pixels ) with a value of 0 to 1 , and these digits are located in the center of the image . This dataset is widely used in adversarial training ( Madry et al. , 2018 ; Zhang et al. , 2019 ; Wang et al. , 2019b ; Carmon et al. , 2019 ) . CIFAR-10 & CIFAR-100 . CIFAR-10 & CIFAR-100 ( Krizhevsky et al. , 2009 ) are labeled subsets of the 80 million tiny images dataset ( Torralba et al. , 2008 ) . CIFAR-10 consists of 50,000 training images and 10,000 test images in 10 classes , with 5,000 and 1,000 images per class . CIFAR-100 has the same total number of images as CIFAR-10 , but it has 100 classes . Thus CIFAR-100 has only 500 training images and 100 test images per class . All images in these two datasets are 32×32 threechannel color images . As mentioned in Section 3 , CIFAR-10 can be grouped into 2 superclasses and CIFAR-100 can be grouped into 20 superclasses . CIFAR-10 is the most popular dataset for adversarial training ( Dong et al. , 2020 ) and all proposed methods are evaluated in this dataset . CIFAR-100 is more challenging than CIFAR-10 , Shafahi et al . ( 2019 ) and Song et al . ( 2019 ) evaluate their defense methods in CIFAR-100 . SVHN . SVHN ( Netzer et al. , 2011 ) is similar in flavor to MNIST and both of them contain 10 digits . SVHN contains 73,257 labeled digits for training , 26,032 labeled digits for testing and over 600,000 unlabeled digits images for semi-supervised or unsupervised training . In order to maintain MNIST-like style , SVHN crops the image to a size of 32×32 . As a result , many of the images do contain some distractors at the sides . Due to SVHN is obtained from house numbers in the real world , its data distribution is more complicated than MNIST . Uesato et al . ( 2019 ) and Zhai et al . ( 2019 ) use this dataset for semi-supervised adversarial training . STL-10 . STL-10 ( Coates et al. , 2011 ) is inspired by the CIFAR-10 and sampled from images in the ImageNet ( Deng et al. , 2009 ) . STL-10 also contains 10 classes and each class has only 500 training images and 800 test images . The size of all images is 96×96 . As mentioned in Section 3 , STL-10 can be grouped into 2 superclasses . Song et al . ( 2019 ) use this dataset to evaluate their proposed method . ImageNet . ImageNet ( Deng et al. , 2009 ) is a high-resolution image dataset with 1000 classes . It contains 1,281,167 training images , 50,000 validation images and 100,000 test images . Since the test set has no labels , the validation set is often used to evaluate model robustness . The speed of training a robust model on ImageNet is intolerable , so using this dataset to evaluate model robustness usually requires some accelerated training techniques ( Shafahi et al. , 2019 ; Wong et al. , 2019 ) . C COMPARE CLASS-WISE GAPS BETWEEN ADVERSARIAL TRAINING AND STANDARD TRAINING In the above paper , we mainly focus on the robustness gap in the model obtained by adversarial training . Since Wang et al . ( 2019a ) also report the emergence of unbalanced accuracy in the standard model , we compare this phenomenon with that in the robust model to highlight the differences between adversarial training and standard training . Experimental setup . We use the pre-trained model of Pytorch ( Paszke et al. , 2019 ) as the standard model for ImageNet . For other datasets , the experimental settings of standard models are the same as the robust models mentioned in Section 3 , but adversarial examples are not added to the training set . Figure 7 shows the class-wise accuracy in standard training and class-wise robustness in adversarial training . The slashed part in each sub-figure represents the largest gap in accuracy/robustness among different classes , and the classes in the bracket represent the highest and lowest accuracy/robustness class . Note that natural test images are evaluated for standard training , while adversarial test images are used for adversarial training . Results Analysis . As illustrated in Figure 7 , the relative order of accuracy/robustness of different classes is almost the same in standard training and adversarial training , but the class-wise gap is enlarged in adversarial training . For example , in CIFAR-10 and SVHN datasets , their largest classwise accuracy gap in standard training are 10.7 % ( Figure 7 ( b ) ) and 5.4 % ( Figure 7 ( d ) ) , but these indicators are enlarged to 52.8 % ( Figure 7 ( b ) ) and 37.0 % ( Figure 7 ( d ) ) in adversarial training . In more complex datasets , such as STL10 , CIFAR-100 and ImageNet , although standard models also have imbalanced accuracy between classes , these gaps in adversarial training are still larger . Conclusion . The performance discrepancies among classes in the robust model are larger than that of the standard model . e.g. , the largest gap in CIFAR-10 is enlarged from 10.7 % in the standard model to 52.8 % in the robust model . D T-SNE VISUALIZATION OF CIFAR-10 In the evaluation phase , we show the t-SNE ( Maaten & Hinton , 2008 ) visualization of CIFAR-10 to further demonstrate the property of the two superclasses Transportation and Animals in this dataset . The results of Figure 8 ( a ) and Figure 8 ( b ) show that the datapoints between Transportation ( class 0,1,8,9 ) and Animals ( class 2,3,4,5,6,7 ) can be clearly distinguished , while the datapoints between the inner classes in Animals are completely confused , which confirms our analysis in Section 3.1 . E HYPERPARAMETERS FOR POPULAR ATTACKS ON THE STATE-OF-THE-ART MODELS FGSM setup . Random start , maximum perturbation = 0.031 . PGD setup . Random start , maximum perturbation = 0.031 . For RST model , step size = 0.01 and steps α = 40 , following Carmon et al . ( 2019 ) . For other models , step size = 0.003 and steps α = 20 . CW∞ setup . Binary search steps b = 5 , maximum perturbation times n = 1000 , learning rate lr = 0.005 , initial constant c0 = 0.01 , τ decrease factor γ = 0.9 . Similar to Carmon et al . ( 2019 ) , we randomly sample 2000 images to evaluate model robustness , and 200 images per class . Transfer-based attack setup . All settings are the same to PGD for the substitute standard model . N attack setup . Random start , maximum perturbation = 0.031 , population size npop = 300 , noise standard deviation σ = 0.1 and learning rate lr = 0.02 . Similar to Li et al . ( 2019 ) , we randomly sample 2000 images to evaluate model robustness , and 200 images per class . F ABLATION EXPERIMENT OF TEMPERATURE-PGD ATTACK The data in Table 4 is similar to Table 3 , except that 1/T is different . Combined with the results of Table 3 , we can find the robustness of vulnerable classes ( e.g. , class 4 ) in TRADES , MART and RST has a significant decrease in all 1/T settings . When 1/T is set to 2 , the overall robustness of the model trained by Madry et al . ( 2018 ) is no exception reduced by 0.26 % , with the most significant decrease by 2.8 % in class 4 . Furthermore , the decline of the overall robustness in Madry ’ s model is indeed lower than that in other models , One possible explanation is that these improved robust models may obfuscate gradients Athalye et al . ( 2018 ) in vulnerable classes , and theoretical analysis is left to the future . Recently , Pang et al . ( 2020 ) combine feature normalization ( FN ) ( Ranjan et al. , 2017 ) , weight normalization ( WN ) ( Guo & Zhang , 2017 ) and angular margins ( AM ) ( Liu et al. , 2016 ) to propose a defense method that can boost model robustness . In their paper , they believe that using FN and WN to limit embeddings on the hypersphere is the key to robustness improvement , so they call their method hypersphere embedding ( HE ) . However , we find that the factor ( temperature factor in our paper ) for scaling WN is the real key to improve robustness . We try to understand this from a point of view they overlooked . Our analysis mainly focuses on FN and WN , following Pang et al . ( 2020 ) . For a better formulation , we assume the input sample is x , the extracted feature of an example in the penultimate layer is z ∈ Rd , the number of classes in the dataset is C , the scale factor is s ( corresponds to the 1/T in our paper ) and the parameter of the last classifier is W = { wi } ∈ Rd×C , where wi ∈ Rd is the classifier weight corresponding to class i . Then FN operation is z̃ = z/‖z‖2 , WN operation is w̃i = wi/‖wi‖2 and the probability Pi of this sample x corresponding to class i ( i ∈ C ) after the softmax function S is Pi = S ( z ) = ew̃i T·z̃·s∑C k=1 e w̃k T·z̃·s = ew̃i T·z̃/T∑C k=1 e w̃k T·z̃/T ( 3 ) The gradient of cross-entropy loss LCE corresponding to wi is ∇wiLCE = { ( Pi − 1 ) · z i = y Pi · z i 6= y ( 4 ) Equation ( 3 ) and Equation ( 4 ) suggest we can change Pi by adjusting T and finally control∇wiLCE . e.g. , the maximum probability for an example is class l , then Pl = 1 if 1/T →∞ and Pl = 1/C if 1/T → 0 . For better demonstration , suppose that there is a three classification task ( Figure 9 ) . The top three figures represent equation ( 3 ) and the bottom three figures represent the corresponding equation ( 4 ) . The light-colored bars in the top three figures indicate the sum of the probabilities should be equal to 1 . The bars corresponding to the pink arrows in Figure 9 ( b ) and Figure 9 ( e ) have the same length , and Figure 9 ( c ) and Figure 9 ( f ) are similar . Specifically , we consider an adversarial example , i.e. , the highest probability of this example is usually the incorrect class . Figures 9 ( a ) and 9 ( d ) represent the probability and gradient of this example after softmax . When 1/T > 1 ( Figures 9 ( b ) and 9 ( e ) ) , this example is considered by the model as a harder example ( the probability of the adversarial class becomes larger ) , so that the model can update more gradients based on this example . Similarly , when 1/T < 1 ( Figures 9 ( c ) and 9 ( f ) ) , this example becomes simpler for the model and obtains a smaller gradient . Overall , these figures clearly show that we can adjust the gradient through the temperature factor 1/T . According to the above analysis and learn from the ideas of curriculum learning ( Bengio et al. , 2009 ) , we believe the gradient should be gradually enlarged ( by increasing 1/T ) during adversarial training , instead of using a fixed 1/T like Pang et al . ( 2020 ) . Specifically , the following two schedules to adjust 1/T are proposed : Linear Interpolation Schedule ( LIS ) . We use a simple linear interpolation schedule to adjust 1/T . Therefore , the 1/T of nth epoch is 1 Tn = 1 T0 + n nFI ( 1 TFI − 1 T0 ) ( 5 ) In our implementation , the initial temperature factor 1/T0 = 1 and the final temperature factor of the interpolation 1/TFI = 75 , where the subscript FI is short for final interpolation . The final epoch of the interpolation is equal to the total training epoch nFI = ntot = 100 . The training pipeline follows Pang et al . ( 2020 ) , but we do not use angular margins . Other hyperparameters are the same to Section 3 . Control Maximum Probability ( CMP ) . At each epoch , we can accurately calculate the required 1/T according to equation ( 3 ) to control the maximum probability . Since equation ( 3 ) is a nonlinear function , Powell ’ s dogleg method ( Powell , 1970 ) is used to solve this function . Therefore , the maximum probability Pmax of all examples in nth epoch isP max n = P max 0 + n nFI ( PmaxFI − Pmax0 ) 0 ≤ n < nFI Pmaxn = 1 nFI ≤ n < ntot ( 6 ) In our implementation , the initial maximum probability Pmax0 = 0.2 and the final maximum probability of the interpolation PmaxFI = 1 . The final epoch of the interpolation nFI = 90 , while the total training epoch ntot = 100 . For the last 10 epochs , the maximum probability is always controlled at 1 . Other settings are the same to Linear Interpolation Schedule . We use the above methods to train ResNet-18 on CIFAR-10 and choose vanilla PGD20 attack to evaluate model robustness . For a fair comparison , we also re-train ResNet18 following Madry et al . ( 2018 ) and Pang et al . ( 2020 ) . As shown in Table 5 , our methods HE-LIS and HE-CMP have further boosted the model robustness . Especially , the improvement of vulnerable classes ( e.g. , class 3 and class 4 ) is impressive . This seems to be an exciting result because the robustness gaps between classes are largely reduced . Unfortunately , these improved methods can not defend the Temperature-PGD attack . As shown in Table 6 , the numbers in the first row indicate the different 1/T . The improvement disappears when 1/T in Temperature-PGD is large enough . We have analyzed it in Section 4
The authors study the robustness of adversially-trained models across different classes. They find that classes tend to have largely non-uniform robust accuracy--i.e., some are less robust then others. Moreover, certain datapoints can only be misclassified as specific classes and removing these classes during training can make these datapoints robust. Next, the authors investigate how this robustness discrepancy across classes relates to the norm of the last fully-connected layer of the model, as well as to the strength of the attack used. Finally, the authors propose a new adversarial attack that they evaluate against existing models.
SP:62517d35207a58ae175ea3c3787512424e8ece51
Sandwich Batch Normalization
1 INTRODUCTION . This paper presents a simple , light-weight , and easy-to-implement modification of Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) , yet strongly motivated by various observations ( Zając et al. , 2019 ; Deecke et al. , 2018 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ) drawn from a number of application fields , that BN has troubles standardizing hidden features with very heterogeneous structures , e.g. , from a multi-modal distribution . We call the phenomenon feature distribution heterogeneity . Such heterogeneity of hidden features could arise from multiple causes , often application-dependent : • One straightforward cause is due to input data heterogeneity . For example , when training a deep network on a diverse set of visual domains , that possess significantly different statistics , BN is found to be ineffective at normalizing the activations with only a single mean and variance ( Deecke et al. , 2018 ) , and often needs to be re-set or adapted ( Li et al. , 2016 ) . • Another intrinsic cause could arise from model heterogeneity , i.e. , when the training is , or could be equivalently viewed as , on a set of different models . For instance , in neural architecture search ( NAS ) using weight sharing ( Liu et al. , 2018 ; Dong & Yang , 2019 ) , training the super-network during the search phase could be considered as training a large set of sub-models ( with many overlapped weights ) simultaneously . As another example , for conditional image generation ( Miyato et al. , 2018 ) , the generative model could be treated as a set of category-specific sub-models packed together , one of which would be “ activated ” by the conditional input each time . The vanilla BN ( Figure 1 ( a ) ) fails to perform well when there is data or model heterogeneity . Recent trends split the affine layer into multiple ones and leverage input signals to modulate or select between them ( De Vries et al. , 2017 ; Deecke et al. , 2018 ) ( Figure 1 ( b ) ) ; or even further , utilize several independent BNs to address such disparity ( Zając et al. , 2019 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ; Yu et al. , 2018 ) ( Figure 1 ( c ) ) . While those relaxations alleviate the data or model heterogeneity , we suggest that they might be “ too loose ” in terms of the normalization or regularization effect . Let us take adversarial training ( AT ) ( Madry et al. , 2017 ) as a concrete motivating example to illustrate our rationale . AT is by far the most effective approach to improve a deep model ’ s adversarial robustness . The model is trained by a mixture of the original training set ( “ clean examples ” ) and Norm ! . . . Norm '' Normalization Affine Normalization Af'ine ! . . . Af'ine '' Meta Affine Af'ine ! . . . Af'ine '' Feature map Feature map Conditional information Feature map Conditional information ( a ) Batch Norm ( b ) Categorical Conditional Batch Norm ( d ) Meta Batch Norm Meta Affine Af'ine ! . . . Af'ine '' Norm ! . . . Norm '' Feature map Conditional information ( e ) Meta Batch Norm++ Normalization Af'ine ! . . . Af'ine '' Feature map Conditional information ( c ) Auxiliary Batch Norm Normalization Affine Normalization Af'ine ! . . . Af'ine '' Feature map Feature map Conditional information ( a ) Batch Norm ( b ) Categorical Conditional Batch Norm Sandwich Affine Af'ine ! . . . Af'ine '' Feature map ( c ) Sandwich Batch Norm Normalization Conditional information Figure 1 : Illustration of ( a ) the original batch normalization ( BN ) , composed of one normalization layer and one affine layer ; ( b ) Categorical Conditional BN , composed of one normalization layer following a set of independent affine layers to intake conditional information ; ( c ) our proposed Sandwich BN , sequentially composed of one normalization layer , one shared sandwich affine layer , and a a set of independent affine layers . its attacked counterpart with some small perturbations applied ( “ adversarial examples ” ) . Yet , latest works ( Xie et al. , 2019 ; Xie & Yuille , 2019 ) pointed out that clean and adversarial examples behave like two different domains with distinct statistics on the feature level ( Li & Li , 2017 ; Pang et al. , 2018 ) . Such data heterogeneity puts vanilla BN in jeopardy for adversarial training , where the two domains are treated as one . ( Xie et al. , 2019 ; Xie & Yuille , 2019 ) demonstrated a helpful remedy to improve AT performance by using two separate BNs for clean and adversarial examples respectively , which allows either BN to learn more stable and noiseless statistics over its own focused domain . But what may be missing ? Unfortunately , using two separate BNs ignores one important fact that the two domains , while being different , are not totally independent . Considering that all adversarial images are generated by perturbing clean counterparts only minimally , it is convincing to hypothesize the two domains to be largely overlapped at least ( i.e. , they still share some hidden features despite the different statistics ) . To put it simple : while it is oversimplified to normalize the two domains as “ same one ” , it is also unfair and unnecessary to treat them as “ disparate two ” . More application examples can be found that all share this important structural feature prior , that we ( informally ) call as “ harmony in diversity ” . For instance , weight-sharing NAS algorithms ( Liu et al. , 2018 ; Dong & Yang , 2019 ; Yu et al. , 2018 ) train a large variety of child models , constituting model heterogeneity ; but most child architectures inevitably have many weights in common since they are sampled from the same super net . Similarly , while a conditional GAN ( Miyato et al. , 2018 ) has to produce diverse images classes , those classes often share the same resolution and many other dataset-specific characteristics ( e.g. , the object-centric bias for CIFAR images ) ; that is even more true when the GAN is trained to produce classes of one super-category , e.g. , dogs and cats . Our Contributions : Recognizing the need to address feature normalization with “ harmony in diversity ” , we propose a new SaBN as illustrated in Fig 1 ( c ) . SaBN modifies BN in a “ frustratingly simple ” way : it is equipped with two cascaded affine layers : a shared unconditional sandwich affine layer , followed by a set of independent affine layers that can be conditioned . Compared to Categorical Conditional BN , the new sandwich affine layer is designed to inject an inductive bias , that all re-scaling transformations will have a shared factor , indicating the commodity . Experiments on the applications of NAS and conditional generation demonstrate that SaBN addresses the model heterogeneity issue elegantly , and improves their performance in a plug-and-play fashion . To better address the data heterogeneity altogether , SaBN could further integrate the idea of split/auxiliary BNs ( Zając et al. , 2019 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ; Yu et al. , 2018 ) , to decompose the normalization layer into multiple parallel ones . That yields the new variant called SaAuxBN . We demonstrate it using the application example of adversarial training . Lastly , we extend the idea of SaBN to Adaptive Instance Normalization ( AdaIN ) ( Huang & Belongie , 2017 ) , and show the resulting SaAdaIN to improve arbitrary style transfer . 2 RELATED WORK . 2.1 NORMALIZATION IN DEEP LEARNING . Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) made critical contributions to training deep convolutional networks and nowadays becomes a cornerstone of the latter for numerous tasks . BN normalizes the input mini-batch of samples by the mean and variance , and then re-scale them with learnable affine parameters . The success of BNs was initially attributed to overcoming internal co- variate shift ( Ioffe & Szegedy , 2015 ) , but later on raises many open discussions on its effect of improving landscape smoothness ( Santurkar et al. , 2018 ) ; enabling larger learning rates ( Bjorck et al. , 2018 ) and reducing gradient sensitivity ( Arora et al. , 2018 ) ; preserving the rank of pre-activation weight matrices ( Daneshmand et al. , 2020 ) ; decoupling feature length and direction ( Kohler et al. , 2018 ) ; capturing domain-specific artifacts ( Li et al. , 2016 ) ; reducing BN ’ s dependency on batch sizeIoffe ( 2017 ) ; Singh & Krishnan ( 2020 ) ; Preventing model from elimination singularities Qiao et al . ( 2019 ) ; and even characterizing an important portion of network expressivity ( Frankle et al. , 2020 ) . Inspired by BN , a number of task-specific modifications are proposed by exploiting different normalization axes , such as Instance Normalization ( IN ) ( Ulyanov et al. , 2016 ) for style transfer ; Layer Normalization ( LN ) ( Ba et al. , 2016 ) for recurrent networks ; Group Normalization ( GN ) ( Wu & He , 2018 ) for tackling small batch sizes ; StochNorm Kou et al . ( 2020 ) for fine-tuning task ; Passport-aware NormalizationZhang et al . ( 2020 ) for model IP protection ; and Li et al . ( 2019a ) ; Wang et al . ( 2020 ) ; Zheng et al . ( 2020 ) for image generation . Several normalization variants have been proposed by modulating BN parameters , mostly the affine layer ( mean and variance ) , to improve the controlling flexibility for more sophisticated usage . For example , Harm et al . ( De Vries et al. , 2017 ) presents Conditional BN , whose affine parameters are generated as a function of the input . Similarly , Conditional IN ( Dumoulin et al. , 2016 ) assigns each style with independent IN affine parameters . In ( Miyato et al. , 2018 ) , the authors developed Categorical Conditional BN for conditional GAN image generation , where each generated class has its independent affine parameters . Huang & Belongie ( Huang & Belongie , 2017 ) presented Adaptive IN ( AdaIN ) , which used the mean and variance of style image to replace the original affine parameter , achieving arbitrary style transfer . Spatial adaptivity ( Park et al. , 2019 ) and channel attention ( Li et al. , 2019b ) managed to modulate BN with higher complexities . A few latest works investigate to use multiple normalization layer instead of one in BN . ( Deecke et al. , 2018 ) developed mode normalization by employing a mixture-of-experts to separate incoming data into several modes and separately normalizing each mode . ( Zając et al. , 2019 ) used two separate BNs to address the domain shift between labeled and unlabeled data in semi-supervised learning . Very recently , ( Xie & Yuille , 2019 ; Xie et al. , 2019 ) reveal the two-domain issue in adversarial training and find improvements by using two separate BNs ( AuxBN ) . 2.2 BRIEF BACKGROUNDS FOR RELATED APPLICATIONS . We leverage four important applications as test beds . All of them appear to be oversimplified by using the vanilla BN , where the feature homogeneity and heterogeneity are not properly handled . We briefly introduce them below , and will concretely illustrate where the heterogeneity comes from and how our methods resolve the bottlenecks in Sec . 3 . Generative Adversarial Network Generative adversarial networks ( GANs ) have been prevailing since its origin ( Goodfellow et al. , 2014a ) for image generation . Many efforts have been made to improve GANs , such as modifying loss function ( Arjovsky et al. , 2017 ; Gulrajani et al. , 2017 ; Jolicoeur-Martineau , 2018 ) , improving network architecture ( Zhang et al. , 2018 ; Karras et al. , 2019 ; Gong et al. , 2019 ) and adjusting training procedure ( Karras et al. , 2017 ) . Recent works also tried to improve the generated image quality by proposing new normalization modules , such as Categorical Conditional BN and spectral normalization ( Miyato et al. , 2018 ) . Neural Architecture Search ( NAS ) The goal of NAS is to automatically search for an optimal model architecture for the given task and dataset . It was first proposed in ( Zoph & Le , 2016 ) where a reinforcement learning algorithm iteratively samples , trains and evaluates candidate models from the search space . Due to its prohibitive time cost , weight-sharing mechanism was introduced ( Pham et al. , 2018 ) and becomes a popular strategy to accelerate the training of sampled models ( Liu et al. , 2018 ) . However , weight-sharing causes performance deterioration due to unfair training ( Chu et al. , 2019 ) . In addition , a few NAS benchmarks ( Ying et al. , 2019 ; Dong & Yang , 2020 ; Zela et al. , 2020 ) were recently released , with ground-truth accuracy for candidate models pre-recorded , enabling researchers to evaluate the performance of search method more easily . Adversarial Robustness Deep networks are notorious for the vulnerability to adversarial attacks ( Goodfellow et al. , 2014b ) . In order to enhance adversarial robustness , countless training approaches have been proposed . ( Dhillon et al. , 2018 ; Papernot & McDaniel , 2017 ; Xu et al. , 2017 ; Meng & Chen , 2017 ; Liao et al. , 2018 ; Madry et al. , 2017 ) . Among them , adversarial training ( AT ) ( Madry et al. , 2017 ) are arguably the strongest , which train the model over a mixture of clean and perturbed data . Overall , the normalization in AT has , to our best knowledge , not been studied in depth . A pioneer work ( Xie et al. , 2019 ) introduce an auxiliary batch norm ( AuxBN ) to improve the clean image recognition accuracy . Neural Style Transfer Style transfer is a technique generating a stylized image , by combining the content of one image with the style of another . Various improvements are made on the normalization methods in this area . Ulyanov et al . ( 2016 ) proposed Instance Normalization , improving the stylized quality of generated images . Conditional Instance Normalization ( Dumoulin et al. , 2016 ) and Adaptive Instance Normalization ( Huang & Belongie , 2017 ) are proposed , enabling the network to perform arbitrary style transfer .
This paper considers improving the performance of various normalizers by factorizing the affinity operations in normalization layer into on shared affinity operation, as well as several several independent affinity operation, each of which is corresponding to a specific data distribution. The experiments on various tasks (e.g. NAS, GAN, adversarial defense) demonstrate the effectiveness of proposed methods.
SP:42885bdb86f343bd752c9a406d7e985fec81a7f6
Sandwich Batch Normalization
1 INTRODUCTION . This paper presents a simple , light-weight , and easy-to-implement modification of Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) , yet strongly motivated by various observations ( Zając et al. , 2019 ; Deecke et al. , 2018 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ) drawn from a number of application fields , that BN has troubles standardizing hidden features with very heterogeneous structures , e.g. , from a multi-modal distribution . We call the phenomenon feature distribution heterogeneity . Such heterogeneity of hidden features could arise from multiple causes , often application-dependent : • One straightforward cause is due to input data heterogeneity . For example , when training a deep network on a diverse set of visual domains , that possess significantly different statistics , BN is found to be ineffective at normalizing the activations with only a single mean and variance ( Deecke et al. , 2018 ) , and often needs to be re-set or adapted ( Li et al. , 2016 ) . • Another intrinsic cause could arise from model heterogeneity , i.e. , when the training is , or could be equivalently viewed as , on a set of different models . For instance , in neural architecture search ( NAS ) using weight sharing ( Liu et al. , 2018 ; Dong & Yang , 2019 ) , training the super-network during the search phase could be considered as training a large set of sub-models ( with many overlapped weights ) simultaneously . As another example , for conditional image generation ( Miyato et al. , 2018 ) , the generative model could be treated as a set of category-specific sub-models packed together , one of which would be “ activated ” by the conditional input each time . The vanilla BN ( Figure 1 ( a ) ) fails to perform well when there is data or model heterogeneity . Recent trends split the affine layer into multiple ones and leverage input signals to modulate or select between them ( De Vries et al. , 2017 ; Deecke et al. , 2018 ) ( Figure 1 ( b ) ) ; or even further , utilize several independent BNs to address such disparity ( Zając et al. , 2019 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ; Yu et al. , 2018 ) ( Figure 1 ( c ) ) . While those relaxations alleviate the data or model heterogeneity , we suggest that they might be “ too loose ” in terms of the normalization or regularization effect . Let us take adversarial training ( AT ) ( Madry et al. , 2017 ) as a concrete motivating example to illustrate our rationale . AT is by far the most effective approach to improve a deep model ’ s adversarial robustness . The model is trained by a mixture of the original training set ( “ clean examples ” ) and Norm ! . . . Norm '' Normalization Affine Normalization Af'ine ! . . . Af'ine '' Meta Affine Af'ine ! . . . Af'ine '' Feature map Feature map Conditional information Feature map Conditional information ( a ) Batch Norm ( b ) Categorical Conditional Batch Norm ( d ) Meta Batch Norm Meta Affine Af'ine ! . . . Af'ine '' Norm ! . . . Norm '' Feature map Conditional information ( e ) Meta Batch Norm++ Normalization Af'ine ! . . . Af'ine '' Feature map Conditional information ( c ) Auxiliary Batch Norm Normalization Affine Normalization Af'ine ! . . . Af'ine '' Feature map Feature map Conditional information ( a ) Batch Norm ( b ) Categorical Conditional Batch Norm Sandwich Affine Af'ine ! . . . Af'ine '' Feature map ( c ) Sandwich Batch Norm Normalization Conditional information Figure 1 : Illustration of ( a ) the original batch normalization ( BN ) , composed of one normalization layer and one affine layer ; ( b ) Categorical Conditional BN , composed of one normalization layer following a set of independent affine layers to intake conditional information ; ( c ) our proposed Sandwich BN , sequentially composed of one normalization layer , one shared sandwich affine layer , and a a set of independent affine layers . its attacked counterpart with some small perturbations applied ( “ adversarial examples ” ) . Yet , latest works ( Xie et al. , 2019 ; Xie & Yuille , 2019 ) pointed out that clean and adversarial examples behave like two different domains with distinct statistics on the feature level ( Li & Li , 2017 ; Pang et al. , 2018 ) . Such data heterogeneity puts vanilla BN in jeopardy for adversarial training , where the two domains are treated as one . ( Xie et al. , 2019 ; Xie & Yuille , 2019 ) demonstrated a helpful remedy to improve AT performance by using two separate BNs for clean and adversarial examples respectively , which allows either BN to learn more stable and noiseless statistics over its own focused domain . But what may be missing ? Unfortunately , using two separate BNs ignores one important fact that the two domains , while being different , are not totally independent . Considering that all adversarial images are generated by perturbing clean counterparts only minimally , it is convincing to hypothesize the two domains to be largely overlapped at least ( i.e. , they still share some hidden features despite the different statistics ) . To put it simple : while it is oversimplified to normalize the two domains as “ same one ” , it is also unfair and unnecessary to treat them as “ disparate two ” . More application examples can be found that all share this important structural feature prior , that we ( informally ) call as “ harmony in diversity ” . For instance , weight-sharing NAS algorithms ( Liu et al. , 2018 ; Dong & Yang , 2019 ; Yu et al. , 2018 ) train a large variety of child models , constituting model heterogeneity ; but most child architectures inevitably have many weights in common since they are sampled from the same super net . Similarly , while a conditional GAN ( Miyato et al. , 2018 ) has to produce diverse images classes , those classes often share the same resolution and many other dataset-specific characteristics ( e.g. , the object-centric bias for CIFAR images ) ; that is even more true when the GAN is trained to produce classes of one super-category , e.g. , dogs and cats . Our Contributions : Recognizing the need to address feature normalization with “ harmony in diversity ” , we propose a new SaBN as illustrated in Fig 1 ( c ) . SaBN modifies BN in a “ frustratingly simple ” way : it is equipped with two cascaded affine layers : a shared unconditional sandwich affine layer , followed by a set of independent affine layers that can be conditioned . Compared to Categorical Conditional BN , the new sandwich affine layer is designed to inject an inductive bias , that all re-scaling transformations will have a shared factor , indicating the commodity . Experiments on the applications of NAS and conditional generation demonstrate that SaBN addresses the model heterogeneity issue elegantly , and improves their performance in a plug-and-play fashion . To better address the data heterogeneity altogether , SaBN could further integrate the idea of split/auxiliary BNs ( Zając et al. , 2019 ; Xie et al. , 2019 ; Xie & Yuille , 2019 ; Yu et al. , 2018 ) , to decompose the normalization layer into multiple parallel ones . That yields the new variant called SaAuxBN . We demonstrate it using the application example of adversarial training . Lastly , we extend the idea of SaBN to Adaptive Instance Normalization ( AdaIN ) ( Huang & Belongie , 2017 ) , and show the resulting SaAdaIN to improve arbitrary style transfer . 2 RELATED WORK . 2.1 NORMALIZATION IN DEEP LEARNING . Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) made critical contributions to training deep convolutional networks and nowadays becomes a cornerstone of the latter for numerous tasks . BN normalizes the input mini-batch of samples by the mean and variance , and then re-scale them with learnable affine parameters . The success of BNs was initially attributed to overcoming internal co- variate shift ( Ioffe & Szegedy , 2015 ) , but later on raises many open discussions on its effect of improving landscape smoothness ( Santurkar et al. , 2018 ) ; enabling larger learning rates ( Bjorck et al. , 2018 ) and reducing gradient sensitivity ( Arora et al. , 2018 ) ; preserving the rank of pre-activation weight matrices ( Daneshmand et al. , 2020 ) ; decoupling feature length and direction ( Kohler et al. , 2018 ) ; capturing domain-specific artifacts ( Li et al. , 2016 ) ; reducing BN ’ s dependency on batch sizeIoffe ( 2017 ) ; Singh & Krishnan ( 2020 ) ; Preventing model from elimination singularities Qiao et al . ( 2019 ) ; and even characterizing an important portion of network expressivity ( Frankle et al. , 2020 ) . Inspired by BN , a number of task-specific modifications are proposed by exploiting different normalization axes , such as Instance Normalization ( IN ) ( Ulyanov et al. , 2016 ) for style transfer ; Layer Normalization ( LN ) ( Ba et al. , 2016 ) for recurrent networks ; Group Normalization ( GN ) ( Wu & He , 2018 ) for tackling small batch sizes ; StochNorm Kou et al . ( 2020 ) for fine-tuning task ; Passport-aware NormalizationZhang et al . ( 2020 ) for model IP protection ; and Li et al . ( 2019a ) ; Wang et al . ( 2020 ) ; Zheng et al . ( 2020 ) for image generation . Several normalization variants have been proposed by modulating BN parameters , mostly the affine layer ( mean and variance ) , to improve the controlling flexibility for more sophisticated usage . For example , Harm et al . ( De Vries et al. , 2017 ) presents Conditional BN , whose affine parameters are generated as a function of the input . Similarly , Conditional IN ( Dumoulin et al. , 2016 ) assigns each style with independent IN affine parameters . In ( Miyato et al. , 2018 ) , the authors developed Categorical Conditional BN for conditional GAN image generation , where each generated class has its independent affine parameters . Huang & Belongie ( Huang & Belongie , 2017 ) presented Adaptive IN ( AdaIN ) , which used the mean and variance of style image to replace the original affine parameter , achieving arbitrary style transfer . Spatial adaptivity ( Park et al. , 2019 ) and channel attention ( Li et al. , 2019b ) managed to modulate BN with higher complexities . A few latest works investigate to use multiple normalization layer instead of one in BN . ( Deecke et al. , 2018 ) developed mode normalization by employing a mixture-of-experts to separate incoming data into several modes and separately normalizing each mode . ( Zając et al. , 2019 ) used two separate BNs to address the domain shift between labeled and unlabeled data in semi-supervised learning . Very recently , ( Xie & Yuille , 2019 ; Xie et al. , 2019 ) reveal the two-domain issue in adversarial training and find improvements by using two separate BNs ( AuxBN ) . 2.2 BRIEF BACKGROUNDS FOR RELATED APPLICATIONS . We leverage four important applications as test beds . All of them appear to be oversimplified by using the vanilla BN , where the feature homogeneity and heterogeneity are not properly handled . We briefly introduce them below , and will concretely illustrate where the heterogeneity comes from and how our methods resolve the bottlenecks in Sec . 3 . Generative Adversarial Network Generative adversarial networks ( GANs ) have been prevailing since its origin ( Goodfellow et al. , 2014a ) for image generation . Many efforts have been made to improve GANs , such as modifying loss function ( Arjovsky et al. , 2017 ; Gulrajani et al. , 2017 ; Jolicoeur-Martineau , 2018 ) , improving network architecture ( Zhang et al. , 2018 ; Karras et al. , 2019 ; Gong et al. , 2019 ) and adjusting training procedure ( Karras et al. , 2017 ) . Recent works also tried to improve the generated image quality by proposing new normalization modules , such as Categorical Conditional BN and spectral normalization ( Miyato et al. , 2018 ) . Neural Architecture Search ( NAS ) The goal of NAS is to automatically search for an optimal model architecture for the given task and dataset . It was first proposed in ( Zoph & Le , 2016 ) where a reinforcement learning algorithm iteratively samples , trains and evaluates candidate models from the search space . Due to its prohibitive time cost , weight-sharing mechanism was introduced ( Pham et al. , 2018 ) and becomes a popular strategy to accelerate the training of sampled models ( Liu et al. , 2018 ) . However , weight-sharing causes performance deterioration due to unfair training ( Chu et al. , 2019 ) . In addition , a few NAS benchmarks ( Ying et al. , 2019 ; Dong & Yang , 2020 ; Zela et al. , 2020 ) were recently released , with ground-truth accuracy for candidate models pre-recorded , enabling researchers to evaluate the performance of search method more easily . Adversarial Robustness Deep networks are notorious for the vulnerability to adversarial attacks ( Goodfellow et al. , 2014b ) . In order to enhance adversarial robustness , countless training approaches have been proposed . ( Dhillon et al. , 2018 ; Papernot & McDaniel , 2017 ; Xu et al. , 2017 ; Meng & Chen , 2017 ; Liao et al. , 2018 ; Madry et al. , 2017 ) . Among them , adversarial training ( AT ) ( Madry et al. , 2017 ) are arguably the strongest , which train the model over a mixture of clean and perturbed data . Overall , the normalization in AT has , to our best knowledge , not been studied in depth . A pioneer work ( Xie et al. , 2019 ) introduce an auxiliary batch norm ( AuxBN ) to improve the clean image recognition accuracy . Neural Style Transfer Style transfer is a technique generating a stylized image , by combining the content of one image with the style of another . Various improvements are made on the normalization methods in this area . Ulyanov et al . ( 2016 ) proposed Instance Normalization , improving the stylized quality of generated images . Conditional Instance Normalization ( Dumoulin et al. , 2016 ) and Adaptive Instance Normalization ( Huang & Belongie , 2017 ) are proposed , enabling the network to perform arbitrary style transfer .
In this paper, the authors propose Sandwich Affine strategy to separate the affine layer in BN into one shared sandwich affine layer, cascaded by several parallel independent affine layers. Such method should well address the inherent feature distribution heterogeneity in many tasks. Following this idea, the SaAuxBN and SaIN have also been introduced in this paper. The extensive experiments demonstrate the effectiveness of such methods in neural architecture search (NAS), image generation, adversarial training, and style transfer.
SP:42885bdb86f343bd752c9a406d7e985fec81a7f6
Uncertainty in Neural Processes
1 INTRODUCTION . What makes a probabilistic conditional generative model good ? The belief that a generative model is good if it produces samples that are indistinguishable from those that it was trained on ( Hinton , 2007 ) is widely accepted , and understandably so . This belief also applies when the generator is conditional , though the standard becomes higher : conditional samples must be indistinguishable from training samples for each value of the condition . Consider an amortized image in-painting task in which the objective is to fill in missing pixel values given a subset of observed pixel values . If the number and location of observed pixels is fixed , then a good conditional generative model should produce sharp-looking sample images , all of which should be compatible with the observed pixel values . If the number and location of observed pixels is allowed to vary , the same should remain true for each set of observed pixels . Recent work on this problem has focused on reconstructing an entire image from as small a conditioning set as possible . As shown in Fig . 1 , state-of-the-art methods ( Kim et al. , 2018 ) achieve high-quality reconstruction from as few as 30 conditioning pixels in a 1024-pixel image . Our work starts by questioning whether reconstructing an image from a small subset of pixels is always the right objective . To illustrate , consider the image completion task on handwritten digits . A small set of pixels might , depending on their locations , rule out the possibility that the full image is , say , 1 , 5 , or 6 . Human-like performance in this case would generate sharp-looking sample images for all digits that are consistent with the observed pixels ( i.e. , 0 , 2-4 , and 7-9 ) . Observing additional pixels will rule out successively more digits until the only remaining uncertainty pertains to stylistic details . The bottom-right panel of Fig . 1 demonstrates this type of “ calibrated ” uncertainty . We argue that in addition to high-quality reconstruction based on large conditioning sets , amortized conditional inference methods should aim for meaningful , calibrated uncertainty , particularly for small conditioning sets . For different problems , this may mean different things ( see discussion in Section 3 ) . In this work , we focus on the image in-painting problem , and define well calibrated uncertainty to be a combination of two qualities : high sample diversity for small conditioning sets ; and sharp-looking , realistic images for any size of conditioning set . As the size of the conditioning set grows , we expect the sample diversity to decrease and the quality of the images to increase . We note that this emphasis is different from the current trend in the literature , which has focused primarily on making sharp and accurate image completions when the size of the conditioning context is large ( Kim et al. , 2018 ) . To better understand and make progress toward our aim , we employ posterior predictive inference in a conditional generative latent-variable model , with a particular focus on neural processes ( NPs ) ( Garnelo et al. , 2018a ; b ) . We find that particular architecture choices can result in markedly different performance . In order to understand this , we investigate posterior uncertainty in NP models ( Section 4 ) , and we use our findings to establish new best practices for NP amortized inference artifacts with well-calibrated uncertainty . In particular , we demonstrate improvements arising from a combination of max pooling , a mixture variational distribution , and a “ normal ” amortized variational inference objective . The rest of this paper is organized as follows . Section 2 and Section 3 present background material on amortized inference for generative models and calibrated uncertainty , respectively . Section 4 discusses and presents empirical evidence for how NP models handle uncertainty . Section 5 introduces our proposed network architecture and objective . Section 6 reports our results on the MNIST , FashionMNIST and CelebA datasets . Finally , Section 7 presents our conclusions . 2 AMORTIZED INFERENCE FOR CONDITIONAL GENERATIVE MODELS . Our work builds on amortized inference ( Gershman & Goodman , 2014 ; Kingma & Welling , 2014 ) , probabilistic meta-learning ( Gordon et al. , 2019 ) , and conditional generative models in the form of neural processes ( Garnelo et al. , 2018b ; Kim et al. , 2018 ) . This section provides background . Let ( xC , yC ) = { ( xi , yi ) } ni=1 and ( xT , yT ) = { ( x′j , y′j ) } mj=1 be a context set and target set respectively . In image in-painting , the context set input xC is a subset of an image ’ s pixel coordinates , the context set output yC are the corresponding pixel values ( greyscale intensity or colors ) , the target set input xT is a set of pixel coordinates requiring in-painting , and the target set output yT is the corresponding set of target pixel values . The corresponding graphical model is shown in Fig . 2 . The goal of amortized conditional inference is to rapidly approximate , at “ test time , ” the posterior predictive distribution pθ ( yT |xT , xC , yC ) = ∫ pθ ( yT |xT , z ) pθ ( z|xC , yC ) dz . ( 1 ) We can think of the latent variable z as representing a problem-specific task-encoding . The likelihood term pθ ( yT |xT , z ) shows that the encoding parameterizes a regression model linking the target inputs to the target outputs . In the NP perspective , z is a function and Eq . ( 1 ) can be seen as integrating over the regression function itself , as in Gaussian process regression ( Rasmussen , 2003 ) . Variational inference There are two fundamental aims for amortized inference for conditional generative models : learning the model , parameterized by θ , that produces good samples , and producing an amortization artifact , parameterized by φ , that can be used to approximately solve Eq . ( 1 ) quickly at test time . Variational inference techniques couple the two learning problems . Let y and x be task-specific output and input sets , respectively , and assume that at training time we know the values of y . We can construct the usual single-training-task evidence lower bound ( ELBO ) as log pθ ( y|x ) ≥ Ez∼qφ ( z|x , y ) [ log pθ ( y|z , x ) pθ ( z ) qφ ( z|x , y ) ] . ( 2 ) Summing over all training examples and optimizing Eq . ( 2 ) with respect to φ learns an amortized inference artifact that takes a context set and returns a task embedding ; optimizing with respect to θ learns a problem-specific generative model . Optimizing both simultaneously results in an amortized inference artifact bespoke to the overall problem domain . At test time the learned model and inference artifacts can be combined to perform amortized posterior predictive inference , approximating Eq . ( 1 ) with pθ ( yT |xT , xC , yC ) ≈ ∫ pθ ( yT |xT , z ) qφ ( z|xC , yC ) dz . ( 3 ) Crucially , given an input ( xC , yC ) , sampling from this distribution is as simple as sampling a task embedding z from qφ ( z|xC , yC ) and then passing the sampled z to the generative model pθ ( yT |xT , z ) to produce samples from the conditional generative model . Meta-learning The task-specific problem becomes a meta-learning problem when learning a regression model θ that performs well on multiple tasks with the same graphical structure , trained on data for which the target outputs { y′j } are observed as well . In training our in-painting models , following conventions in the literature ( Garnelo et al. , 2018a ; b ) , tasks are simply random-size subsets of random pixel locations x and values y from training set images . This random subsetting of training images into context and target sets transforms this into a meta-learning problem , and the “ encoder ” qφ ( z|x , y ) must learn to generalize over different context set sizes , with less posterior uncertainty as the context set size grows . Neural processes Our work builds on neural processes ( NPs ) ( Garnelo et al. , 2018a ; b ) . NPs are deep neural network conditional generative models . Multiple variants of NPs have been proposed ( Garnelo et al. , 2018a ; b ; Kim et al. , 2018 ) , and careful empirical comparisons between them appear in the literature ( Grover et al. , 2019 ; Le et al. , 2018 ) . NPs employ an alternative training objective to Eq . ( 2 ) arising from the fact that the graphical model in Fig . 2 allows a Bayesian update on the distribution of z , conditioning on the entire context set to produce a posterior pθ ( z|xC , yC ) . If the generative model is in a tractable family that allows analytic updates of this kind , then the NP objective corresponds to maximizing Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) pθ ( z|xC , yC ) qφ ( z|xT , yT ) ] ≈ Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) qφ ( z|xC , yC ) qφ ( z|xT , yT ) ] ( 4 ) where replacing pθ ( z|xC , yC ) with its variational approximation is typically necessary because most deep neural generative models have a computationally inaccessible posterior . This “ NP objective ” can be trained end-to-end , optimizing for both φ and θ simultaneously , where the split of training data into context and target sets must vary in terms of context set size . The choice of optimizing Eq . ( 4 ) instead of Eq . ( 2 ) is largely empirical ( Le et al. , 2018 ) . 3 CALIBRATED UNCERTAINTY . Quantifying and calibrating uncertainty in generative models remains an open problem , particularly in the context of amortized inference . Previous work on uncertainty calibration has focused on problems with relatively simpler structure . For example , in classification and regression problems with a single dataset , prior work framed the problem as predicting a cumulative distribution function that is close to the data-generating distribution , first as a model diagnostic ( Gneiting et al. , 2007 ) and subsequently as a post-hoc adjustment to a learned predictor ( Kuleshov et al. , 2018 ) . A version of the latter approach was also applied to structured prediction problems ( Kuleshov & Liang , 2015 ) . Previous approaches are conceptually similar to our working definition of calibrated uncertainty . However , we seek calibrated uncertainty on a per-image , per-conditioning set basis , which is fundamentally different from previous settings . Quantification of all aspects of generative model performance is an area of ongoing research , with uncertainty quantification a particularly challenging problem . 4 UNCERTAINTY IN NEURAL PROCESS MODELS . In this section , we investigate how NP models handle uncertainty . A striking property of NP models is that as the size of the ( random ) context set increases , there is less sampling variation in target samples generated by passing z ∼ qφ ( z|xC , yC ) through the decoder . The samples shown in Fig . 1 are the likelihood mean ( hence a deterministic function of z ) , and so the reduced sampling variation can only be produced by decreased posterior uncertainty . Our experiments confirm this , as shown in Fig . 3a : posterior uncertainty ( as measured by entropy ) decreases for increasing context size , even beyond the maximum training context size . Such posterior contraction is a well-studied property of classical Bayesian inference and is a consequence of the inductive bias of exchangeable models . However , NP models do not have the same inductive bias explicitly built in . How do trained NP models exhibit posterior contraction without being explicitly designed to do so ? How do they learn to do so during training ? A simple hypothesis is that the network somehow transfers the context size through the pooling operation and into ρφ ( sC ) , which uses that information to set the posterior uncertainty . That hypothesis is supported by Fig . 3b , which shows the results of training a classifier to infer the context size given only sC . However , consider that within a randomly generated context set , some observations are more informative than others . For example , Fig . 4 shows the first { 10 , 50 , 100 } pixels of an MNIST digit 2 , greedily chosen to minimizeDKL ( qφ ( z|x , y ) ||qφ ( z|xC , yC ) ) . If z is interpreted to represent , amongst other things , which digit the image contains , then a small subset of pixels determine which digits are possible . It is these highly informative pixels that drive posterior contraction in a trained NP . In a random context set , the number of highly informative pixels is random . For example , a max-pooled embedding saturates with the M most highly informative context pixels , where M ≤ d , the dimension of embedding space . On average , a random context set of size n , taken from an image with N pixels , will contain only nM/N of the informative pixels . In truth , Fig . 3 displays how the information content of a context depends , on average , on the size of that context . Indeed , greedily choosing context pixels results in much faster contraction ( Fig . 4 ) . Learning to contract Posterior contraction is implicitly encouraged by the NP objective Eq . ( 4 ) . It can be rewritten as Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) ] −DKL ( qφ ( z|xT , yT ) ||qφ ( z|xC , yC ) ) . ( 5 ) The first term encourages perfect reconstruction of yT , and discourages large variations in z ∼ qφ ( z|xT , yT ) , which would result in large variations in predictive log-likelihood . This effect is stronger for larger target sets since there are more target pixels to predict . In practice , C ⊂ T , so the first term also ( indirectly ) encourages posterior contraction for increasing context sizes . The second term , DKL ( qφ ( z|xT , yT ) ||qφ ( z|xC , yC ) ) , reinforces the contraction by encouraging the context posterior to be close to the target posterior . Although the objective encourages posterior contraction , the network mechanisms for achieving contraction are not immediately clear . Ultimately , the details depend on interplay between the pixel embedding function , hφ , the pooling operation ⊕ , and ρφ . We focus on mean and max pooling . Max pooling As the size of the context set increases , the max-pooled embedding sC = ⊕ni=1si is non-decreasing in n ; in a trained NP model , ||sC || will increase each time an informative pixel is added to the context set ; it will continue increasing until the context embedding saturates at the full image embedding . At a high level , this property of max-pooling means that the σC component of ρφ ( sC ) has a relatively simple task : represent a function such that the posterior entropy is a decreasing function of all dimensions of the embedding space . An empirical demonstration that ρφ achieves this can be found in the Supplementary Material . Mean pooling For a fixed image , as the size of a random context set increases , its mean-pooled embedding will , on average , become closer to the full image embedding . Moreover , the meanpooled embeddings of all possible context sets of the image are contained in the convex set whose hull is formed by ( a subset of ) the individual pixel embeddings . The σC component of ρφ ( sC ) , then , must approximate a function such that the posterior entropy is a convex function on the convex set formed by individual pixel embeddings , with minimum at or near the full image embedding . Learning such a function across the embeddings of many training images seems a much harder learning task than that required by max pooling , which may explain the better performance of max pooling relative to mean pooling in NPs ( see Section 6 ) . Generalizing posterior contraction Remarkably , trained NP-based models generalize their posterior contraction to context and target sizes not seen during training ( see Fig . 3 ) . The discussion of posterior contraction in NPs using mean and max pooling in the previous paragraphs highlights a shared property : for both models , the pooled embeddings of all possible context sets that can be obtained from an image are in a convex set that is determined by a subset of possible context set embeddings . For max-pooling , the convex set is formed by the max-pooled embedding of the M “ activation ” pixels . For mean-pooling , the convex set is obtained from the convex hull of the individual pixel embeddings . Furthermore , the full image embedding in both cases is contained in the convex set . We conjecture that a sufficient condition for an NP image completion model to yield posterior contraction that generalizes to context sets of unseen size is as follows : For any image , the pooled embedding of every possible context set ( which includes the full image ) lies in a convex subset of the embedding space .
The paper aims at increasing the sample diversity of neural processes when the condition set is small, while maintaining visual fidelity. The low-data regime is arguably where neural processes are most interesting, and in that regard the paper is right to turn to this setting. The discussion on how different aggregation functions affect the predictive uncertainty of the neural process is also appreciated, as is the experiment on regressing the size of the condition set based on the latent embedding.
SP:4f8854605423fab230a26fa2d12d3bfef54b0ca5
Uncertainty in Neural Processes
1 INTRODUCTION . What makes a probabilistic conditional generative model good ? The belief that a generative model is good if it produces samples that are indistinguishable from those that it was trained on ( Hinton , 2007 ) is widely accepted , and understandably so . This belief also applies when the generator is conditional , though the standard becomes higher : conditional samples must be indistinguishable from training samples for each value of the condition . Consider an amortized image in-painting task in which the objective is to fill in missing pixel values given a subset of observed pixel values . If the number and location of observed pixels is fixed , then a good conditional generative model should produce sharp-looking sample images , all of which should be compatible with the observed pixel values . If the number and location of observed pixels is allowed to vary , the same should remain true for each set of observed pixels . Recent work on this problem has focused on reconstructing an entire image from as small a conditioning set as possible . As shown in Fig . 1 , state-of-the-art methods ( Kim et al. , 2018 ) achieve high-quality reconstruction from as few as 30 conditioning pixels in a 1024-pixel image . Our work starts by questioning whether reconstructing an image from a small subset of pixels is always the right objective . To illustrate , consider the image completion task on handwritten digits . A small set of pixels might , depending on their locations , rule out the possibility that the full image is , say , 1 , 5 , or 6 . Human-like performance in this case would generate sharp-looking sample images for all digits that are consistent with the observed pixels ( i.e. , 0 , 2-4 , and 7-9 ) . Observing additional pixels will rule out successively more digits until the only remaining uncertainty pertains to stylistic details . The bottom-right panel of Fig . 1 demonstrates this type of “ calibrated ” uncertainty . We argue that in addition to high-quality reconstruction based on large conditioning sets , amortized conditional inference methods should aim for meaningful , calibrated uncertainty , particularly for small conditioning sets . For different problems , this may mean different things ( see discussion in Section 3 ) . In this work , we focus on the image in-painting problem , and define well calibrated uncertainty to be a combination of two qualities : high sample diversity for small conditioning sets ; and sharp-looking , realistic images for any size of conditioning set . As the size of the conditioning set grows , we expect the sample diversity to decrease and the quality of the images to increase . We note that this emphasis is different from the current trend in the literature , which has focused primarily on making sharp and accurate image completions when the size of the conditioning context is large ( Kim et al. , 2018 ) . To better understand and make progress toward our aim , we employ posterior predictive inference in a conditional generative latent-variable model , with a particular focus on neural processes ( NPs ) ( Garnelo et al. , 2018a ; b ) . We find that particular architecture choices can result in markedly different performance . In order to understand this , we investigate posterior uncertainty in NP models ( Section 4 ) , and we use our findings to establish new best practices for NP amortized inference artifacts with well-calibrated uncertainty . In particular , we demonstrate improvements arising from a combination of max pooling , a mixture variational distribution , and a “ normal ” amortized variational inference objective . The rest of this paper is organized as follows . Section 2 and Section 3 present background material on amortized inference for generative models and calibrated uncertainty , respectively . Section 4 discusses and presents empirical evidence for how NP models handle uncertainty . Section 5 introduces our proposed network architecture and objective . Section 6 reports our results on the MNIST , FashionMNIST and CelebA datasets . Finally , Section 7 presents our conclusions . 2 AMORTIZED INFERENCE FOR CONDITIONAL GENERATIVE MODELS . Our work builds on amortized inference ( Gershman & Goodman , 2014 ; Kingma & Welling , 2014 ) , probabilistic meta-learning ( Gordon et al. , 2019 ) , and conditional generative models in the form of neural processes ( Garnelo et al. , 2018b ; Kim et al. , 2018 ) . This section provides background . Let ( xC , yC ) = { ( xi , yi ) } ni=1 and ( xT , yT ) = { ( x′j , y′j ) } mj=1 be a context set and target set respectively . In image in-painting , the context set input xC is a subset of an image ’ s pixel coordinates , the context set output yC are the corresponding pixel values ( greyscale intensity or colors ) , the target set input xT is a set of pixel coordinates requiring in-painting , and the target set output yT is the corresponding set of target pixel values . The corresponding graphical model is shown in Fig . 2 . The goal of amortized conditional inference is to rapidly approximate , at “ test time , ” the posterior predictive distribution pθ ( yT |xT , xC , yC ) = ∫ pθ ( yT |xT , z ) pθ ( z|xC , yC ) dz . ( 1 ) We can think of the latent variable z as representing a problem-specific task-encoding . The likelihood term pθ ( yT |xT , z ) shows that the encoding parameterizes a regression model linking the target inputs to the target outputs . In the NP perspective , z is a function and Eq . ( 1 ) can be seen as integrating over the regression function itself , as in Gaussian process regression ( Rasmussen , 2003 ) . Variational inference There are two fundamental aims for amortized inference for conditional generative models : learning the model , parameterized by θ , that produces good samples , and producing an amortization artifact , parameterized by φ , that can be used to approximately solve Eq . ( 1 ) quickly at test time . Variational inference techniques couple the two learning problems . Let y and x be task-specific output and input sets , respectively , and assume that at training time we know the values of y . We can construct the usual single-training-task evidence lower bound ( ELBO ) as log pθ ( y|x ) ≥ Ez∼qφ ( z|x , y ) [ log pθ ( y|z , x ) pθ ( z ) qφ ( z|x , y ) ] . ( 2 ) Summing over all training examples and optimizing Eq . ( 2 ) with respect to φ learns an amortized inference artifact that takes a context set and returns a task embedding ; optimizing with respect to θ learns a problem-specific generative model . Optimizing both simultaneously results in an amortized inference artifact bespoke to the overall problem domain . At test time the learned model and inference artifacts can be combined to perform amortized posterior predictive inference , approximating Eq . ( 1 ) with pθ ( yT |xT , xC , yC ) ≈ ∫ pθ ( yT |xT , z ) qφ ( z|xC , yC ) dz . ( 3 ) Crucially , given an input ( xC , yC ) , sampling from this distribution is as simple as sampling a task embedding z from qφ ( z|xC , yC ) and then passing the sampled z to the generative model pθ ( yT |xT , z ) to produce samples from the conditional generative model . Meta-learning The task-specific problem becomes a meta-learning problem when learning a regression model θ that performs well on multiple tasks with the same graphical structure , trained on data for which the target outputs { y′j } are observed as well . In training our in-painting models , following conventions in the literature ( Garnelo et al. , 2018a ; b ) , tasks are simply random-size subsets of random pixel locations x and values y from training set images . This random subsetting of training images into context and target sets transforms this into a meta-learning problem , and the “ encoder ” qφ ( z|x , y ) must learn to generalize over different context set sizes , with less posterior uncertainty as the context set size grows . Neural processes Our work builds on neural processes ( NPs ) ( Garnelo et al. , 2018a ; b ) . NPs are deep neural network conditional generative models . Multiple variants of NPs have been proposed ( Garnelo et al. , 2018a ; b ; Kim et al. , 2018 ) , and careful empirical comparisons between them appear in the literature ( Grover et al. , 2019 ; Le et al. , 2018 ) . NPs employ an alternative training objective to Eq . ( 2 ) arising from the fact that the graphical model in Fig . 2 allows a Bayesian update on the distribution of z , conditioning on the entire context set to produce a posterior pθ ( z|xC , yC ) . If the generative model is in a tractable family that allows analytic updates of this kind , then the NP objective corresponds to maximizing Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) pθ ( z|xC , yC ) qφ ( z|xT , yT ) ] ≈ Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) qφ ( z|xC , yC ) qφ ( z|xT , yT ) ] ( 4 ) where replacing pθ ( z|xC , yC ) with its variational approximation is typically necessary because most deep neural generative models have a computationally inaccessible posterior . This “ NP objective ” can be trained end-to-end , optimizing for both φ and θ simultaneously , where the split of training data into context and target sets must vary in terms of context set size . The choice of optimizing Eq . ( 4 ) instead of Eq . ( 2 ) is largely empirical ( Le et al. , 2018 ) . 3 CALIBRATED UNCERTAINTY . Quantifying and calibrating uncertainty in generative models remains an open problem , particularly in the context of amortized inference . Previous work on uncertainty calibration has focused on problems with relatively simpler structure . For example , in classification and regression problems with a single dataset , prior work framed the problem as predicting a cumulative distribution function that is close to the data-generating distribution , first as a model diagnostic ( Gneiting et al. , 2007 ) and subsequently as a post-hoc adjustment to a learned predictor ( Kuleshov et al. , 2018 ) . A version of the latter approach was also applied to structured prediction problems ( Kuleshov & Liang , 2015 ) . Previous approaches are conceptually similar to our working definition of calibrated uncertainty . However , we seek calibrated uncertainty on a per-image , per-conditioning set basis , which is fundamentally different from previous settings . Quantification of all aspects of generative model performance is an area of ongoing research , with uncertainty quantification a particularly challenging problem . 4 UNCERTAINTY IN NEURAL PROCESS MODELS . In this section , we investigate how NP models handle uncertainty . A striking property of NP models is that as the size of the ( random ) context set increases , there is less sampling variation in target samples generated by passing z ∼ qφ ( z|xC , yC ) through the decoder . The samples shown in Fig . 1 are the likelihood mean ( hence a deterministic function of z ) , and so the reduced sampling variation can only be produced by decreased posterior uncertainty . Our experiments confirm this , as shown in Fig . 3a : posterior uncertainty ( as measured by entropy ) decreases for increasing context size , even beyond the maximum training context size . Such posterior contraction is a well-studied property of classical Bayesian inference and is a consequence of the inductive bias of exchangeable models . However , NP models do not have the same inductive bias explicitly built in . How do trained NP models exhibit posterior contraction without being explicitly designed to do so ? How do they learn to do so during training ? A simple hypothesis is that the network somehow transfers the context size through the pooling operation and into ρφ ( sC ) , which uses that information to set the posterior uncertainty . That hypothesis is supported by Fig . 3b , which shows the results of training a classifier to infer the context size given only sC . However , consider that within a randomly generated context set , some observations are more informative than others . For example , Fig . 4 shows the first { 10 , 50 , 100 } pixels of an MNIST digit 2 , greedily chosen to minimizeDKL ( qφ ( z|x , y ) ||qφ ( z|xC , yC ) ) . If z is interpreted to represent , amongst other things , which digit the image contains , then a small subset of pixels determine which digits are possible . It is these highly informative pixels that drive posterior contraction in a trained NP . In a random context set , the number of highly informative pixels is random . For example , a max-pooled embedding saturates with the M most highly informative context pixels , where M ≤ d , the dimension of embedding space . On average , a random context set of size n , taken from an image with N pixels , will contain only nM/N of the informative pixels . In truth , Fig . 3 displays how the information content of a context depends , on average , on the size of that context . Indeed , greedily choosing context pixels results in much faster contraction ( Fig . 4 ) . Learning to contract Posterior contraction is implicitly encouraged by the NP objective Eq . ( 4 ) . It can be rewritten as Ez∼qφ ( z|xT , yT ) [ log pθ ( yT |z , xT ) ] −DKL ( qφ ( z|xT , yT ) ||qφ ( z|xC , yC ) ) . ( 5 ) The first term encourages perfect reconstruction of yT , and discourages large variations in z ∼ qφ ( z|xT , yT ) , which would result in large variations in predictive log-likelihood . This effect is stronger for larger target sets since there are more target pixels to predict . In practice , C ⊂ T , so the first term also ( indirectly ) encourages posterior contraction for increasing context sizes . The second term , DKL ( qφ ( z|xT , yT ) ||qφ ( z|xC , yC ) ) , reinforces the contraction by encouraging the context posterior to be close to the target posterior . Although the objective encourages posterior contraction , the network mechanisms for achieving contraction are not immediately clear . Ultimately , the details depend on interplay between the pixel embedding function , hφ , the pooling operation ⊕ , and ρφ . We focus on mean and max pooling . Max pooling As the size of the context set increases , the max-pooled embedding sC = ⊕ni=1si is non-decreasing in n ; in a trained NP model , ||sC || will increase each time an informative pixel is added to the context set ; it will continue increasing until the context embedding saturates at the full image embedding . At a high level , this property of max-pooling means that the σC component of ρφ ( sC ) has a relatively simple task : represent a function such that the posterior entropy is a decreasing function of all dimensions of the embedding space . An empirical demonstration that ρφ achieves this can be found in the Supplementary Material . Mean pooling For a fixed image , as the size of a random context set increases , its mean-pooled embedding will , on average , become closer to the full image embedding . Moreover , the meanpooled embeddings of all possible context sets of the image are contained in the convex set whose hull is formed by ( a subset of ) the individual pixel embeddings . The σC component of ρφ ( sC ) , then , must approximate a function such that the posterior entropy is a convex function on the convex set formed by individual pixel embeddings , with minimum at or near the full image embedding . Learning such a function across the embeddings of many training images seems a much harder learning task than that required by max pooling , which may explain the better performance of max pooling relative to mean pooling in NPs ( see Section 6 ) . Generalizing posterior contraction Remarkably , trained NP-based models generalize their posterior contraction to context and target sizes not seen during training ( see Fig . 3 ) . The discussion of posterior contraction in NPs using mean and max pooling in the previous paragraphs highlights a shared property : for both models , the pooled embeddings of all possible context sets that can be obtained from an image are in a convex set that is determined by a subset of possible context set embeddings . For max-pooling , the convex set is formed by the max-pooled embedding of the M “ activation ” pixels . For mean-pooling , the convex set is obtained from the convex hull of the individual pixel embeddings . Furthermore , the full image embedding in both cases is contained in the convex set . We conjecture that a sufficient condition for an NP image completion model to yield posterior contraction that generalizes to context sets of unseen size is as follows : For any image , the pooled embedding of every possible context set ( which includes the full image ) lies in a convex subset of the embedding space .
This paper proposes an improvement of the standard NP by using a mixture distribution \q_{\phi}, semi-implicit variational inference, and max pooling to capture the multimodel structure of the posterior distribution. Replacing one normal Gaussian distribution with a mixture (of Gaussians, normally) is a widely-adopted idea in latent variable models including NP; the adopted semi-implicit variational inference was originally developed in Yin and Zhou ICML 2018, and no further improvement on this inference method is proposed in this manuscript; max pooling is one of three commonly used pooling methods, i.e., max, min, and mean pooling. using one of them to replace another is simple but the explanation of the reason why max pooling is better is interesting and profound. So, the improvement is weak although it is shown to be effective by the empirical study. More importantly, the authors have investigated the posterior contraction of NP. It is interesting. The relationship between the two parts of the objective function of NP has been discussed related to the posterior contraction, both parts have contributed to the contraction apart from their classical explanation on reconstruction and regularization. To my best knowledge, it is the first work to discuss the posterior contraction of NP. It is a classical property in Bayesian and this link will enable further theoretical analysis for NP.
SP:4f8854605423fab230a26fa2d12d3bfef54b0ca5
BROS: A Pre-trained Language Model for Understanding Texts in Document
1 INTRODUCTION . Document intelligence ( DI ) 1 , which understands industrial documents from their visual appearance , is a critical application of AI in business . One of the important challenges of DI is a key information extraction task ( KIE ) ( Huang et al. , 2019 ; Jaume et al. , 2019 ; Park et al. , 2019 ) that extracts structured information from documents such as financial reports , invoices , business emails , insurance quotes , and many others . KIE requires a multi-disciplinary perspective spanning from computer vision for extracting text from document images to natural language processing for parsing key information from the identified texts . Optical character recognition ( OCR ) is a key component to extract texts in document images . As OCR provides a set of text blocks consisting of a text and its location , key information in documents can be represented as a single or a sequence of the text blocks ( Schuster et al. , 2013 ; Qian et al. , 2019 ; Hwang et al. , 2019 ; 2020 ) . Although OCR alleviates the burden of processing images , understanding semantic relations between text blocks on diverse layouts remains a challenging problem . To solve this problem , existing works use a pre-trained language model to utilize its effective representation of text . Hwang et al . ( 2019 ) fine-tunes BERT by regarding KIE tasks as sequence tagging problems . Denk & Reisswig ( 2019 ) uses BERT to incorporate textual information into image pixels during their image segmentation tasks . However , since BERT is designed for text sequences , they artificially convert text blocks distributed in two dimensions into a single text sequence losing spatial layout information . Recently , Xu et al . ( 2020 ) proposes LayoutLM pre-trained on large-scale documents by utilizing spatial information of text blocks . They show the effectiveness of the pretraining approach by achieving high performance on several downstream tasks . Despite this success , LayoutLM has three limitations . First , LayoutLM embeds x- and y-axis individually using trainable parameters like the position embedding of BERT , ignoring the gap between positions in a sequence and 2D space . Second , its pre-training method is essentially identical to BERT that does not explicitly consider spatial relations between text blocks . Finally , in its downstream tasks , LayoutLM only conducts sequential tagging tasks ( e.g . BIO tagging ) that require serialization of text blocks . 1https : //sites.google.com/view/di2019 These limitations indicate that LayoutLM fails not only to fully utilize spatial information but also to address KIE problems in practical scenarios when a serialization of text blocks is difficult . This paper introduces an advanced language model , BROS , pre-trained on large-scale documents , and provides a new guideline for KIE tasks . Specifically , to address the three limitations mentioned above , BROS combines three proposed methods : ( 1 ) a 2D positional encoding method that can represent the continuous property of 2D space , ( 2 ) a novel area-masking pre-training strategy that performs masked language modeling on 2D , and ( 3 ) a combination with a graph-based decoder for solving KIE tasks . We evaluated BROS on four public KIE datasets : FUNSD ( form-like documents ) , SROIE * ( receipts ) , CORD ( receipts ) , and SciTSR ( table structures ) and observed that BROS achieved the best results on all tasks . Also , to address KIE problem under a more realistic setting we removed the order information between text blocks from the four benchmark datasets . BROS still shows the best performance on these modified datasets . Further ablation studies provide how each component contributes to the final performances of BROS . 2 RELATED WORK . 2.1 PRE-TRAINED LANGUAGE MODELS . BERT ( Devlin et al. , 2019 ) is a pre-trained language model using Transformer ( Vaswani et al. , 2017 ) that shows superior performance on various NLP tasks . The main strategy to train BERT is a masked language model ( MLM ) that masks and estimates randomly selected tokens to learn the semantics of language from large-scale corpora . Many variants of BERT have been introduced to learn transferable knowledge by modifying the pre-training strategy . XLNet ( Yang et al. , 2019 ) permutes tokens during the pre-training phase to reduce a discrepancy from the fine-tuning phase . XLNet also utilizes relative position encoding to handle long texts . StructBERT ( Wang et al. , 2020 ) shuffles tokens in text spans and adds sentence prediction tasks for recovering the order of words or sentences . SpanBERT ( Joshi et al. , 2020 ) masks span of tokens to extract better representation for span selection tasks such as question answering and co-reference resolution . ELECTRA ( Clark et al. , 2020 ) is trained to distinguish real and fake input tokens generated by another network for sample-efficient pre-training . Inspired by these previous works , BROS utilizes a new pre-training strategy that can capture complex spatial dependencies between text blocks distributed on two dimensions . Note that LayoutLM is the first pre-trained language model on spatial text blocks but they still employs the original MLM of BERT . 2.2 KEY INFORMATION EXTRACTION FROM DOCUMENTS . Most of the existing approaches utilize a serializer to identify the text order of key information . POT ( Hwang et al. , 2019 ) applies BERT on serialized text blocks and extracts key contexts via a BIO tagging approach . CharGrid ( Katti et al. , 2018 ) and BERTGrid ( Denk & Reisswig , 2019 ) map text blocks upon a grid space , identify the region of key information , and extract key contexts in the pre-determined order . Liu et al . ( 2019 ) , Yu et al . ( 2020 ) , and Qian et al . ( 2019 ) utilize graph convolutional networks to model dependencies between text blocks but their decoder that performs BIO tagging relies on a serialization . LayoutLM ( Xu et al. , 2020 ) is pre-trained on large-scale documents with spatial information of text blocks , but it also conducts BIO tagging for their downstream tasks . However , using a serializer and relying on the identified sequence has two limitations . First , the information represented in two dimensional layout can be lost by improper serialization . Second , there may even be no correct serialization order . A natural way to model key contexts from text blocks is a graph-based formulation that identifies all relationships between text blocks . SPADE ( Hwang et al. , 2020 ) proposes a graph-based decoder to extract key contexts from identified connectivity between text blocks without any serialization . Specifically , they utilize BERT without its sequential position embeddings and train the model while fine-tuning BERT . However , their performance is limited by the amount of data as all relations have to be learned from the beginning at the fine-tuning stage . To fully utilize the graph-based decoder , BROS is pre-trained on a large number of documents and is combined with the SPADE decoder to determine key contexts from text blocks . 3 BERT RELYING ON SPATIALITY ( BROS ) . The main structure of BROS follows BERT , but there are three novel differences : ( 1 ) a spatial encoding metric that reflects the continuous property of 2D space , ( 2 ) a pre-training objective designed for text blocks on 2D space , and ( 3 ) a guideline for designing downstream models based on a graphbased formulation . Figure 1 shows visual description of BROS for document KIE tasks . 3.1 ENCODING SPATIAL INFORMATION INTO BERT . 3.1.1 REPRESENTATION OF A TEXT BLOCK LOCATION . The way to represent spatial information of text blocks is important to encode information from layouts . We utilize sinusoidal functions to encode continuous values of x- and y-axis , and merge them through a linear transformation to represent a point upon 2D space . For formal description , we use p = ( x , y ) to denote a point on 2D space and f sinu : R → RDs to represent a sinusoidal function . Ds is the dimensions of sinusoid embedding . BROS encodes a 2D point by applying the sinusoidal function to x- and y-axis and concatenating them as p̄ = [ f sinu ( x ) ⊕ f sinu ( y ) ] . The ⊕ symbol indicates concatenation . The bounding box of a text block , bbi , consists of four vertices , such as ptli , p tr i , p br i , and p bl i that indicate top-left , top-right , bottom-right , and bottom-left points , respectively . The four points are converted into vectors such as p̄tli , p̄ tr i , p̄ br i , and p̄bli with f sinu . Finally , to represent a spatial embedding , bbi , BROS combines four identified vectors through a linear transformation , bbi = W tlp̄tli + W trp̄tri + W brp̄bri + W blp̄bli , ( 1 ) where W tl , W tr , W br , W bl ∈ RH×2Ds are linear transition metrics and H is a hidden size of BERT . The periodic property of the sinusoidal function can encode continuous 2D coordinates more natural than using point-specific embedding used in BERT and LayoutLM . In addition , by learning the linear transition parameters , BROS provides an effective representation of a bounding box . 3.1.2 ENCODING SPATIAL REPRESENTATION . Position encoding methods affect how models utilize the position information . In BERT , position embedding is tied with the token through a point-wise summation . However , 2D spatial information is richer than 1D sequence due to the their continuous property and the high dimensionality . Moreover , text blocks can be placed over various locations on documents without significant changes in its semantic meaning . For example , locations of page numbers differ over multiple document snapshots even though they are captured from a single document . Therefore , more advanced approach is required to maximally include spatial information during encoding beyond the simple summation approach used in BERT . In BROS , the spatial information is directly encoded during the contextualization of text blocks . Specifically , BROS calculates an attention logit combining both semantic and spatial features . The former is the same as the original attention mechanism in Transformer ( Vaswani et al. , 2017 ) , but the latter is a new component identifying the importance of the target location when the source context and location are given . Our proposed attention logit is formulated as follows , Ai , j = ( W qti ) > ( W ktj ) + ( W qti W sq|qbbi ) > ( W sk|qbbj ) + ( W sqbbi ) > ( W skbbj ) , ( 2 ) where ti and tj are context representations for ith and jth tokens and W q , W k , W sq|q , W sk|q , W sq , W sk are linear transition matrices . The symbol indicates Hadamard product . The first term indicates an attention logit from contextual representations and the third term is from spatial representation . The second term is designed to model the spatial dependency given the source semantic representation , ti . The second and third terms are independently calculated at each layer because spatial dependencies might differ over layers . 3.2 PRE-TRAINING OBJECTIVE : AREA-MASKED LANGUAGE MODEL . Pre-training diverse layouts from unlabeled documents is a key factor for document understanding tasks . To learn effective spatial representation including relationships between text blocks , we propose a novel pre-training objective . Inspired by SpanBERT ( Joshi et al. , 2020 ) , we expand spans of a 1D sequence to consecutive text blocks in 2D space . Specifically , we select a few regions in a document layout , mask all tokens of text blocks in the selected regions , and estimate the masked tokens . The rules for masking tokens in area-masked language model are as the following procedure . ( a ) Select a text block randomly and get the top-left and bottom-right points ( ptl and pbr ) of the block . ( b ) Identify the width , height , and center of the block as ( w , h ) = |ptl − pbr| and c = ( ptl + pbr ) /2 . ( c ) Expand the width and height as ( ŵ , ĥ ) = l ∗ ( w , h ) where l ∼ exp ( λ ) and λ is a distribution parameter . ( d ) Identify rectangular masking area of which top-left and bottom-right are p̂tl = ptl − ( ŵ , ĥ ) , and p̂br = pbr + ( ŵ , ĥ ) , respectively . ( e ) Mask all tokens of text blocks whose centers are allocated in the area . ( f ) Repeat ( a ) – ( e ) until 15 % of tokens are masked . The rationale behind using exponential distribution is to convert the geometric distribution used in SpanBERT for a discrete domain into distribution for a continuous domain . Thus , we set λ = −ln ( 1 − p ) where p = 0.2 used in SpanBERT . In addition , we truncated exponential distribution with 1 to prevent an infinity multiplier covering all space of the document . It should be noted that the masking area is expanded from a randomly selected text block since the area should be related to the text sizes and locations to represent text spans in 2D space . Figure 2 compares token- and area-masking on text blocks . Finally , the loss function for the area-masked language model is formed as ; LAMLM = − ∑ x̂∈A ( x ) log p ( x̂|x\A ( x ) ) , ( 3 ) where x , A ( x ) , and x\A ( x ) denote tokens in given image , masked tokens of which text block is located in masking area , and the rest tokens , respectively . Similar to BERT ( Devlin et al. , 2019 ) , the masked tokens are replaced by [ MASK ] token 80 % of the time , a random token 10 % of the time , or an unchanged token 10 % of the time .
Authors used BERT alongside to a 2D-position embedding based on a sinusoidal function and a graph-based decoder to improve performance on document information extraction tasks. They do pre-train their model (BROS) on a large dataset with 11M documents, and then used such models to perform downstream tasks in four smaller datasets. Their models achieve better quantitative results when compared to the provided baselines.
SP:301524218da40096adedfa6d058b1f6ef93ea882
BROS: A Pre-trained Language Model for Understanding Texts in Document
1 INTRODUCTION . Document intelligence ( DI ) 1 , which understands industrial documents from their visual appearance , is a critical application of AI in business . One of the important challenges of DI is a key information extraction task ( KIE ) ( Huang et al. , 2019 ; Jaume et al. , 2019 ; Park et al. , 2019 ) that extracts structured information from documents such as financial reports , invoices , business emails , insurance quotes , and many others . KIE requires a multi-disciplinary perspective spanning from computer vision for extracting text from document images to natural language processing for parsing key information from the identified texts . Optical character recognition ( OCR ) is a key component to extract texts in document images . As OCR provides a set of text blocks consisting of a text and its location , key information in documents can be represented as a single or a sequence of the text blocks ( Schuster et al. , 2013 ; Qian et al. , 2019 ; Hwang et al. , 2019 ; 2020 ) . Although OCR alleviates the burden of processing images , understanding semantic relations between text blocks on diverse layouts remains a challenging problem . To solve this problem , existing works use a pre-trained language model to utilize its effective representation of text . Hwang et al . ( 2019 ) fine-tunes BERT by regarding KIE tasks as sequence tagging problems . Denk & Reisswig ( 2019 ) uses BERT to incorporate textual information into image pixels during their image segmentation tasks . However , since BERT is designed for text sequences , they artificially convert text blocks distributed in two dimensions into a single text sequence losing spatial layout information . Recently , Xu et al . ( 2020 ) proposes LayoutLM pre-trained on large-scale documents by utilizing spatial information of text blocks . They show the effectiveness of the pretraining approach by achieving high performance on several downstream tasks . Despite this success , LayoutLM has three limitations . First , LayoutLM embeds x- and y-axis individually using trainable parameters like the position embedding of BERT , ignoring the gap between positions in a sequence and 2D space . Second , its pre-training method is essentially identical to BERT that does not explicitly consider spatial relations between text blocks . Finally , in its downstream tasks , LayoutLM only conducts sequential tagging tasks ( e.g . BIO tagging ) that require serialization of text blocks . 1https : //sites.google.com/view/di2019 These limitations indicate that LayoutLM fails not only to fully utilize spatial information but also to address KIE problems in practical scenarios when a serialization of text blocks is difficult . This paper introduces an advanced language model , BROS , pre-trained on large-scale documents , and provides a new guideline for KIE tasks . Specifically , to address the three limitations mentioned above , BROS combines three proposed methods : ( 1 ) a 2D positional encoding method that can represent the continuous property of 2D space , ( 2 ) a novel area-masking pre-training strategy that performs masked language modeling on 2D , and ( 3 ) a combination with a graph-based decoder for solving KIE tasks . We evaluated BROS on four public KIE datasets : FUNSD ( form-like documents ) , SROIE * ( receipts ) , CORD ( receipts ) , and SciTSR ( table structures ) and observed that BROS achieved the best results on all tasks . Also , to address KIE problem under a more realistic setting we removed the order information between text blocks from the four benchmark datasets . BROS still shows the best performance on these modified datasets . Further ablation studies provide how each component contributes to the final performances of BROS . 2 RELATED WORK . 2.1 PRE-TRAINED LANGUAGE MODELS . BERT ( Devlin et al. , 2019 ) is a pre-trained language model using Transformer ( Vaswani et al. , 2017 ) that shows superior performance on various NLP tasks . The main strategy to train BERT is a masked language model ( MLM ) that masks and estimates randomly selected tokens to learn the semantics of language from large-scale corpora . Many variants of BERT have been introduced to learn transferable knowledge by modifying the pre-training strategy . XLNet ( Yang et al. , 2019 ) permutes tokens during the pre-training phase to reduce a discrepancy from the fine-tuning phase . XLNet also utilizes relative position encoding to handle long texts . StructBERT ( Wang et al. , 2020 ) shuffles tokens in text spans and adds sentence prediction tasks for recovering the order of words or sentences . SpanBERT ( Joshi et al. , 2020 ) masks span of tokens to extract better representation for span selection tasks such as question answering and co-reference resolution . ELECTRA ( Clark et al. , 2020 ) is trained to distinguish real and fake input tokens generated by another network for sample-efficient pre-training . Inspired by these previous works , BROS utilizes a new pre-training strategy that can capture complex spatial dependencies between text blocks distributed on two dimensions . Note that LayoutLM is the first pre-trained language model on spatial text blocks but they still employs the original MLM of BERT . 2.2 KEY INFORMATION EXTRACTION FROM DOCUMENTS . Most of the existing approaches utilize a serializer to identify the text order of key information . POT ( Hwang et al. , 2019 ) applies BERT on serialized text blocks and extracts key contexts via a BIO tagging approach . CharGrid ( Katti et al. , 2018 ) and BERTGrid ( Denk & Reisswig , 2019 ) map text blocks upon a grid space , identify the region of key information , and extract key contexts in the pre-determined order . Liu et al . ( 2019 ) , Yu et al . ( 2020 ) , and Qian et al . ( 2019 ) utilize graph convolutional networks to model dependencies between text blocks but their decoder that performs BIO tagging relies on a serialization . LayoutLM ( Xu et al. , 2020 ) is pre-trained on large-scale documents with spatial information of text blocks , but it also conducts BIO tagging for their downstream tasks . However , using a serializer and relying on the identified sequence has two limitations . First , the information represented in two dimensional layout can be lost by improper serialization . Second , there may even be no correct serialization order . A natural way to model key contexts from text blocks is a graph-based formulation that identifies all relationships between text blocks . SPADE ( Hwang et al. , 2020 ) proposes a graph-based decoder to extract key contexts from identified connectivity between text blocks without any serialization . Specifically , they utilize BERT without its sequential position embeddings and train the model while fine-tuning BERT . However , their performance is limited by the amount of data as all relations have to be learned from the beginning at the fine-tuning stage . To fully utilize the graph-based decoder , BROS is pre-trained on a large number of documents and is combined with the SPADE decoder to determine key contexts from text blocks . 3 BERT RELYING ON SPATIALITY ( BROS ) . The main structure of BROS follows BERT , but there are three novel differences : ( 1 ) a spatial encoding metric that reflects the continuous property of 2D space , ( 2 ) a pre-training objective designed for text blocks on 2D space , and ( 3 ) a guideline for designing downstream models based on a graphbased formulation . Figure 1 shows visual description of BROS for document KIE tasks . 3.1 ENCODING SPATIAL INFORMATION INTO BERT . 3.1.1 REPRESENTATION OF A TEXT BLOCK LOCATION . The way to represent spatial information of text blocks is important to encode information from layouts . We utilize sinusoidal functions to encode continuous values of x- and y-axis , and merge them through a linear transformation to represent a point upon 2D space . For formal description , we use p = ( x , y ) to denote a point on 2D space and f sinu : R → RDs to represent a sinusoidal function . Ds is the dimensions of sinusoid embedding . BROS encodes a 2D point by applying the sinusoidal function to x- and y-axis and concatenating them as p̄ = [ f sinu ( x ) ⊕ f sinu ( y ) ] . The ⊕ symbol indicates concatenation . The bounding box of a text block , bbi , consists of four vertices , such as ptli , p tr i , p br i , and p bl i that indicate top-left , top-right , bottom-right , and bottom-left points , respectively . The four points are converted into vectors such as p̄tli , p̄ tr i , p̄ br i , and p̄bli with f sinu . Finally , to represent a spatial embedding , bbi , BROS combines four identified vectors through a linear transformation , bbi = W tlp̄tli + W trp̄tri + W brp̄bri + W blp̄bli , ( 1 ) where W tl , W tr , W br , W bl ∈ RH×2Ds are linear transition metrics and H is a hidden size of BERT . The periodic property of the sinusoidal function can encode continuous 2D coordinates more natural than using point-specific embedding used in BERT and LayoutLM . In addition , by learning the linear transition parameters , BROS provides an effective representation of a bounding box . 3.1.2 ENCODING SPATIAL REPRESENTATION . Position encoding methods affect how models utilize the position information . In BERT , position embedding is tied with the token through a point-wise summation . However , 2D spatial information is richer than 1D sequence due to the their continuous property and the high dimensionality . Moreover , text blocks can be placed over various locations on documents without significant changes in its semantic meaning . For example , locations of page numbers differ over multiple document snapshots even though they are captured from a single document . Therefore , more advanced approach is required to maximally include spatial information during encoding beyond the simple summation approach used in BERT . In BROS , the spatial information is directly encoded during the contextualization of text blocks . Specifically , BROS calculates an attention logit combining both semantic and spatial features . The former is the same as the original attention mechanism in Transformer ( Vaswani et al. , 2017 ) , but the latter is a new component identifying the importance of the target location when the source context and location are given . Our proposed attention logit is formulated as follows , Ai , j = ( W qti ) > ( W ktj ) + ( W qti W sq|qbbi ) > ( W sk|qbbj ) + ( W sqbbi ) > ( W skbbj ) , ( 2 ) where ti and tj are context representations for ith and jth tokens and W q , W k , W sq|q , W sk|q , W sq , W sk are linear transition matrices . The symbol indicates Hadamard product . The first term indicates an attention logit from contextual representations and the third term is from spatial representation . The second term is designed to model the spatial dependency given the source semantic representation , ti . The second and third terms are independently calculated at each layer because spatial dependencies might differ over layers . 3.2 PRE-TRAINING OBJECTIVE : AREA-MASKED LANGUAGE MODEL . Pre-training diverse layouts from unlabeled documents is a key factor for document understanding tasks . To learn effective spatial representation including relationships between text blocks , we propose a novel pre-training objective . Inspired by SpanBERT ( Joshi et al. , 2020 ) , we expand spans of a 1D sequence to consecutive text blocks in 2D space . Specifically , we select a few regions in a document layout , mask all tokens of text blocks in the selected regions , and estimate the masked tokens . The rules for masking tokens in area-masked language model are as the following procedure . ( a ) Select a text block randomly and get the top-left and bottom-right points ( ptl and pbr ) of the block . ( b ) Identify the width , height , and center of the block as ( w , h ) = |ptl − pbr| and c = ( ptl + pbr ) /2 . ( c ) Expand the width and height as ( ŵ , ĥ ) = l ∗ ( w , h ) where l ∼ exp ( λ ) and λ is a distribution parameter . ( d ) Identify rectangular masking area of which top-left and bottom-right are p̂tl = ptl − ( ŵ , ĥ ) , and p̂br = pbr + ( ŵ , ĥ ) , respectively . ( e ) Mask all tokens of text blocks whose centers are allocated in the area . ( f ) Repeat ( a ) – ( e ) until 15 % of tokens are masked . The rationale behind using exponential distribution is to convert the geometric distribution used in SpanBERT for a discrete domain into distribution for a continuous domain . Thus , we set λ = −ln ( 1 − p ) where p = 0.2 used in SpanBERT . In addition , we truncated exponential distribution with 1 to prevent an infinity multiplier covering all space of the document . It should be noted that the masking area is expanded from a randomly selected text block since the area should be related to the text sizes and locations to represent text spans in 2D space . Figure 2 compares token- and area-masking on text blocks . Finally , the loss function for the area-masked language model is formed as ; LAMLM = − ∑ x̂∈A ( x ) log p ( x̂|x\A ( x ) ) , ( 3 ) where x , A ( x ) , and x\A ( x ) denote tokens in given image , masked tokens of which text block is located in masking area , and the rest tokens , respectively . Similar to BERT ( Devlin et al. , 2019 ) , the masked tokens are replaced by [ MASK ] token 80 % of the time , a random token 10 % of the time , or an unchanged token 10 % of the time .
The paper proposes the pre-trained language model BROS which aims to leverage both text and spatial information to improve information extraction on documents. Using the graph-based decoder from SPADE, BROS achieves the SOTA performance on some entity extraction and entity linking downstream tasks. However, the area-masking strategy does not show significant improvement over the LayoutLM and the graph decoder is proposed in SPADE which is not new. In addition, as most commercial OCR tools have already got very good reading order information, the benefit from the graph decoder might be marginal.
SP:301524218da40096adedfa6d058b1f6ef93ea882
SkillBERT: “Skilling” the BERT to classify skills!
1 INTRODUCTION . Competency group can be thought of as a group of similar skills required for success in a job . For example , skills such as Apache Hadoop , Apache Pig represent competency in Big Data analysis while HTML , Javascript are part of Front-end competency . Classification of skills into the right competency groups can help in gauging candidate ’ s job interest and automation of the recruitment process . Recently , several contextual word embedding models have been explored on various domain-specific datasets but no work has been done on exploring those models on job-skill specific datasets . Fields like medical and law have already explored these models in their respective domains . Lee et al . ( 2019 ) in their BioBERT model trained the BERT model on a large biomedical corpus . They found that without changing the architecture too much across tasks , BioBERT beats BERT and previous state-of-the-art models in several biomedical text mining tasks by a large difference . Alsentzer et al . ( 2019 ) trained publicly released BERT-Base and BioBERT-finetuned models on clinical notes and discharge summaries . They have shown that embeddings formed are superior to a general domain or BioBERT specific embeddings for two well established clinical NER tasks and one medical natural language inference task ( i2b2 2010 ( Uzuner et al. , 2011 ) , i2b2 2012 ( Sun et al. , 2013a ; b ) ) , and MedNLI ( Romanov & Shivade , 2018 ) ) . 1https : //www.dropbox.com/s/wcg8kbq5btl4gm0/code_data_pickle_files.zip ? dl=0 ! Beltagy et al . ( 2019 ) in their model SciBERT leveraged unsupervised pretraining of a BERT based model on a large multi-domain corpus of scientific publications . SciBERT significantly outperformed BERT-Base and achieves better results on tasks like sequence tagging , sentence classification , and dependency parsing , even compared to some reported BioBERT results on biomedical tasks . Similarly , Elwany et al . ( 2019 ) in their work has shown the improvement in results on fine-tuning the BERT model on legal domain-specific corpora . They concluded that fine-tuning BERT gives the best performance and reduces the need for a more sophisticated architecture and/or features . In this paper , we are proposing a multi-label competency group classifier , which primarily leverages : SkillBERT , which uses BERT architecture and is trained on the job-skill data from scratch to generate embeddings for skills . These embeddings are used to create several similarity-based features to capture the association between skills and group . We have also engineered features through clustering algorithms like spectral clustering on embeddings to attach cluster labels to skills . All these features along with SkillBERT embeddings are used in the final classifier to achieve the best possible classification accuracy . 2 METHODOLOGY . As no prior benchmark related to job-skill classification is available , we manually assigned each skill in our dataset to one or more competency groups with the help of the respective domain experts to create training data . We experimented with three different models : pre-trained BERT , Word2vec , and SkillBERT to generate word embeddings . Word2vec and SkillBERT were trained from scratch on our skill dataset . We created some similarity-based and cluster-based features on top of these embeddings . Except for these features , some frequency-based and group-based features were also generated . A detailed explanation of all the steps is mentioned in the next sections . The details of dataset design and feature engineering used for model creation are given in the next sections . 2.1 TRAINING DATA CREATION . Our approach uses a multi-label classification model to predict competency groups for a skill . However , as no prior competency group tagging was available for existing skills , we had to manually assign labels for training data creation . For this task , the skill dataset is taken from our organization ’ s database which contains 700,000 job requisitions and 2,997 unique skills . The competency groups were created in consultation with domain experts across all major sectors . Currently , there exists 40 competency groups in our data representing all major industries . Also within a competency group , we have classified a skill as core or fringe . For example , in marketing competency group , digital marketing is a core skill while creativity is a fringe skill . Once training data is created , our job is to classify a new skill into these 40 competency groups . Some skills can belong to more than one category also . For such cases , a skill will have representation in multiple groups . Figure 1 shows an overview of the datasets used in this step . 2.2 FEATURE ENGINEERING . For feature creation , we have experimented with Word2vec and BERT to generate skill embeddings . By leveraging these skill embeddings we created similarity-based features as well . We also used clustering on generated embeddings to create cluster-based features . As multiple clustering algorithms are available in the literature , we evaluated the most popular clustering algorithms – K-means ( Lloyd , 1982 ) and spectral clustering for experimentation . We have done extensive feature engineering to capture information at skill level , group level , and skill-group combination level . The details of features designed for experiments are given below . 2.2.1 EMBEDDING FEATURES . Traditionally , n-gram based algorithms were used to extract information from text . However , these methods completely ignore the context surrounding a word . Hence , we have experimented with Word2vec and BERT based architecture to learn embeddings of skills present in training data . The details of how we have leveraged them in our problem domain are given below . Word2vec is one of the most popular techniques to learn word embeddings using a neural network . It uses a shallow , two-layer neural network to generate n-dimensional embedding for words . To use the Word2vec model on requisition data , we extracted skills from job requisitions and constructed a single document . Each sentence of this document represents the skills present in one requisition . As a requisition can have multiple skills , we created a 2-dimensional list , where the outer dimension specifies the sentence and inner dimension corresponds to the skills in that sentence . E.g . if there are two job requisitions called req1 and req2 and their corresponding skills are `` Java , J2EE '' and `` Logistic regression , Data visualization , NLP '' then outer index 0 corresponds to req1 and outer index 1 corresponds to req2 . Index 0,0 will refer to Java and Index 0,1 will refer to J2EE and so on . Also before feeding this data for training lowercasing of words , stop word removal and stemming was performed as part of preprocessing . A total of more than 700,000 requisitions were used for model training . We have used embeddings of size 30 which was decided after evaluating model performance on different embedding sizes . BERT Bidirectional Encoder Representations from Transformers , is designed to pre-train deep bidirectional representations from the unlabeled text by jointly conditioning on both left and right context in all layers . Pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models for tasks such as question answering , next sentence prediction , etc . Similar to Word2vec , BERT can also be used to extract fixed-length embeddings of words and sentences , which can further be used as features for downstream tasks like classification . But unlike fixed embedding produced by Word2vec , BERT will generate different embedding for an input word based on its left and right context . BERT has shown performance improvement for many natural language processing tasks . However , it has been minimally explored on the job-skill database . Hence , we leveraged BERT architecture on skill data to train the SkillBERT model . We have leveraged ml.p2.xlarge type 12 GIB GPU memory 1xK80 GPU available on the AWS cloud for SkillBERT training and it took us around 72 hours to completely train it on our dataset . In the next section , we have given the details of training BERT on skill corpus . Training : For training BERT , we used the same corpus as used for Word2vec training and experimented with hyperparameters like learning rate and maximum sequence length . For the learning rate , we used 0.1 , 0.05 , and 0.01 and finalised 0.01 . For maximum sequence length , we used 64 , 128 , 180 and finalised 128 . We could not perform extensive hyperparameter tuning due to hardware limitations . Once the training is finished , we extract the last hidden layer output of size 768 and further reduce the embedding size to 128 to decrease the training time of our final model discussed in the experiment section . For the dimensionality reduction of embedding , we did experiments with embeddings of size 32 , 64 , 128 and 256 . As shown in Appendix Table 6 , the best results were obtained using embedding of size 128 . To make sure information from all the 768 dimensions is leveraged , we trained a 2-layer neural network classifier using SkillBERT embeddings as an independent feature and competency group as a dependent variable . Out of the 2,997 skills , 80 % were used for training and the rest of the 20 % were used for the validation . This model generates the probability values of a skill belonging to each of the 40 competency groups and was used as a feature in the final model at skill and competency group combination level . We have referred this feature as `` bert-prob '' in the rest of the sections . Figure 2 represents the architecture of the model used for getting these probabilities . 2.2.2 SIMILARITY-BASED FEATURES . By leveraging skill embeddings generated using embedding techniques , similarity-based features were created to capture the association between a group and skill . The details of those are given below . Similarity from competency group : In competency group data , the name of each competency group is also present as a skill . We created a similarity score feature measuring the cosine distance between competency group name and skill embeddings . Similarity from top skills per group : Apart from utilizing the similarity between competency group name and skill , we have also created similarity-based features between a given skill and skills present in the competency group . As an example , we have a skill named auditing and competency group finance . Three similarity-based features were created called top1 , top2 , and top3 , where top1 is cosine similarity score between skill auditing and most similar skill from finance , top2 is the average cosine similarity score of top two most similar skills and top3 is the average cosine similarity score of top three most similar skills . As shown in Appendix Table 5 , the use of similarity-based features beyond three skills did not improve model performance . 2.2.3 CLUSTER-BASED FEATURE . For generating labels for skills using clustering , we experimented with two techniques on SkillBERT embedding – K-means and spectral clustering . Scikit-learn package of K-means was used to generate 45 cluster labels . The number 45 was decided by using the elbow method , the graph of which is shown in Appendix Figure 8 . Using spectral clustering we generated 35 cluster labels . The details of how we used spectral clustering on SkillBERT embedding to generate cluster-based feature are given in Appendix section A.1 . 2.2.4 SKILL TFIDF FEATURE . TFIDF ( Salton & McGill , 1986 ; Ramos , 1999 ) is widely used in text mining to find rare and important words in a document , and as in our training data a single skill can be part of multiple competency groups , we used the same strategy to find skills that are unique to a competency group by calculating their TFIDF value . However , as group information will not be available for new skills , we will calculate the TFIDF of such skills differently . First , we will find the most similar top 3 existing skills and thereafter , take the average of their TFIDF values . This resultant value will be the TFIDF value for a new skill .
This paper proposes a model for job application screening. Since there is no job-related dataset available, the authors manually assigned labels to a large job application dataset. A skill set (e.g., Apache Hadoop, Apache Pig, HTML, Javascript) is firstly extracted from the job dataset. Then a competency group is constructed (e.g., big data, front-end) as the labels. The problem is then formulated as a multi-label classification problem. That is, given a skill (which may belong to multiple competency groups), the model has to predict its competency groups. The authors proposed to use BERT as the main model. Moreover, the authors use additional features like similarity-based and cluster-based features. The experimental results are good. We think it can help recruiters find a suitable applicant.
SP:e2f5cc48d84e800d9557d2a0f0e90b636ea22a15
SkillBERT: “Skilling” the BERT to classify skills!
1 INTRODUCTION . Competency group can be thought of as a group of similar skills required for success in a job . For example , skills such as Apache Hadoop , Apache Pig represent competency in Big Data analysis while HTML , Javascript are part of Front-end competency . Classification of skills into the right competency groups can help in gauging candidate ’ s job interest and automation of the recruitment process . Recently , several contextual word embedding models have been explored on various domain-specific datasets but no work has been done on exploring those models on job-skill specific datasets . Fields like medical and law have already explored these models in their respective domains . Lee et al . ( 2019 ) in their BioBERT model trained the BERT model on a large biomedical corpus . They found that without changing the architecture too much across tasks , BioBERT beats BERT and previous state-of-the-art models in several biomedical text mining tasks by a large difference . Alsentzer et al . ( 2019 ) trained publicly released BERT-Base and BioBERT-finetuned models on clinical notes and discharge summaries . They have shown that embeddings formed are superior to a general domain or BioBERT specific embeddings for two well established clinical NER tasks and one medical natural language inference task ( i2b2 2010 ( Uzuner et al. , 2011 ) , i2b2 2012 ( Sun et al. , 2013a ; b ) ) , and MedNLI ( Romanov & Shivade , 2018 ) ) . 1https : //www.dropbox.com/s/wcg8kbq5btl4gm0/code_data_pickle_files.zip ? dl=0 ! Beltagy et al . ( 2019 ) in their model SciBERT leveraged unsupervised pretraining of a BERT based model on a large multi-domain corpus of scientific publications . SciBERT significantly outperformed BERT-Base and achieves better results on tasks like sequence tagging , sentence classification , and dependency parsing , even compared to some reported BioBERT results on biomedical tasks . Similarly , Elwany et al . ( 2019 ) in their work has shown the improvement in results on fine-tuning the BERT model on legal domain-specific corpora . They concluded that fine-tuning BERT gives the best performance and reduces the need for a more sophisticated architecture and/or features . In this paper , we are proposing a multi-label competency group classifier , which primarily leverages : SkillBERT , which uses BERT architecture and is trained on the job-skill data from scratch to generate embeddings for skills . These embeddings are used to create several similarity-based features to capture the association between skills and group . We have also engineered features through clustering algorithms like spectral clustering on embeddings to attach cluster labels to skills . All these features along with SkillBERT embeddings are used in the final classifier to achieve the best possible classification accuracy . 2 METHODOLOGY . As no prior benchmark related to job-skill classification is available , we manually assigned each skill in our dataset to one or more competency groups with the help of the respective domain experts to create training data . We experimented with three different models : pre-trained BERT , Word2vec , and SkillBERT to generate word embeddings . Word2vec and SkillBERT were trained from scratch on our skill dataset . We created some similarity-based and cluster-based features on top of these embeddings . Except for these features , some frequency-based and group-based features were also generated . A detailed explanation of all the steps is mentioned in the next sections . The details of dataset design and feature engineering used for model creation are given in the next sections . 2.1 TRAINING DATA CREATION . Our approach uses a multi-label classification model to predict competency groups for a skill . However , as no prior competency group tagging was available for existing skills , we had to manually assign labels for training data creation . For this task , the skill dataset is taken from our organization ’ s database which contains 700,000 job requisitions and 2,997 unique skills . The competency groups were created in consultation with domain experts across all major sectors . Currently , there exists 40 competency groups in our data representing all major industries . Also within a competency group , we have classified a skill as core or fringe . For example , in marketing competency group , digital marketing is a core skill while creativity is a fringe skill . Once training data is created , our job is to classify a new skill into these 40 competency groups . Some skills can belong to more than one category also . For such cases , a skill will have representation in multiple groups . Figure 1 shows an overview of the datasets used in this step . 2.2 FEATURE ENGINEERING . For feature creation , we have experimented with Word2vec and BERT to generate skill embeddings . By leveraging these skill embeddings we created similarity-based features as well . We also used clustering on generated embeddings to create cluster-based features . As multiple clustering algorithms are available in the literature , we evaluated the most popular clustering algorithms – K-means ( Lloyd , 1982 ) and spectral clustering for experimentation . We have done extensive feature engineering to capture information at skill level , group level , and skill-group combination level . The details of features designed for experiments are given below . 2.2.1 EMBEDDING FEATURES . Traditionally , n-gram based algorithms were used to extract information from text . However , these methods completely ignore the context surrounding a word . Hence , we have experimented with Word2vec and BERT based architecture to learn embeddings of skills present in training data . The details of how we have leveraged them in our problem domain are given below . Word2vec is one of the most popular techniques to learn word embeddings using a neural network . It uses a shallow , two-layer neural network to generate n-dimensional embedding for words . To use the Word2vec model on requisition data , we extracted skills from job requisitions and constructed a single document . Each sentence of this document represents the skills present in one requisition . As a requisition can have multiple skills , we created a 2-dimensional list , where the outer dimension specifies the sentence and inner dimension corresponds to the skills in that sentence . E.g . if there are two job requisitions called req1 and req2 and their corresponding skills are `` Java , J2EE '' and `` Logistic regression , Data visualization , NLP '' then outer index 0 corresponds to req1 and outer index 1 corresponds to req2 . Index 0,0 will refer to Java and Index 0,1 will refer to J2EE and so on . Also before feeding this data for training lowercasing of words , stop word removal and stemming was performed as part of preprocessing . A total of more than 700,000 requisitions were used for model training . We have used embeddings of size 30 which was decided after evaluating model performance on different embedding sizes . BERT Bidirectional Encoder Representations from Transformers , is designed to pre-train deep bidirectional representations from the unlabeled text by jointly conditioning on both left and right context in all layers . Pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models for tasks such as question answering , next sentence prediction , etc . Similar to Word2vec , BERT can also be used to extract fixed-length embeddings of words and sentences , which can further be used as features for downstream tasks like classification . But unlike fixed embedding produced by Word2vec , BERT will generate different embedding for an input word based on its left and right context . BERT has shown performance improvement for many natural language processing tasks . However , it has been minimally explored on the job-skill database . Hence , we leveraged BERT architecture on skill data to train the SkillBERT model . We have leveraged ml.p2.xlarge type 12 GIB GPU memory 1xK80 GPU available on the AWS cloud for SkillBERT training and it took us around 72 hours to completely train it on our dataset . In the next section , we have given the details of training BERT on skill corpus . Training : For training BERT , we used the same corpus as used for Word2vec training and experimented with hyperparameters like learning rate and maximum sequence length . For the learning rate , we used 0.1 , 0.05 , and 0.01 and finalised 0.01 . For maximum sequence length , we used 64 , 128 , 180 and finalised 128 . We could not perform extensive hyperparameter tuning due to hardware limitations . Once the training is finished , we extract the last hidden layer output of size 768 and further reduce the embedding size to 128 to decrease the training time of our final model discussed in the experiment section . For the dimensionality reduction of embedding , we did experiments with embeddings of size 32 , 64 , 128 and 256 . As shown in Appendix Table 6 , the best results were obtained using embedding of size 128 . To make sure information from all the 768 dimensions is leveraged , we trained a 2-layer neural network classifier using SkillBERT embeddings as an independent feature and competency group as a dependent variable . Out of the 2,997 skills , 80 % were used for training and the rest of the 20 % were used for the validation . This model generates the probability values of a skill belonging to each of the 40 competency groups and was used as a feature in the final model at skill and competency group combination level . We have referred this feature as `` bert-prob '' in the rest of the sections . Figure 2 represents the architecture of the model used for getting these probabilities . 2.2.2 SIMILARITY-BASED FEATURES . By leveraging skill embeddings generated using embedding techniques , similarity-based features were created to capture the association between a group and skill . The details of those are given below . Similarity from competency group : In competency group data , the name of each competency group is also present as a skill . We created a similarity score feature measuring the cosine distance between competency group name and skill embeddings . Similarity from top skills per group : Apart from utilizing the similarity between competency group name and skill , we have also created similarity-based features between a given skill and skills present in the competency group . As an example , we have a skill named auditing and competency group finance . Three similarity-based features were created called top1 , top2 , and top3 , where top1 is cosine similarity score between skill auditing and most similar skill from finance , top2 is the average cosine similarity score of top two most similar skills and top3 is the average cosine similarity score of top three most similar skills . As shown in Appendix Table 5 , the use of similarity-based features beyond three skills did not improve model performance . 2.2.3 CLUSTER-BASED FEATURE . For generating labels for skills using clustering , we experimented with two techniques on SkillBERT embedding – K-means and spectral clustering . Scikit-learn package of K-means was used to generate 45 cluster labels . The number 45 was decided by using the elbow method , the graph of which is shown in Appendix Figure 8 . Using spectral clustering we generated 35 cluster labels . The details of how we used spectral clustering on SkillBERT embedding to generate cluster-based feature are given in Appendix section A.1 . 2.2.4 SKILL TFIDF FEATURE . TFIDF ( Salton & McGill , 1986 ; Ramos , 1999 ) is widely used in text mining to find rare and important words in a document , and as in our training data a single skill can be part of multiple competency groups , we used the same strategy to find skills that are unique to a competency group by calculating their TFIDF value . However , as group information will not be available for new skills , we will calculate the TFIDF of such skills differently . First , we will find the most similar top 3 existing skills and thereafter , take the average of their TFIDF values . This resultant value will be the TFIDF value for a new skill .
The manuscript focuses on a trending topic of applying a Bidirectional Encoder Representations from Transformers (BERT)-based prediction model to a new domain. More precisely, it addresses classifying Electronic Recruitment Records (ERRs) with respect to job skills. Its contributions include, but are not limited to, (i) releasing a related de-identified ERR dataset to the public domain, (ii) introducing a BERT-based embedding model, called SkillBERT, to group skills present in this ERR dataset into as competency clusters, and (iii) giving experimental evidence of the obtained modelling gains.
SP:e2f5cc48d84e800d9557d2a0f0e90b636ea22a15
ROMUL: Scale Adaptative Population Based Training
In most pragmatic settings , data augmentation and regularization are essential , and require hyperparameter search . Population based training ( PBT ) is an effective tool for efficiently finding them as well as schedules over hyperparameters . In this paper , we compare existing PBT algorithms and contribute a new one : ROMUL , for RObust MULtistep search , which adapts its stepsize over the course of training . We report competitive results with standard models on CIFAR ( image classification ) as well as Penn Tree Bank ( language modeling ) , which both depend on heavy regularization . We also open-source hoptim , a PBT library agnostic to the training framework , which is simple to use , reentrant , and provides good defaults with ROMUL . 1 INTRODUCTION . Hyperparameter tuning is essential for good performance in most machine learning tasks , and poses numerous challenges . First , optimal hyperparameter values can change over the course of training ( schedules ) , e.g . for learning rate , fine tuning phases , data augmentation . Hyperparameters values are also rarely independent from each other ( e.g . the magnitude of individual data augmentations depends on the number of data augmentations applied ) , and the search space grows exponentially with the number of hyperparameters . All of that search has to be performed within a computational budget , and sometimes even within a wall-clock time budget ( e.g . models that are frequently retrained on new data ) , requiring efficient parallelization . In practice , competitive existing methods range from random search ( Bergstra & Bengio , 2012 ) to more advanced methods ( that aim at being more compute-efficient ) like sequential search ( Bergstra et al. , 2011 ; 2013 ; Li et al. , 2018 ) , population based training ( PBT , e.g . Jaderberg et al . ( 2017 ) ; Ho et al . ( 2019 ) ) and search structured by the space of the hyperparameters ( Liu et al. , 2018 ; Cubuk et al. , 2019b ) . A major drawback of advanced hyperparameter optimization methods is that they themselves require attention from the user to reliably outperform random search . In this work , we empirically study the different training dynamics of data augmentation and regularization hyperparameters across vision and language modeling tasks , in particular for multistep ( sequential ) hyperparameter search . A common failure mode ( i ) is due to hyperparameters that have a different effect on the validation loss in the short and long terms , for instance using a smaller dropout often leads to faster but worse convergence . Another common problem ( ii ) is that successful searches are constrained on adequate “ hyper-hyperparameters ” ( such as value ranges or the search policy used , which in current methods are non-adaptative mutation steps ) . Our contributions can be summarized as follows : • We present a robust algorithm for leveraging population based training for hyperparameter search : ROMUL ( RObust MULtistep ) search , which addresses ( i ) and ( ii ) . We empirically study its benefits and limitations , and show that it provides good defaults that compare favorably to existing methods . • We open-source hoptim , a simple library for sequential hyperparameter search , that provides multiple optimizers ( including ROMUL ) , as well as toy benchmarks showcasing hyperparameter optimization problems we identified empirically and standard datasets . 2 HYPERPARAMETER OPTIMIZATION WITH POPULATION-BASED TRAINING . In this article , we refer to the family of algorithms that continuously tunes hyperparameters of a set of models over the course of their training as “ PBT algorithms ” or “ PBT optimizers ” . Hyperparameter optimization is thus a zero order optimization performed at a slower frequency than the ( often first order , e.g . SGD ) optimization of the model . A PBT step happens typically after a fixed number of epochs or updates of the model , often optimizing the loss from the validation set , continuing from an already produced “ parent ” checkpoint , and producing and evaluating a new checkpoint . At every PBT step , hyperparameters can be updated ( mutated ) , incremented or decremented by some number ( step size ) , or sampled . There are multiple aspects to consider when designing a PBT algorithm . Technical constraints : how the optimization is distributed , with a centralized or decentralized algorithm , workers to run the trainings , how failed workers are handled . They are solved in a unified manner in the experiments we performed , by the hoptim library to implement and compare multiple algorithms . It is decoupled from the scheduling of the jobs and designed to accommodate adding more workers to scale up the training , or fewer when some are killed , for example through preemption or time-out on a shared cluster . Optimization method : how the hyper-parameters are modified throughout the training , for instance through mutations . Selection process : which individual of the population are kept , both in term of hyper-parameters and state of the neural network ( checkpoint ) . For those last two points , some solutions are described below . 2.1 CHALLENGES . In order to have a clearer understanding of our proposed methods , we show below the main concerns we have observed in PBT : Anisotropy : by definition , the optimal value of the hyperparameters considered is unknown , and oftentimes the range ( or mutation scheme ) provided to the algorithm is a loose estimate only . As modifying two hyperparameters with the same step size can produce effects with very different magnitudes , the user is required to to normalize the search space . But pre-tuning the hyperparameter tuner itself can be cumbersome as dynamics evolve during training . Section 3.1 provides an example based on the Rosenbrock function which illustrates this issue and highlights the interest of adaptative mutations . Checkpoint vs. hyperparameters : comparing individuals in the population is extremely hard as improvements can be due to better hyperparameters , or better checkpoints ( including potentially better batches ) . Better performance through better checkpoints is an optimization phenomenon ( e.g . random restarts ) , that can bias the hyperparameter selection . We will detail this aspect in Section 4.2 . Short-term-long-term discordance : we observed empirically that hyperparameters which induce better performance in the short term are not always optimal in the longer term . This is a challenge that does not exist in classical static optimization , but is crucial for PBT since local minima are easy to reach and pose a danger for greedy algorithms . An example of such a parameter is the learning rate . Dropping the learning rate often induces a drop in the validation loss , even early in the training , and increasing it has the opposite effect , causing greedy PBT algorithms to reduce it to the minimum value too early , without being able to recover . We will detail this aspect in Section 4.1 . 2.2 DIFFERENTIAL EVOLUTION AND ROMUL . Differential Evolution Storn & Price ( 1997 ) ( DE ) is a standard black-box optimization method , for minimizing f : Rn → R. It operates on a population xi ∈ Rn for all i ∈ { 1 , ... , M } , M ≥ 4 , and indefinitely repeats the following steps for each individual xbase in the population to generate another individual called mutated vector that could replace xbase if better : 1. given the best individual xbest which minimizes f in the population , as well as two randomly selected ones xa and xb , compute the donor d , which will give part of its coefficients to the mutated vector . In the current-to-best/1 scheme we use , these are the base coefficients plus a term attracting to the best set of coefficients from the current population , and an additional random variation ( a standard value for Fi is F1 = F2 = 0.8 ) : d = xbase + F1 ( x best − xbase ) + F2 ( xb − xa ) ( 1 ) 2. create the new mutated vector x̃base by randomly selecting each component j ∈ { 1 , ... , n } of the base xbase or the donor d through the binary crossover operator : x̃basej = CHOICE ( xbasej , dj ) . This non-linear operation lets the optimization leave the vector span of the population . 3. compute f ( x̃base ) and replace xbase by x̃base within the population if and only if f ( x̃base ) ≤ f ( xbase ) . This method is interesting as it is already based on a population and adapts well to parameters with different dynamics while being simple and fully parallelizable . In particular , it does not rely on mutation ranges or step sizes - Equation 1 samples new parameters close to the current population , and as the population individuals go through selection this sampling is refined and becomes sharper around optimal values . In practice , if a parameter ’ s bounds are too loose or wrong , DE will eventually adapt after iterations of selection by removing individuals too far from the optimal value , and concentrate its computation budget on relevant values for this parameter . In order to use it for PBT , the set of hyper-parameters is converted to a vector in Rn using nevergrad parametrization system ( Rapin & Teytaud , 2018 ) . However , this basic version of differential evolution ( also implemented in nevergrad ) is not adapted to PBT . Indeed the training function f changes with the checkpoint as we are updating the parameters ( not the hyperparameters ) with a stochastic gradient from the task loss . The trend of f is therefore typically downwards during the training , younger generations/later epochs tending to have a lower loss than their parents ’ , biasing the hyperperameter selection process in favor of those of the children ( later steps of SGD updates ) instead of in favor of better hyperparameters . ROMUL We therefore propose an adaptation : a population of n individuals is trained , after finishing their step , individuals are compared to the rest of the population . If they have one of the n/k best loss ( we use k = 2 throughout ) , the training continues without changing the hyperparameters , otherwise , the hyperparameters are mutated . If the hyperparameters of an individual are mutated m times in a row ( we use m = 3 throughout ) , its checkpoint is killed and replaced by one of the n/k best individuals . The values of k and m are hyperparameters , although we did not vary them in any experiments : k = 2 allows to have , on average , one alternative ( mutated ) version to each of the ones we keep training without hyperparameter change , and m = 3 proved to be robust across our experiments , to select when to discard a checkpoint . If using lower m values , one should consider increasing the number of epochs per PBT step to prevent culling checkpoints too early ( see Section 4.1 and 4.2 ) . The mutation scheme is adapted to fit this use case . In Eq . 1 , xbase and xbest are both replaced by a randomly selected set of hyperparameters xc and xd from the best n/2 individuals ( “ rand-to-rand/1 ” scheme following ( Storn & Price , 1997 ; Das & Suganthan , 2011 ) notations ) . Replacing xbase aims at keeping the path through checkpoints unimodal , since keeping several modes with corresponding checkpoints is unnecessary . Replacing xbest by any other ” good ” ( top 50 % ) set of hyperparameters aims at avoiding early convergence , which we observed as one of the main problems during trainings . This also avoids a strong bias by a good checkpoint ( more on this in 4.2 ) . To avoid duplication of hyperparameters , we opt for making F1 and F2 random vectors instead of using the binary crossover non-linearity . In order to keep the initial scaling of DE , we chose F1 [ i ] uniformly distributed between 0 and 2F ( we use the common value for F from vanilla DE : F = 0.8 ) , and F2 [ i ] = 2F − F1 [ i ] , ∀i . This ensures that the sum F1 [ i ] + F2 [ i ] = 2F , ∀i , as in vanilla DE . With the elementwise multiplication , this yields d = xc + F1 ( xd − xc ) + F2 ( xb − xa ) .
The paper provides a new variant of PBT which utilizes ideas from differential evolution and cross-over. The original PBT and even initiator PBT do not perform crossover on the hyper-parameters, and insufficient cross-over may cause PBT to perform greedy in the initial phases which ends up with a suboptimal convergence. The investigation of better cross-over in PBT is itself an interesting research direction and the authors demonstrated its effectiveness in standard benchmarks and data augmentation tasks. The improvements of ROMUL-PBT are also helpful to the community since PBT has been applied in a variety of real world applications.
SP:7e75b1311a12b8c0353180183447e529683a88d6
ROMUL: Scale Adaptative Population Based Training
In most pragmatic settings , data augmentation and regularization are essential , and require hyperparameter search . Population based training ( PBT ) is an effective tool for efficiently finding them as well as schedules over hyperparameters . In this paper , we compare existing PBT algorithms and contribute a new one : ROMUL , for RObust MULtistep search , which adapts its stepsize over the course of training . We report competitive results with standard models on CIFAR ( image classification ) as well as Penn Tree Bank ( language modeling ) , which both depend on heavy regularization . We also open-source hoptim , a PBT library agnostic to the training framework , which is simple to use , reentrant , and provides good defaults with ROMUL . 1 INTRODUCTION . Hyperparameter tuning is essential for good performance in most machine learning tasks , and poses numerous challenges . First , optimal hyperparameter values can change over the course of training ( schedules ) , e.g . for learning rate , fine tuning phases , data augmentation . Hyperparameters values are also rarely independent from each other ( e.g . the magnitude of individual data augmentations depends on the number of data augmentations applied ) , and the search space grows exponentially with the number of hyperparameters . All of that search has to be performed within a computational budget , and sometimes even within a wall-clock time budget ( e.g . models that are frequently retrained on new data ) , requiring efficient parallelization . In practice , competitive existing methods range from random search ( Bergstra & Bengio , 2012 ) to more advanced methods ( that aim at being more compute-efficient ) like sequential search ( Bergstra et al. , 2011 ; 2013 ; Li et al. , 2018 ) , population based training ( PBT , e.g . Jaderberg et al . ( 2017 ) ; Ho et al . ( 2019 ) ) and search structured by the space of the hyperparameters ( Liu et al. , 2018 ; Cubuk et al. , 2019b ) . A major drawback of advanced hyperparameter optimization methods is that they themselves require attention from the user to reliably outperform random search . In this work , we empirically study the different training dynamics of data augmentation and regularization hyperparameters across vision and language modeling tasks , in particular for multistep ( sequential ) hyperparameter search . A common failure mode ( i ) is due to hyperparameters that have a different effect on the validation loss in the short and long terms , for instance using a smaller dropout often leads to faster but worse convergence . Another common problem ( ii ) is that successful searches are constrained on adequate “ hyper-hyperparameters ” ( such as value ranges or the search policy used , which in current methods are non-adaptative mutation steps ) . Our contributions can be summarized as follows : • We present a robust algorithm for leveraging population based training for hyperparameter search : ROMUL ( RObust MULtistep ) search , which addresses ( i ) and ( ii ) . We empirically study its benefits and limitations , and show that it provides good defaults that compare favorably to existing methods . • We open-source hoptim , a simple library for sequential hyperparameter search , that provides multiple optimizers ( including ROMUL ) , as well as toy benchmarks showcasing hyperparameter optimization problems we identified empirically and standard datasets . 2 HYPERPARAMETER OPTIMIZATION WITH POPULATION-BASED TRAINING . In this article , we refer to the family of algorithms that continuously tunes hyperparameters of a set of models over the course of their training as “ PBT algorithms ” or “ PBT optimizers ” . Hyperparameter optimization is thus a zero order optimization performed at a slower frequency than the ( often first order , e.g . SGD ) optimization of the model . A PBT step happens typically after a fixed number of epochs or updates of the model , often optimizing the loss from the validation set , continuing from an already produced “ parent ” checkpoint , and producing and evaluating a new checkpoint . At every PBT step , hyperparameters can be updated ( mutated ) , incremented or decremented by some number ( step size ) , or sampled . There are multiple aspects to consider when designing a PBT algorithm . Technical constraints : how the optimization is distributed , with a centralized or decentralized algorithm , workers to run the trainings , how failed workers are handled . They are solved in a unified manner in the experiments we performed , by the hoptim library to implement and compare multiple algorithms . It is decoupled from the scheduling of the jobs and designed to accommodate adding more workers to scale up the training , or fewer when some are killed , for example through preemption or time-out on a shared cluster . Optimization method : how the hyper-parameters are modified throughout the training , for instance through mutations . Selection process : which individual of the population are kept , both in term of hyper-parameters and state of the neural network ( checkpoint ) . For those last two points , some solutions are described below . 2.1 CHALLENGES . In order to have a clearer understanding of our proposed methods , we show below the main concerns we have observed in PBT : Anisotropy : by definition , the optimal value of the hyperparameters considered is unknown , and oftentimes the range ( or mutation scheme ) provided to the algorithm is a loose estimate only . As modifying two hyperparameters with the same step size can produce effects with very different magnitudes , the user is required to to normalize the search space . But pre-tuning the hyperparameter tuner itself can be cumbersome as dynamics evolve during training . Section 3.1 provides an example based on the Rosenbrock function which illustrates this issue and highlights the interest of adaptative mutations . Checkpoint vs. hyperparameters : comparing individuals in the population is extremely hard as improvements can be due to better hyperparameters , or better checkpoints ( including potentially better batches ) . Better performance through better checkpoints is an optimization phenomenon ( e.g . random restarts ) , that can bias the hyperparameter selection . We will detail this aspect in Section 4.2 . Short-term-long-term discordance : we observed empirically that hyperparameters which induce better performance in the short term are not always optimal in the longer term . This is a challenge that does not exist in classical static optimization , but is crucial for PBT since local minima are easy to reach and pose a danger for greedy algorithms . An example of such a parameter is the learning rate . Dropping the learning rate often induces a drop in the validation loss , even early in the training , and increasing it has the opposite effect , causing greedy PBT algorithms to reduce it to the minimum value too early , without being able to recover . We will detail this aspect in Section 4.1 . 2.2 DIFFERENTIAL EVOLUTION AND ROMUL . Differential Evolution Storn & Price ( 1997 ) ( DE ) is a standard black-box optimization method , for minimizing f : Rn → R. It operates on a population xi ∈ Rn for all i ∈ { 1 , ... , M } , M ≥ 4 , and indefinitely repeats the following steps for each individual xbase in the population to generate another individual called mutated vector that could replace xbase if better : 1. given the best individual xbest which minimizes f in the population , as well as two randomly selected ones xa and xb , compute the donor d , which will give part of its coefficients to the mutated vector . In the current-to-best/1 scheme we use , these are the base coefficients plus a term attracting to the best set of coefficients from the current population , and an additional random variation ( a standard value for Fi is F1 = F2 = 0.8 ) : d = xbase + F1 ( x best − xbase ) + F2 ( xb − xa ) ( 1 ) 2. create the new mutated vector x̃base by randomly selecting each component j ∈ { 1 , ... , n } of the base xbase or the donor d through the binary crossover operator : x̃basej = CHOICE ( xbasej , dj ) . This non-linear operation lets the optimization leave the vector span of the population . 3. compute f ( x̃base ) and replace xbase by x̃base within the population if and only if f ( x̃base ) ≤ f ( xbase ) . This method is interesting as it is already based on a population and adapts well to parameters with different dynamics while being simple and fully parallelizable . In particular , it does not rely on mutation ranges or step sizes - Equation 1 samples new parameters close to the current population , and as the population individuals go through selection this sampling is refined and becomes sharper around optimal values . In practice , if a parameter ’ s bounds are too loose or wrong , DE will eventually adapt after iterations of selection by removing individuals too far from the optimal value , and concentrate its computation budget on relevant values for this parameter . In order to use it for PBT , the set of hyper-parameters is converted to a vector in Rn using nevergrad parametrization system ( Rapin & Teytaud , 2018 ) . However , this basic version of differential evolution ( also implemented in nevergrad ) is not adapted to PBT . Indeed the training function f changes with the checkpoint as we are updating the parameters ( not the hyperparameters ) with a stochastic gradient from the task loss . The trend of f is therefore typically downwards during the training , younger generations/later epochs tending to have a lower loss than their parents ’ , biasing the hyperperameter selection process in favor of those of the children ( later steps of SGD updates ) instead of in favor of better hyperparameters . ROMUL We therefore propose an adaptation : a population of n individuals is trained , after finishing their step , individuals are compared to the rest of the population . If they have one of the n/k best loss ( we use k = 2 throughout ) , the training continues without changing the hyperparameters , otherwise , the hyperparameters are mutated . If the hyperparameters of an individual are mutated m times in a row ( we use m = 3 throughout ) , its checkpoint is killed and replaced by one of the n/k best individuals . The values of k and m are hyperparameters , although we did not vary them in any experiments : k = 2 allows to have , on average , one alternative ( mutated ) version to each of the ones we keep training without hyperparameter change , and m = 3 proved to be robust across our experiments , to select when to discard a checkpoint . If using lower m values , one should consider increasing the number of epochs per PBT step to prevent culling checkpoints too early ( see Section 4.1 and 4.2 ) . The mutation scheme is adapted to fit this use case . In Eq . 1 , xbase and xbest are both replaced by a randomly selected set of hyperparameters xc and xd from the best n/2 individuals ( “ rand-to-rand/1 ” scheme following ( Storn & Price , 1997 ; Das & Suganthan , 2011 ) notations ) . Replacing xbase aims at keeping the path through checkpoints unimodal , since keeping several modes with corresponding checkpoints is unnecessary . Replacing xbest by any other ” good ” ( top 50 % ) set of hyperparameters aims at avoiding early convergence , which we observed as one of the main problems during trainings . This also avoids a strong bias by a good checkpoint ( more on this in 4.2 ) . To avoid duplication of hyperparameters , we opt for making F1 and F2 random vectors instead of using the binary crossover non-linearity . In order to keep the initial scaling of DE , we chose F1 [ i ] uniformly distributed between 0 and 2F ( we use the common value for F from vanilla DE : F = 0.8 ) , and F2 [ i ] = 2F − F1 [ i ] , ∀i . This ensures that the sum F1 [ i ] + F2 [ i ] = 2F , ∀i , as in vanilla DE . With the elementwise multiplication , this yields d = xc + F1 ( xd − xc ) + F2 ( xb − xa ) .
This paper focuses on issues in the popular PBT algorithm for hyperparameter optimization. It investigates the 1) step size (which is typically a constant multiplier) 2) the variance induced by better weights and 3) the greediness of the algorithm, which they refer to as short-term vs. long term effects. These issues are well motivated, and it is intuitive that they are flaws in the original algorithm. The proposed approach is to use Differential Evolution which the authors claim makes the hyperparameter selection more robust. The paper also introduces a new library for online hyperparameter tuning.
SP:7e75b1311a12b8c0353180183447e529683a88d6
Deep Ecological Inference
1 INTRODUCTION . Ecological inference ( EI ) , or learning labels from label proportions , is the problem of trying to make predictions about individual units from observations about aggregates . The canonical case is voting . We can not observe individual people ’ s votes , but people live in precincts , and we know for each precinct what the final vote count was . The problem is to try to estimate probabilities that a particular type of individual voted for a candidate . Since we can not observe individual labels , but only sums of pre-specified groups of labels , nonidentifiability is inherent to the ecological inference problem . The possibility of interaction effects between any relevant demographics and the aggregation groups themselves also means that Simpson ’ s paradox type confounding is an ever present risk . The most basic approach to this problem involves assuming total heterogeneity at the precinct level , and simply assigning the final distribution of votes in a precinct to each person living in that precinct . However , typically people are sorted geographically along characteristics that are politically salient , and that variation can be leveraged to learn information about voting patterns based on those demographics . Classical ecological regressions use aggregate demographics , but here we have access to individual-level demographics via a commercial voter file with individual records , and therefore we construct our models at the individual level . There are a number of advantages to using individual demographics for ecological inference , but note that while individual-level features are observed , individual-level labels still can not be observed , and therefore the fundamental challenges of non-identifiability and aggregation paradoxes remain . Related Work Classical ecological inference typically assumes an underlying individual linear model and constructs estimators for those model coefficients using aggregated demographics and labels King ( 1997 ) . More recent work has used distribution regression for large-scale ecological inference incorporating Census microdata in nationwide elections in the US Flaxman et al . ( 2016 ) . Aggregated labels represent a substantial loss of information that could be used to constrain inferences , and all ecological methods rely on the analyst making assumptions which are not definitively empirically testable from those aggregates alone . Some research has been done on visual techniques for determining when some of these assumptions may have been violated Gelman et al . ( 2001 ) . Other work has sought to impose additional constraints on the ecological problem by incorporating information from multiple elections Park et al . ( 2014 ) , which also has the benefit of allowing for estimation of voter transitions , which themselves are of interest . Our models are built from individual records of commercial voter file data , which leads to some immediate differences between classical methods . First , we do not need to determine the composition of the electorate from an ecological model , since we already know who from the total population voted from administrative records and we only need to use an ecological model for vote choice ( who votes is public ) . Second , we can directly specify a model for vote choice at the individual level and train this using a suitable ecological loss function , as opposed to specifying a model only on aggregates . This is convenient and allows the analyst a great deal of flexibility in modeling choices , and opens the possibility of using ecological inference for individual-level vote choice prediction as well as individual-level latent space modeling . However it does not automatically resolve the fundamental difficulties of ecological methods . We therefore introduce additional constraints on the ecological problem by jointly training on multiple races in a given election year in a manner analogous to existing methods , but adapted to our individual-level framework . Contributions We develop a loss function that allows us to approximate the poisson binomial and poisson multinomial loss that sits at the center of the individually-oriented approach to EI , but are too intractable to optimize directly . This approach allows us to extend EI with deep learning , providing three key benefits : learning non-linear relationships in data , jointly learning multiple aggregated outcomes and learning low-dimensional high-information representations of individual voters . We apply these methods to data from the Maryland 2018 midterm election , to estimate vote propensity in the elections for the Governor , US Senator , and Attorney General . We validate these estimates using three datasets : first , post-election survey data on individuals ’ vote choices ; second , data on the joint distribution of candidate support for these three races ; and third we validate the learned representations by predicting individual responses to surveys using data linked to the representation . 2 AN APPROXIMATE ECOLOGICAL LOSS AND ARCHITECTURES . 2.1 APPROXIMATING THE POISSON BINOMIAL AND MULTINOMIAL LOSS . We model the choice of candidate ( including abstaining from voting on a particular race ) as a realization from a categorical distribution , according to an individually defined vector of probabilities p ( i ) , so that each individuals “ vote ” is a one-hot encoded vector , where the indicator represents the candidate the selected . If individuals are modeled as independent realizations of non-identically distributed categorical variables then precincts are distributed as poisson multinomial variables , parameterized by a matrix P where each row corresponds to an individual ’ s set of probabilities . The likelihood of the observed precinct-level counts is then : L ( v1 , v2 , . . . , vC |P ) = log ∑ A∈FC ∏ ( i , c ( i ) ) ∈A P ( i ) c ( i ) ( 1 ) Where FC is the set of all possible assignments ( i , c ( i ) ) of an individual i to a vote choice c ( i ) , subject to the constraint that the total number of individuals assigned to each candidate c is vc , so that |FC | = ( ∑C c=1 vc ) ! ∏C c=1 vc ! . Even for the simplest possible case of a single race with only two candidates , this loss is not straightforward to compute Hong ( 2013 ) . In practice this loss is intractable to compute for the voting setting , where C > 3 ( the United States has a two party vote system , and people need not fill vote in every race at the ballot box ) and N > 20 , 000 . We propose to approximate this loss by assuming as L ( v1 , v2 , . . . , vC |P ) = log ( ∑ A∈FC ∏ ( i , c ( i ) ) ∈A ( 1 N N∑ n=1 P ( n ) c ( i ) ) ) ( 2 ) = log ( ( C∏ c=1 ( 1 N N∑ n=1 P ( n ) c ) vc ) ∑ A∈FC 1 ) ( 3 ) = log ( C∏ c=1 ( 1 N N∑ n=1 P ( n ) c ) vc ) + log ( ( ∑C c=1 vc ) ! ∏C c=1 vc ! ) ( 4 ) Where ( 4 ) is the multinomial loss using the precinct-average of the predicted probabilities for each candidate . This approximation is correct for the first moment , but overestimates the variance compared to the variance of the poisson multinomial distribution . It is however extremely efficient to compute for a large number of precincts in parallel . For the poisson binomial we employ a similar strategy . 2.2 EXTENDING ECOLOGICAL INFERENCE . 2.2.1 ARCHITECTURES . We consider two architectures , each of which were implemented using Bayesian and non-Bayesian neural networks . The first architecture is a dense network , and the second is an extension of a varying-intercepts varying-slopes model that has been used for modeling voting behavior in Ghitza & Gelman ( 2013 ) . A varying-intercepts varying-slopes model is typically written as follows for a binary model ( extensions to multiple classes are straightforward ) logit ( pi ) = α0 + K∑ k=1 αk [ i ] + L∑ l=1 Xil K∑ k=1 βk [ i ] l ( 5 ) Where we have K groups of random effects and L fixed effects . Including a column of ones in X to account for the intercept terms and absorbing the βs into the αs , we can rewrite this as a linear model where the coefficients themselves are computed from another linear model as follows logit ( pi ) = α0 + L∑ l=1 Xilγil ( 6 ) γil = K∑ k=1 αk [ i ] l ( 7 ) Here , the slopes for the fixed effects are the sum of additive contributions which depend on some categorical variables for unit i . Therefore , βil can be interpreted as an embedding of the categorical features , which are learned in such a way that the when taken in a linear combination with the numerical features X , the results give good predictions on the probability scale . Categorical features tend to be sparse , and so the embedding reduces the dimensionality of those input features . This concept can be extended by predicting βil from a general embedding of a matrix of categorical features Xc so that βil = f ( X c i ) ( 8 ) Where in this study , f is given by a fully connected neural network . The advantage of this architecture is that globally it has very high capacity to fit complex data , but locally it has linear structure . We call this architecture a Deep multi-level model ( MLM ) . We find that this leads to more reasonable estimates of partisan crossover voting , that is republican voters voting for Democratic candidates and vice versa , than the dense network , which tends to underestimate the degree of crossover relative to what is found in survey data . This architecture also provides advantages in interpretation because it is fundamentally a linear model . 2.2.2 BAYESIAN LAYERS . For the Bayesian implementation for both architectures , we use the following multilevel formulation for each dense layer . σ ∼ pσ = HalfNormal ( 0 , S ) ( 9 ) w ∼ pw = Normal ( 0 , σ ) ( 10 ) b ∼ pb = Normal ( 0 , σ ) ( 11 ) y = activation ( wx+ b ) ( 12 ) for layer inputs x and outputs y , where S is a hyperparameter that controls the prior on the regularization strength . These multilevel layers help desensitize the model from our choice of hyperparameters , while allowing for different regularization strengths in each layer . We use a fully factorized mean-field variational approximation with the standard non-centered parameterization . Bayesian neural nets often under perform as a result of training difficulties that arise from increased variance in the stochastic gradients . To mitigate this , we train all Bayesian nets using KL annealing , where the variational standard deviation parameters are set to small values and the KL divergence term in the variational loss is initially zeroed out , and gradually increased over the course of training . This allows the model to find a solution basin about as quickly as a non Bayesian net , essentially by training the variational mean parameters with the standard deviations fixed . Once inside a basin we optimize the full objective , and this tends to give good results . 3 APPLICATION TO THE MARYLAND 2018 MIDTERM ELECTIONS . We applied this method to the statewide races in the Maryland 2018 midterm elections . Maryland typically votes for Democrats but had a Republican governor in 2018 who had high approval ratings going into the race and won reelection by a little less than 300,000 votes . Maryland also had an attorney general and US senate race in that same election , where incumbent Democrats won by large margins . This gives us a useful test case for examining not correlations in voting patterns between races . We demonstrate two practical use cases for out methods . The first is the classical use case for ecological regression , where the analyst wants to learn demographic breakdowns of the vote share in the election . This involves fitting an ecological model and then cross tabulating the model scores by various quantities of interest . While it is impossible to determine the ground truth for this , we compare the cross tabulations from our ecological model to estimates of support from a large sample survey which is weighted to be representative of Maryland voters . We additionally leverage a dataset we are not aware of having been used in this validation setting : the distribution of ballots is public information . This means if we predict multiple races we can additionally check how well our recovers the joint distribution of votes for candidates in different offices . The second , which to our knowledge is new for ecological modeling , is to use an ecological model to train a latent space for a few shot learning model , which we then trained on survey data . We show that the features learned by the EI model are more predictive on survey data than the raw features , with significantly reduced dimensionality .
This paper proposes a deep learning framework for approximating ecological inference for estimating voting propensities based on demographic aggregates. This is an important problem, as EI has become a court standard for evaluating racially polarized voting in gerrymandering cases for the Gingles factors. Additionally, the increased attention on building coalition districts and availability of individual level data means that this is a problem that is likely to have a large impact in the next redistricting cycle that begins next year.
SP:86823c4b45c78992ca5925cd1fb0e241e42a56ea
Deep Ecological Inference
1 INTRODUCTION . Ecological inference ( EI ) , or learning labels from label proportions , is the problem of trying to make predictions about individual units from observations about aggregates . The canonical case is voting . We can not observe individual people ’ s votes , but people live in precincts , and we know for each precinct what the final vote count was . The problem is to try to estimate probabilities that a particular type of individual voted for a candidate . Since we can not observe individual labels , but only sums of pre-specified groups of labels , nonidentifiability is inherent to the ecological inference problem . The possibility of interaction effects between any relevant demographics and the aggregation groups themselves also means that Simpson ’ s paradox type confounding is an ever present risk . The most basic approach to this problem involves assuming total heterogeneity at the precinct level , and simply assigning the final distribution of votes in a precinct to each person living in that precinct . However , typically people are sorted geographically along characteristics that are politically salient , and that variation can be leveraged to learn information about voting patterns based on those demographics . Classical ecological regressions use aggregate demographics , but here we have access to individual-level demographics via a commercial voter file with individual records , and therefore we construct our models at the individual level . There are a number of advantages to using individual demographics for ecological inference , but note that while individual-level features are observed , individual-level labels still can not be observed , and therefore the fundamental challenges of non-identifiability and aggregation paradoxes remain . Related Work Classical ecological inference typically assumes an underlying individual linear model and constructs estimators for those model coefficients using aggregated demographics and labels King ( 1997 ) . More recent work has used distribution regression for large-scale ecological inference incorporating Census microdata in nationwide elections in the US Flaxman et al . ( 2016 ) . Aggregated labels represent a substantial loss of information that could be used to constrain inferences , and all ecological methods rely on the analyst making assumptions which are not definitively empirically testable from those aggregates alone . Some research has been done on visual techniques for determining when some of these assumptions may have been violated Gelman et al . ( 2001 ) . Other work has sought to impose additional constraints on the ecological problem by incorporating information from multiple elections Park et al . ( 2014 ) , which also has the benefit of allowing for estimation of voter transitions , which themselves are of interest . Our models are built from individual records of commercial voter file data , which leads to some immediate differences between classical methods . First , we do not need to determine the composition of the electorate from an ecological model , since we already know who from the total population voted from administrative records and we only need to use an ecological model for vote choice ( who votes is public ) . Second , we can directly specify a model for vote choice at the individual level and train this using a suitable ecological loss function , as opposed to specifying a model only on aggregates . This is convenient and allows the analyst a great deal of flexibility in modeling choices , and opens the possibility of using ecological inference for individual-level vote choice prediction as well as individual-level latent space modeling . However it does not automatically resolve the fundamental difficulties of ecological methods . We therefore introduce additional constraints on the ecological problem by jointly training on multiple races in a given election year in a manner analogous to existing methods , but adapted to our individual-level framework . Contributions We develop a loss function that allows us to approximate the poisson binomial and poisson multinomial loss that sits at the center of the individually-oriented approach to EI , but are too intractable to optimize directly . This approach allows us to extend EI with deep learning , providing three key benefits : learning non-linear relationships in data , jointly learning multiple aggregated outcomes and learning low-dimensional high-information representations of individual voters . We apply these methods to data from the Maryland 2018 midterm election , to estimate vote propensity in the elections for the Governor , US Senator , and Attorney General . We validate these estimates using three datasets : first , post-election survey data on individuals ’ vote choices ; second , data on the joint distribution of candidate support for these three races ; and third we validate the learned representations by predicting individual responses to surveys using data linked to the representation . 2 AN APPROXIMATE ECOLOGICAL LOSS AND ARCHITECTURES . 2.1 APPROXIMATING THE POISSON BINOMIAL AND MULTINOMIAL LOSS . We model the choice of candidate ( including abstaining from voting on a particular race ) as a realization from a categorical distribution , according to an individually defined vector of probabilities p ( i ) , so that each individuals “ vote ” is a one-hot encoded vector , where the indicator represents the candidate the selected . If individuals are modeled as independent realizations of non-identically distributed categorical variables then precincts are distributed as poisson multinomial variables , parameterized by a matrix P where each row corresponds to an individual ’ s set of probabilities . The likelihood of the observed precinct-level counts is then : L ( v1 , v2 , . . . , vC |P ) = log ∑ A∈FC ∏ ( i , c ( i ) ) ∈A P ( i ) c ( i ) ( 1 ) Where FC is the set of all possible assignments ( i , c ( i ) ) of an individual i to a vote choice c ( i ) , subject to the constraint that the total number of individuals assigned to each candidate c is vc , so that |FC | = ( ∑C c=1 vc ) ! ∏C c=1 vc ! . Even for the simplest possible case of a single race with only two candidates , this loss is not straightforward to compute Hong ( 2013 ) . In practice this loss is intractable to compute for the voting setting , where C > 3 ( the United States has a two party vote system , and people need not fill vote in every race at the ballot box ) and N > 20 , 000 . We propose to approximate this loss by assuming as L ( v1 , v2 , . . . , vC |P ) = log ( ∑ A∈FC ∏ ( i , c ( i ) ) ∈A ( 1 N N∑ n=1 P ( n ) c ( i ) ) ) ( 2 ) = log ( ( C∏ c=1 ( 1 N N∑ n=1 P ( n ) c ) vc ) ∑ A∈FC 1 ) ( 3 ) = log ( C∏ c=1 ( 1 N N∑ n=1 P ( n ) c ) vc ) + log ( ( ∑C c=1 vc ) ! ∏C c=1 vc ! ) ( 4 ) Where ( 4 ) is the multinomial loss using the precinct-average of the predicted probabilities for each candidate . This approximation is correct for the first moment , but overestimates the variance compared to the variance of the poisson multinomial distribution . It is however extremely efficient to compute for a large number of precincts in parallel . For the poisson binomial we employ a similar strategy . 2.2 EXTENDING ECOLOGICAL INFERENCE . 2.2.1 ARCHITECTURES . We consider two architectures , each of which were implemented using Bayesian and non-Bayesian neural networks . The first architecture is a dense network , and the second is an extension of a varying-intercepts varying-slopes model that has been used for modeling voting behavior in Ghitza & Gelman ( 2013 ) . A varying-intercepts varying-slopes model is typically written as follows for a binary model ( extensions to multiple classes are straightforward ) logit ( pi ) = α0 + K∑ k=1 αk [ i ] + L∑ l=1 Xil K∑ k=1 βk [ i ] l ( 5 ) Where we have K groups of random effects and L fixed effects . Including a column of ones in X to account for the intercept terms and absorbing the βs into the αs , we can rewrite this as a linear model where the coefficients themselves are computed from another linear model as follows logit ( pi ) = α0 + L∑ l=1 Xilγil ( 6 ) γil = K∑ k=1 αk [ i ] l ( 7 ) Here , the slopes for the fixed effects are the sum of additive contributions which depend on some categorical variables for unit i . Therefore , βil can be interpreted as an embedding of the categorical features , which are learned in such a way that the when taken in a linear combination with the numerical features X , the results give good predictions on the probability scale . Categorical features tend to be sparse , and so the embedding reduces the dimensionality of those input features . This concept can be extended by predicting βil from a general embedding of a matrix of categorical features Xc so that βil = f ( X c i ) ( 8 ) Where in this study , f is given by a fully connected neural network . The advantage of this architecture is that globally it has very high capacity to fit complex data , but locally it has linear structure . We call this architecture a Deep multi-level model ( MLM ) . We find that this leads to more reasonable estimates of partisan crossover voting , that is republican voters voting for Democratic candidates and vice versa , than the dense network , which tends to underestimate the degree of crossover relative to what is found in survey data . This architecture also provides advantages in interpretation because it is fundamentally a linear model . 2.2.2 BAYESIAN LAYERS . For the Bayesian implementation for both architectures , we use the following multilevel formulation for each dense layer . σ ∼ pσ = HalfNormal ( 0 , S ) ( 9 ) w ∼ pw = Normal ( 0 , σ ) ( 10 ) b ∼ pb = Normal ( 0 , σ ) ( 11 ) y = activation ( wx+ b ) ( 12 ) for layer inputs x and outputs y , where S is a hyperparameter that controls the prior on the regularization strength . These multilevel layers help desensitize the model from our choice of hyperparameters , while allowing for different regularization strengths in each layer . We use a fully factorized mean-field variational approximation with the standard non-centered parameterization . Bayesian neural nets often under perform as a result of training difficulties that arise from increased variance in the stochastic gradients . To mitigate this , we train all Bayesian nets using KL annealing , where the variational standard deviation parameters are set to small values and the KL divergence term in the variational loss is initially zeroed out , and gradually increased over the course of training . This allows the model to find a solution basin about as quickly as a non Bayesian net , essentially by training the variational mean parameters with the standard deviations fixed . Once inside a basin we optimize the full objective , and this tends to give good results . 3 APPLICATION TO THE MARYLAND 2018 MIDTERM ELECTIONS . We applied this method to the statewide races in the Maryland 2018 midterm elections . Maryland typically votes for Democrats but had a Republican governor in 2018 who had high approval ratings going into the race and won reelection by a little less than 300,000 votes . Maryland also had an attorney general and US senate race in that same election , where incumbent Democrats won by large margins . This gives us a useful test case for examining not correlations in voting patterns between races . We demonstrate two practical use cases for out methods . The first is the classical use case for ecological regression , where the analyst wants to learn demographic breakdowns of the vote share in the election . This involves fitting an ecological model and then cross tabulating the model scores by various quantities of interest . While it is impossible to determine the ground truth for this , we compare the cross tabulations from our ecological model to estimates of support from a large sample survey which is weighted to be representative of Maryland voters . We additionally leverage a dataset we are not aware of having been used in this validation setting : the distribution of ballots is public information . This means if we predict multiple races we can additionally check how well our recovers the joint distribution of votes for candidates in different offices . The second , which to our knowledge is new for ecological modeling , is to use an ecological model to train a latent space for a few shot learning model , which we then trained on survey data . We show that the features learned by the EI model are more predictive on survey data than the raw features , with significantly reduced dimensionality .
This paper takes an approach to ecological inference inspired by deep learning. Ecological inference is the problem of learning individual labels when only large sets of aggregated data are available. It requires a way to estimate label propensities as a function of covariates. This paper proposes combining a multi-level model with deep learning to estimate voter propensities. The model is then applied to Maryland 2018 midterm election data, and is validated with demographic-level polling data (treating the polling data as ground truth) and with known vote correlations.
SP:86823c4b45c78992ca5925cd1fb0e241e42a56ea
MARS: Markov Molecular Sampling for Multi-objective Drug Discovery
1 INTRODUCTION . Drug discovery aims to find chemical compounds with desired target properties , such as high druglikeness ( Bickerton et al. , 2012 , QED ) . The problem is also referred to as molecular design , molecular generation , or molecular search . The space of drug-like chemicals is enormous , approximate 1033 for realistic drugs that could ever be synthesized ( Polishchuk et al. , 2013 ) . Therefore it is very challenging to search for high-quality molecules from such a vast space — enumeration would take almost forever . For a particular disease , finding the right candidates targeting specific proteins further complicates the problem . Instead of enumerating or searching from the immense chemical space , recent work utilizes deep generative models to generate candidate molecules directly ( Schwalbe-Koda & Gómez-Bombarelli , 2020 ) . However , most prior work focuses on generating molecules concerning a single property such as drug-likeness ( QED ) or octanol-water partition coefficient ( logP ) ( Jin et al. , 2018 ; You et al. , 2018 ; Popova et al. , 2019 ; Shi et al. , 2020 ; Zang & Wang , 2020 ) . While in practical settings , typical drug discovery requires consideration of multiple properties jointly ( Nicolaou et al. , 2012 ) . For example , to find drug-like molecules that are easy to synthesize and exhibit high biological activity against the target protein . Naturally , multi-objective molecule design is much more challenging than the single-objective scenario ( Jin et al. , 2020 ) . This paper studies the problem of multi-objective molecule design for drug discovery . An ideal solution should be efficient and meet the following criteria . C1 : It should satisfy multiple properties with high scores ; C2 : It should produce novel and diverse molecules ; C3 : Its generation process does not ∗Work was done while Yutong Xie and Chence Shi were research interns at ByteDance . Corresponding to : zhouhao.nlp @ bytedance.com and lileilab @ bytedance.com . rely on either expert annotated or wet experimental data collected from a biochemistry lab ( since it requires tremendous effort and hard to obtain ) . Existing molecule generation approaches are mainly designed for the single objective setting , and they could not meet all criteria in the setting of multiple objectives . These methods belong to four categories : a ) generating candidates from a learned continuous latent space ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ) , b ) through reinforcement learning ( You et al. , 2018 ) , c ) using an encoder-decoder translation approach ( Jin et al. , 2019 ) , or d ) optimizing molecular properties through genetic algorithms ( Nigam et al. , 2020 ) . Current stateof-the-art multi-objective molecular generation is a rationale-based method ( Jin et al. , 2020 ) . In this approach , the authors propose to build molecules by composing multiple extracted rationales , and the model can generate compounds that are simultaneously active to multiple biological targets . However , such an approach will result in quite complex molecules when we have many objectives . This is because different objectives correspond to different rationales , and including all these rationales could lead to large molecules , which may be less drug-like and hard to be synthesized practically . In this paper , we propose MArkov moleculaR Sampling ( MARS ) , a simple yet flexible method for drug discovery . The basic idea is to start from a seed molecule and keep generating candidate molecules by modifying fragments of molecular graphs from previous steps . It meets all the criteria C1-3 . In MARS , the molecular design is formulated as an iterative editing procedure with its total objective consisting of multiple property scores ( C1 ) . MARS employs the annealed Markov chain Monte Carlo sampling method to search for optimal chemical compounds , which allows for the exploration of chemicals with novel and different fragments ( C2 ) . The proposal to modify molecular fragments is represented using graph neural networks ( GNNs ) , whose parameters are adaptively learned . We used message passing neural networks ( MPNNs ) in practice ( Gilmer et al. , 2017 ) , but other GNNs can fit the framework as well . Furthermore , MARS utilizes the sample paths generated on-the-fly to train the proposal network adaptively . Therefore , it does not rely on external annotated data ( C3 ) . With such an adaptive learnable proposal , it keeps improving the generation quality throughout the process . We evaluate MARS and four other baselines , one latest method for each of the four method categories . The benchmark includes a variety of multi-objective generation settings . Experiments show that our proposed MARS achieves state-of-the-art performance on five out of six tasks in terms of a comprehensive evaluation consisting of the success rate , novelty , and diversity of the generated molecules . Notably , in the most challenging setting where four objectives – bio-activities to two different targets , drug-likeness , and synthesizability – are simultaneously considered , our method achieves the state-of-the-art result and outperforms existing methods by 77 % in the comprehensive evaluation . Our contributions are as follows : • We present MARS , a generic formulation of molecular design using Markov sampling , which can easily accommodate multiple objectives . • We develop an adaptive fragment-editing proposal based on GNN that is learnable on the fly with only samples self-generated and efficient in exploring the chemical space . • Experiments verifies our proposed MARS framework can find novel and diverse bioactive molecules that are both drug-like and highly synthesizable . 2 RELATED WORK . Recent years have witnessed the success of applying deep generative models and molecular graph representation learning in drug discovery ( Schwalbe-Koda & Gómez-Bombarelli , 2020 ; Guo & Zhao , 2020 ) . Existing approaches for molecular property optimization can be grouped into four categories , including generation with a ) Bayesian inference , b ) reinforcement learning , c ) encoderdecoder translation models , and d ) evolutionary and genetic algorithms . The first category is learning continuous latent spaces for molecular sequences or graphs and generating from such spaces using Bayesian optimization ( BO ) ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ; Winter et al. , 2019 ) . These methods rely heavily on the quality of latent representations , which imposes huge challenges to the encoders when there are multiple properties to consider . Unlike the first class , other work uses reinforcement learning ( RL ) to optimize desired objectives directly in the explicit chemical space ( De Cao & Kipf , 2018 ; Popova et al. , 2018 ; You et al. , 2018 ; Popova et al. , 2019 ; Shi et al. , 2020 ) . However , the models are usually hard to train due to the high variance of RL . The third category directly trains a translation model that maps from an input molecule to a highquality output molecule ( Jin et al. , 2019 ; 2020 ) . Although simple , such methods require many high-quality labeled data , making them impractical in scenarios where the data is limited . The last category of methods are evolutionary algorithms ( EAs ) and genetic algorithms ( GAs ) to explore large chemical space with certain property ( Nicolaou et al. , 2012 ; Devi et al. , 2015 ; Jensen , 2019 ; Ahn et al. , 2020 ) . In Nigam et al . ( 2020 ) , the authors propose to augment GA by adding an adversarial loss into the fitness evaluation to increase the diversity , and the augmented GA outperforms all other generative models in optimizing logP . Though flexible and straightforward , to make the search process efficient enough , most GA and EA methods require domain experts to design molecular mutation and crossover rules , which could be non-trivial to obtain . Besides single property optimization , there is recent work to address the multi-objective molecule generation problem . For example , Li et al . ( 2018 ) proposes to use a conditional generative model to incorporate several objectives flexibly , while Lim et al . ( 2020 ) leverages molecular scaffolds to control the properties of generated molecules better . Among them , the current state-of-the-art approach is a rationale-based method proposed by Jin et al . ( 2020 ) . In this method , the authors propose to build molecules by assembling extracted rationales . Despite its great success in generating compounds simultaneously active to multiple biological targets , the combination of rationales might hinder the synthesizability and drug-likeness of produced molecules , as they tend to be large as the number of objectives grows . In contrast , our MARS framework turns the generation problem into a sampling procedure , which serves as an alternative way compared with deep generative models , and can efficiently discover bio-active molecules that are both drug-like and highly synthesizable . Remotely related is recent work to generate molecules through sampling . Seff et al . ( 2019 ) defines a Gibbs sampling procedure , in which the Markov chain alternates between randomly corrupting the molecules and recovering the corrupted ones with a learned reconstruction model . However , this method mainly focuses on generating molecules that follow the observed data distribution and can not be directly tailored for property optimization . Different from this work , MARS is built upon the general MCMC sampling framework , which allows further enhancement with adaptive proposal learning to edit molecular graphs efficiently . Actually , generating instances from a discrete space with MCMC sampling methods is previously employed in various other applications , e.g. , generating natural language sentences under various constraints ( Miao et al. , 2019 ; Zhang et al. , 2019 ; Liu et al. , 2020 ; Zhang et al. , 2020 ) . 3 PROPOSED MARS APPROACH . In this section , we present the MArkov moleculaR Sampling method ( MARS ) for multi-objective molecular design . We define a Markov chain over the explicit molecular graph space and design a kernel to navigate high probable candidates with acceptance and rejection . 3.1 SAMPLING FROM THE MOLECULAR SPACE . Our proposed MARS framework aims at sampling molecules with desired properties from the chemical space . Specifically , given K properties of interest , the desired molecular distribution can be formulated as a combination of all objectives : π ( x ) = s1 ( x ) ◦ s2 ( x ) ◦ s3 ( x ) ◦ · · · ◦ sK ( x ) ︸ ︷︷ ︸ desired properties ( 1 ) where x is a molecule in the molecular spaceX . π ( x ) is an unnormalized distribution over molecules integrating the desired properties . sk ( x ) is a scoring function for the k-th property and the “ ◦ ” operator stands for a combination of scores ( e.g. , summation or multiplication ) . In practical drug discovery , these terms could be related to the biological activity , drug-likeness , and synthesizability of molecules ( Nicolaou et al. , 2012 ) . This framework allows flexible configuration according to various concrete applications . However , as the number of objectives grows , the joint distribution π ( x ) will become more complex and intractable , making the sampling non-trivial . In MARS , we propose to sample molecules from the desired distribution Eq . 1 using Markov chain Monte Carlo ( MCMC ) methods ( Andrieu et al. , 2003 ) . Given a desired molecular distribution π ( x ) as the unnormalized target distribution , we define a Markov chain on the explicit chemical space X ( i.e. , each state of the Markov chain is a particular molecule ) and introduce a proposal distribution q ( x′ | x ) to perform state transitions . Specifically , as shown in Figure 1 , the sampling procedure of MARS starts from an initial molecule x ( 0 ) ∈ X . At each time step t , a molecule candidate x′ ∈ X will be sampled from the proposal distribution q ( x′ | x ( t−1 ) ) , where x ( t−1 ) denotes the molecule at time step t− 1 . Then the proposed candidate x′ could be either accepted x ( t ) = x′ or rejected x ( t ) = x ( t−1 ) according to the acceptance rate A ( x ( t−1 ) , x′ ) ∈ [ 0 , 1 ] controlled by the target distribution π ( x ) . By repeating this process , a sequence of molecules { x ( t ) } ∞t=0 can be generated . Such sequence of molecules will converge to the target distribution π ( x ) if the proposal distribution and the acceptance mechanism are configured properly . The acceptance rate is calculated as follow : A ( x , x′ ) = min { 1 , πα ( x′ ) q ( x|x′ ) πα ( x ) q ( x′|x ) } ( 2 ) where α is a coefficient that varies in different instantiations of MCMC algorithms . Here to find molecules that globally maximize the target distribution , we employ an annealing scheme ( Laarhoven & Aarts , 1987 ) where α = 1/T and T is a temperature controlled by a cooling schedule . In addition to this , other instantiations such as Metropolis-Hastings ( MH ) algorithm ( Metropolis et al. , 1953 ) where α = 1 are also feasible under our general framework . As for the proposal distribution q ( x′ | x ) , it largely affects the sampling performance and should be designed elaborately . In general , it is crucial that the proposal distribution q ( x′ | x ) and the target distribution π ( x′ ) are as close as possible to ensure high sampling efficiency . So we propose using a proposal distribution qθ ( x′ | x ) with learnable parameters to capture the desired molecular properties and develop a strategy to train the proposal throughout the sampling process adaptively . The details will be described in the next section .
The authors propose a novel way to generate molecules with specified objectives, named MArkov moleculaR Sampling (MARS). The idea of MARS is based on generating the chemical candidates by iterative editing fragments of molecular graphs. To transform a molecule x into another molecule x′, the authors considers two sets of graph editing actions fragment adding and fragment deleting, where fragments are connected components in molecules separated by single bonds. To generate the molecules with desired objectives, MARS is using Markov chain Monte Carlo sampling with specified annealing scheme, together with graph convolutional neural network. The results reported in the following paper are very promising and show that this could be a good direction in the area of multi-objective molecules optimization.
SP:0de748131383ac3425179fa9b34e7593c25fd8bd
MARS: Markov Molecular Sampling for Multi-objective Drug Discovery
1 INTRODUCTION . Drug discovery aims to find chemical compounds with desired target properties , such as high druglikeness ( Bickerton et al. , 2012 , QED ) . The problem is also referred to as molecular design , molecular generation , or molecular search . The space of drug-like chemicals is enormous , approximate 1033 for realistic drugs that could ever be synthesized ( Polishchuk et al. , 2013 ) . Therefore it is very challenging to search for high-quality molecules from such a vast space — enumeration would take almost forever . For a particular disease , finding the right candidates targeting specific proteins further complicates the problem . Instead of enumerating or searching from the immense chemical space , recent work utilizes deep generative models to generate candidate molecules directly ( Schwalbe-Koda & Gómez-Bombarelli , 2020 ) . However , most prior work focuses on generating molecules concerning a single property such as drug-likeness ( QED ) or octanol-water partition coefficient ( logP ) ( Jin et al. , 2018 ; You et al. , 2018 ; Popova et al. , 2019 ; Shi et al. , 2020 ; Zang & Wang , 2020 ) . While in practical settings , typical drug discovery requires consideration of multiple properties jointly ( Nicolaou et al. , 2012 ) . For example , to find drug-like molecules that are easy to synthesize and exhibit high biological activity against the target protein . Naturally , multi-objective molecule design is much more challenging than the single-objective scenario ( Jin et al. , 2020 ) . This paper studies the problem of multi-objective molecule design for drug discovery . An ideal solution should be efficient and meet the following criteria . C1 : It should satisfy multiple properties with high scores ; C2 : It should produce novel and diverse molecules ; C3 : Its generation process does not ∗Work was done while Yutong Xie and Chence Shi were research interns at ByteDance . Corresponding to : zhouhao.nlp @ bytedance.com and lileilab @ bytedance.com . rely on either expert annotated or wet experimental data collected from a biochemistry lab ( since it requires tremendous effort and hard to obtain ) . Existing molecule generation approaches are mainly designed for the single objective setting , and they could not meet all criteria in the setting of multiple objectives . These methods belong to four categories : a ) generating candidates from a learned continuous latent space ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ) , b ) through reinforcement learning ( You et al. , 2018 ) , c ) using an encoder-decoder translation approach ( Jin et al. , 2019 ) , or d ) optimizing molecular properties through genetic algorithms ( Nigam et al. , 2020 ) . Current stateof-the-art multi-objective molecular generation is a rationale-based method ( Jin et al. , 2020 ) . In this approach , the authors propose to build molecules by composing multiple extracted rationales , and the model can generate compounds that are simultaneously active to multiple biological targets . However , such an approach will result in quite complex molecules when we have many objectives . This is because different objectives correspond to different rationales , and including all these rationales could lead to large molecules , which may be less drug-like and hard to be synthesized practically . In this paper , we propose MArkov moleculaR Sampling ( MARS ) , a simple yet flexible method for drug discovery . The basic idea is to start from a seed molecule and keep generating candidate molecules by modifying fragments of molecular graphs from previous steps . It meets all the criteria C1-3 . In MARS , the molecular design is formulated as an iterative editing procedure with its total objective consisting of multiple property scores ( C1 ) . MARS employs the annealed Markov chain Monte Carlo sampling method to search for optimal chemical compounds , which allows for the exploration of chemicals with novel and different fragments ( C2 ) . The proposal to modify molecular fragments is represented using graph neural networks ( GNNs ) , whose parameters are adaptively learned . We used message passing neural networks ( MPNNs ) in practice ( Gilmer et al. , 2017 ) , but other GNNs can fit the framework as well . Furthermore , MARS utilizes the sample paths generated on-the-fly to train the proposal network adaptively . Therefore , it does not rely on external annotated data ( C3 ) . With such an adaptive learnable proposal , it keeps improving the generation quality throughout the process . We evaluate MARS and four other baselines , one latest method for each of the four method categories . The benchmark includes a variety of multi-objective generation settings . Experiments show that our proposed MARS achieves state-of-the-art performance on five out of six tasks in terms of a comprehensive evaluation consisting of the success rate , novelty , and diversity of the generated molecules . Notably , in the most challenging setting where four objectives – bio-activities to two different targets , drug-likeness , and synthesizability – are simultaneously considered , our method achieves the state-of-the-art result and outperforms existing methods by 77 % in the comprehensive evaluation . Our contributions are as follows : • We present MARS , a generic formulation of molecular design using Markov sampling , which can easily accommodate multiple objectives . • We develop an adaptive fragment-editing proposal based on GNN that is learnable on the fly with only samples self-generated and efficient in exploring the chemical space . • Experiments verifies our proposed MARS framework can find novel and diverse bioactive molecules that are both drug-like and highly synthesizable . 2 RELATED WORK . Recent years have witnessed the success of applying deep generative models and molecular graph representation learning in drug discovery ( Schwalbe-Koda & Gómez-Bombarelli , 2020 ; Guo & Zhao , 2020 ) . Existing approaches for molecular property optimization can be grouped into four categories , including generation with a ) Bayesian inference , b ) reinforcement learning , c ) encoderdecoder translation models , and d ) evolutionary and genetic algorithms . The first category is learning continuous latent spaces for molecular sequences or graphs and generating from such spaces using Bayesian optimization ( BO ) ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ; Winter et al. , 2019 ) . These methods rely heavily on the quality of latent representations , which imposes huge challenges to the encoders when there are multiple properties to consider . Unlike the first class , other work uses reinforcement learning ( RL ) to optimize desired objectives directly in the explicit chemical space ( De Cao & Kipf , 2018 ; Popova et al. , 2018 ; You et al. , 2018 ; Popova et al. , 2019 ; Shi et al. , 2020 ) . However , the models are usually hard to train due to the high variance of RL . The third category directly trains a translation model that maps from an input molecule to a highquality output molecule ( Jin et al. , 2019 ; 2020 ) . Although simple , such methods require many high-quality labeled data , making them impractical in scenarios where the data is limited . The last category of methods are evolutionary algorithms ( EAs ) and genetic algorithms ( GAs ) to explore large chemical space with certain property ( Nicolaou et al. , 2012 ; Devi et al. , 2015 ; Jensen , 2019 ; Ahn et al. , 2020 ) . In Nigam et al . ( 2020 ) , the authors propose to augment GA by adding an adversarial loss into the fitness evaluation to increase the diversity , and the augmented GA outperforms all other generative models in optimizing logP . Though flexible and straightforward , to make the search process efficient enough , most GA and EA methods require domain experts to design molecular mutation and crossover rules , which could be non-trivial to obtain . Besides single property optimization , there is recent work to address the multi-objective molecule generation problem . For example , Li et al . ( 2018 ) proposes to use a conditional generative model to incorporate several objectives flexibly , while Lim et al . ( 2020 ) leverages molecular scaffolds to control the properties of generated molecules better . Among them , the current state-of-the-art approach is a rationale-based method proposed by Jin et al . ( 2020 ) . In this method , the authors propose to build molecules by assembling extracted rationales . Despite its great success in generating compounds simultaneously active to multiple biological targets , the combination of rationales might hinder the synthesizability and drug-likeness of produced molecules , as they tend to be large as the number of objectives grows . In contrast , our MARS framework turns the generation problem into a sampling procedure , which serves as an alternative way compared with deep generative models , and can efficiently discover bio-active molecules that are both drug-like and highly synthesizable . Remotely related is recent work to generate molecules through sampling . Seff et al . ( 2019 ) defines a Gibbs sampling procedure , in which the Markov chain alternates between randomly corrupting the molecules and recovering the corrupted ones with a learned reconstruction model . However , this method mainly focuses on generating molecules that follow the observed data distribution and can not be directly tailored for property optimization . Different from this work , MARS is built upon the general MCMC sampling framework , which allows further enhancement with adaptive proposal learning to edit molecular graphs efficiently . Actually , generating instances from a discrete space with MCMC sampling methods is previously employed in various other applications , e.g. , generating natural language sentences under various constraints ( Miao et al. , 2019 ; Zhang et al. , 2019 ; Liu et al. , 2020 ; Zhang et al. , 2020 ) . 3 PROPOSED MARS APPROACH . In this section , we present the MArkov moleculaR Sampling method ( MARS ) for multi-objective molecular design . We define a Markov chain over the explicit molecular graph space and design a kernel to navigate high probable candidates with acceptance and rejection . 3.1 SAMPLING FROM THE MOLECULAR SPACE . Our proposed MARS framework aims at sampling molecules with desired properties from the chemical space . Specifically , given K properties of interest , the desired molecular distribution can be formulated as a combination of all objectives : π ( x ) = s1 ( x ) ◦ s2 ( x ) ◦ s3 ( x ) ◦ · · · ◦ sK ( x ) ︸ ︷︷ ︸ desired properties ( 1 ) where x is a molecule in the molecular spaceX . π ( x ) is an unnormalized distribution over molecules integrating the desired properties . sk ( x ) is a scoring function for the k-th property and the “ ◦ ” operator stands for a combination of scores ( e.g. , summation or multiplication ) . In practical drug discovery , these terms could be related to the biological activity , drug-likeness , and synthesizability of molecules ( Nicolaou et al. , 2012 ) . This framework allows flexible configuration according to various concrete applications . However , as the number of objectives grows , the joint distribution π ( x ) will become more complex and intractable , making the sampling non-trivial . In MARS , we propose to sample molecules from the desired distribution Eq . 1 using Markov chain Monte Carlo ( MCMC ) methods ( Andrieu et al. , 2003 ) . Given a desired molecular distribution π ( x ) as the unnormalized target distribution , we define a Markov chain on the explicit chemical space X ( i.e. , each state of the Markov chain is a particular molecule ) and introduce a proposal distribution q ( x′ | x ) to perform state transitions . Specifically , as shown in Figure 1 , the sampling procedure of MARS starts from an initial molecule x ( 0 ) ∈ X . At each time step t , a molecule candidate x′ ∈ X will be sampled from the proposal distribution q ( x′ | x ( t−1 ) ) , where x ( t−1 ) denotes the molecule at time step t− 1 . Then the proposed candidate x′ could be either accepted x ( t ) = x′ or rejected x ( t ) = x ( t−1 ) according to the acceptance rate A ( x ( t−1 ) , x′ ) ∈ [ 0 , 1 ] controlled by the target distribution π ( x ) . By repeating this process , a sequence of molecules { x ( t ) } ∞t=0 can be generated . Such sequence of molecules will converge to the target distribution π ( x ) if the proposal distribution and the acceptance mechanism are configured properly . The acceptance rate is calculated as follow : A ( x , x′ ) = min { 1 , πα ( x′ ) q ( x|x′ ) πα ( x ) q ( x′|x ) } ( 2 ) where α is a coefficient that varies in different instantiations of MCMC algorithms . Here to find molecules that globally maximize the target distribution , we employ an annealing scheme ( Laarhoven & Aarts , 1987 ) where α = 1/T and T is a temperature controlled by a cooling schedule . In addition to this , other instantiations such as Metropolis-Hastings ( MH ) algorithm ( Metropolis et al. , 1953 ) where α = 1 are also feasible under our general framework . As for the proposal distribution q ( x′ | x ) , it largely affects the sampling performance and should be designed elaborately . In general , it is crucial that the proposal distribution q ( x′ | x ) and the target distribution π ( x′ ) are as close as possible to ensure high sampling efficiency . So we propose using a proposal distribution qθ ( x′ | x ) with learnable parameters to capture the desired molecular properties and develop a strategy to train the proposal throughout the sampling process adaptively . The details will be described in the next section .
This paper proposes a method to generate molecular graphs with multiple optimized properties. Molecular graphs are constructed/edited by the iterative addition and removal of molecular fragments. A MCMC search procedure, guided by a learned graph neural network that proposes good graph edit actions, is used to sample molecules with optimized properties. The proposed model is compared with some baselines on a few multi-objective optimization tasks and shows good performance.
SP:0de748131383ac3425179fa9b34e7593c25fd8bd
Geometry-Aware Gradient Algorithms for Neural Architecture Search
1 INTRODUCTION . Neural architecture search has become an important tool for automating machine learning ( ML ) but can require hundreds of thousands of GPU-hours to train . Recently , weight-sharing approaches have achieved state-of-the-art performance while drastically reducing the computational cost of NAS to just that of training a single shared-weights network ( Pham et al. , 2018 ; Liu et al. , 2019 ) . Methods such as DARTS ( Liu et al. , 2019 ) , GDAS ( Dong & Yang , 2019 ) , and many others ( Pham et al. , 2018 ; Zheng et al. , 2019 ; Yang et al. , 2020 ; Xie et al. , 2019 ; Liu et al. , 2018 ; Laube & Zell , 2019 ; Cai et al. , 2019 ; Akimoto et al. , 2019 ; Xu et al. , 2020 ) combine weight-sharing with a continuous relaxation of the discrete search space to allow cheap gradient updates , enabling the use of popular optimizers . However , despite some empirical success , weight-sharing remains poorly understood and has received criticism due to ( 1 ) rank-disorder ( Yu et al. , 2020 ; Zela et al. , 2020b ; Zhang et al. , 2020 ; Pourchot et al. , 2020 ) , where the shared-weights performance is a poor surrogate of standalone performance , and ( 2 ) poor results on recent benchmarks ( Dong & Yang , 2020 ; Zela et al. , 2020a ) . Motivated by the challenge of developing simple and efficient methods that achieve state-of-the-art performance , we study how to best handle the goals and optimization objectives of NAS . We start by observing that weight-sharing subsumes architecture hyperparameters as another set of learned parameters of the shared-weights network , in effect extending the class of functions being learned . This suggests that a reasonable approach towards obtaining high-quality NAS solutions is to study how to regularize and optimize the empirical risk over this extended class . While many regularization approaches have been implicitly proposed in recent NAS efforts , we focus instead on the question of optimizing architecture parameters , which may not be amenable to standard procedures such as SGD that work well for standard neural network weights . In particular , to better-satisfy desirable properties such as generalization and sparsity of architectural decisions , we propose to constrain architecture parameters to the simplex and update them using exponentiated gradient , which has favorable convergence properties due to the underlying problem structure . Theoretically , we draw upon the mirror descent meta-algorithm ( Nemirovski & Yudin , 1983 ; Beck & Teboulle , 2003 ) to give convergence guarantees when using any of a broad class of such geometry-aware gradient methods to optimize the weight-sharing objective ; empirically , we show that our solution leads to strong improvements on several NAS benchmarks . We summarize these contributions below : 1 . We argue for studying NAS with weight-sharing as a single-level objective over a structured function class in which architectural decisions are treated as learned parameters rather than hyperparameters . Our setup clarifies recent concerns about rank disorder and makes clear that proper regularization and optimization of this objective is critical to obtaining high-quality solutions . 2 . Focusing on optimization , we propose to improve existing NAS algorithms by re-parameterizing architecture parameters over the simplex and updating them using exponentiated gradient , a variant of mirror descent that converges quickly over this domain and enjoys favorable sparsity properties . This simple modification—which we call the Geometry-Aware Exponentiated Algorithm ( GAEA ) —is easily applicable to numerous methods , including first-order DARTS Liu et al . ( 2019 ) , GDAS Dong & Yang ( 2019 ) , and PC-DARTS ( Xu et al. , 2020 ) . 3 . To show correctness and efficiency of our scheme , we prove polynomial-time stationary-point convergence of block-stochastic mirror descent—a family of geometry-aware gradient algorithms that includes GAEA—over a continuous relaxation of the single-level NAS objective . To the best of our knowledge these are the first finite-time convergence guarantees for gradient-based NAS . 4 . We demonstrate that GAEA improves upon state-of-the-art methods on three of the latest NAS benchmarks for computer vision . Specifically , we beat the current best results on NAS-Bench-201 ( Dong & Yang , 2020 ) by 0.18 % on CIFAR-10 , 1.59 % on CIFAR-100 , and 0.82 % on ImageNet16-120 ; we also outperform the state-of-the-art on the DARTS search space Liu et al . ( 2019 ) , for both CIFAR-10 and ImageNet , and match it on NAS-Bench-1Shot1 ( Zela et al. , 2020a ) .1 Related Work . Most optimization analyses of NAS show monotonic improvement ( Akimoto et al. , 2019 ) , asymptotic guarantees ( Yao et al. , 2020 ) , or bounds on auxiliary quantities disconnected from any objective ( Noy et al. , 2019 ; Nayman et al. , 2019 ; Carlucci et al. , 2019 ) . In contrast , we prove polynomial-time stationary-point convergence on a single-level objective for weight-sharing NAS , so far only studied empirically ( Xie et al. , 2019 ; Li et al. , 2019 ) . Our results draw upon the mirror descent meta-algorithm ( Nemirovski & Yudin , 1983 ; Beck & Teboulle , 2003 ) and extend recent nonconvex convergence results Zhang & He ( 2018 ) to handle alternating descent . While there exist related results ( Dang & Lan , 2015 ) the associated guarantees do not hold for the algorithms we propose . Finally , we note that a variant of GAEA that modifies first-order DARTS is related to XNAS ( Nayman et al. , 2019 ) , whose update also involves exponentiated gradient ; however , GAEA is simpler and easier to implement.2 Furthermore , the regret guarantees for XNAS do not relate to any meaningful performance measure for NAS such as speed or accuracy , whereas we guarantee convergence on the ERM objective . 2 THE WEIGHT-SHARING OPTIMIZATION PROBLEM . In supervised ML we have a dataset T of labeled pairs ( x , y ) drawn from a distribution D over input/output spaces X and Y . The goal is to use T to search a function class H for hw : X 7→ Y parameterized by w ∈ Rd that has low expected test loss ` ( hw ( x ) , y ) when using x to predict the associated y on unseen samples drawn from D , as measured by some loss ` : Y × Y 7→ [ 0 , ∞ ) . A common way to do so is by approximate ( regularized ) empirical risk minimization ( ERM ) , i.e . finding w ∈ Rd with the smallest average loss over T , via some iterative method Alg , e.g . SGD . 2.1 THE BENEFITS AND CRITICISMS OF WEIGHT-SHARING FOR NAS . NAS is often viewed as hyperparameter optimization on top of Alg , with each architecture a ∈ A corresponding to a function class Ha = { hw , a : X 7→ Y , w ∈ Rd } to be selected by using validation data V ⊂ X × Y to evaluate the predictor obtained by fixing a and doing approximate ERM over T : min a∈A ∑ ( x , y ) ∈V ` ( hwa , a ( x ) , y ) s.t . wa = Alg ( T , a ) ( 1 ) Since training individual sets of weights for any sizeable number of architectures is prohibitive , weight-sharing methods instead use a single set of shared weights to obtain validation signal about many architectures at once . In its most simple form , RS-WS ( Li & Talwalkar , 2019 ) , these weights 1Code to obtain these results has been made available in the supplementary material . 2XNAS code does not implement search and , as with previous efforts ( Li et al. , 2019 , OpenReview ) , we can not reproduce results after correspondence with the authors . XNAS ’ s best architecture achieves an average test error of 2.70 % under the DARTS evaluation , while GAEA achieves 2.50 % . For details see Appendix C.4 . are trained to minimize a non-adaptive objective , minw∈Rd Ea ∑ ( x , y ) ∈T ` ( hwa , a ( x ) , y ) , where the expectation is over a fixed distribution over architectures A . The final architecture a is then chosen to maximize the outer ( validation ) objective in ( 1 ) subject to wa = w. More frequently used is a bilevel objective over some continuous relaxation Θ of the architecture space A , after which a valid architecture is obtained via a discretization step Map : Θ 7→ A ( Pham et al. , 2018 ; Liu et al. , 2019 ) : min θ∈Θ ∑ ( x , y ) ∈V ` ( hw , θ ( x ) , y ) s.t . w ∈ arg min u∈Rd ∑ ( x , y ) ∈T ` ( hu , θ ( x ) , y ) ( 2 ) This objective is not significantly different from ( 2 ) , since Alg ( T , a ) approximately minimizes the empirical risk w.r.t . T ; the difference is replacing discrete architectures with relaxed architecture parameters θ ∈ Θ , w.r.t . which we can take derivatives of the outer objective . This allows ( 2 ) to be approximated via alternating gradient updates w.r.t . w and θ. Relaxations can be stochastic , so that Map ( θ ) is a sample from a θ-parameterized distribution ( Pham et al. , 2018 ; Dong & Yang , 2019 ) , or a mixture , in which case Map ( θ ) selects architectural decisions with the highest weight in a convex combination given by θ ( Liu et al. , 2019 ) . We overview this in more detail in Appendix A . While weight-sharing significantly shortens search ( Pham et al. , 2018 ) , it draws two main criticisms : • Rank disorder : this describes when the rank of an architecture a according to the validation risk evaluated with fixed shared weights w is poorly correlated with the one using “ standalone ” weights wa = Alg ( T , a ) . This causes suboptimal architectures to be selected after shared weights search ( Yu et al. , 2020 ; Zela et al. , 2020b ; Zhang et al. , 2020 ; Pourchot et al. , 2020 ) . • Poor performance : weight-sharing can converge to degenerate architectures ( Zela et al. , 2020a ) and is outperformed by regular hyperparameter tuning on NAS-Bench-201 ( Dong & Yang , 2020 ) . 2.2 SINGLE-LEVEL NAS AS A BASELINE OBJECT OF STUDY . Why are we able to apply weight-sharing to NAS ? The key is that , unlike regular hyperparameters such as step-size , architectural hyperparameters directly affect the loss function without requiring a dependent change in the model weights w. Thus we can distinguish architectures without retraining simply by changing architectural decisions . Besides enabling weight-sharing , this point reveals that the goal of NAS is perhaps better viewed as a regular learning problem over an extended class HA = ⋃ a∈AHa = { hw , a : X 7→ Y , w ∈ Rd , a ∈ A } that subsumes the architectural decisions as parameters of a larger model class , an unrelaxed “ supernet. ” The natural approach to solving this is by approximate empirical risk minimization , e.g . by approximating continuous objective below on the right using a gradient algorithm and passing the output θ through Map to obtain a valid architecture : min w∈Rd , a∈A ∑ ( x , y ) ∈T ` ( hw , a ( x ) , y ) ︸ ︷︷ ︸ discrete ( unrelaxed ) supernet ( NAS ERM ) min w∈Rd , θ∈Θ ∑ ( x , y ) ∈T ` ( hw , θ ( x ) , y ) ︸ ︷︷ ︸ continuous relaxation ( supernet ERM ) ( 3 ) Several works have optimized this single-level objective as an alternative to bilevel ( 2 ) ( Xie et al. , 2019 ; Li et al. , 2019 ) . We argue for its use as the baseline object of study in NAS for three reasons : 1 . As discussed above , it is the natural first approach to solving the statistical objective of NAS : finding a good predictor hw , a ∈ HA in the extended function class over architectures and weights . 2 . The common alternating gradient approach to the bilevel problem ( 2 ) is in practice very similar to alternating block approaches to ERM ( 3 ) ; as we will see , there are established ways of analyzing such methods for the latter objective , while for the former convergence is known only under very strong assumptions such as uniqueness of the inner minimum ( Franceschi et al. , 2018 ) . 3 . While less frequently used in practice than bilevel , single-level optimization can be very effective : we use it to achieve new state-of-the-art results on NAS-Bench-201 ( Dong & Yang , 2020 ) . Understanding NAS as single-level optimization—the usual deep learning setting—makes weightsharing a natural , not surprising , approach . Furthermore , for methods—both single-level and bilevel— that adapt architecture parameters during search , it suggests that we need not worry about rank disorder as long as we can use optimization to find a single feasible point that generalizes well ; we explicitly do not need a ranking . Non-adaptive methods such as RS-WS still do require rank correlation to select good architectures after search , but they are explicitly not changing θ and so have no variant solving ( 3 ) . The single-level formulation thus reduces search method design to well-studied questions of how to best regularize and optimize ERM . While there are many techniques for regularizing weight-sharing—including partial channels ( Xu et al. , 2020 ) and validation Hessian penalization ( Zela et al. , 2020a ) —we focus on the second question of optimization .
The submission presents a modification to the DARTS family of efficient Neural Architecture Search algorithms. The authors claim their modification (i) leads to better empirical performance, and (ii) is theoretically well-motivated. DARTS is a Neural Architecture Search algorithm which aims to find the most accurate network architecture within a human-defined search space.
SP:6dc30e63334ceb8d3ef8b987b0a1d92167c780c5